////////////////////////////////////////////////////////////////
// the following 4 variables can be changed
//
// NOTE: if this script is not working, make sure that you
// have the TITLES variable set on the calling page
////////////////////////////////////////////////////////////////

////////////////////////////////////////////
// an array of image string names for the
// rollovers
////////////////////////////////////////////

var TITLES;

////////////////////////////////////////////
// basic settings for where items are,
// what extension is used and what prefix
// is used to show the rollover image
//
// NOTE: these can be moved out to the 
// calling page if for some reason they
// vary from page to page
////////////////////////////////////////////

// var PIC_DIR = "/mages/dropdown_nav/";
// var OVER_PREFIX = "_o";
// var IMG_EXTENSION = ".gif";

////////////////////////////////////////////////////////////////
// do not edit code below this point
////////////////////////////////////////////////////////////////

// if this isn't ok, then i'll eat my hat (it's an old script)
var BROSWER_ROLLOVER = (document.images) ? true : false;

// the array of menu images
var menuImages = new Array();

// the preload
function preloadImages () {
    if (TITLES == null) {
        // this should only happen if there's an error
        alert("There are no images in the TITLES array");
        return;
    }

    if (BROSWER_ROLLOVER) {
        for (i=0; i < TITLES.length; i++) {
            var btn = (PIC_DIR + TITLES[i] + OVER_PREFIX + IMG_EXTENSION);
            menuImages[i] = new Image();
            menuImages[i].src = btn;
        }
    }
}

// the rollover function        
function imgRoll (item, state) {
    if (BROSWER_ROLLOVER) {
        var a = (PIC_DIR + item + OVER_PREFIX + IMG_EXTENSION);
        var b = (PIC_DIR  + item + IMG_EXTENSION);
        document.getElementById(item).src = (state) ? a : b;
    }
}

// window.onload = preloadImages;
