/********************************************************************************
 
Name:     Flash plugin detect
 
*********************************************************************************/
var flashdetect = false;
function fnFlashDetect() {
 if (navigator.plugins && navigator.plugins.length) {
  for (x=0; x < navigator.plugins.length; x++) {
   if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
     flashdetect = true;      
    break;
   }
  }
 }
 else if (window.ActiveXObject) {
  for (x = 2; x <= 20; x++) {
   try {
    oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
    if(oFlash) {
     flashdetect = true;  
    }
   }
   catch(e) {}
  }
 }
}
fnFlashDetect(); // run on file load; 


/********************************************************************************
 
Name:     		Flash embed
Description:  	Writeout flash code. Fixes Eolas update for IE as well.  
				No-flash content should be placed in a div with ID of "noFlashContent" 
				before flash embed JS.  This div should be hidden by the javascript stylesheet.
@param swf  	String path to swf file
@param width    Number value of movie width
@param height   Number value of movie height

Example HTML:
				<div id="noFlashContent">
					Non-Flash content here
				</div>
				<div id="flashContent">
					<script type="text/javascript"> 
						//<![CDATA[ 
						flash.insert('pathToFlash.swf',886,28);
						//]]>-->
					</script>
				</div>


Notes:			This can be combined with the print stylesheet, to hide flash 
				from printing, and to print non-flash content
				
*********************************************************************************/

// Link JS stylesheet - css should hide non-flash content
document.write('<link rel="StyleSheet" href="clientNameJavascript.css" type="text/css" media="screen" />');
 
// Run flash embed code if flash installed, else show non-flash content 
flash = new Object();
flash.insert = function(swf,width,height) {
	swf = swf.replace(/\./g,"%2E") // encode periods as %2e	
	if(flashdetect) { 	
		flashObject = '<embed src="'+swf+'" menu="false" quality="high" width="'+width+'px" height="'+height+'px" type="application/x-shockwave-flash" wmode="transparent" salign="T" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
		document.write(flashObject);
	} else {
		document.getElementById("noFlashContent").style.display = "block";	
	} 
}

