// RETURN THE HTML ID's
function $(idTag){
	return document.getElementById(idTag);
}

// GET WINDOW HEIGHT
function getWindowHeight() {
	var windowHeight = 0
	if( typeof( window.innerHeight ) == 'number' ) {
		//Non-IE
		windowHeight = window.innerHeight;
	}
	else if( document.documentElement && document.documentElement.clientHeight ) {
		//IE
		windowHeight = document.documentElement.clientHeight;
	}
	else if( document.body && document.body.clientHeight ) {
		//IE 4 compatible
		windowHeight = document.body.clientHeight;
	}
	return windowHeight;
}

// FOOTER POSITIONING
function setFooter() {
	//alert("j'appelle:setFooter");
	var windowHeight = getWindowHeight();
	var containerHeight = $('container').offsetHeight;
	if (windowHeight > 768) {
		$('container').style.top = ((windowHeight - containerHeight)/2) + 'px';
	}else{
		$('container').style.top = '20px';
	}
	$('container').style.display = 'block';
}

var passed='false';
// FUNCTIONS LOADING
window.onload = function() {
	if(passed=='false'){
		passed='true';
		setFooter();
		window.onresize();
	}
}
window.onresize = function() {
	setFooter();
}
