// defect 14674: removed unused "static" routines, since the little arrows GIF's are no longer used

// global variables
var objTimeOut=1;

//browser sniffer
var agt=navigator.userAgent.toLowerCase();
var is_mac    = (agt.indexOf("mac")!=-1);
var is_major  = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var msie_vers_start = agt.indexOf("msie")+5;
var msie_real_vers = parseFloat(agt.substring(msie_vers_start, msie_vers_start+3));
var is_linux  = (agt.indexOf("inux")!=-1);
var is_nav    = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) && (agt.indexOf('webtv')==-1));
var is_nav6   = (is_nav && (agt.indexOf('netscape6') != -1));
var is_nav41up = (is_nav && (is_minor >= 4.1));
var is_ie     = (agt.indexOf("msie") != -1);
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (msie_real_vers < 5));
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);
var is_aol    = (agt.indexOf("aol") != -1);
var is_aol4   = (is_aol && is_ie3);


// change the visiblity of the input object
function show(id) {
    // IE
    if (document.all){
        document.all[id].style.visibility='visible';}
    // NS 4
    else if (document.layers){
        document.layers[id].visibility='show';}
    // Mozilla / Netscape / Firefox
    else
        document.getElementById(id).style.visibility='visible';
}

// change the visibilty of the input object
function hide(id) {
    // IE
    if (document.all)
        document.all[id].style.visibility='hidden';
    // NS 4
    else if (document.layers)
        document.layers[id].visibility='hide';
    // Mozilla / Netscape / Firefox
    else
        document.getElementById(id).style.visibility='hidden';
}

// change the background color
function bgChange(id, color)
{
     // IE
    if (document.all)
    {
        document.all[id].style.backgroundColor=color;
    }
    // NS 4
    else if (document.layers)
    {
        document.layers[id].bgColor=color;
    }
    // Mozilla / Netscape / Firefox
    else
        document.getElementById(id).style.backgroundColor=color;
}


// doMenu displays the input menu
// input: state: 0 - hide the submenu
//               >0 - display  the submenu
//        imgName: ignore the first four characters
//                 the remaining string must have a <DIV> that corresponds to that name
//                      [for example <div id="subMenu2" ...> ]
//                 the last characters must have a LAYER created for it
//                      [which is done in the doInit function below]
function doMenu(state,imgName){
divName = imgName.substring(4);
layerName = divName.substring(3);
layerName = layerName.toLowerCase();
if(state){
    show(divName);
}else{
    hide(divName);
}
return true;
}


// doInit does all initialization for menuing system
// To modify:
//    set the number of main menu items for the "j" loop
//    change the odd/even colors
function doInit(){
    for(j=1; j<=9; j++){
        var color = ((Math.floor(j/2))==(Math.ceil(j/2))) ? 'FF8E28':'FF9A3E';

        if(document.layers){
            // hook functions to mouse events for NS Nav
            eval("document.menu"+j+".onmouseover=new Function(\"bgChange('menu"+j+       "','FFCC00');doMenu(1,'img_subMenu"+j+"');\")");
            eval("document.subMenu"+j+".onmouseover=new Function(\"bgChange('menu"+j+        "','FFCC00');doMenu(1,'img_subMenu"+j+"')\")");
            eval("document.menu"+j+".onmouseout=new Function(\"bgChange('menu"+j+        "','#"+color+"');doMenu(0,'img_subMenu"+j+"')\")");
            eval("document.subMenu"+j+".onmouseout=new Function(\"bgChange('menu"+j+         "','#"+color+"');doMenu(0,'img_subMenu"+j+"')\")");
            // set bg color for NS Nav here
            eval("document.menu"+j+".bgColor='#"+color+"'");
            eval("document.subMenu"+j+".bgColor='#FFFFFF'");

        } else if(document.all){
            // set bg color for IE here
            eval("document.all.menu"+j+".style.backgroundColor='#"+color+"';");
            eval("document.all.subMenu"+j+".style.backgroundColor='#FFFFFF';");
        } else {
            // set bg color for other browsers that follow HTML standards here
            eval("document.getElementById('menu"+j+"').style.backgroundColor='#"+color+"';");
            eval("document.getElementById('subMenu"+j+"').style.backgroundColor='#FFFFFF';");
        }
    }

}
