
function setMasque()
{ 
    if(navigator.appName == "Microsoft Internet Explorer"){
    	window.attachEvent('onload', modifyHeight);
    	window.attachEvent('onresize', modifyHeight);
    }
    else{
    	window.addEventListener('load', modifyHeight,false);
    	window.addEventListener('resize', modifyHeight,false);
    }
}
    
function modifyHeight(){
	var footer = document.getElementById("footer");
	var cache = document.getElementById("cache");
	var y = calcY(footer);
  y = y + footer.offsetHeight;
  var res = Math.max(0,document.body.clientHeight - y);
  
  if(res > 0)
  {
  	cache.style.display='block';
  }
  else
  {
  	cache.style.display='none';
  }
  
  cache.style.height = Math.max(0,document.body.clientHeight - y);
}

function calcY( obj )
{
  x=0;
  y=0;
  
  w = obj.offsetWidth;
  h = obj.offsetHeight;

  var aTag = obj;
  do
  {
    x += aTag.offsetLeft;
    y += aTag.offsetTop;
    aTag = aTag.offsetParent;
  } while(aTag.tagName!="BODY");

  return y;
}
