/**
* Autor: Thilo Beckmann
* Funktionen, die Formulare betreffen.
*/


/**
* fügt allen "textarea"- und "input"-Elementen einen focuslistener hinzu, 
* der die Hintergrundfarbe des Feldes highlightet, wenn es markiert ist.
*/
function onFocusHandlerHinzufuegen(){
  var inputs = document.getElementsByTagName('input'); //holt alle input-elemente
  for (var i=0; i<inputs.length; i++){
    if (inputs[i].type != "button" && inputs[i].type != "submit" && inputs[i].id != 'sucheingabe' && inputs[i].id != 'suchsubmit'){
      inputs[i].onfocus = changeBackground;
      inputs[i].onblur  = resetBackground;
      inputs[i].style.border = '1px solid #ffcc00';
    }
  }
  var textarea = document.getElementsByTagName('textarea'); //holt alle textarea-elemente
  for (var i=0; i<textarea.length; i++){
    textarea[i].onfocus = changeBackground;
    textarea[i].onblur  = resetBackground;
    textarea[i].style.border = '1px solid #ffcc00';
  }
}

function changeBackground(){
  this.style.backgroundColor = '#FEF9AE'; //helles cremefarbenes Gelb
}
function resetBackground(){
  this.style.backgroundColor = '#FFFFFF'; //Weiß
}