window.onresize = fix;

function fix() {
  try {
	  y1 = document.body.scrollHeight;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    y2 = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    y2 = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientHeight ) ) {
	    //IE 4 compatible
	    y2 = document.body.clientHeight;
	  }
	
	    if (y2>y1) y=y2; else y=y1;
	  document.getElementById('bg2').style.height = y+"px";
	  document.body.style.backgroundImage = "url(images/bg.gif)";
	  document.body.style.visibility = "visible"; 
  } catch (e) { }
}
