var isFlash3 = false;
var isFlash4 = false;
var isFlash5 = false;
var isFlash6 = false;
var isFlash7 = false;
var isFlash8 = false;
var isFlash9 = false;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

if(isIE && isWin){ 
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('isFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('isFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('isFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');	
	document.write('isFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');	
	document.write('isFlash7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');	
	document.write('isFlash8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');	
	document.write('isFlash9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}
function detectFlash(){	
	if (navigator.plugins){
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]){
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			isFlash3 = flashVersion >= 3;
			isFlash4 = flashVersion >= 4;
			isFlash5 = flashVersion >= 5;
			isFlash6 = flashVersion >= 6;
			isFlash7 = flashVersion >= 7;
			isFlash8 = flashVersion >= 8;
			isFlash9 = flashVersion >= 9;
		}
	}	
}
detectFlash();
if (isFlash9) isFlash8=true;
if (isFlash8) isFlash7=true;
if (isFlash7) isFlash6=true;
if (isFlash6) isFlash5=true;
if (isFlash5) isFlash4=true;
if (isFlash4) isFlash3=true;
function embedFlash(width,height,swf,name,slc,play,loop,quality,wmode,bgcolor,scale,align,salign,base,menu,vars,locale,debug){
		if (!bgcolor) bgcolor="#FFFFFF";
		baseRef = location.protocol+'//'+location.hostname+base;
		pass = swf;
		if (vars && !locale){
		pass = new String(swf+'?'+vars);
		}else if (vars && locale){
		pass = new String(swf+'?'+vars+'&locale\='+locale);
		}else if (!vars && locale){
		pass = new String(swf+'?locale\='+locale);
		}
		var code = '<base href="'+baseRef+'">\n'
		+ '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"\n'
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'"\n'
		+ 'CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">\n'
		+ '<PARAM NAME="MOVIE" VALUE="'+pass+'">\n'
		+ '<PARAM NAME="NAME" VALUE="'+name+'">\n'
		+ '<PARAM NAME="SWLIVECONNECT" VALUE="'+slc+'">\n'
		+ '<PARAM NAME="PLAY" VALUE="'+play+'">\n'
		+ '<PARAM NAME="LOOP" VALUE="'+loop+'">\n'
		+ '<PARAM NAME="WMODE" VALUE='+wmode+'">\n'
		+ '<PARAM NAME="QUALITY" VALUE="'+quality+'">\n'
		+ '<PARAM NAME="BGCOLOR" VALUE="'+bgcolor+'">\n'
		+ '<PARAM NAME="SCALE" VALUE="'+scale+'">\n'
		+ '<PARAM NAME="ALIGN" VALUE="'+align+'">\n'
		+ '<PARAM NAME="SALIGN" VALUE="'+salign+'">\n'
		+ '<PARAM NAME="BASE" VALUE="'+baseRef+'">\n'
		+ '<PARAM NAME="MENU" VALUE="'+menu+'">\n'
		+ '<EMBED  \n' 
		+ 'WIDTH="'+width+'" HEIGHT="'+height+'" \n'
		+ 'SRC="'+pass+'" \n'
		+ 'ID="'+name+'" \n'
		+ 'SWLIVECONNECT="'+slc+'" \n'
		+ 'PLAY="'+play+'" \n'
		+ 'LOOP="'+loop+'" \n'
		+ 'QUALITY="'+quality+'" \n'
		+ 'WMODE="'+wmode+'" \n'
		+ 'BGCOLOR="'+bgcolor+'" \n'
		+ 'SCALE="'+scale+'" \n'
		+ 'ALIGN="'+align+'" \n'
		+ 'SALIGN="'+salign+'" \n'
		+ 'BASE="'+baseRef+'" \n'
		+ 'MENU="'+menu+'" \n'
		+ 'TYPE="application/x-shockwave-flash" \n'
		+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">\n'
		+ '</EMBED>\n'
		+ '</OBJECT>\n'
		+ '</base>';
		debug = new String (debug.toLowerCase());
		if (debug == "yes"){
		alert(code)
		};
		document.write(code);
}
