// Flash Detection
function hasFlashVersion(theVersion)
{
   if(!self["MM_FlashCanPlay_" + theVersion])
      return false;
   else
      return true;
}
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
for(i=3;i<=10;i++)
{
   if (plugin)
   {
      var words = navigator.plugins["Shockwave Flash"].description.split(" ");
      for(j=0; j<words.length; j++)
      {
         if (isNaN(parseInt(words[j])))
            continue;
         self["MM_PluginVersion_" + i] = words[j]; 
      }
      self["MM_FlashCanPlay_" + i] = self["MM_PluginVersion_" + i] >= i;
   }
   else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1))
   {
      document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
      document.write('on error resume next \n');
      document.write('MM_FlashCanPlay_' + i + ' = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + i + ')))\n');
      document.write('</SCR' + 'IPT\> \n');
   }
}

// Flash Embedding
function insertFlashApp(theFile, theWidth, theHeight, theFlashVersion, theAlternateCode, theBGColor, theQuality, theID, theWindowMode)
{
   if(!theFlashVersion || !parseInt(theFlashVersion) || parseInt(theFlashVersion) == "")
      theFlashVersion = 3;
   if((!theBGColor && theBGColor != 0) || theBGColor == "")
      theBGColor = "#FFFFFF";
   if((!theQuality && theQuality != 0) || theQuality == "")
      theQuality = "high";

   if(hasFlashVersion(parseInt(theFlashVersion)) && !(!theFile && theFile != 0) && theFile != "" && !(!theWidth && theWidth != 0) && theWidth != "" && !(!theHeight && theHeight != 0) && theHeight != 0)
   {
      var theFlashEmbedCode = "<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n"
         + "	CODEBASE=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=" + theFlashVersion + ",0,0,0\"\n";

      if(!(!theID && theID != 0) && theID != "")
         theFlashEmbedCode += "	ID=\"" + theID + "\"\n";

      theFlashEmbedCode += "	WIDTH=\"" + theWidth + "\"\n"
         + "	HEIGHT=\"" + theHeight + "\"\n";

      theFlashEmbedCode += "	>\n"
      + "	<PARAM NAME=\"movie\" VALUE=\"" + theFile + "\">\n"
      + "	<PARAM NAME=\"quality\" VALUE=\"" + theQuality + "\">\n"
      + "	<PARAM NAME=\"bgcolor\" VALUE=\"" + theBGColor + "\">\n";

      if(!(!theWindowMode && theWindowMode != 0) && theWindowMode != "")
         theFlashEmbedCode += "	<PARAM NAME=\"wmode\" VALUE=\"" + theWindowMode + "\">\n";

      theFlashEmbedCode += "	<EMBED SRC=\"" + theFile + "\"\n";

      if(!(!theID && theID != 0) && theID != "")
         theFlashEmbedCode += "		NAME=\"" + theID + "\"\n";

      theFlashEmbedCode += "		WIDTH=\"" + theWidth + "\"\n"
         + "		HEIGHT=\"" + theHeight + "\"\n"
         + "		QUALITY=\"" + theQuality + "\"\n"
         + "		BGCOLOR=\"" + theBGColor + "\"\n";

      if(!(!theWindowMode && theWindowMode != 0) && theWindowMode != "")
         theFlashEmbedCode += "		WMODE=\"" + theWindowMode + "\"\n";

      theFlashEmbedCode += "		TYPE=\"application/x-shockwave-flash\"\n"
         + "		PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">\n"
         + "	</EMBED>\n"
         + "</OBJECT><BR>";

      document.write(theFlashEmbedCode);
   }
   else if(theAlternateCode)
      document.write(theAlternateCode);
}

// Dropdown Menu
function mmLoadMenus()
{
   if (window.mm_menu_0616132219_0)
      return;
   window.mm_menu_0616132219_0 = new Menu("root",143,18,"Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#CCCCCC","#003399","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0616132219_0.addMenuItem("Hazard Assessment","location='about-hazard-assessment.html'");
   mm_menu_0616132219_0.addMenuItem("Design","location='about-design.html'");
   mm_menu_0616132219_0.addMenuItem("Engineering","location='about-engineering.html'");
   mm_menu_0616132219_0.addMenuItem("Equipment","location='about-equipment.html'");
   mm_menu_0616132219_0.addMenuItem("System&nbsp;Installation","location='about-system-installation.html'");
   mm_menu_0616132219_0.addMenuItem("Training","location='about-trainingn.html'");
   mm_menu_0616132219_0.fontWeight="bold";
   mm_menu_0616132219_0.hideOnMouseOut=true;
   mm_menu_0616132219_0.bgColor='#333333';
   mm_menu_0616132219_0.menuBorder=1;
   mm_menu_0616132219_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0616132219_0.menuBorderBgColor='#666666';

window.mm_menu_0616132218_0 = new Menu("root",143,18,"Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#CCCCCC","#003399","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0616132218_0.addMenuItem("Training Trailer","location='trailer.html'");
   mm_menu_0616132218_0.addMenuItem("Training Room","location='trainingroom.html'");
   mm_menu_0616132218_0.fontWeight="bold";
   mm_menu_0616132218_0.hideOnMouseOut=true;
   mm_menu_0616132218_0.bgColor='#333333';
   mm_menu_0616132218_0.menuBorder=1;
   mm_menu_0616132218_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0616132218_0.menuBorderBgColor='#666666';

   mm_menu_0616132219_0.writeMenus();
}

// Image Popup
function openImage(theImage,theTarget,theWidth,theHeight)
{
   var imgwin = window.open("about:blank",theTarget,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + theWidth + ",height=" + theHeight);
   imgwin.document.write("<HTML>\n<HEAD>\n	<TITLE>Lighthouse Safety - Image</TITLE>\n</HEAD>\n<BODY MARGINHEIGHT=0 MARGINWIDTH=0 TOPMARGIN=0 LEFTMARGIN=0 onBlur=\"window.close()\">\n<IMG SRC=\"" + theImage + "\" WIDTH=" + theWidth + " HEIGHT=" + theHeight + " BORDER=0 ALT=\"\">\n</BODY>\n</HTML>");
   imgwin.document.close();
   imgwin.focus();
}