
/**
 * getWindowHeight
 * used by the footer for 
 * absolute placing footer
 */
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;
}

/**
 * setFooter
 * sets the footer by using the windowheight function
 */
 function setFooter() {
 
    if (document.getElementById) {
        var windowHeight=getWindowHeight();

        if (windowHeight>0) {
        	var contentElement 		= document.getElementById('container2');
            var contentHeight       = contentElement.offsetHeight;
            var footerElement       = document.getElementById('footer');
            var footerHeight=footerElement.offsetHeight;
            //console.info('window'+windowHeight);
            //console.info('content'+contentHeight);
            //console.info('footer'+footerHeight);
            
            if (windowHeight-(contentHeight+footerHeight)>=0) {
                footerElement.style.position='relative';
                
                cheight = windowHeight-footerHeight;
            	//console.info('newh:'+cheight);
            	contentElement.style.height = ''+cheight+'px';
                //footerElement.style.top=(windowHeight-(contentHeight+footerHeight))+'px';
            } else {
            
                //footerElement.style.position='static';
            }

        }
    }
}    

