//all variables required except for offx and offy IF CENTER is set to yes!!
// example follows
//onLoad="javascript:ultimatePU('xxx.html','XXX','no','300','400','no','no','no','no','no','no','no','100','200');"
var newwin;
function ultimatePU(winurl,winname,xPos,yPos,width,height,dir,loc,menu,scrollb,stat,tool,resize)
{
var xMax = screen.width, yMax = screen.height;
var features =
        'width='        + width +
        ',height='      + height +
        ',directories=' + dir +
        ',location='    + loc +
        ',menubar='     + menu +
        ',scrollbars='  + scrollb +
        ',status='      + stat +
        ',toolbar='     + tool +
        ',resizable='   + resize +'';
		
if (xPos=='center') {
		var xOffset = (xMax - width)/2;
		features = features +',screenX='+xOffset+',left='+xOffset+'';
		} else {
		features = features +',screenX='+xPos+',left='+xPos+'';
		}
if (yPos=='center') {
		var yOffset = (yMax - height)/2;
		features = features +',screenY='+yOffset+',top='+yOffset+'';
		} else {
		features = features +',screenY='+yPos+',top='+yPos+'';
		}
newwin = window.open(winurl,winname,features);
setTimeout('newwin.focus();',250);	
}