function changebutton(e){
  var target = getTarget(e);
  if(!target.style.backgroundImage){target.style.backgroundImage = "url(http://" + document.domain + "/images/" + target.className + "a.gif)";}
  switch(target.style.backgroundImage){
    case "url(http://" + document.domain + "/images/button1a.gif)":
    case "url(\"http://" + document.domain + "/images/button1a.gif\")":
      target.style.backgroundImage = "url(http://" + document.domain + "/images/button1b.gif)";
      break;
    case "url(http://" + document.domain + "/images/button1b.gif)":
    case "url(\"http://" + document.domain + "/images/button1b.gif\")":
      target.style.backgroundImage = "url(http://" + document.domain + "/images/button1a.gif)";
      break;
    case "url(http://" + document.domain + "/images/button2a.gif)":
    case "url(\"http://" + document.domain + "/images/button2a.gif\")":
      target.style.backgroundImage = "url(http://" + document.domain + "/images/button2b.gif)";
      break;
    case "url(http://" + document.domain + "/images/button2b.gif)":
    case "url(\"http://" + document.domain + "/images/button2b.gif\")":
      target.style.backgroundImage = "url(http://" + document.domain + "/images/button2a.gif)";
      break;
    default:
      alert(document.domain + ": Fehler in navigation.js! " + target.style.backgroundImage);
      break;
  }
}

function links(e){
  // ID des Elements ermitteln
  var id = getTarget(e).id.substr(1,2);;
  // Menue anpassen
  if(activesub && activesub.id.substr(1,1) != id.substr(0,1)){
    activesub.style.display="none";
    try{
      document.getElementById("b" + id.substr(0,1) + "sub").style.display="block";
      activesub = document.getElementById("b" + id.substr(0,1) + "sub");
    }catch(e){
      activesub=false;
    }
  }else if(!activesub){
    try{
      document.getElementById("b" + id.substr(0,1) + "sub").style.display="block";
      activesub = document.getElementById("b" + id.substr(0,1) + "sub");
    }catch(e){}
  }
  // Inhalt laden und ausgeben
  var target = document.getElementById("b" + id);
  if(debug > 1){
    var text = "";
    for(i=0; i < target.attributes.length; i++){
      text += i + ": " + target.attributes[i].nodeName + "\n";
    }
    alert("target.attributes:\n\n" + text);
  }
  if(target.attributes.getNamedItem("link_init").value == ""){
    var init=true;
  }else{
    var init=target.attributes.getNamedItem("link_init").value;
  }
  request(target.attributes.getNamedItem("link").value, "debug=" + debug + "&attribute=" + target.attributes.getNamedItem("link_attribute").value, init, cont);
}
