﻿function lightOff(img) {
    var regExp = /-on.gif/g;
    img.src = img.src.replace(regExp, "-off.gif");
}

function lightOn(img) {
    var regExp = /-off.gif/g;
    img.src = img.src.replace(regExp, "-on.gif");
}

function loadUrl(url) {
    window.location = url;
}

function closeAndRefresh() {
    window.opener.location.reload();
    window.close();
}

function openWin(url, name) {
    window.open(url, name, "width=440,height=400,left=200,top=50,scrollbars=yes,resizable=yes");
}

var activeNav = "";
var navTimeOut = "";

function navHiLt(tdID, hideSub) {
    window.clearTimeout(navTimeOut);
    if (!activeNav) {
        document.getElementById(tdID).className = "navActive";
        if (!hideSub) {
            document.getElementById(tdID + "Sub").style.display = "block";
        }
        activeNav = tdID;
    }
}

function setNavTimeOut() {
    navTimeOut = window.setTimeout('navNormal();', 5000);
}

function navNormal() {
    window.clearTimeout(navTimeOut);
    document.getElementById(activeNav).className = "navInactive";

    sub = document.getElementById(activeNav + "Sub")
    if (sub != null)
        document.getElementById(activeNav + "Sub").style.display = "none";
        
    activeNav = "";
}

function hi(itemID) {
    document.getElementById(itemID).className = "navActive"
}
function unHi(itemID) {
    document.getElementById(itemID).className = "navInactive"
}