function displayFlash(src, width, height,bgColor,flashvars) {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + width + '" height="' + height + '" id="flashobj" align="middle">');
	document.write('<param name="movie" value="' + src + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="'+bgColor+'" />');
	document.write('<param name="play" value="true" />');
	document.write('<param name="loop" value="true" />');
	document.write('<param name="wmode" value="window" />');
	document.write('<param name="scale" value="showall" />');
	document.write('<param name="menu" value="true" />');
	document.write('<param name="devicefont" value="false" />');
	document.write('<param name="salign" value="" />');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="flashVars" value="'+flashvars+'" />');
	document.write('<!--[if !IE]>-->');
	document.write('<object type="application/x-shockwave-flash" data="' + src + '" width="' + width + '" height="' + height + '">');
	document.write('<param name="movie" value="' + src + '" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="'+bgColor+'" />');
	document.write('<param name="play" value="true" />');
	document.write('<param name="loop" value="true" />');
	document.write('<param name="wmode" value="window" />');
	document.write('<param name="scale" value="showall" />');
	document.write('<param name="menu" value="true" />');
	document.write('<param name="devicefont" value="false" />');
	document.write('<param name="salign" value="" />');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="flashVars" value="'+flashvars+'" />');
	document.write('<!--<![endif]-->');
	document.write('<a href="http://www.adobe.com/go/getflash">');
	document.write('<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="get Adobe Flash Player" />');
	document.write('</a>');
	document.write('<!--[if !IE]>-->');
	document.write('</object>');
	document.write('<!--<![endif]-->');
	document.write('</object>');
}

function displayShockwave(src, width, height,bgColor) {
	document.write('<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="swRemote" value="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'">');
	document.write('<param name="swStretchStyle" value="meet">');
	document.write('<param name="bgColor" value="'+bgColor+'">');
	document.write('<param name="src" value="' + src + '">');
	document.write('<embed src="' + src + '" width="' + width + '" height="' + height + '" bgColor="#000000" swRemote="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'" swStretchStyle="meet" type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/"></embed>');
	document.write('</object>');
}

function displayIFrame(src, width, height) {
	document.write('<iframe src="' + src + '" height="' + height + '" width="' + width + '"></iframe>');
}

function display(src,width,height,bgColor,flashvars){
	if(src.slice(-4) ==".swf"){
		displayFlash(src, width, height,bgColor,flashvars);
	}else if(src.slice(-4) ==".dcr"){
		displayShockwave(src, width, height,bgColor);
	}else{
		document.write('no flash or no shockwave');
	}
}
