//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: add rollover for SmartWebs buttons (handles GIFs and PNGs)
    function addSWBtnRollovers() {
        //alert("images # " + document.images.length);
        for (i=0;i<document.images.length;i++){
            //if button is a smartwebs button
            
            if (document.images[i].src.indexOf('swbtn_') > 0) { 
                //if button is a png
                //alert("src: " + document.images[i].src);
                imgSrc = document.images[i].src
                //alert(imgSrc)
                arrParts = imgSrc.split(".")
                ext = arrParts[arrParts.length-1]
                //alert(ext)
                document.images[i].onmouseover = function() { swapSWButtons(this, ext); };
                document.images[i].onmouseout = function() { swapSWButtons(this, ext); };
                
            }
	    }
    }
    function swapSWButtons(img, ext) {
        thisSrc = img.src
        if (thisSrc.indexOf("Over") > 0) {
            thisSrc = thisSrc.replace("Over." + ext, "." + ext)
            img.src = thisSrc
        } else {
            thisSrc = thisSrc.replace("." + ext, "Over." + ext)
            img.src = thisSrc
        }
    }

    
    function init(){
        addSWBtnRollovers();
    }
    window.onload = init;

/////////////////////////////////////////////////////////////
// END
/////////////////////////////////////////////////////////////