// JavaScript Document
function getPopUpWin(url,w,h){
	newWin=window.open(url,"NEW","top="+(screen.height/2 - h/2)+",left="+(screen.width/2 - w/2)+",width="+w+",height="+h+",scrollbars=1");
	newWin.focus();
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function showDiv(divname){
	div = MM_findObj(divname);
	if (div.style.display != "block"){
		div.style.display = "block";
	}else{
		div.style.display = "none";
	}
}
window.onresize = function (){
	menuLcontent = $('page-left');
	menuRcontent = $('page-right');
	pagecontent = $('page-layout');
	if (pagecontent.clientHeight > document.body.clientHeight){
		return false;
	}
	if(typeof fitToParent == 'function') {
		fitToParent('page-layout', 0);
		fitToParent('page-layout-outer', 0);
		fitToParent('page-layout-inner', 0);
		if($('page-left')) {
			fitToParent('page-left', 0);
			fitToParent('page-right', 0);
		}
	}
	if( menuLcontent ) {
		// #right has padding-bottom to make room for AJAX Action buttons so we need to add that
 		if (navigator.appName == "Microsoft Internet Explorer") {
			var paddingBottomOffset = 00;
		} else {
			var paddingBottomOffset = 0;
		}
		var leftH = parseInt(menuLcontent.style.height) + paddingBottomOffset;
//		var rightH = parseInt(right.style.height);
		menuLcontent.style.height = leftH + 'px';
		menuRcontent.style.height = leftH + 'px';
	}
}
window.onload = function(){
	window.onresize();
}
