
// BT 7-12-04 modified to work with versions of Flash up to version 20
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
	var mV = 20;		// this is the maximum version of FLASH to test
	var f2 = false;
	var f3 = false;
	var f4 = false;
	var f5 = false;
	var f6 = false;
	var f7 = false;
	var f8 = false;
	var f9 = false;
	var f10 = false;
	var f11 = false;
	var f12 = false;
	var f13 = false;
	var f14 = false;
	var f15 = false;
	var f16 = false;
	var f17 = false;
	var f18 = false;
	var f19 = false;
	var f20 = false;
	var aV = 0;
	var hRV = false;
	var jsV = 1.0;
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
	jsV = 1.1;
if(isIE && isWin){
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('f2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	document.write('f3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	document.write('f4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	document.write('f5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
	document.write('f6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
	document.write('f7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
	document.write('f8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
	document.write('f9 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
	document.write('f10 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
	document.write('f11 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
	document.write('f12 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
	document.write('f13 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.13"))) \n');
	document.write('f14 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.14"))) \n');
	document.write('f15 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.15"))) \n');
	document.write('f16 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.16"))) \n');
	document.write('f17 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.17"))) \n');
	document.write('f18 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.18"))) \n');
	document.write('f19 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.19"))) \n');
	document.write('f20 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.20"))) \n');
	document.write('</SCR' + 'IPT\> \n');
}
function checkFlash(rV){
	var ua=navigator.userAgent.toLowerCase();
	this.webtv = (ua.indexOf("webtv")>-1);
	this.ie = (parseFloat(ua.slice(ua.indexOf("msie")+5)));
	this.nn = (parseFloat(ua.slice(ua.indexOf("mozilla/")+8)));
	this.mac = (ua.indexOf("mac")>-1);
	this.flash = false;

	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 fD = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var fV = parseInt(fD.charAt(fD.indexOf(".") - 1));
			// BT 7-12-04 added to handle newer versions of Flash
			for (var i = 2; i <= mV; i++) {
				if (eval("fV == " + i) == true) {
					eval("f" + i + " = true")
				} else {
					eval("f" + i + " = false")
				}
				//alert("f" + i + " = " + eval("f" + i));
			}
			//f2 = fV == 2;
			//f3 = fV == 3;
			//f4 = fV == 4;
			//f5 = fV == 5;
			//f6 = fV == 6;
			//f7 = fV == 7;
			//// as mV increases, additional checks need to be added here
			//// f8 = fV == 8; for example
			//if (eval("f" + mV) == undefined) {
			//	// this should take care of the newest version of Flash
			//	// if the f* = fV == * is forgotten.  However, it will not
			//	// handle the case where f(* - 1) = fV == (* - 1)
			//	eval("f" + mV) = fV == mV;
			//}
		}
	}
	for (var i = 2; i <= mV; i++) {
		if (eval("f" + i) == true) aV = i;
	}
	if (aV >= rV) {
		this.flash = true;
	}
}

function flashObj() {
	this.flashFile = "filename.swf";
	this.LiveConnect = "FALSE";
    this.wmode = "transparent";
	this.DenyIEdl = "false";
	this.altImg = "NoFlash.gif";
	this.altTxt = null;
	this.height = "18";
	this.width = "370";
	this.ID = "netphoria";
	this.webTV = "false";
	this.quality = "high";
	this.scale = "exactfit";
	this.menu = "false";
	this.deviceFont = "false";
	this.bgcolor = "ffffff";
	this.FlashVer = 4;
	this.cabVersion = "4,0,0,0";
	this.render = writeFlashComponent;
}
function writeFlashComponent() {
	var Ticket=new checkFlash(this.FlashVer);
	var sCR;
	if (Ticket.flash) {
	// alert(this.DenyIEdl);
		if (Ticket.mac || Ticket.nn || this.DenyIEdl!="false") {
			sCR="<EMBED SRC="+this.flashFile+" swLiveConnect="+this.LiveConnect+" WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" MENU="+this.menu+" BGCOLOR="+this.bgcolor+" DEVICEFONT="+this.deviceFont+"  TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
		} else if (Ticket.ie>=4) {
			sCR="<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version="+this.cabVersion+"\" ID=\""+this.ID+"\" WIDTH=\""+this.width+"\" HEIGHT=\""+this.height+"\">\n";
			sCR+="<PARAM NAME=movie VALUE=\""+this.flashFile+"\">\n";
			sCR+="<PARAM NAME=quality VALUE=\""+this.quality+"\">\n";
			sCR+="<PARAM NAME=scale VALUE=\""+this.scale+"\">\n";
			sCR+="<PARAM NAME=menu VALUE=\""+this.menu+"\">\n";
			sCR+="<PARAM NAME=wmode VALUE=\""+this.wmode+"\">\n";
			sCR+="<PARAM NAME=bgcolor VALUE=\""+this.bgcolor+"\">\n";
			sCR+="<PARAM NAME=devicefont VALUE=\""+this.deviceFont+"\">\n";
			sCR+="</OBJECT>\n";
		} else if (Ticket.webtv) {
				sCR="<EMBED SRC="+this.flashFile+" swLiveConnect=TRUE WIDTH="+this.width+" HEIGHT="+this.height+" QUALITY="+this.quality+" SCALE="+this.scale+" wmode="+this.wmode+" ID="+this.ID+" MENU="+this.menu+" BGCOLOR="+this.bgcolor+" DEVICEFONT="+this.deviceFont+"  TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED>";
		}
		} else {
			if (this.altTxt){
			sCR = this.altTxt;
			} else {
			sCR="<IMG SRC="+this.altImg+" WIDTH="+this.width+" HEIGHT="+this.height+" BORDER=0>";
			}
		}
	return sCR;
}