// ******************************************************* //
//       Konfiguration: Hier Anpassungen vornehmen         //
// ******************************************************* //

// Anzahl der Hauptmmenues
var numberMainmenu = 6;  

// Anzahl der Untermenüs: new Array(Anzahl Untermenue1, Anzahl Untermenue2, ...)
var linksProSubmenu = new Array(6, 10, 2, 2, 0);

// Anzahl der Standardmenues
var numberStandardmenu = 3;  


// ******************************************************* //
//          Ab hier keine Aenderungen vornehmen            //
// ******************************************************* //

// Ein-/Ausblenden des Untermenues und Zuweisung der richtigen Klasse des Hauptmenues

function submenu_act(mmIndex) {
  for (var i=1; i <= linksProSubmenu[mmIndex-1]; ++i) {
      if(top.document.getElementById) {
        top.document.getElementById('sm'+mmIndex+'_'+i).className = "submenu-no";
      } else if(top.document.all && !top.document.getElementById) {
        top.document.all['sm'+mmIndex+'_'+i].className = "submenu-no";
      }
  }
  for (var i=1; i <= numberMainmenu; ++i) {  
    if (i == mmIndex) {
      if(top.document.getElementById) {
        top.document.getElementById('sm'+i).style.display = "block";
        top.document.getElementById('mm'+i).className = "mainmenu-act"; 
        top.document.getElementById('sm'+i+'_1').className = "submenu-act";
        top.document.getElementById('iframe_content_right').src='clear.html';
      } else if(top.document.all && !top.document.getElementById) {
        top.document.all['sm'+i].style.display="block";
        top.document.all['mm'+i].className="mainmenu-act";
        top.document.all['sm'+i+'_1'].className = "submenu-act";
        top.document.all['iframe_content_right'].src='clear.html';
      }
    }
    else {
      if (top.document.getElementById) {
        top.document.getElementById('sm'+i).style.display = "none";
        top.document.getElementById('mm'+i).className = "mainmenu-no";
      } else if(top.document.all && !top.document.getElementById) {
        top.document.all['sm'+i].style.display = "none";
        top.document.all['mm'+i].className = "mainmenu-no";
      }  
    }
  }
  for (var i=1; i <= numberStandardmenu; ++i) {  
    if (top.document.getElementById) {
      top.document.getElementById('strdm'+i).className = "standardmenu-no";
    } else if(top.document.all && !document.getElementById) {
      top.document.all['strdm'+i].className = "standardmenu-no";
    }  
  }
}


// Zuweisung der richtigen Klasse des Untermenues

function submenu_entry_act(mmIndex, sbIndex) {
  if(linksProSubmenu[mmIndex-1] > 0) {
    for (var i=1; i <= linksProSubmenu[mmIndex-1]; ++i) {
      if (i == sbIndex) {
        if(top.document.getElementById) {
          top.document.getElementById('sm'+mmIndex+'_'+i).className = "submenu-act";
          top.document.getElementById('iframe_content_right').src='clear.html';
        } else if(top.document.all && !top.document.getElementById) {
          top.document.all['sm'+mmIndex+'_'+i].className = "submenu-act";
          top.document.all['iframe_content_right'].src='clear.html';
        }
      }
      else {
        if(top.document.getElementById) {
          top.document.getElementById('sm'+mmIndex+'_'+i).className = "submenu-no";
        } else if(top.document.all && !top.document.getElementById) {
          top.document.all['sm'+mmIndex+'_'+i].className = "submenu-no";
        }
      }
    }
  }
}


// Zuweisung der richtigen Klasse des Standardmenues

function standardmenu_act(strdmIndex) {
  currentstrdmIndex = strdmIndex;
  for (var i=1; i <= numberStandardmenu; ++i) {  
    if (i == strdmIndex) {
      if(top.document.getElementById) {
        top.document.getElementById('strdm'+i).className = "standardmenu-act";
        top.document.getElementById('iframe_content_right').src='clear.html';
      } else if(top.document.all && !top.document.getElementById) {
        top.document.all['strdm'+i].className="standardmenu-act";
        top.document.all['iframe_content_right'].src='clear.html';
      }
    }
    else {
      if (top.document.getElementById) {
        top.document.getElementById('strdm'+i).className = "standardmenu-no";
      } else if(top.document.all && !top.document.getElementById) {
        top.document.all['strdm'+i].className = "standardmenu-no";
      }  
    }
  }
  for (var i=1; i <= numberMainmenu; ++i) {  
    if (top.document.getElementById) {
      top.document.getElementById('sm'+i).style.display = "none";
      top.document.getElementById('mm'+i).className = "mainmenu-no";
    } else if(top.document.all && !top.document.getElementById) {
      top.document.all['sm'+i].style.display = "none";
      top.document.all['mm'+i].className = "mainmenu-no";
    }  
  }
}


// Anpassung der Höhe des I-Frames

function setIframeHeightCenter() {
    if(parent.frames.length && document.documentElement && document.documentElement.scrollHeight) {
      var iframe = parent.document.getElementById('iframe_content_center');
      var height = document.documentElement.scrollHeight;
      if (height < 460) {
        height = 460;
      }
      //iframe.style.height = '0';
      iframe.style.height = (height) + 'px';
    }
  }
  
function setIframeHeightRight() {
  if(parent.frames.length && document.documentElement && document.documentElement.scrollHeight) {
    var iframe = parent.document.getElementById('iframe_content_right');
    var height = document.documentElement.scrollHeight;
    if (height < 360) {
      height = 360;
    }
    //iframe.style.height = '0';
    iframe.style.height = (height) + 'px';
  }
}

function setHeight(iframeHeight) {
    var iframe = parent.document.getElementById('iframe_content_center');
    var height = document.documentElement.scrollHeight;
    if (document.getElementById) {
        iframe.style.height = (iframeHeight) + 'px';
    } else if(document.all && !document.getElementById) {
      
    }  
}
