﻿<!--
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;
}
function setFooter() 
{
	if (document.getElementById) 
	{
	    
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) 
		{ 
		    //if window is too small
	        if(windowHeight > 400)
	        {
	            var contentContainer
	            if (document.getElementById('OneColumn')) contentContainer=document.getElementById('OneColumn');
	            if (document.getElementById('ThreeColumn')) contentContainer=document.getElementById('ThreeColumn');
	            if (document.getElementById('OneThirdTwoThirds')) contentContainer=document.getElementById('OneThirdTwoThirds');
	            if (document.getElementById('TwoColumn')) contentContainer=document.getElementById('TwoColumn');
	            
	        
			    var contentHeight = contentContainer.offsetHeight;
			    var footerElement = document.getElementById('WrapperFooter');
			    var footerHeight  = footerElement.offsetHeight;
			    var topHeight = document.getElementById('Top').offsetHeight;
			    if (windowHeight - (contentHeight + footerHeight) >= 0) 
			    {
			    	footerElement.style.position = 'absolute';
			    	footerElement.style.top = (windowHeight - footerHeight) + 'px';
			    }
			    else 
			    {
			    	footerElement.style.position = 'static';
			    }
			
		      var height = (windowHeight - footerHeight - topHeight) - 15 ;
		      //height of scroll bar = height of one column - height of footer
		
              contentContainer.style.height= height+ 'px';
            }
        
        }
	}
		
}
	   
function pageLoad(sender, eventArgs) {
	setFooter();
}
window.onresize = function() {
	setFooter();
}
//-->