function WindowOpen(url,width,height,scroll,resize)
{
  var params="";
  var l,t;
  params+="toolbar=no,location=no,status=no,menubar=no,";
  if (resize==null || typeof(resize)=="undefined" || !resize)
    params+="resizable=no";
  else
    params+="resizable=yes";
  if (scroll==null || typeof(scroll)=="undefined" || !scroll)
    params+=",scrollbars=no";
  else
    params+=",scrollbars=yes";
    
  if (width!=null && typeof(width)!="undefined")
    { l=(window.screen.availWidth-width)/2; }
  else
    { l=0; width=window.screen.availWidth; }
  if (height!=null && typeof(height)!="undefined")
    { t=(window.screen.availHeight-height)/2; }
  else
    { t=0; height=window.screen.availHeight; }
  params+=",left="+l+",top="+t+",width="+width+",height="+height;
  
  var w=window.open(url,null,params);
  w.resizeTo(width,height);
  w.moveTo(l,t);
  
  return w;
}

function WindowOpenBlank(name,width,height,scroll,resize)
{
  var params="";
  var l,t;
  params+="toolbar=no,location=no,status=no,menubar=no,";
  if (resize==null || typeof(resize)=="undefined" || !resize)
    params+="resizable=no";
  else
    params+="resizable=yes";
  if (scroll==null || typeof(scroll)=="undefined" || !scroll)
    params+=",scrollbars=no";
  else
    params+=",scrollbars=yes";
    
  if (width!=null && typeof(width)!="undefined")
    { l=(window.screen.availWidth-width)/2; }
  else
    { l=0; width=window.screen.availWidth; }
  if (height!=null && typeof(height)!="undefined")
    { t=(window.screen.availHeight-height)/2; }
  else
    { t=0; height=window.screen.availHeight; }
  params+=",left="+l+",top="+t+",width="+width+",height="+height;

  var w=window.open("",name,params);
  w.resizeTo(width,height);
  w.moveTo(l,t);
  
  return w;
}

function WindowClose()
{
  window.top.close();
}
