var latHome = 53.9583;
var longHome = -4.093;



function page_resize(){
 
     /*  Dev:    James Pearson
        Date:   2007-08-13
        Desc:   Resizes the main content area when the window is resized. 
                Partially based on the sample on http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/ */
                
    // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
    if (typeof window.innerWidth != 'undefined')
    {
        viewportwidth = window.innerWidth,
        viewportheight = window.innerHeight
    }
    // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
     else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
    {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
    }
    
    // older versions of IE
    
    else
    {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
    }
    
    
    var divPrimary = $('primary');
    var divSecondary = $('secondary');
    var iHeightMod = 150;
    
    if(divPrimary){
        //divPrimary.style.height = Math.max(viewportheight - iHeightMod,400) + 'px';
        //Test code to move footer into content.
        divPrimary.style.height = (viewportheight - iHeightMod) + 'px'
    }
    
    if(ie6)
    { 
       if (divSecondary){
            divPrimary.style.width = Math.max(viewportwidth - 355, 570) + 'px';
       }
       else
       {
            divPrimary.style.width = (viewportwidth*0.90) + 'px';
       }
    }

    if(divSecondary){
        divSecondary.style.left = (divPrimary.offsetWidth + 30) + 'px';
    }

	var mapdiv = $('map');
	var container = $('map-container');
	
	if ((typeof map != 'undefined') && (typeof container != 'undefined'))
	{
	    container.style.height = (viewportheight - iHeightMod) + 'px';
	    mapdiv.style.height = (viewportheight - iHeightMod) + 'px';
	    
	    
	    try{
		    map.checkResize();
		}catch(err){}
    }

}

window.onresize = page_resize;