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);
	}
}
function PW(w,h,page,params,pos) {
	var u="";
	u=page+'?'+params;
	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;}
	if ((PopWin==null) || PopWin.closed) { PopWin=window.open(u,'POPUP',o); }
	else {PopWin.location=u; PopWin.focus();}
}
function PW2(w,h,page,params,pos,pY) {
	screenheight = screen.height - 80;
	if (w > screen.width) w = screen.width - 50;
	if (h > screenheight) h = screenheight - 50;
	var u="";
	u=page+'?'+params;
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	if ((PopWin==null) || PopWin.closed) { PopWin=window.open(u,'POPUP2',o); }
	else { PopWin.location=u;}
	 PopWin.focus();
	return false;
}
function PW3(w,h,page,params,pos) 
{
	w = w + 50;
	h = h + 160;
	screenheight = screen.height - 80;
	if (w > screen.width) w = screen.width - 50;
	if (h > screenheight) h = screenheight - 50;
	var u="";
	var PopWin3=null;
	u=page+'?'+params;
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	if ((PopWin3==null) || PopWin3.closed) { PopWin3=window.open(u,'POPUP3',o); }
	else {PopWin3.location=u;}
	PopWin3.focus();
}

function PW4(w,h,page,params,pos) {
	var u="";
	var PopWin4 = null;
	u=page+'?'+params;
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=1,location=0,status=1,menubar=1,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=1,location=0,status=1,menubar=1,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	if ((PopWin4==null) || PopWin4.closed) { PopWin4=window.open(u,'POPUP4',o); }
	else {PopWin4.location=u; PopWin4.focus();}
}

function PW5(w,h,page,params,pos) {
	screenheight = screen.height - 80;
	if (w > screen.width) w = screen.width - 50;
	if (h > screenheight) h = screenheight - 50;
	var printer_window = null;
	var u="";
	u=page+'?'+params;
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	if ((printer_window==null) || printer_window.closed) { printer_window=window.open(u,'printer_window',o); }
	else { printer_window.location=u; printer_window.focus();}
	return false;
}

function PW6(w,h,page,params,pos) {
	screenheight = screen.height - 80;
	if (w > screen.width) w = screen.width - 50;
	if (h > screenheight) h = screenheight - 50;
	var PopWin6=null;
	var u="";
	u=page+'?'+params;
	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;}
	if ((PopWin6==null) || PopWin6.closed) { PopWin6=window.open(u,'POPUP6',o); }
	else { PopWin6.location=u; PopWin6.focus();}
	return false;
}
function PW7(w,h,page,params,pos,pY) {
	//screenheight = screen.height - 80;
	//if (w > screen.width) w = screen.width - 50;
	//if (h > screenheight) h = screenheight - 50;
	var u="";
	u=page+'?'+params;
	WP(w,h,pos);
	if (document.layers) {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',screenX='+pX+',screenY='+pY;}				
	else {var o='resizable=yes,toolbar=0,location=0,status=0,menubar=0,scrollbars=1,width='+w+',height='+h+',left='+pX+',top='+pY;}
	if ((PopWin==null) || PopWin.closed) { PopWin=window.open(u,'POPUP7',o); }
	else { PopWin.location=u;}
	 PopWin.focus();
	return false;
}

