swfObj = function(a,b,c,d,e,f,g,h,i){
	
	this.swfObjisIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	this.swfObjisWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	this.swfObjisOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	
	this.swfObjFindObj = function(n, d){ //v4.01
		this.p = "";this.i="";this.x="";  if(!d) d=document; if((this.p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(this.p+1)].document; n=n.substring(0,this.p);}
		if(!(this.x=d[n])&&d.all) this.x=d.all[n]; for (this.i=0;!this.x&&this.i<d.forms.length;this.i++) this.x=d.forms[this.i][n];
		for(this.i=0;!this.x&&d.layers&&this.i<d.layers.length;this.i++) this.x=MM_findObj(n,d.layers[this.i].document);
		if(!this.x && d.getElementById) this.x=d.getElementById(n); return this.x;
	}

	this.swfObjGetSwfVer = function(){
		// NS/Opera version >= 3 check for Flash plugin in plugin array
		this.flashVer = -1;
		if (navigator.plugins != null && navigator.plugins.length > 0) {
			if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
				this.swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
				this.flashDescription = navigator.plugins["Shockwave Flash" + this.swVer2].description;
				this.descArray = this.flashDescription.split(" ");
				this.tempArrayMajor = this.descArray[2].split(".");			
				this.versionMajor = this.tempArrayMajor[0];
				this.versionMinor = this.tempArrayMajor[1];
				this.versionRevision = this.descArray[3];
				if (this.versionRevision == "") {
					this.versionRevision = this.descArray[4];
				}
				if (this.versionRevision[0] == "d") {
					this.versionRevision = this.versionRevision.substring(1);
				} else if (this.versionRevision[0] == "r") {
					this.versionRevision = this.versionRevision.substring(1);
					if (this.versionRevision.indexOf("d") > 0) {
						this.versionRevision = this.versionRevision.substring(0, this.versionRevision.indexOf("d"));
					}
				}
				this.flashVer = this.versionMajor + "." + this.versionMinor + "." + this.versionRevision;
			}
		}
		// MSN/WebTV 2.6 supports Flash 4
		else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) this.flashVer = 4;
		// WebTV 2.5 supports Flash 3
		else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) this.flashVer = 3;
		// older WebTV supports Flash 2
		else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) this.flashVer = 2;
		
		else if ( this.swfObjisIE && this.swfObjisWin && !this.swfObjisOpera ) {
			this.flashVer = this.swfObjControlVersion();
		}	
		return this.flashVer;
	}
	
	// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
	this.swfObjDetectFlashVer = function(reqMajorVer, reqMinorVer, reqRevision){
		this.versionStr = this.swfObjGetSwfVer();
		if (this.versionStr == -1 ) {
			return false;
		} else if (this.versionStr != 0) {
			if(this.swfObjisIE && this.swfObjisWin && !this.swfObjisOpera) {
				// Given "WIN 2,0,0,11"
				this.tempArray         = this.versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
				this.tempString        = this.tempArray[1];			// "2,0,0,11"
				this.versionArray      = this.tempString.split(",");	// ['2', '0', '0', '11']
			} else {
				this.versionArray      = this.versionStr.split(".");
			}
			this.versionMajor      = this.versionArray[0];
			this.versionMinor      = this.versionArray[1];
			this.versionRevision   = this.versionArray[2];
	
				// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if (this.versionMajor > parseFloat(reqMajorVer)) {
				return true;
			} else if (this.versionMajor == parseFloat(reqMajorVer)) {
				if (this.versionMinor > parseFloat(reqMinorVer))
					return true;
				else if (this.versionMinor == parseFloat(reqMinorVer)) {
					if (this.versionRevision >= parseFloat(reqRevision))
						return true;
				}
			}
			return false;
		}
	}
	
	this.swfObjControlVersion = function(){
		this.version;
		this.axo;
		this.e;
	
		// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
	
		try {
			// version will be set for 7.X or greater players
			this.axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			this.version = this.axo.GetVariable("$version");
		} catch (e) {
		}
	
		if (!this.version)
		{
			try {
				// version will be set for 6.X players only
				this.axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				
				// installed player is some revision of 6.0
				// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
				// so we have to be careful. 
				
				// default to the first public version
				this.version = "WIN 6,0,21,0";
	
				// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
				this.axo.AllowScriptAccess = "always";
	
				// safe to call for 6.0r47 or greater
				this.version = this.axo.GetVariable("$version");
	
			} catch (e) {
			}
		}
	
		if (!this.version)
		{
			try {
				// version will be set for 4.X or 5.X player
				this.axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
				this.version = this.axo.GetVariable("$version");
			} catch (e) {
			}
		}
	
		if (!this.version)
		{
			try {
				// version will be set for 3.X player
				this.axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
				this.version = "WIN 3,0,18,0";
			} catch (e) {
			}
		}
	
		if (!this.version)
		{
			try {
				// version will be set for 2.X player
				this.axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				this.version = "WIN 2,0,0,11";
			} catch (e) {
				this.version = -1;
			}
		}
		
		return this.version;
	}
	this.classid = 		"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
	this.codebase = 	"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";
	this.objStartTag = 	"<OBJECT CLASSID=\""+this.classid+"\" CODEBASE=\""+this.classid+"\" WIDTH=\""+c+"\" HEIGHT=\""+d+"\" ";
	this.objEndTag = 	"</OBJECT>";
	this.paramStr =		"<PARAM NAME=\"movie\" VALUE=\""+a+"\"/>";
	this.flashVarsStr = "";
	this.embedTag = 	"<embed pluginspage=\"http://www.adobe.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" src=\""+a+"\" width=\""+c+"\" height=\""+d+"\"";
	for(this.x in g){this.flashVarsStr += this.x+"="+g[this.x]+"&";}
	for(this.x in h){this.embedTag += this.x+"=\""+h[this.x]+"\" ";this.paramStr += "<PARAM NAME=\""+this.x+"\" VALUE=\""+h[this.x]+"\"/>";}
	this.paramStr += "<PARAM NAME=\"flashvars\" VALUE=\""+this.flashVarsStr+"\"/>";
	for(this.x in i){this.embedTag += this.x+"=\""+i[this.x]+"\" "; this.objStartTag += this.x + "=\"" + i[this.x] + "\"";} this.objStartTag += ">";
	this.embedTag += "flashvars=\""+this.flashVarsStr+"\"></embed>";
	try{
		this.flashVer = e.split(",");
		if(this.swfObjDetectFlashVer(this.flashVer[0],this.flashVer[1],this.flashVer[2])){
			if (navigator.userAgent.indexOf("MSIE")!=-1){
				this.swfObjFindObj(b).innerHTML = this.objStartTag+this.paramStr+this.embedTag+this.objEndTag;
			}else{
				this.swfObjFindObj(b).innerHTML = this.embedTag;
			}
		}else{
			if (navigator.userAgent.indexOf("Chrome")!=-1){
				this.swfObjFindObj(b).innerHTML = this.swfObjFindObj(f).innerHTML;
			}else{
				alert(this.objStartTag+this.swfObjFindObj(f).innerHTML+this.objEndTag)
				this.swfObjFindObj(b).innerHTML = this.objStartTag+this.swfObjFindObj(f).innerHTML+this.objEndTag;
			}
		}
	}catch(e){}
}
