function windowWidth()
{
 if (window.innerWidth) return window.innerWidth;
 else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
 else return 0;
}

function windowHeight()
{
 if (window.innerHeight) return window.innerHeight;
 else if (document.body && document.body.offsetHeight) return document.body.offsetHeight;
 else return 0;
}

function windowResize(offset, id) {
 	if(document.getElementById(id)) {
	 if (window.innerHeight) winHeight= window.innerHeight + 8;
	 else if (document.body && document.body.offsetHeight) winHeight = document.body.offsetHeight;
     newHeight = winHeight - offset;
	 if(newHeight <= 400)
	   newHeight= 400;
	 document.getElementById(id).style.height = newHeight;
	}
}

function windowReload()
{
 if (Width != windowWidth() || Height != windowHeight()) {
   window.history.go(0);
   windowResize(offset, id);
 }
}