$(document).ready(function() {
    $(window).resize(function() {
        setDiv();
    });
    window.onload = setDiv;
    $(".headerlowernavilink").mouseover(function(){
        $(this).children('.headerotherlowernavilinkleft').css("background-image",'url(/gfx/navibgleft.png)');
        $(this).children('.headerotherlowernavilinkmiddle').css("background-image",'url(/gfx/navibgmiddle.png)');
        $(this).children('.headerotherlowernavilinkright').css("background-image",'url(/gfx/navibgright.png)');
    });
    $(".headerlowernavilink").mouseout(function(){
        $(this).children('.headerotherlowernavilinkleft').css("background-image",'none');
        $(this).children('.headerotherlowernavilinkmiddle').css("background-image",'none');
        $(this).children('.headerotherlowernavilinkright').css("background-image",'none');
    });
    $(".headerlowernavilink").click(function(){
        var pageurl = $(this).children('.pageurl').val();
        window.location = pageurl;
    });
});
function setDiv() {
    var content = document.getElementById('pagecenterer');
    var bgred = document.getElementById('bgredleft');
    var bgimg = document.getElementById('bgimage');
    var bgslide = document.getElementById('bgslise');
    var contentheight = content.offsetHeight;
    var wh = getWindowHeight();
    if(wh > contentheight){
        contentheight = wh;
    }
    bgred.style.height = contentheight + 'px';
    bgimg.style.height = contentheight + 'px';
    bgslide.style.height = contentheight + 'px';
}
function getWindowHeight() {
    var windowHeight = 0;
 
    if (typeof(window.innerHeight) == 'number')
        windowHeight = window.innerHeight;
 
    else {
 
        if (document.documentElement && document.documentElement.clientHeight){
            windowHeight = document.documentElement.clientHeight;
 
        }else {
            if (document.body && document.body.clientHeight)
                windowHeight = document.body.clientHeight; 
        }; 
    };
 
    return windowHeight;
};
