function WindowClose()
{
  window.close();
}


function WindowSafeClose()
{
  try
   {
     WindowClose();
   } catch(e)
   {
   }
}


function WindowMoveToMouse(aWindow,w,h)
{
  if (aWindow)
  {
    var X = dhtmlMouseScreenX();
    var Y = dhtmlMouseScreenY();
    if (!w)
    {
      w = 300;
      //w = aWindow.document.body.offsetWidth+8;
    }    
    if (!h)
    {
      h = 300;
      //h = aWindow.document.body.offsetHeight+27;
    }    
    if ((X+parseInt())>window.screen.width)
    {
      X=window.screen.width-(w+20);
    }
    if ((Y+h)>window.screen.height)
    {
      Y=window.screen.height-(h+70);
    }
    aWindow.moveTo(X,Y);
  }
}


function WindowSize(aWindow,width,height)
{
   try
    {
      window.resizeTo(width,height);
    } catch(e)
    {
    }    
} 


function WindowOpenUrl(windowname,url,w,h,resize,status,menubar,toolbar)
{
  if (!resize) resize='1';
  if (!status) status='1';
  if (!menubar) menubar='0';
  if (!toolbar) toolbar='0';
  aWindow = window.open(url , windowname, "fullscreen=0,toolbar="+toolbar+",location=0,directories=0,status="+status+",menubar="+menubar+",scrollbars=1,resizable="+resize+",titlebar=1,width="+w+",height="+h);
  return aWindow;
}


function WindowOpenUrlHere(windowname,windowtitle,url,w,h,resize,status,menubar,toolbar)
{
  if (!resize) resize='1';
  if (!status) status='1';
  if (!menubar) menubar='0';
  if (!toolbar) toolbar='0';  
  aWindow = WindowOpenUrl(windowname,windowtitle,url,w,h,resize,status,menubar,toolbar);
  //WindowMoveToMouse(aWindow,w,h);
  return aWindow;
}


function WindowOpen(url)
{
 window.open(url);
}


function ShowWindowSize()
{
  alert("Fenster: " + (document.body.offsetWidth+8)  + " x " + (document.body.offsetHeight+27));
} 
