

function setFooter(){
	var footerHeight = getElementHeight("footer");
	var bodyHeight = getBodyHeight();
	var viewportHeight = getViewportHeight();
	
	var container = document.getElementById("content");
	var containerHeight = container.offsetHeight;
	
	
	
	if(bodyHeight < viewportHeight)
	{
		var diff = viewportHeight - bodyHeight;
		var newHeight = containerHeight + diff;
		
		document.getElementById("content").style.height = newHeight + "px";	
	}

}

function getBodyHeight(){
	if (document.getElementById)
        var bodyHeight = document.body.offsetHeight;
	return bodyHeight;
}


function getElementHeight(id){
	// This is incomplete and only supports modern browsers
    // IE 5+ FF Mozilla Opera
	if (document.getElementById){
        var element = document.getElementById(id);
    	var elementHeight = element.offsetHeight;
	}
	// Old IE
	else if (document.all){
        var element = document.all[id];
	}
    // Netscape Navigator 4-
	else if (document.layers){
        var element = document.layers[id];
	}
    return elementHeight;
	
}

function getViewportHeight(){

	var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerheight != 'undefined')
 {
      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)
 {
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
return(viewportheight);
}