var g_errYoN ;
function pageControlWrapper() {
  pageControl(g_errYoN);
}

function pageControl(errYoN) {
	if (!g_errYoN) {
    g_errYoN = errYoN;
    window.setInterval(pageControlWrapper, 500);
	}

	var height = document.documentElement.clientHeight;
	var width = document.documentElement.clientWidth;

	var PageHeaderMainTableHeight = document.getElementById("PageHeaderMainTable").clientHeight;
	var PageButtonsMainTableHeight = document.getElementById("PageButtonsMainTable").clientHeight;
	var PageFooterMainTableHeight = document.getElementById("PageFooterMainTable").clientHeight;	
	var PageContentHeight = height-55-PageHeaderMainTableHeight-PageButtonsMainTableHeight-PageFooterMainTableHeight;
	
	var elm = document.getElementById("PageHeader");
	elm.style.width = (width-30) + "px";
	elm.style.height = (PageHeaderMainTableHeight) + "px";
	var elm = document.getElementById("PageButtons");
	elm.style.width = (width-30) + "px";
	elm.style.height = (PageButtonsMainTableHeight) + "px";
	var elm = document.getElementById("PageContent");
	elm.style.width = (width-30) + "px";
	elm.style.height = (PageContentHeight) + "px";
	var elm = document.getElementById("PageFooter");
	elm.style.width = (width-30) + "px";
	elm.style.height = (PageFooterMainTableHeight) + "px";
	elm.style.top = ((height) - (PageFooterMainTableHeight) - 15) + "px";
}
