//  ***************  Flash detection via jscript  **********************

var MM_contentVersion = 8; // required Flash version
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}


function putFlash(swf,w,h) { // url, width and height are required
	/*
	noFlashHTML = HTML to show without flash player present
	or redirectURL = url to jump to when no flashplayer
	
	call this function like this:
	var noFlashHTML = '<a href="futurizer.htm"><img src="futurizer_home.gif" alt="Futurizer" title="Futurizer" border="0" /></a>';
	putFlash("banner.swf",212,261);

	*/
	
	if ( MM_FlashCanPlay ) { 	
		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+'" align="middle">');
		document.write('<param name="movie" value="'+swf+'">');
		document.write('<param name="quality" value="high">');
		//document.write('<param name="WMode" value="Transparent">');
		//document.write('<embed src="'+swf+'" quality="high" width="'+w+'" height="'+h+'" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
		document.write('<embed src="'+swf+'" quality="high" width="'+w+'" height="'+h+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	    document.write('</object>');	
	} else { // show image or redirect if they are defined
		if (noFlashHTML) document.write(noFlashHTML); 
		else if (redirectURL) top.location.href = redirectURL;
	}
	
} // end function


function putNoCacheFlash(swf,w,h) { // url, width and height are required
	/*
	same as putFlash, but tries to avoid caching (especially useful if Flashmovie changes a lot)
	this will try to make sure the Flash movie is redownload each time
	*/
	var mydate = new Date(); var t = mydate.getTime();
	var param = (swf.indexOf("?")>-1) ? "&t="+t : "?t="+t;
	putFlash( swf +""+ param ,w,h); // from here on business as usual
	
} // end function

//  *****************************************************

