//use to add any custom javascripts to this site

/////////////////////////////////////////////////////////////
// the following three functions are used as default functions
// for setting over and out mouseover states for top nav
/////////////////////////////////////////////////////////////
    function menuOver(img) {
        //get file type
        strFileType = getFileType(img.src)
        if (img.src.indexOf("On." + strFileType) == -1) {
            img.src = img.src.replace("." + strFileType, "Over." + strFileType)
        }
    }
    function menuOut(img) {
        //get file type
        strFileType = getFileType(img.src)
        if (img.src.indexOf("Over." + strFileType) != -1) {
            img.src = img.src.replace("Over." + strFileType, "." + strFileType)
        }
    }

    function getFileType(strFileName){
        strFileType = ""
        arrParts = strFileName.split(".")
        strFileType = arrParts[arrParts.length-1]
        return strFileType
       
    }

//function: set height of left nav using jquery
function setHeight() {
    if (document.getElementById("contentMiddle")) {
        
        var height = $("#contentMiddle").height();
        
        if (height > 495) {
            
            //height = height + 40; //add some to the height
            $("#ctl00_ucSubNav_navMiddle").css("height", height + "px");
            //$("#innerleftbtm").css("height", height + "px");
            //var contentheight = height - 191; //subtract height of the banner
            //$("#contentbucket").css("height", contentheight + "px");
        }
    }
}


// function: add png class for PNG images
function addPNGfix() {
    //alert("images # " + document.images.length);
    for (i = 0; i < document.images.length; i++) {
        //get image extension
        imgSrc = document.images[i].src
        //alert(imgSrc)
        arrParts = imgSrc.split(".")
        ext = arrParts[arrParts.length - 1].toLowerCase()
        
        //if image is a PNG
        if (ext == "png") {
            //alert(ext);
            //if button is a png
            $(document.images[i]).addClass("png");
        }
    }
}

function init() {
  
    setHeight(); //set height of leftnav
    addPNGfix(); //add PNG fix
}
window.onload = init;
/////////////////////////////////////////////////////////////
// END
/////////////////////////////////////////////////////////////
