﻿// globals
document.navInterval = 0;

// loader object to call functions upon document load
var loader = new Object();
loader.loadlist = new Array();
loader.load = function(){
    for(var item in this.loadlist){
        eval( this.loadlist[item] );
    }
}


function preload(){
    if(!document.preloads) document.preloads = new Array();
    for(item=0; item<prearray.length; item++){
        var img = new Image();
        img.src = prearray[item];
        document.preloads.push(img);
    }
}

var prearray = new Array(
                'includes/images/searchbutton_ovr.gif'
);

function setupnav(){
    /* CURRENT */
    $("#navinner ul").find(":has(ul)").mouseover(
        function(){
            $(this).find("ul").css("display", "block");
        }
    );
    
    $("#navinner ul").find(":has(ul)").mouseout(
        function(){
            $(this).find("ul").css("display", "none");
        }
    );
    
    /* NEW */
    $("#nav").find(":has(div)").mouseover(
        function(){
            clearInterval($(this).navInterval);
            $(this).find("div").css("display", "block");
        }
    );
    
    $("#nav").find(":has(div)").mouseout(
        function(){
         $(this).find("div").css("display", "none");
        }
    );
    
}




function doGSearch(form){
   val = form.search.value;
   document.location.href= "/tools/search.aspx?" + escape(val);
}

function doFooter(){
    return;
     $("#footer").css("display", "none");
     h = ($(document).height() - $("#footer").height()) + "px";
     $("#footer").css("top", h);
     $("#footer").css("display", "block");
 }
    
loader.loadlist.push("setupnav()");
//loader.loadlist.push("setupsearch()");

$(document).ready(doFooter);