var Netscape = new Boolean();

var PosX = new Number();
var PosY = new Number();
var f;

var Titel;


function MouseRaus(Ereignis)
{
  window.defaultStatus=Titel;
}

function MouseKoord(Ereignis)
{
  if (Netscape==true)
  {
    PosX=Ereignis.screenX;
    PosY=Ereignis.screenY;
  }
  else
  {
    PosX=event.x;
    PosY=event.y;
  }
 //  window.defaultStatus="X:"+PosX+" Y:"+PosY;
}

function HilfeFenster(adresse,width,height)
{
  if (f)
  {
    if (!f.closed)
    {
      f.close();
    }
  }
/*
  if (navigator.appName == "Netscape")
  {
    document.releaseEvents();
  }
*/
  f = open(adresse,"Hilfe","resizable==yes,scrollbars=yes,width=1,height=1,screenX=-1000,screenY=-1000,innerWidth="+width+",innerHeight="+(height-60));

  f.resizeTo(width,height+60);
  if ((PosX+width) > screen.width)
  {
    PosX=screen.width-width;
  }
  if ((PosY+height+60) > screen.height)
  {
    PosY=screen.height-height-60;
  }
  f.moveTo(PosX,PosY-40);
  f.focus();

}

function Initialisierung(titel)
{
  if (navigator.appName == "Netscape")
  {
    Netscape = true;
  }

  if (Netscape==true)
  {
    document.captureEvents(Event.MOUSEMOVE);
//    document.captureEvents(Event.MOUSEOUT);
  }
  document.onmousemove = MouseKoord;
  Titel=titel;
  document.onmouseout = MouseRaus;
}

function popup(url,width,height)
{
  if (f)
  {
    if (f.closed == undefined)
    {
      f.close();
    }
  }
  f = open(url,"popper","resizable==yes,scrollbars=yes,width="+width+",height="+height+",screenX=-1000,screenY=-1000,innerWidth="+width+",innerHeight="+(height-60));

  f.focus();

}
function popup2(url,width,height,scrollbared,resized)
{
  if (f)
  {
    if (f.closed == undefined)
    {
      f.close();
    }
  }
  f = open(url,"popper","resizable=="+resized+",scrollbars="+scrollbared+",width="+width+",height="+height+",screenX=-1000,screenY=-1000,innerWidth="+width+",innerHeight="+(height-60));

  f.focus();

}

function fokus(feld)
{
  if (feld)
    feld.focus();
}


function NoExit()
{
  if (top.noexit)
    top.noexit(true);
}

function checkEmail(email) {
  var proto  = "(mailto:)?";
  var usr    = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
  var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";
  var regex  = "^" + proto + "?" + usr + "\@" + domain + "$";

  var rgx    = new RegExp(regex);
  return rgx.exec(email) ? true : false;
}

