window.onerror = function () { return true; }
var Hoffset=15; 
var Voffset=60;
var pX=0;
var pY=0;
var PopWin=null;
function WP(w,h,pos) {
	if (pos=="T") { pX=parseInt((screen.width-w)/2); }
	else if (pos=="TR") { pX=parseInt(screen.width-w-Hoffset); }
	else if (pos=="L") { pY=parseInt((screen.height-h)/2); }
	else if (pos=="C") {
		pX=parseInt((screen.width-w)/2);
		pY=parseInt((screen.height-h)/2);
	} else if (pos=="R") {
		pX=parseInt(screen.width-w-Hoffset);
		pY=parseInt((screen.height-h)/2);
	} else if (pos=="BL") {
		pY=parseInt(screen.height-h-Voffset);
	} else if (pos=="B") {
		pX=parseInt((screen.width-w)/2);
		pY=parseInt(screen.height-h-Voffset);
	} else if (pos=="BR") {
		pX=parseInt(screen.width-w-Hoffset);
		pY=parseInt(screen.height-h-Voffset);
	}
	pY=pY-40;
	if (pY<0) {pY=0;}
}
function PW(w,h,page,params,pos) {
	var u="";
	u=page+'?'+params;
	if (name==undefined){name="POPUP";}
	WP(w,h,pos);
	if (document.layers) {var o='resizable=no,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=no,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,width='+w+',height='+h+',left='+pX+',top='+pY;}
	PopWin=window.open(u,name,o);
	PopWin.focus();
}
function PW2(w,h,page,params,pos,name) {
	var u="";
	u=page+'?'+params;
	if (name==undefined){name="POPUP2";}
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=0,location=0,status=1,menubar=0,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=0,location=0,status=1,menubar=0,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	PopWin=window.open(u,name,o);
	PopWin.focus();
}
