
function getWindowHeight() 
{
    if (window.self && self.innerHeight) 
    {
        return self.innerHeight;
    }
    if (document.documentElement && document.documentElement.clientHeight) 
    {
        return document.documentElement.clientHeight;
    }
    return 0;
}

function getWindowWidth() 
{
    if (window.self && self.innerWidth) 
    {
        return self.innerWidth;
    }
    if (document.documentElement && document.documentElement.clientWidth) 
    {
        return document.documentElement.clientWidth;
    }
    return 0;
}

function resizeApp() 
{
    var divHeader = document.getElementById('wrapperHeader');
    var divMap = document.getElementById('wrapperMap');
    var divAccordion = document.getElementById('accordion');
    var divAccordion1 = document.getElementById('accordion1');
    var divAccordion2 = document.getElementById('accordion2');
    var divAccordion3 = document.getElementById('accordion3');
    var divAccordion4 = document.getElementById('accordion4');
    
    var mapHeight = getWindowHeight() - 131;
    var mapWidth = getWindowWidth() - 326;
    var navHeight = getWindowHeight() - 142;
    var navAccordion = getWindowHeight() - 292;
    
    if (mapWidth < 600) {
        divMap.style.width = 600 + "px";
    }
    else {
        divMap.style.width = mapWidth + "px";
	document.getElementById('navBar').style.width = getWindowWidth() - 2 + "px";
    }
    
    if (mapHeight < 600) {
        divMap.style.height = 600 + "px";
 	$('#accordion').css('height','430px');
	$('#accordion1').css('height','430px');
	$('#accordion2').css('height','430px');
	$('#accordion3').css('height','430px');
	$('#accordion4').css('height','430px');
   }
    else {
        divMap.style.height = mapHeight + "px";
	$('#accordion').css('height',getWindowHeight() - 292 + 'px');
	$('#accordion1').css('height',getWindowHeight() - 292 + 'px');
	$('#accordion2').css('height',getWindowHeight() - 292 + 'px');
	$('#accordion3').css('height',getWindowHeight() - 292 + 'px');
	$('#accordion4').css('height',getWindowHeight() - 292 + 'px');

    }
    _map.updateSize();
}