﻿<!--
/*
 ************************************************************************************************************************************************
 *  FILENAME:       navbar.js                                                                                                                   *
 *  PROGRAMMER:     Anthony Nguyen                                                                                                              *
 *  DESCRIPTION:    This file is to be modified to allow developers to pre-cache their swappable images and provide functions to swap the       *
 *                  images when called upon.                                                                                                    *
 *  DATE CREATED:   February 23, 2004                                                                                                           *
 ************************************************************************************************************************************************
*/

    /* Global variables... */
    var NormalImages = new Array();
    NormalImages[0] = new Image();
    NormalImages[1] = new Image();
    NormalImages[2] = new Image();
    NormalImages[3] = new Image();
    NormalImages[4] = new Image();
    NormalImages[5] = new Image();
    
    var RollOverImages = new Array();
    RollOverImages[0] = new Image();
    RollOverImages[1] = new Image();
    RollOverImages[2] = new Image();
    RollOverImages[3] = new Image();
    RollOverImages[4] = new Image();
    RollOverImages[5] = new Image();
    
    //now beging to pre-cache the images used with image swapping so there is no delaying when downloading.
    
    //first begin to pre-cache the normal images displayed.
    NormalImages[0].src = "/images/homepage/clickhereoff.jpg";
    //NormalImages[1].src = "/images/navigation/safetyinfooff.jpg";
    //NormalImages[2].src = "/images/navigation/resultsoff.jpg";
    //NormalImages[3].src = "/images/navigation/linksoff.jpg";
    //NormalImages[4].src = "/images/navigation/solutionsoff.jpg";
    //NormalImages[5].src = "/images/navigation/contactusoff.jpg";
    
    //then pre-cache all the rollover images to be displayed.
    RollOverImages[0].src = "/images/homepage/clickhereon.jpg";
    //RollOverImages[1].src = "/images/navigation/safetyinfoon.jpg";
    //RollOverImages[2].src = "/images/navigation/resultson.jpg";
    //RollOverImages[3].src = "/images/navigation/linkson.jpg";
    //RollOverImages[4].src = "/images/navigation/solutionson.jpg";
    //RollOverImages[5].src = "/images/navigation/contactuson.jpg";
    
    /*
     ****************************************************************************************************************************************
     *  FUNCTION:       rollover                                                                                                            *
     *  PARAMETERS:     name - the name of the Image object                                                                                 *
     *                  eventType - the type of event that is happening so we can determine which image to swap.                            *
     *                  index - the index of the image to swap                                                                              *
     *  DESCRIPTION:    This function swaps the proper image with the one requested, depending on the event type that triggered it.         *
     ****************************************************************************************************************************************
    */
    function rollover(name, eventType, index) {
        //check to see if its a mouseover event.
        if (eventType == "mouseover")
            document.images[name].src = RollOverImages[index].src;
        else if (eventType == "mouseout")
            document.images[name].src = NormalImages[index].src;
    }

//-->
