/* *******************************************************************
**
** THIS SCRIPT REQUIRES browser_detection.js
** The scripts should be loaded from the <head> in the 
** following order:
** <script type="text/javascript" src="browser_detection.js"><//script>
** <script type="text/javascript" src="flash.js"><//script>
**
******************************************************************** */
var debug=false;
var flash=false;
if (debug) browser_info();

with (navigator) { 
  if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) {
    document.write('<scr'+'ipt language="VBScript">\n');
	  document.write('  On error resume next\n');
    document.write('  MM_dir = (IsObject(CreateObject("SWCtl.SWCtl.1")) Or IsObject(CreateObject("Macromedia.ActiveShockwave.1")))\n');
    document.write('  MM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n');
	  document.write('</scr'+'ipt>');
  }
}

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v3.0
  // plugin is defaulted to false below 
  var ok=false; 
  document.MM_returnValue = false;
	with (navigator) { 
    if (!ie) { 
	    ok = (plugins && plugins[plgIn]);
	  } else if (appVersion.indexOf('3.1')==-1) { 
      //not Netscape or Win3.1
      // plugin is set to a value which is NOT false
      if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) {
		    ok=window.MM_flash;
		  } else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) {
		    ok=window.MM_dir;
		  } else {
		    ok=autoGo;
		  } 
    }
  }
  if (!ok) {
	  flash=false;
  } else {
	  flash=true;
  }
}

// Check for flash plugin (will set flash=true if found)
MM_checkPlugin('Shockwave Flash','','',false);

function awmSafe() {
	// special case AWM fix
	// menus dont work over op6/ns6 and lower (disable ie5 and lower, just incase)
	if (op && (nu < 8)) { // Disable Flash for Opera 6 and lower 
		flash=false;
	}
	if ((moz && (nu < 1.0)) || ns4) { // Disable Flash for Netscape 6 and lower
		flash=false;
	}
	if (ie && (nu < 6) && !mac) { // Disable Flash for IE 5 and lower
		flash=false;
	}
	if (ie && (nu < 5) && mac) {
		flash=false;
	}
}

/* Flash not loading for Opera? Why? */
function Embed_Flash(myName, myBackColor, myWidth, myHeight, overAWM) {
  if (overAWM) awmSafe();
  if (!flash) {
    document.write('<img src="images/'+myName+'.jpg" width="'+myWidth+'" height="'+myHeight+'">');
  } else {
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" name="'+myName+'" width="'+myWidth+'" height="'+myHeight+'" id="'+myName+'">\n');
    document.write('  <param name="movie" value="'+myName+'.swf">\n');
		document.write('  <param name="wmode" value="transparent">\n');
		document.write('  <param name="bgcolor" value="#FFFFFF">\n');
    document.write('  <embed src="'+myName+'.swf" width="'+myWidth+'" height="'+myHeight+'" wmode="transparent" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>\n');
    document.write('</object>');
  }
}

function Embed_Flash2(flashFile, altImgFile, myName, myBackColor, myWidth, myHeight, overAWM) {
	if (overAWM) awmSafe();
	if (debug) document.write('<!-- flash='+flash+' -->');
	if (!flash) {
		document.write('<img src="'+altImgFile+'" width="'+myWidth+'" height="'+myHeight+'" style="display:block;">');
	} else {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="'+myWidth+'" height="'+myHeight+'" name="'+myName+'" id="'+myName+'">\n');
		document.write('  <param name="movie" value="'+flashFile+'">\n');
		document.write('  <param name="quality" value="high">\n');
		document.write('  <param name="bgcolor" value="'+myBackColor+'">\n');
		document.write('  <!--[if !IE]> <-->\n');
		document.write('  <object type="application/x-shockwave-flash" data="'+flashFile+'" width="'+myWidth+'" height="'+myHeight+'" name="'+myName+'" id="'+myName+'">\n');
		document.write('    <param name="quality" value="high">\n');
		document.write('    <param name="bgcolor" value="'+myBackColor+'">\n');
		document.write('    <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer">\n');
		document.write('      FAIL (the browser should render some flash content, not this).\n');
		document.write('  </object>\n');
		document.write('  <!--> <![endif]-->\n');
		document.write('</object>\n');
	}
}

/*
Providing Alternate Object Content
<OBJECT CLASSID="java:Yahtzee.class" CODETYPE="application/java" WIDTH=400 HEIGHT=250 STANDBY="Ready to play Yahtzee?" TITLE="My Yahtzee Game">
<OBJECT DATA="yahtzee.gif" TYPE="image/gif" TITLE="A Yahtzee animation" WIDTH=200 HEIGHT=100>
Yahtzee is my <EM>favorite</EM> game!
</OBJECT>
</OBJECT>
*/

