window.onresize = adjustLayout;

//adjusts layout width window
function adjustLayout() {



    //get height and width values for window
    browserHeight = getBrowserHeight();
    browserWidth = getBrowserWidth();
    
    //get height and width values for header and footer
    headerHeight=document.getElementById('header').offsetHeight;
    footerHeight=document.getElementById('footer').offsetHeight;
	bodyHeight=document.getElementById('content').offsetHeight;
    
   //set page height
    pageHeight = headerHeight + bodyHeight + footerHeight;
    
    
    //for interior pages -- if page height is less than browser window height, set footer to bottom of browswer window
    if (pageHeight < browserHeight) {
    document.getElementById('footer').style.position = "absolute";
    document.getElementById('footer').style.marginLeft = "auto";
    document.getElementById('footer').style.marginRight = "auto";
    document.getElementById('footer').style.bottom = "0px";
    document.getElementById('footer').style.width = (browserWidth - 10) + "px";
    }
    
    if (pageHeight > browserHeight) {
    document.getElementById('footer').style.position = "static";
    }
}
    
    
    
/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ADJUST FOOTER POSITION FOR LARGE SCREENS FOR HOME PAGE 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    

    

//retrieves height of browser window
function getBrowserHeight() {
    if (window.innerHeight) {
    return window.innerHeight;    
    }
    if (document.documentElement.clientHeight) {
    return document.documentElement.clientHeight;    
    }
 return (null);
}
//retrieves width of browser window
function getBrowserWidth() {
    if (window.innerWidth) {
    return window.innerWidth;    
    }
    if (document.documentElement.clientWidth) {
    return document.documentElement.clientWidth;    
    }
 return (null);
}

