var oldOnLoad = window.onload;
window.onload = function(){
        if(typeof oldOnLoad != typeof undefined && oldOnLoad != null)
             oldOnLoad();
        init();
}

function initMenu(id){
    var navElement = document.getElementById(id);
    var nestedId = id + "_nested";
    var nestedElem = document.getElementById(nestedId);

    if(typeof navElement != typeof undefined && navElement != null){
        navElement.onmouseover = function() {
            if(typeof nestedElem != typeof undefined && nestedElem != null)
                nestedElem.style.display = "block";
        }
        navElement.onmouseout = function() {
            var nestedElem = document.getElementById(nestedId);
            if(typeof nestedElem != typeof undefined && nestedElem != null)
                nestedElem.style.display = "none";
        }
    }
    if(typeof nestedElem != typeof undefined && nestedElem != null){
        nestedElem.onmouseover = function() {
            nestedElem.style.display = "block";
        }
        nestedElem.onmouseout = function() {
            var nestedElem = document.getElementById(nestedId);
            nestedElem.style.display = "none";
        }
    }
}

function init(){
    initMenu("nav_rentals");
    initMenu("nav_sales");
    initMenu("nav_selling");
}




