function popUpWindow(URLStr, width, height, perc)
{
var top;
var left;

  if (width ==0)
    width = 100;
  if (height ==0)
    height = 100;
	
  if (perc==1) 
    {
	width = screen.availWidth * width / 100;
	height = screen.availHeight * height / 100;
    }
 
  left = (screen.availWidth - width);
  top = (screen.availHeight - height);
 
  if (left<=0) 
    left = 1;
  if (top<=0) 
    top = 1;

  left = left / 2;
  top = top / 2;
  
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  popUpWin.focus();
}
