	var UA = function()
	{
		var sUA = navigator.userAgent.toLowerCase();
		var oReturn =  {
			bIsWebKit : sUA.indexOf("applewebkit") > -1,
			bIsSafari : sUA.indexOf("safari") > -1,
			bIsKonq: navigator.product != null && navigator.product.toLowerCase().indexOf("konqueror") > -1,
			bIsOpera : sUA.indexOf("opera") > -1,
			bIsXML : document.contentType != null && document.contentType.indexOf("xml") > -1,
			bHasTransparencySupport : true,
			bUseDOM : true,
			nFlashVersion : null,
			nOperaVersion : null,
			nGeckoBuildDate : null,
			nWebKitVersion : null
		};
		
		oReturn.bIsKHTML = oReturn.bIsWebKit || oReturn.bIsKonq;
		oReturn.bIsGecko = !oReturn.bIsWebKit && navigator.product != null && navigator.product.toLowerCase() == "gecko";
		if(oReturn.bIsGecko){ oReturn.nGeckoBuildDate = new Number(sUA.match(/.*gecko\/(\d{8}).*/)[1]) };
		oReturn.bIsIE = sUA.indexOf("msie") > -1 && !oReturn.bIsOpera && !oReturn.bIsKHTML && !oReturn.bIsGecko;
		oReturn.bIsIEMac = oReturn.bIsIE && sUA.match(/.*mac.*/) != null;
		if(oReturn.bIsOpera){ oReturn.nOperaVersion = new Number(sUA.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]) };
		if(oReturn.bIsIE || (oReturn.bIsOpera && oReturn.nOperaVersion < 7.6)){ oReturn.bUseDOM = false };
		if(oReturn.bIsWebKit){ oReturn.nWebKitVersion = new Number(sUA.match(/.*applewebkit\/(\d+).*/)[1]) };
		if(window.hasFlash && (!oReturn.bIsIE || oReturn.bIsIEMac)){ 
			var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
			oReturn.nFlashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
		};
		if(sUA.match(/.*(windows|mac).*/) == null || 
		oReturn.bIsIEMac || oReturn.bIsKonq || 
		(oReturn.bIsOpera && oReturn.nOperaVersion < 7.6) || 
		(oReturn.bIsSafari && oReturn.nFlashVersion < 7) ||
		(!oReturn.bIsSafari && oReturn.bIsWebKit && oReturn.nWebKitVersion < 124) || 
		(oReturn.bIsGecko && oReturn.nGeckoBuildDate < 20020523)){
			oReturn.bHasTransparencySupport = false;
		};

		if(!oReturn.bIsIEMac && !oReturn.bIsGecko && document.createElementNS){
			try {
				document.createElementNS("http://www.w3.org/1999/xhtml", "i").innerHTML = "";
			} catch(e){
				oReturn.bIsXML = true;
			};
		};
		
		oReturn.bUseInnerHTMLHack = oReturn.bIsKonq || (oReturn.bIsWebKit && oReturn.nWebKitVersion < 312) || oReturn.bIsIE;
		
		return oReturn;
	}();
	/*	If executed, the VBScript above checks for Flash and sets the hasFlash variable. 
		If VBScript is not supported it's value will still be undefined, so we'll run it though another test
		This will make sure even Opera identified as IE will be tested */
	var hasFlash = function()
	{
		var nRequiredVersion = 7;	
		
		if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1) {
			document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n</script\> \n');
			if(window.hasFlash != null){
				return window.hasFlash;
			}
		}
		
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)
		{
			var flashDescription = (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description;
			var re1=/(\d+)\.(\d*)/;
			var result1=flashDescription.match(re1);

			return parseInt(result1[1]) >= nRequiredVersion;
		}
		
		return false;
	}();

flash = {
	init : function()
	{
		myHeader = document.getElementById("flash");
		flash.insert(myHeader, "header", 370, 205);
		myHeader = document.getElementById("flash2");
		flash.insert(myHeader, "header2", 61 , 55);
	},
	
	createObjectParameter : function(nodeObject, sName, sValue)
	{
		var node = document.createElement("param");
		
		node.setAttribute("name", sName);	
		node.setAttribute("value", sValue);
		nodeObject.appendChild(node);
	},
	
	insert : function(myElement, myId, myWidth, myHeight)
	{
		if(!UA.bUseDOM){
			myElement.innerHTML = ["<embed type=\"application/x-shockwave-flash\" src=\"flash/"+myId+".swf"+"\" quality=\"best\" wmode=\"Transparent\" bgcolor=\"White\" width=\""+myWidth+"\" height=\""+myHeight+"\" name=\"fl"+myId+"\"></embed>"].join("");
		} else {
			nodeFlash = document.createElement("object");
			
			flash.createObjectParameter(nodeFlash, "movie", "flash/"+myId+".swf");
			flash.createObjectParameter(nodeFlash, "quality", "best");
			
			nodeFlash.setAttribute("id", "fl"+myId);
			nodeFlash.setAttribute("width", myWidth);
			nodeFlash.setAttribute("height", myHeight);
			nodeFlash.style.width = myWidth+"px";
			nodeFlash.style.height = myHeight+"px";
			
			if (!UA.bIsOpera)
			{
				nodeEmbed = document.createElement("embed");
				
				nodeEmbed.setAttribute("name", "fl"+myId);
				nodeEmbed.setAttribute("src", "flash/"+myId+".swf");
				nodeEmbed.setAttribute("quality", "best");
				nodeEmbed.setAttribute("wmode", "Transparent");
				nodeEmbed.setAttribute("type", "application/x-shockwave-flash");
				nodeEmbed.setAttribute("swliveconnect", "true");
				nodeEmbed.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer");
				nodeEmbed.setAttribute("width", myWidth);
				nodeEmbed.setAttribute("height", myHeight);

				nodeFlash.appendChild(nodeEmbed);
			}
			myElement.appendChild(nodeFlash);
		}
	}

};

if (hasFlash)
	evt.add(window, "load", flash.init);
