function openAdobe() {
	window.open('http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash');
}
function createFlash() {

	var spanEle = document.getElementsByTagName("span");
	
	for (var i = 0; i<spanEle.length; i++) {
		
		if (spanEle[i].id.indexOf("flash") != -1) {

		var flashId = spanEle[i].id.substr(6);

		var flashData = "flash/"+flashId+".swf";
		//var flashWidth = spanEle[i].style.width.substring(0, spanEle[i].style.width.length-2);
		//var flashHeight = spanEle[i].style.height.substring(0, spanEle[i].style.height.length-2);

		var flashWidth = "100%";
		var flashHeight = "100%";

		var thisContainer = spanEle[i].id;
		var agt = navigator.userAgent.toLowerCase();
			
//alert(flashData);


			if (agt.indexOf("firefox") != -1 || agt.indexOf("netscape") != -1) {
				
				var flashObj = document.createElement("object");
				flashObj.id = flashId;
				flashObj.type = "application/x-shockwave-flash";
				flashObj.data = flashData;
				flashObj.width = flashWidth;
				flashObj.height = flashHeight;

				//--
				var param = document.createElement("param");
				param.name = "movie";
				param.value = flashData;
				flashObj.appendChild(param, null);

				var param2 = document.createElement("param");
				param2.name = "wmode";
				param2.value = "transparent";
				flashObj.appendChild(param2, null);

				var param3 = document.createElement("param");
				param3.name = "swliveconnect";
				param3.value = "true";
				flashObj.appendChild(param3, null);

				var param4 = document.createElement("param");
				param4.name = "Scale";
				param4.value = "NoScale";
				flashObj.appendChild(param4, null);

				//--
				var divObj = document.createElement("span");
				//divObj.style.width = flashWidth+"px";
				//divObj.style.height = flashHeight+"px";
				divObj.style.width = flashWidth;
				divObj.style.height = flashHeight;
				divObj.style.backgroundColor = "#fff";
				
				flashObj.appendChild(divObj, null);
				
				var imgObj = document.createElement("img");
				//imgObj.style.width = flashWidth+"px";
				//imgObj.style.height = flashHeight+"px";
				imgObj.style.width = flashWidth;
				imgObj.style.height = flashHeight;
				imgObj.src = "images/noflash/"+flashId+".jpg";
				
				divObj.appendChild(imgObj);

				var f1Txt = document.createTextNode("Can\'t see the animation above? ");
				divObj.appendChild(f1Txt);

				var anchorObj = document.createElement("a");

				anchorObj.href = "javascript: //";
				anchorObj.onclick= openAdobe;

				var f2Txt = document.createTextNode("Install Adobe Flash Plugin");

				anchorObj.appendChild(f2Txt);

				divObj.appendChild(anchorObj);




				document.getElementById(thisContainer).appendChild(flashObj, null);
			} else {



				var newHTML = '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="'+flashId+'" width="'+flashWidth+'" height="'+flashHeight+'"><param name="movie" value="'+flashData+'"></param><param name="wmode" value="transparent"></param><param name="menu" value="true"></param><param name="Scale" value="NoScale"></param><param name="swliveconnect" value="true"></param><img src="images/noflash/'+flashId+'.jpg" width="'+flashWidth+'" height="'+flashHeight+'" alt=""><br>Can\'t see the animation above? <a href="javascript: //" onclick="openAdobe();" class="newwindow">Install Adobe Flash Plugin</a></object>';

		document.getElementById(thisContainer).innerHTML = newHTML;


			}
		}
	}
}
