var iW;
function proceedDimensions() {
    proceedHeight();
    proceedWidth();
    if(typeof map != 'undefined') map.checkResize();
}
function proceedHeight() {
	var h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
	$('#map_container').height( h - $('#topheader').height() );
}
function proceedWidth() {
    //var iW = parseInt($('#inright').get(0).style.marginLeft);
    //window.console.log($('#inright').get(0).style);
    var iW = parseInt($('#inright').css("margin-left"));
    
    var w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
    if(w<=1090) {
        $("div.left_topbanner").css("left","18px");
        $("div.right_topbanner").css("left","300px");
    }
    else {
        $("div.left_topbanner").css("left","49px");
        $("div.right_topbanner").css("left","400px");
    }

    $('#map_container').width( w - (iW?iW:0) - 10);
}
$(document).ready(function(){
	window.onresize = function() { proceedDimensions() };
    $("#toggleSidebar").bind('click' , function() {
        toggleSidebar();
        proceedDimensions();
    });
    var h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));


    $('div.accrdion').css('max-height',h-115-29);
    proceedDimensions();

    if(DTVLocation.getValue("hide") > 0) $("#toggleSidebar").trigger("click");
});

window.onresize = function() { proceedDimensions() };
