// JavaScript Document

window.onresize = function() {
	setContentPosition();
}

window.onload = function() {
	setContentPosition();
}

function setContentPosition() {
	var contentHeight = document.getElementById('contentContainer').offsetHeight;

	var h = contentHeight + 120;
	var wHeight = getBrowserHeight();
	var bottom = Math.min(0, wHeight - h);

	//var mainMarginTop = (bottom == 0) ? Math.floor((wHeight - 120 - contentHeight) / 3) : 0;
	//document.getElementById('contentContainer').style.marginTop = mainMarginTop + 'px';
	document.getElementById('footer').style.bottom = bottom + 'px';
	document.getElementById('footer').style.display = 'block';
}

function getBrowserHeight() {  
    if ( window.innerHeight ) { return window.innerHeight; }  
    else if ( document.documentElement && document.documentElement.clientHeight != 0 ) { return document.documentElement.clientHeight; }  
    else if ( document.body ) { return document.body.clientHeight; }  
    return 0;  
}  
