// JavaScript Document

function windowAddFunction(onEvent,f) {
	if (onEvent == 'onload') {
		var prev = window.onload;
		window.onload = function() {
				if(prev)prev(); f(); 
			}
	}	
	if (onEvent == 'onresize') {
		var prev = window.onresize;
		window.onresize = function() {
			if(prev)prev(); f(); 
		}
	}
}


var initHeight = null;
function fixSiteHeight() {
	contentHeight = document.getElementById('container').offsetHeight;
	windowHeight = document.documentElement.offsetHeight;
	heightDiff = windowHeight - contentHeight;
//	alert(contentHeight+' - '+windowHeight);
	if ((contentHeight + 193) < windowHeight ) {
		document.getElementById('footer').style.marginTop = heightDiff - 243 + 'px';
	} else {
		document.getElementById('footer').style.marginTop = '-50px';
	}
}




windowAddFunction('onload',fixSiteHeight);
windowAddFunction('onresize',fixSiteHeight);

