//check for flash
var flashversionMin = 8;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;

if (plugin) {
	for (f = 0; f < 20; f++) {
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if (plugin.description.indexOf(f+".")>=0){
			flashversion = f;
			
			if (flashversion >= flashversionMin){
				plugin = true;
				break;
			}
		}
	}
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flashversionMin+'")))\n');
	document.write('</SCRIPT\> \n');
}

function playSWF(file,id,vars,width,height,bgcolor,baseurl)	
{
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" ');
	document.write(' ID='+id+' WIDTH='+width+'px; HEIGHT='+height+'px>' );
	document.write(' <PARAM NAME="allowScriptAccess" VALUE="sameDomain" /> <PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=FlashVars VALUE="page_vars='+vars+'"> <PARAM NAME=menu VALUE=false>  <PARAM NAME="BASE" VALUE='+baseurl+'> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE='+bgcolor+'>'); 
	if(navigator.userAgent.indexOf("Opera")==-1)	
	{
		document.write(' <EMBED src="'+file+'" FlashVars="page_vars='+vars+'" menu=false quality=high bgcolor='+bgcolor+'');
		document.write(' swLiveConnect=FALSE allowScriptAccess="sameDomain" NAME='+id+' WIDTH='+width+'px HEIGHT='+height+'px');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>');
		document.write(' </EMBED>');
	}
	else	{
		document.write(' <EMBED src="'+file+'" FlashVars="page_vars='+vars+'" menu=false quality=high bgcolor='+bgcolor+'');
		document.write(' swLiveConnect=FALSE allowScriptAccess="sameDomain" ID='+id+' WIDTH='+width+'px HEIGHT='+height+'px');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" BASE='+baseurl+'>');
		document.write(' </EMBED>');
	}
	document.write(' </OBJECT>');

}
