function posFooter() {
	var f = document.getElementById('footer');
	f.style.position = 'absolute';
	f.style.left = '0px';

	var w = document.getElementById('wrapper');

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	if(windowHeight > w.offsetHeight) {
		f.style.bottom = '0px';
		f.style.top = null;
	} else {
		f.style.top = (w.offsetHeight)+'px';
		f.style.bottom = null;
	}
}

window.onload = posFooter;
window.onresize = posFooter;