// Name: FlashEmbed// Language: JavaScript// Author: Ramon Tapales (hacked in par) | mielmedia.com// Description: embeds swf if Flash player is present//              and serves alternate content if not// --------------------------------------------------// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/*hasFlash() - flash detection courtesy of mikeindustries.com (sIFR)*/// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||var hasFlash = function(){	var nRequiredVersion = 7;			if(navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") > -1){		document.write('<script language="VBScript"\> \n');		document.write('on error resume next \n');		document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + nRequiredVersion + '))) \n');  		document.write('<'+'/script\> \n');		/*	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 */		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 flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));		return flashVersion >= nRequiredVersion;	};		return false;}// |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||/*embedFlashMovie() - Self-explanatory*/// PARAM VALUES (entered as string type unless otherwise specified)// swf     - name & path of flash movie// w       - width value// h       - height value// imgSrc  - path to alternate image// imgW    - width value of image (sets def value to same as 'w' if undefined)// imgH    - height value of image (sets def value to same as 'h' if undefined)// imgAlt  - alternate message (sets def message for downloading Flash Player if undefined)// bgclr   - background color (sets def hex value to #FFFFFF if undefined)// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||function embedFlashMovie(swf, w, h, imgSrc, imgW, imgH, imgAlt, bgclr) {	if (imgW == null || imgW == "") {		imgW = w;	}		if (imgH == null || imgH == "") {		imgH = h;	}		if (imgAlt == null || imgAlt == "") {		imgAlt = "Click to download the latest Flash Player from Macromedia.";	}			if (bgclr == null || bgclr == "") {		bgclr = "#FFFFFF";	}				if (window.hasFlash == false) {		document.write("<a href=\"http://macromedia.com/downloads/\"><img src=\"" + imgSrc + "\" alt=\"" + imgAlt + "\" width=\"" + imgW + "\" height=\"" + imgH + "\" /></a>");	} else {			document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + w + "\" height=\"" + h + "\" id=\"" + swf + "\" align=\"middle\">");		document.write("<param name=\"allowScriptAccess\" value=\"sameDomain\" />");		document.write("<param name=\"movie\" value=\"" + swf + "\" />");						document.write("<param name=\"quality\" value=\"high\" />");						document.write("<param name=\"bgcolor\" value=\"" + bgclr + "\" />");			document.write("<embed src=\"" + swf + "\" quality=\"high\" bgcolor=\"" + bgclr + "\" width=\"" + w + "\" height=\"" + h + "\" name=\"slideshow_as1\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />");						document.write("</object>");		}}