var borderBotColor = '#33656B';
 function setClass(id){
   if (document.getElementById('m_'+id) && document.getElementById('m_'+id).name=='none'){
     for (i=0;i<document.getElementsByName("none").length;i++){

        if(document.getElementsByName("none")[i].value==id) {
         document.getElementById('l_'+id).className='mainlinkact';
       }
       else
         document.getElementById('l_'+id).className='mainlinkact';
     }
   }
 }

 function mMenHov(mid){
   if (id != mid) {
     if (document.getElementById('l_'+mid).parentNode.parentNode.style.borderBottomColor == "")
     document.getElementById('l_'+mid).parentNode.parentNode.style.borderBottomColor = borderBotColor;
     else
     document.getElementById('l_'+mid).parentNode.parentNode.style.borderBottomColor = "";
   }
 }

 function subchg(id){
 var lastId = false;
 var nextId = false;
  if (document.getElementById('m_'+id) && document.getElementById('m_'+id).name!="none"){
    preId = document.getElementById('m_'+id).value;
    // FEEEEHLER bei Untermenüs auf EBENE 4
    if(preId != id && document.getElementById(preId) && document.getElementById(preId).style.display != 'block') {
      document.getElementById('l_'+id).className='submenact';

      if (document.getElementById(id)) nextId = id;
      if (document.getElementById('m_'+preId).value != id) lastId = preId;
      id = preId;
    }
    else {
     if (preId == id){
     if (document.getElementById('l_'+id).parentNode.parentNode.name==id) {
       document.getElementById('l_'+id).parentNode.parentNode.style.borderBottomColor=borderBotColor;
     }
     document.getElementById('l_'+id).className='mainmenact';
     }
    }
  }
 if (document.getElementById(id)) {
  if (document.getElementById(id).style.display=='none' || document.getElementById(id).style.display==''){
    if (document.getElementById(id) && (
        document.getElementById(id).style.display=='none' ||
        document.getElementById(id).style.display=='')
        ) {
     parId = id;
    }
    document.getElementById(id).style.display='block';
    if(lastId) subchg(lastId);
    if(nextId) subchg(nextId);
  }
  else {

    if (document.getElementById(id).parentNode.id && (
        document.getElementById(id).parentNode.style.display=='none' ||
        document.getElementById(id).parentNode.style.display=='')
        ) {
     parId = document.getElementById(id).parentNode.id;
     subchg(parId);
    }
    else {
    if ((lastId)) {
      document.getElementById(id).style.display='none';
    }
    }
  }
  }
 }

 function chg(id){
  if (document.getElementById('m_'+id) && document.getElementById('m_'+id).name!="none"){
     preId = document.getElementById('m_'+id).value;
     if(preId != id && document.getElementById(preId) && document.getElementById(preId).style.display != 'block') {
       document.getElementById('i_'+id).src='./i/menu/arr_red.gif';
     }
  }
  subchg(id);
 }

 var ch = false;;
 var ext_id;
 function show_extraMen(id,s,ty){

   if (id && id == 'show') ch = true;
   if (id && id == 'hide') {

     ext_id = false;
     ch = false;
     id = false;
   }
   if (s && ext_id) {
    chg(ext_id);
   }
   else {
      if (id && !(ch)) {
       overElm = document.getElementById("extrM");
       ely = ty;
       overElm.style.top = ely;
       overElm.style.left = document.getElementById('l_'+id).offsetWidth+10;
       ext_id = id;
       overElm.style.display='block';
      }
      else
      if (!s && !ch )  document.getElementById("extrM").style.display='none';
   }
 }


 function set_extraMen(id,s,y){
  /*
  if(document.getElementById(id) && document.getElementById(id).style.display!='block' || id == 'hide') {
  //&& document.getElementById('m_'+id).style.display!='block'
     setTimeout("show_extraMen('"+id+"','','"+y+"');",500);
  }
  else setTimeout("show_extraMen("+false+","+false+","+false+");",500);
  */
 }