function detector(){
	this.lastModified="v2.0 06/07/06";
	http="http:/\/";
	this.v=parseFloat(navigator.appVersion);
	this.uA=navigator.userAgent;
	this.ns=false;
	this.ns6=false;
	this.ie=false;
	this.ie5=false;
	this.opera=false;
	this.AOL=false;
	this.mac=false;
	this.pc=false;
	this.dhtml=false;
	this.Java=false;
	//this.Flash_Download=http+"www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
	//this.Flash_Codebase=http+"download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0";
	this.Flash="Not Detected";
	this.loaded=false;
	navigator.appVersion.indexOf('Mac')!=-1?(this.mac=true):(this.pc=true);
	var ns6pos=this.uA.indexOf('Netscape6/');
	var iepos=this.uA.indexOf('MSIE');
	var oppos=this.uA.indexOf('Opera');
	var AOLpos=this.uA.toUpperCase().indexOf('AOL');
	if(oppos>=0){
		this.v=parseFloat(this.uA.substring(oppos+6,this.uA.length));
		this.opera=true;
	} else {
		navigator.appName.indexOf('Netscape')!=-1?(this.ns=true):(this.ie=true);
	}
	if(iepos!=-1){
		ie5cut=this.uA.substring(iepos+5,this.uA.length);
		this.v=parseFloat(ie5cut.substring(0,ie5cut.indexOf('\;')));
		if(this.v>=5)this.ie5=true;
	}
	this.guy=true;
	if(ns6pos!=-1){
		this.v=parseFloat(this.uA.substring(ns6pos+10,this.uA.length));
		this.ns6=true;
	}
	if(AOLpos!=-1){
		this.AOL=parseFloat(this.uA.substring((AOLpos+3),this.uA.length));
	}
	if(this.v>=4){
		this.dhtml=this.opera?false:true;
		this.Java=navigator.javaEnabled();
	}
	detector.prototype.DetectFlash=DetectFlash;
	//detector.prototype.EmbedFlash=writeFlash;
}
	
	function DetectFlash(){
		if(this.Flash!="Not Detected"){
			return;
		}
		ActiveX='<SCRIPT LANGUAGE="VBScript">\n';
		ActiveX+='Function GetFlashValue\n';
		ActiveX+='on error resume next\n';
		ActiveX+='dim tmpobj, FlashInstalled\n';
		ActiveX+='FlashInstalled = 0\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.3")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 3\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.4")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 4\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.5")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 5\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.6")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 6\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.7")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 7\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='GetFlashValue = FlashInstalled\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.8")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 8\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='GetFlashValue = FlashInstalled\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.9")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 9\n';
		ActiveX+='tmpobj = 0\n';
		ActiveX+='GetFlashValue = FlashInstalled\n';
		ActiveX+='set tmpobj = CreateObject("ShockwaveFlash.ShockwaveFlash.10")\n';
		ActiveX+='if IsObject(tmpobj) then FlashInstalled = 10\n';
		ActiveX+='GetFlashValue = FlashInstalled\n';
		ActiveX+='End Function\n';
		ActiveX+='<\/SCRIPT>\n';
		if(navigator.plugins&&navigator.plugins.length>0){
			nparray=navigator.plugins;
			nparraylen=nparray.length;
			for(i=0;i<nparraylen;i++){
				npplugin=nparray[i];
				npname=npplugin.name;
				npdesc=npplugin.description;
				if(npdesc.indexOf("Shockwave Flash 3")!=-1){
					this.Flash=3;
				}
				if(npdesc.indexOf("Shockwave Flash 4")!=-1){
					this.Flash=4;
				}
				if(npdesc.indexOf("Shockwave Flash 5")!=-1){
					this.Flash=5;
				}
				if(npdesc.indexOf("Shockwave Flash 6")!=-1){
					this.Flash=6;
				}if(npdesc.indexOf("Shockwave Flash 7")!=-1){
					this.Flash=7;
				}
				if(npdesc.indexOf("Shockwave Flash 8")!=-1){
					this.Flash=8;
				}
				if(npdesc.indexOf("Shockwave Flash 9")!=-1){
					this.Flash=9;
				}
				if(npdesc.indexOf("Shockwave Flash 10")!=-1){
					this.Flash=10;
				}
			}
		}
    /*
    else if(this.ie){
			if(!this.mac||(this.mac&&this.ie&&this.v>=5)){
				document.write(ActiveX);
				this.Flash=GetFlashValue();
				if(!this.Flash){
					this.Flash=false;
				}
			}else{
				this.Flash=-1;
			}
		}
    */
		disableFlash=document.URL.toLowerCase().indexOf("flash=false")>document.URL.indexOf("?");
		if(disableFlash){this.Flash=false
		;
	}
}



function writeFlash(fVersion, swf, w, h, bgcolor, altimg, altimgtype, alttext, althref, alttarget) {
	if(!alttarget){alttarget="self";}
	if(!fVersion){fVersion=3;}
	var insHTML="";
	var insIMG="";
	var rnd = Math.floor(Math.random() * 5 + 1);
	//
	var altImage = ('<img src="' + altimg + '.' + altimgtype + '" alt="' + alttext + '" width="' + w + '" height="' + h + '" border="0">');
	var altLink = ('<a href="' + althref + '.html" target="_' + alttarget + '">');
	//
  //
	var flashcheck = new detector();
	flashcheck.DetectFlash();
	//if(flashcheck.Flash >= fVersion) {
	if(flashcheck.Flash != fVersion) {
  //
    var html = document.documentElement;
    //var lang = document.documentElement.getAttributeNS('http://www.w3.org/XML/1998/namespace','lang');
    var lang = (document.all) ? document.documentElement.lang : document.documentElement.getAttribute("xml:lang");
    //alert(lang);
		insHTML  = ('\n<object type="application/x-shockwave-flash" data="' + swf + '.swf?lang=' + lang + '" width="' + w + '" height="' + h + '">');
		insHTML += ('\n\t<param name="movie" value="' + swf + '.swf?lang=' + lang + '" />');
		//insHTML += ('\n\t<param name="bgcolor" value="#' + bgcolor + '" />');
		//insHTML += ('\n\t<param name="quality" value="high" />');
		insHTML += ('\n<\/object>');
    //alert(insHTML);
    document.getElementById("header").innerHTML = insHTML;
    //Comment rest out from here
	} else {
		//insHTML  = ('\n<a href="' + althref + '.html" target="' + alttarget + '">');
		insHTML = ('<img src="/images/' + altimg + '' + rnd + '.' + altimgtype + '" alt="' + alttext + '" width="' + w + '" height="' + h + '" border="0" />');
		//insHTML += ('</a>');
    document.getElementById("header").innerHTML = insHTML;
		//and end here//
	}
}