function test(){
var infoHeight = document.getElementById("header").scrollHeight + document.getElementById("main").scrollHeight;
var bottomHeight = document.getElementById("footer").scrollHeight;
var allHeight = document.documentElement.clientHeight;

var bottom = document.getElementById("footer");
if((infoHeight + bottomHeight) < allHeight){
   bottom.style.position = "absolute";
   bottom.style.bottom = "0";
}else{
   bottom.style.position = "";
   bottom.style.bottom = "";
} 

setTimeout(function(){test();},10);
}
test();

