// ******************************************************* //
//       Konfiguration: Hier Anpassungen vornehmen         //
// ******************************************************* //

// Anzahl der Hauptmmenues
var numberMainmenu = 8;  

// Anzahl der Standardmenues
var numberStandardmenu = 5;


// ******************************************************* //
//          Ab hier keine Aenderungen vornehmen            //
// ******************************************************* //

// Zuweisung der richtigen Klasse des Hauptmenues

function mainmenu_act(mmIndex) {
  for (var i=1; i <= numberMainmenu; ++i) {  
    if (i == mmIndex) {
      if(document.getElementById) {
        document.getElementById('mm'+i).style.color = "#6B64CC"; 
      } else if(document.all && !document.getElementById) {
        document.all['mm'+i].style.color="#000";
      }
    }  else {
      if (document.getElementById) {
        document.getElementById('mm'+i).style.color = "#000";
      } else if(document.all && !document.getElementById) {
        document.all['mm'+i].style.color = "#000";
      }  
    }
    
  }
  for (var i=1; i <= numberStandardmenu; ++i) {  
    if (document.getElementById) {
      document.getElementById('strdm'+i).style.color = "#000";
    } else if(document.all && !document.getElementById) {
      document.all['strdm'+i].style.color = "#000";
    }  
  }
}


// Zuweisung der richtigen Klasse des Standardmenues

function strdmenu_act(strdmIndex) {
  currentstrdmIndex = strdmIndex;
  for (var i=1; i <= numberStandardmenu; ++i) {  
    if (i == strdmIndex) {
      if(document.getElementById) {
        document.getElementById('strdm'+i).style.color = "#6B64CC";
      } else if(document.all && !document.getElementById) {
        document.all['strdm'+i].style.color="6B64CC";
      }
    }
    else {
      if (document.getElementById) {
        document.getElementById('strdm'+i).style.color = "#000";
      } else if(document.all && !document.getElementById) {
        document.all['strdm'+i].style.color = "#000";
      }  
    }
  }
  for (var i=1; i <= numberMainmenu; ++i) {  
    if (document.getElementById) {
      document.getElementById('mm'+i).style.color = "#000";
    } else if(document.all && !document.getElementById) {
      document.all['mm'+i].style.color = "#000";
    }  
  }
}

/*
function strdmenu_act(menu) {
  var count = document.getElementById("standardmenu").childNodes.length;
  for (var i=0; i < count; ++i) {
    current = document.getElementById("standardmenu").childNodes[i];
    if(current.nodeName == 'A') {
      if (current == menu) {
        current.style.color = "#6B64CC";
      } else {
        current.style.color = "#000";
      }
    }
  }
  var countMm = document.getElementById("mainmenu").childNodes.length;
  for (var j=0; j < countMm; ++j) {
    currentMm = document.getElementById("mainmenu").childNodes[j];
    if(currentMm.nodeName == 'A') {
      currentMm.style.color = "#000";
    }
  }
}

function mainmenu_act(menu) {
  var count = document.getElementById("mainmenu").childNodes.length;
  for (var i=0; i < count; ++i) {
    current = document.getElementById("mainmenu").childNodes[i];
    if(current.nodeName == 'A') {
      if (current == menu) {
        current.style.color = "#6B64CC";
      } else {
        current.style.color = "#000";
      }
    }
  }
  var countSm = document.getElementById("standardmenu").childNodes.length;
  for (var j=0; j < countSm; ++j) {
    currentSm = document.getElementById("standardmenu").childNodes[j];
    if(currentSm.nodeName == 'A') {
      currentSm.style.color = "#000";
    }
  }
}
*/

function addNet(url,titel){
  if((typeof window.sidebar=="object") && (typeof window.sidebar.addPanel=="function")){
      alert('Sie benutzen den Firefox.\nUm ein Lesezeichen zu setzen, klicken Sie bitte <Strg+d>');
      //window.sidebar.addPanel(titel,url,"");
  }else{
      alert("Mit ihrem Browser ist das Hinzufügen von Lesezeichen via Javascript nicht möglich.\nBitte legen sie das Lesezeichen manuell an.");
  }
}
  
function lesezeichen(){
  var url=window.location.href,t=document.title,ap=navigator.appName;
  if(ap=="Microsoft Internet Explorer"){
      window.external.AddFavorite(url,t);
  }else{
      if(ap=="Netscape"){
          addNet(url,t);
      }else{
          alert("Mit ihrem Browser ist das Hinzufügen von Lesezeichen via Javascript nicht möglich.\nBitte legen sie das Lesezeichen manuell an.\nURL:"+url);
      };
  }
}
