//                       width height left  down
function popUp(URL, name, winW, winH, winX, winY) 
{
  // pop-up window
  var newWindow, name, features;
  features = "status=0,toolbar=0,scrollbars=1,location=0,menubar=0,resizable=1";
  features = features + ",width=" + winW + ",height=" + winH;
  //features = features + ",screenX=" + winY + ",screenY=" + winX;
  features = features + ",left=" + winX + ",top=" + winY;

  newWindow = window.open (URL,null,features);
  newWindow.focus();
  return false;
}

//                              width height offset left offset down
function popUpRelative(URL, name, winW, winH, winXOffset, winYOffset) 
{
  // popup window relative to calling window
  var newWindow, name, features;
  var winX, winY;

  // calling window position
  var winLeft = (document.all)?window.screenLeft:window.screenX;
  // IE and Safari show top of html area,  other browsers show top of entire panel
  var winTop = (document.all)?window.screenTop:window.screenY;
  
  var brow=detectBrowser(); 
  var addYOffset = 0;
  switch (brow.toLowerCase())
  {
    case 'microsoft internet explorer':
      // IE - reduce top offset
      addYOffset = -200;
      break;
    case 'opera':
      // Opera - reduce top offset
      //addYOffset = -250;
      break;
    //default:
      //break;
  }

  winX = winLeft + winXOffset;
  winY = winTop + winYOffset + addYOffset;
    
  features = "status=0,toolbar=0,scrollbars=0,location=0,menubar=0,resizable=0";
  features = features + ",width=" + winW + ",height=" + winH;
  features = features + ",screenX=" + winX + ",screenY=" + winY;
  features = features + ",left=" + winX + ",top=" + winY;

  newWindow = window.open (URL,null,features);
  newWindow.focus();
  return false;
}

