function mnuover(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#CCCCCC";
}
function mnuout(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#e0e0e0";
}
function menuover(menuid) {
    document[menuid].src = "http://www.northlich.com/wp-content/themes/nl/images/" + menuid + "_over.gif";
}
function menuout(menuid) {
    document[menuid].src="http://www.northlich.com/wp-content/themes/nl/images/" + menuid + ".gif";
}
function followover(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#d9541e";
}
function followout(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#b9b9b9";
}
function sidebarmnuover(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#c2c2c2";
}
function sidebarmnuout(menuid) {
    document.getElementById(menuid).style.backgroundColor = "#d4d4d4";
}
function sidebarover(elm) {
    if (elm.className != "sidebarlist_active") {
		elm.style.backgroundColor = "#c2c2c2";
	}
}
function sidebarout(elm) {
    if (elm.className != "sidebarlist_active") {
	   elm.style.backgroundColor = "#d4d4d4";
   }
}
function ddl_over(elm) {
	elm.style.backgroundColor = "#c2c2c2";
}
function ddl_out(elm) {
   elm.style.backgroundColor = "#f1f1f1";
}
function showddl() {
    var dim = GetTopLeft(document.getElementById("cats"));
    var tp, lt = '';
    var browser = navigator.appName;
    var ua = navigator.userAgent;
    tp = (dim.Top + 20) + 'px';
    lt = (dim.Left) + 'px';
    var imgdiv = document.getElementById("ddl");
    if (imgdiv.style.display == 'none') {
        imgdiv.style.display = 'block';
        imgdiv.style.top = tp;
        imgdiv.style.left = lt;
    } else {
        imgdiv.style.display = 'none';
    }
    return false;
}

function GetTopLeft(elm) {
    var x, y = 0;
    x = elm.offsetLeft;
    y = elm.offsetTop;
    elm = elm.offsetParent;
    while (elm != null) {
        x = parseInt(x) + parseInt(elm.offsetLeft);
        y = parseInt(y) + parseInt(elm.offsetTop);
        elm = elm.offsetParent;
    }
    return { Top: y, Left: x };
}

function ddlhide(e) {
    if (!e) {
        e = window.event;
    }

    if (!e.fromElement.contains(e.toElement) && !document.getElementById(menuid).contains(e.toElement)) {
        var imgdiv = document.getElementById("ddl");
        imgdiv.style.display = 'none';
    }
} 
