/* DHTML-Bibliothek */

  /* globale Variablen */
  var DHTML = 0;
  var DOM = 0;
  var MS = 0;
  var NS = 0;
  var OP = 0;

  /* Initialisierung */
  function DHTML_init()
  {
    if (window.opera)
    {
      OP = 1;
    }
    if (document.getElementById)
    {
      DHTML = 1;
      DOM = 1;
    }
    if (document.all && !OP)
    {
      DHTML = 1;
      MS = 1;
    }
    if (document.layers && !OP)
    {
      DHTML = 1;
      NS = 1;
    }
  }

  function getElement(p1, p2, p3)
  {
    var Element;
    if (DOM)
    {
      if (p1.toLowerCase() == "id")
      {
        if (typeof document.getElementById(p2) == "object")
        {
          Element = document.getElementById(p2);
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else if (p1.toLowerCase() == "name")
      {
        if (typeof document.getElementsByName(p2) == "object")
        {
          Element = document.getElementsByName(p2)[p3];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else if (p1.toLowerCase() == "tagname")
      {
        if (typeof document.getElementsByTagName(p2) == "object" || (OP && typeof document.getElementsByTagName(p2) == "function"))
        {
          Element = document.getElementsByTagName(p2)[p3];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else
      {
        return void(0);
      }
    }
    else if (MS)
    {
      if (p1.toLowerCase() == "id")
      {
        if (typeof document.all[p2] == "object")
        {
          Element = document.all[p2];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else if (p1.toLowerCase() == "name")
      {
        if (typeof document[p2] == "object")
        {
          Element = document[p2];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else if (p1.toLowerCase() == "tagname")
      {
        if (typeof document.all.tags(p2) == "object")
        {
          Element = document.all.tags(p2)[p3];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else
      {
        return void(0);
      }
    }
    else if (NS)
    {
      if (p1.toLowerCase() == "id" || p1.toLowerCase() == "name")
      {
        if (typeof document[p2] == "object")
        {
          Element = document[p2];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else if (p1.toLowerCase() == "index")
      {
        if (typeof document.layers[p2] == "object")
        {
          Element = document.layers[p2];
        }
        else
        {
          Element = void(0);
        }
        return (Element);
      }
      else
      {
        return void(0);
      }
    }
  }

  function getCont(p1,p2,p3) {
     var Cont;
     if(DOM && getElement(p1,p2,p3) && getElement(p1,p2,p3).firstChild) {
       if(getElement(p1,p2,p3).firstChild.nodeType == 3)
         Cont = getElement(p1,p2,p3).firstChild.nodeValue;
       else
         Cont = "";
       return(Cont);
     }
     else if(MS && getElement(p1,p2,p3)) {
       Cont = getElement(p1,p2,p3).innerText;
       return(Cont);
     }
     else return void(0);
  }

  function getAttr(p1,p2,p3,p4) {
     var Attr;
     if((DOM || MS) && getElement(p1,p2,p3)) {
       Attr = getElement(p1,p2,p3).getAttribute(p4);
       return(Attr);
     }
     else if (NS && getElement(p1,p2)) {
         if (typeof getElement(p1,p2)[p3] == "object")
          Attr=getElement(p1,p2)[p3][p4]
         else
          Attr=getElement(p1,p2)[p4]
           return Attr;
         }
     else return void(0);
  }

  function setContent(element, content)
  {
    if(DOM && element && element.firstChild)
    {
      element.innerHTML = content;
    }
    else if(MS && element)
    {
      element.innerHTML = content;
    }
    else if(NS && element)
    {
      element.document.open();
      element.document.write(content);
      element.document.close();
    }
  }

DHTML_init();
