// Preload MouseOver Images
var use_images = new Array();
var pl_images = new Array();
for(i=0;i<use_images.length;i++)
{
   pl_images[i] = new Image();
   pl_images[i].src = "images/" + use_images[i];
}

// Partner Image Changer
menupartners = new Array("partner-menu-connectship.jpg","partner-menu-fedex.jpg","partner-menu-dhl.jpg","partner-menu-ups.jpg","partner-menu-usps.jpg","partner-menu-baxglobal.jpg","partner-menu-bestwaytech.jpg","partner-menu-kewill.jpg","partner-menu-provia.jpg","partner-menu-artraffic.jpg","partner-menu-ibm.jpg","partner-menu-microsoft.jpg","partner-menu-loftware.jpg","partner-menu-wavelink.jpg","partner-menu-numina.jpg","partner-menu-hp.jpg","partner-menu-hhp.jpg","partner-menu-datamax.jpg","intermec_sm.jpg","partner-menu-psc.jpg","partner-menu-rjs.jpg","partner-menu-nato.jpg","partner-menu-symbol.jpg","partner-menu-zebra.jpg","partner-menu-cisco.jpg");
partnerlinks = new Array("software",                    "carriers",              "carriers",            "carriers",            "carriers",             "carriers",                  "software",                    "software",               "software",               "software",                  "software",            "software",                  "software",                  "software",                "software",               "hardware",           "hardware",            "hardware",                "hardware",                 "hardware",            "hardware",            "hardware",             "hardware",               "hardware",              "hardware");
var curpartnerindex = Math.floor(menupartners.length*Math.random());
function switchPartner()
{
   if(curpartnerindex < menupartners.length-1)
      curpartnerindex++;
   else
      curpartnerindex = 0;
   document.partner_menu.src = "images/" + menupartners[curpartnerindex];
   document.getElementById('partnerlink').href = "partners.cfm#" + partnerlinks[curpartnerindex];
   setTimeout("switchPartner()",2500);
}

// Open Video Window
function hasFileExtension(theValue,theExtensionList){var reg = new RegExp("\\.(" + theExtensionList.replace(/( |\.)/gi,"").replace(/,/gi,"|") + ")$","gi"); if(reg.test(theValue)) return true; else return false;}
function openVid(vidurl,vidtitle)
{
   var vidWidth = 400;
   var vidHeight = 367;

   var showWMStatus = "True";
   var showWMControls = "True";

   var movieWin = window.open("about:blank","","toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,width=" + vidWidth + ",height=" + vidHeight);

   var vidpagecode = "";
   if (hasFileExtension(vidurl,"mpg,mpeg,wmv,asf,avi"))
   {
      vidpagecode += "<HTML>\n<HEAD>\n	<TITLE>" + vidtitle + "</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"#000000\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" onBlur=\"close()\">\n";
      vidpagecode += "<OBJECT WIDTH=" + vidWidth + " HEIGHT=" + vidHeight + "\n"
      + "CLASSID=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" ID=\"mediaplayer1\">\n"
      + "<PARAM NAME=\"Filename\" VALUE=\"" + vidurl + "\">\n"
      + "<PARAM NAME=\"AutoStart\" VALUE=\"True\">\n"
      + "<PARAM NAME=\"ShowControls\" VALUE=\"" + showWMControls + "\">\n"
      + "<PARAM NAME=\"ShowStatusBar\" VALUE=\"" + showWMStatus + "\">\n"
      + "<PARAM NAME=\"ShowDisplay\" VALUE=\"False\">\n"
      + "<PARAM NAME=\"AutoRewind\" VALUE=\"True\">\n"
      + "<EMBED WIDTH=" + vidWidth + " HEIGHT=" + vidHeight + " SRC=\"" + vidurl + "\"\n"
      + "FILENAME=\"" + vidurl + "\" AUTOSTART=\"True\"\n"
      + "SHOWCONTROLS=\"" + showWMControls + "\" SHOWSTATUSBAR=\"" + showWMStatus + "\"\n"
      + "SHOWDISPLAY=\"False\" AUTOREWIND=\"True\">\n"
      + "</EMBED>\n"
      + "</OBJECT>\n";
   }
   else if (hasFileExtension(vidurl,"swf") && hasFlashVersion(6))
   {
      vidpagecode += "<HTML>\n<HEAD>\n	<TITLE>" + vidtitle + "</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"#000000\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" onBlur=\"close()\">\n";
      vidpagecode += "<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\n"
        + "	CODEBASE=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"\n"
        + "	WIDTH=\"" + vidWidth + "\"\n"
        + "	HEIGHT=\"" + vidHeight + "\">\n"
        + "	<PARAM NAME=\"movie\" VALUE=\"" + vidurl + "\">\n"
        + "	<PARAM NAME=\"quality\" VALUE=\"high\">\n"
        + "	<PARAM NAME=\"bgcolor\" VALUE=\"#000000\">\n"
        + "	<EMBED SRC=\"" + vidurl + "\"\n"
        + "		WIDTH=\"" + vidWidth + "\"\n"
        + "		HEIGHT=\"" + vidHeight + "\"\n"
        + "		QUALITY=\"high\"\n"
        + "		BGCOLOR=\"#000000\"\n"
        + "		TYPE=\"application/x-shockwave-flash\"\n"
        + "		PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">\n"
        + "	</EMBED>\n"
      + "</OBJECT>\n";
   }
   else if (hasFileExtension(vidurl,"swf"))
   {
      vidpagecode += "<HTML>\n<HEAD>\n	<TITLE>" + vidtitle + "</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\">\n";
      vidpagecode += "<DIV ALIGN=\"center\"><STRONG>Flash 6 or Higher Required</STRONG><BR><BR><BR><A HREF=\"http:\/\/www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" TARGET=\"_blank\">Click Here</A> to get it.</DIV>";
   }
   else
   {
      vidpagecode += "<HTML>\n<HEAD>\n	<TITLE>" + vidtitle + "</TITLE>\n</HEAD>\n<BODY BGCOLOR=\"#FFFFFF\" MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\" onBlur=\"close()\">\n";
      vidpagecode += "<DIV ALIGN=\"center\"><STRONG>Error Loading Video</STRONG></DIV>";
   }
   vidpagecode += "</BODY>\n</HTML>";

   movieWin.document.write(vidpagecode);
   movieWin.document.close();
   movieWin.focus();
}

// 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);
}

// SubMenu Operation
var submenuin = "";
var submenutime = 100;
function showSubMenu(menuID)
{
   submenuin = menuID;
   document.getElementById(menuID).style.display = "block";
   document.getElementById(menuID).style.zIndex = 25;
}
function hideSubMenu(menuID)
{
   document.getElementById(menuID).style.zIndex = 24;
   setTimeout("doHideSubMenu('" + menuID + "')",submenutime);
   submenuin = "";
}
function doHideSubMenu(menuID)
{
   if(submenuin != menuID)
      document.getElementById(menuID).style.display = "none";
}
function getTopNode(linkElem)
{
   tn = "";
   le = linkElem;
   while (tn != "TABLE")
   {
      le = le.parentNode;
	  tn = le.tagName;
   }
   return le.id;
}

