/*
 help.js
 (c) 1996-2004 KasCada Telekommunikation

*/

function OverE (kurz,imgover)
{
  this.IsOver = false;
  this.Kurz = kurz;
  this.SetFrame     = oeSetFrame;
  this.SetOverBg    = oeSetOverBg;
  this.SetKurzImage = oeSetKurzImage;
  this.SetParams    = oeSetParams;
  this.SetBlock     = oeSetBlock;
  this.SetWidth     = oeSetWidth;

  this.Width = 300;  // default ist 200

  if (imgover)
  {
    this.ImgOver = new Image;
    this.ImgOver.src = imgover;
  }
}


function oeSetFrame (frameNr,frameImg)
{
  this.FrameNr = frameNr;
  this.FrameImg = new Image;
  this.FrameImg.src = frameImg;
}

function oeSetOverBg (src)
{
  this.OverBg = new Image;
  this.OverBg.src = src;
}

function oeSetKurzImage (src)
{
  this.KurzImage = new Image;
  this.KurzImage.src = src;
}

function oeSetParams (param1,param2,param3,param4)
{
  this.Param1 = param1;
  if (param2)  this.Param2 = param2;
  if (param3)  this.Param3 = param3;
  if (param4)  this.Param4 = param4;
}

function oeSetBlock (blockID)
{
  this.BlockID = blockID;
}

function oeSetWidth (width)
{
  this.Width = width;
}

function AOver_oe (oe)
{
  if (oe.KurzImage)
  {
    overlib(oe.Kurz,AUTOSTATUS,BACKGROUND,
	    oe.KurzImage.src,WIDTH,oe.KurzImage.width,HEIGHT,oe.KurzImage.height);
  }
  else if (oe.Kurz)
    overlib(oe.Kurz,WIDTH,oe.Width,AUTOSTATUS);

  if (oe.FrameImg)
  {
    if (oe.FrameNr<0)
      oe.ImgI = document.images['OverImg'];
    else if (parent.frames[oe.FrameNr])
    {
      oe.ImgI = parent.frames[oe.FrameNr].document.images['OverImg'];
    }

    if (oe.ImgI)
    {
      oe.ImgI.src    = oe.FrameImg.src;
      oe.ImgI.width  = oe.FrameImg.width;
      oe.ImgI.height = oe.FrameImg.height;
      oe.ImgI.style.visibility="visible";
    }
  }

  if (oe.OverBg)
  {
    if (!oe.OverBgNormal) 
    {
      oe.OverBgNormal = new Image;
      oe.OverBgNormal.src = document.body.background;
    }

    document.body.background = oe.OverBg.src;
  }

  return false;
}

function AOut_oe (oe)
{
  if (oe.Kurz || oe.KurzImage)
    nd();

  if (oe.ImgI)
    oe.ImgI.style.visibility="hidden";

  if (oe.OverBgNormal)
    document.body.background = oe.OverBgNormal.src;

  return true;
}

function AOverImg (img)
{
  var oe = OverA[img.name];

  if (!oe || oe.IsOver)
    return false;

  oe.IsOver = true;

  if (oe.ImgOver)
  {
    if (!oe.ImgNormal) 
    {
      oe.ImgNormal = new Image;
      oe.ImgNormal.src    = img.src;
    }

    img.src = oe.ImgOver.src;
    if (oe.ImgOver.width)  img.width  = oe.ImgOver.width;
    if (oe.ImgOver.height) img.height = oe.ImgOver.height;

  }

  return AOver_oe(oe);
}


function AOutImg (img)
{
  var oe = OverA[img.name];
  if (!oe || !oe.IsOver)
    return false;

  oe.IsOver = false;

  if (oe.ImgNormal)
  {
    img.src = oe.ImgNormal.src;
    if (oe.ImgNormal.width)   img.width  = oe.ImgNormal.width;
    if (oe.ImgNormal.height)  img.height = oe.ImgNormal.height;
  }

  return AOut_oe(oe);
}


function AOverText (name)
{
  var oe = OverA[name];

  if (!oe || oe.IsOver)
    return false;

  oe.IsOver = true;

  return AOver_oe(oe);
}

function AOutText (name)
{
  var oe = OverA[name];
  if (!oe || !oe.IsOver)
    return false;

  oe.IsOver = false;

  return AOut_oe(oe);
}

function AOpenWindow (name)
{
  var oe = OverA[name];
  if (!oe)  return false;

  MyWindow=window.open(oe.Param1,oe.Param2,
                       "toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=500,left=50,dependent=yes");
  MyWindow.focus();
  return false;
}

function AKlickAuswahl (name)
{
  var oe = OverA[name];
  if (!oe)  return false;

  overlib(oe.Param2,STICKY, CAPTION,oe.Param1, CLOSECLICK,CLOSETEXT,'schließen');
  return false;
}


function Block_CloseAll ()
{
  if (!document.getElementById) return;
  for (var name in OverA)  
  {
    /* momentan werden alle mit Param1 geprueft ! */
    if (OverA[name].Param1)
    {
      elem = document.getElementById(OverA[name].Param1);
      if (elem)  elem.style.display = "none";
    }
  }
}

function Block_OpenAll ()
{
  if (!document.getElementById) return;
  for (var name in OverA)  
  {
    /* momentan werden alle mit Param1 geprueft ! */
    if (OverA[name].Param1)
    {
      elem = document.getElementById(OverA[name].Param1);
      if (elem)  elem.style.display = "block";
    }
  }
}

function Block (selem,name)
{
  var oe = OverA[name];
  if (!oe)  return false;

  if (!document.getElementById) return;
  elem = document.getElementById(oe.Param1);
  if (!elem)  return;

  fc = selem.firstChild;

  if (elem.style.display == "none")
  {
    if (fc)  fc.nodeValue = "-"+fc.nodeValue.substr(1,100);
    elem.style.display = "block";
  }
  else
  {
    if (fc)  fc.nodeValue = "+"+fc.nodeValue.substr(1,100);
    elem.style.display = "none";
  }
}

function FindForm (elem)
{
  while (elem)
  {
    /* alert(elem.nodeName); */ 
    if (elem.nodeName == 'FORM')
      return elem;
    elem = elem.parentNode;
  }
  return null;
}


/*
 AskSubmit 
  wenn die Frage positiv beantwortet wird:
   data wird in das input-Feld data geschrieben und das Formular abgeschickt.
*/
function AskSubmitPrompt (elem,name)
{
  elem = FindForm(elem);
  if (!elem)  return;

  var oe = OverA[name];
  if (!oe)  return false;

  wert = prompt(oe.Param1,oe.Param2);  /* frage,value */
  if (wert == null)
    return false;

  elem.data.value = oe.Param3+wert;    /* dataStart */
  elem.submit();
  return false;
}


/*
 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
*/

function OverText (info,bubble)
{
  if (bubble)  return overlib(info,AUTOSTATUS,BUBBLE,BUBBLETYPE,'quotation');
  else         return overlib(info,AUTOSTATUS);
} 

function OverTextI (infoNr)
{
  return overlib(INARRAY,infoNr,AUTOSTATUS);
} 


function OutText ()
{
  return nd();
}

function OverBild (name,width,height)
{
  if (Bilder2 && Bilder2[name])
    return overlib('',AUTOSTATUS,BACKGROUND,
                   Bilder2[name].src,WIDTH,width,HEIGHT,height);
}

function OutBild ()
{
  return nd();
}


function BGStyleT (elem)
{
  if (typeof(elem.style)!='undefined') 
    elem.style.backgroundColor='#CCFFCC';
}

function BGStyle0 (elem)
{
  if (typeof(elem.style)!='undefined') 
    elem.style.backgroundColor='';
}

/* Login */

function LoginStart ()
{
  if (top!=self)
    document.getElementsByTagName('body')[0].style.backgroundPosition='-175px 0px';

  form = document.login;
  if (form)
  {
    if      (!form.user.value)   form.user.focus();
    else if (!form.input.value)  form.input.focus();
    else                         form.submit.focus();
  }
}

/* allgemeines */


