var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
function writePlayer() {	
	if (plugin) {
	 plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-2)) >= 6;
	}
	else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0) {
	 document.write('<script language=VBScript\> \n');
	 document.write('on error resume next \n');
	 document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	 document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	 document.write('<\/script\> \n');
	}
};
writePlayer();
// function
function writeSWF(ourSwf,ourWidth,ourHeight,ourBg,msgOrPage,noFlashMsg) {
	if (plugin) {
	 document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	 document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"');
	 document.write(' ID=FLASH_AD WIDTH='+ourWidth+' HEIGHT='+ourHeight+'>\n');
	 document.write('<PARAM NAME=movie VALUE="'+ourSwf+'">\n');
	 document.write('<PARAM NAME=quality VALUE=high>\n'); 
	 document.write('<PARAM NAME=bgcolor VALUE='+ourBg+'>\n'); 
	 document.write('<EMBED src="'+ourSwf+'" quality=high');
	 document.write(' swLiveConnect=FALSE WIDTH='+ourWidth+' HEIGHT='+ourHeight+' bgcolor='+ourBg);
	 document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">\n');
	 document.write('</EMBED>\n');
	 document.write('</OBJECT>');
	} else { 
	// if the right flash player version has not been found:
		if (msgOrPage == 2) { 
			popup(noFlashMsg,'noflash',350,350);
		} else if (msgOrPage == 3) { 
			document.write('<a href="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank">'+noFlashMsg+'</a>');
		}
	}	
};
/*
script body tag:
<script language="JavaScript" type="text/javascript">
		writeSWF('swf/csg3b.swf',880,520,'#ffffff');
	</script>
	
*/