  function getElement(elem) {
    var theElement = document.getElementById(elem);
    return theElement;
  }

  function toggleArea(element, object) {
    var theElement = getElement(element);
    var theObject = getElement(object);
    if (theElement.style.display=='none') {
      theElement.style.display='block'
      if (object) theObject.style.backgroundImage = "url(/grafik/arrow_meta_nav_green_down.gif)";
    }
    else if (theElement.style.display=='block') {
      theElement.style.display='none'
      if (object) theObject.style.backgroundImage = "url(/grafik/arrow_meta_nav_green.gif)";
    }
  }

  function searchToggleBG(object){
    if (object.style.backgroundColor=='' || object.style.backgroundColor=='rgb(255, 255, 255)' || object.style.backgroundColor=='#FFFFFF' || object.style.backgroundColor=='#ffffff') {
      //object.style.backgroundColor = 'rgb(246, 245, 240)';
      object.style.backgroundColor = '#F6F5F0';
      pointer(object);
    }
    else {
      //object.style.backgroundColor = 'rgb(255, 255, 255)';
      object.style.backgroundColor = '#FFFFFF';
    }
  }

  function toggleBorder(objectID){
    var object = getElement(objectID);
    if (object.style.border=='' || object.style.border=='none') {
      object.style.border = '2px solid #00ABEF';
      pointer(object);
    }
    else {
      object.style.border = '';
    }
  }

  function pointer(object) {
    object.style.cursor ='pointer';
  }

  function showImg(src,element){
    var theElement = getElement(element+"_img");
    var theMediaElement = getElement(element+"_media");
    if (src == '') {
      theMediaElement.style.display = "none";    
    }
    else {
      theElement.src = src;
      theMediaElement.style.display = "block";
    }
  }

  function label(element,labelText){
    var theElement = getElement(element);
    if (theElement.value == labelText){
      theElement.value = '';
    }
    else if (theElement.value == ''){
      theElement.value = labelText;
    }
  }

  var popupWindow;
  function openPopUp(windowWidth,windowHeight,URL,windowName){
    if (popupWindow && !popupWindow.closed){
      popupWindow.close()
      popupWindow = open(''+URL+'',''+windowName+'','width='+windowWidth+',height='+windowHeight+',scrollbars=1,resizable=1,status=1,top=100,left=100');
    }
    else{
      popupWindow = open(''+URL+'',''+windowName+'','width='+windowWidth+',height='+windowHeight+',scrollbars=1,resizable=1,status=1,top=100,left=100');
    }
  }

  /* get computed styles */
  function getStyle(oElm, strCssRule){
    var strValue = "";
    oElm = getElement(oElm);
    if(document.defaultView && document.defaultView.getComputedStyle){
      strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
    }
    else if(oElm.currentStyle){
      try{
        strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
          return p1.toUpperCase();
        });
        strValue = oElm.currentStyle[strCssRule];
      }
      catch(e){
        // Used to prevent an error in IE 5.0
      }
    }
    return strValue;
  }
  
  function preLoad() {
    for (i=0; i < homeImages.length; i++) {
      var homeImg = new Image();
      homeImg.src = homeImages[i];
    }
  }

  var t = 10;
  var opac = 1;
  function opacity(){
    if (opac > 0){
      document.getElementById("headerback1").style.MozOpacity = opac;
      document.getElementById("headerback1").style.filter="Alpha(opacity="+opac*100+", finishopacity=0, style=0)";
      if ((Math.round(opac*1000)/1000) == 0.5){
        if (homeCaption[nextIndex]!='') {
          document.getElementById("caption").innerHTML = homeCaption[nextIndex];
          document.getElementById("caption").style.paddingLeft='10px';
          document.getElementById("caption").style.paddingRight='10px';
        }
        else {
          document.getElementById("caption").style.padding=0;      
          document.getElementById("caption").innerHTML = '';
        }
      }
      opac = opac - 0.025;
      window.setTimeout("opacity()", t);
      t = 50
    }
    else {
      index = nextIndex;
      nextIndex = (nextIndex + 1) % homeImages.length
      document.getElementById("headerback1").style.backgroundImage = "url("+homeImages[index]+")"
      document.getElementById("headerback1").style.MozOpacity = 1;
      document.getElementById("headerback2").style.backgroundImage = "url("+homeImages[nextIndex]+")"
      opac = 1;
      t = 3000
      opacity()
    }
  }

  // 
  var index = (Math.round(Math.random()*10))%7;
  var nextIndex = (index+1)%7;
  function homeLoad(){
    document.getElementById("headerback1").style.backgroundImage = "url("+homeImages[index]+")";
    document.getElementById("headerback2").style.backgroundImage = "url("+homeImages[nextIndex]+")";
    if (homeCaption[index]!='') {
      document.getElementById("caption").innerHTML = homeCaption[index];
      document.getElementById("caption").style.paddingLeft='10px';
      document.getElementById("caption").style.paddingRight='10px';
    }
    else {
      document.getElementById("caption").style.padding=0;
      document.getElementById("caption").innerHTML = '';
    }
    window.setTimeout("opacity()", 1000);
  }

  // fixes IE 6 Button-Tag malfunction
  function buttonfix(){
    var buttons = document.getElementsByTagName('button');
    for (var i=0; i<buttons.length; i++) {
      buttons[i].onclick = function () {
        for(j=0; j<this.form.elements.length; j++){
          if( this.form.elements[j].tagName == 'BUTTON' ){
            this.form.elements[j].disabled = true;
          }
        }
        this.disabled=false;
      }
    }
  }

  function display(element,display) {
    var theElement = getElement(element);
    theElement.style.display=display;
  }
  
/*
  Site: www.whooka.com
  Scripttype: JavaScript
  Desc: build DOM based tooltip class and methods
  init: 08.08.2007, Jan Rickes, Stefan Burbulla
*/

function initTT(id) {
  if (document.getElementById(id)){
    var toolTippInit = new ToolTipp(id);
    var element = document.getElementById(id);
    if (element.addEventListener){
      element.addEventListener("mouseover", toolTippInit.showtooltipp, true);
      element.addEventListener("mouseout", toolTippInit.hidetooltipp, true);
      element.addEventListener("mousemove", toolTippInit.updToolTipp, true);
    }
    else if (element.attachEvent){
      element.attachEvent("onmouseover", toolTippInit.showtooltipp);
      element.attachEvent("onmouseout", toolTippInit.hidetooltipp);
      element.attachEvent("onmousemove", toolTippInit.updToolTipp);
    }
  }
}

function ToolTipp(elemID){
  this.init(elemID);
  this.element = document.getElementById(this.elemID);
}

ToolTipp.prototype.init = function (elemID){
  this.elemID = elemID;
  this.toolTippID = document.getElementById(elemID);
  this.toolTippID.style.cursor = 'pointer';
  this.name = elemID+'Div';
  this.domElem = document.getElementById(this.name);
  this.domElem.style.zIndex = 20;
  this.domElem.style.width = 180+'px';
}

ToolTipp.prototype.updToolTipp = function (event) {
  var yOffset = -180;
  var xOffset = -200;
  if (document.all){
    var toolTipp = document.getElementById(window.event.srcElement.id+'Div');
  }
  else{
    var toolTipp = document.getElementById(event.target.id+'Div');
  }
  if (document.all) {
    x = window.event.clientX;
    y = window.event.clientY;
  }
  else{
    x = event.pageX;
    y = event.pageY;
  }
  if (toolTipp != null) {
    toolTipp.style.top   = (y + yOffset) + "px";
    toolTipp.style.left = (x + xOffset) + "px";
  }
}

ToolTipp.prototype.showtooltipp = function (event){
  if (document.all){
    element = document.getElementById(window.event.srcElement.id+'Div');
  }
  else{
   element = document.getElementById(event.target.id+'Div');
  }
  element.style.display = "block";
}

ToolTipp.prototype.hidetooltipp  = function (event){
  if (document.all){
    element = document.getElementById(window.event.srcElement.id+'Div');
  }
  else{
    element = document.getElementById(event.target.id+'Div');
  }
  element.style.display = "none";
}