function height() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function check() {
  var content = document.getElementById('outercont');
  var footer = document.getElementById('footer');
  
  
  if((content.offsetHeight+122) > (height())){
	  footer.style.position = 'relative';
  } else {
	  footer.style.position = 'absolute';
  }
  
      
   setTimeout("check()", 100);
}


function check_pos() {
	alert(document.getElementById('background').offsetHeight + " " + (height()-122));
}

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