myWin = null;

function openWin(x,y,url)
{
  var width      = x;
  var height     = y;
  var page       = url.toString();
  var options    = "resizable=0,width="+width.toString();
      options   += ",height="+height.toString();
  var leftborder = Math.ceil((screen.availWidth-width)/2);
  var topborder  = Math.ceil((screen.availHeight-height)/2);
      options   += ",left="+leftborder.toString();
      options   += ",top="+topborder.toString();
      options   += ",scrollbars=1";

  myWin = window.open(page,"myWin",options)
  myWin.focus();
}


function closeWin()
{
  if (myWin != null)
    if (!myWin.closed)
      myWin.close();
}
