//
// Author(s): Shawn McCartt
// Date: 17-Feb-2007
// Copyright Notice: Copyright (c) 2006 Perot Systems, Inc. All rights reserved.
// 
// Description: Performs menu button animation in the global navigation bar for the Consumer View Intellectual Property Site.
//
//              The navigation bar contains menu buttons for each of the main website sections.  These
//              functions animate the buttons when they are rolled over with the mouse.  They also highlight
//              the menu button for the section of the website the user is currently in.
//
//              There are two versions for each menu button.  The first is the ground (deactivated) state.
//              The second is the state the button takes on when it is rolled over by the mouse.  This state
//              is also used for the menu button in the active section of the website.
//
//              This JavaScript file has an associated JSP, JSPANavigation.jsp, which is included in the Site
//              Studio code fragment to which this file belongs.  The JSP drives the creation of the global
//              navigation menu bar.
//


//
// Define general variables.
//
var bookMark = "";
var prefix = (isSpanish ? "sp_" : "");


//
// Set menu button image variables.
//
var aboutUs = new Image(); aboutUs.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipaboutus.gif";
var aboutUsRO = new Image(); aboutUsRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipaboutusover.gif";
var aboutUsOn = new Image(); aboutUsOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipaboutuson.gif";
var forInventors = new Image(); forInventors.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforinventors.gif";
var forInventorsRO = new Image(); forInventorsRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforinventorsover.gif";
var forInventorsOn = new Image(); forInventorsOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforinventorson.gif";
var forIndustry = new Image(); forIndustry.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforindustry.gif";
var forIndustryRO = new Image(); forIndustryRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforindustryover.gif";
var forIndustryOn = new Image(); forIndustryOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipforindustryon.gif";
var technologyAndPartnerships = new Image(); technologyAndPartnerships.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anaviptechandpartnerships.gif";
var technologyAndPartnershipsRO = new Image(); technologyAndPartnershipsRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anaviptechandpartnershipsover.gif";
var technologyAndPartnershipsOn = new Image(); technologyAndPartnershipsOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anaviptechandpartnershipson.gif";
var departmentsAndPrograms = new Image(); departmentsAndPrograms.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipdeptandprograms.gif";
var departmentsAndProgramsRO = new Image(); departmentsAndProgramsRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipdeptandprogramsover.gif";
var departmentsAndProgramsOn = new Image(); departmentsAndProgramsOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipdeptandprogramson.gif";
var referencesAndResources = new Image(); referencesAndResources.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipreferencesandresources.gif";
var referencesAndResourcesRO = new Image(); referencesAndResourcesRO.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipreferencesandresourcesov.gif";
var referencesAndResourcesOn = new Image(); referencesAndResourcesOn.src=g_HttpRelativeWebRoot + "/groups/jsp/documents/webcontent/" + prefix + "anavipreferencesandresourceson.gif";

//
// Set browser type variables.
//
var ie = (document.all) ? 1:0; // detects ie
var dom = (document.getElementById && !document.all) ? 1:0; //detects mozilla browsers like NS6 & 7
var rolloverOk = ( ie || dom ) ? 1:0;

//
// Change Image On Script.
//
function setBookMark(imageID) 
{
  bookMark = imageID;

  if (imageID != 'none') 
  {
    window.document.images[imageID].src = eval(imageID + "On.src");
  }
}

//
// RollOver Image Change Script.
//
function imgChg(imageID) 
{ 
  if (rolloverOk) 
  {
    window.document.images[imageID].src = eval(imageID + "RO.src");
  }	
}


//
// RollOver Image Change Back Script.
//
function imgChgBack(imageID, changeBack) 
{
  if (rolloverOk && changeBack) 
  {
    if (bookMark == imageID) 
    {
      window.document.images[imageID].src = eval(imageID + "On.src");
    }
    else 
    {
      window.document.images[imageID].src = eval(imageID + ".src");
    }
  }
}
