<!--

//alert('HIGHLIGHT.JS ADMIN');

// WICHTIG
// wenn Funktion über CLICK in Menu aufgerufen: übergeordnete Instanzen sind bereits aktiviert
// wenn Funktion aus den Webseiten aufgerufen: übergeordnete Instanzen müssen erst aktiviert werden !!!
// => Funktion wird aus headscripts.inc für jede übergeordnete Instanz aufgerufen


var old_menupoint1_id;
var old_menupoint2_id;
var old_menupoint3_id;

var old_active_sub_id;
var old_active_subsub_id;

//alert('HIGHLIGHT.JS: ' + old_menupoint1_id);


/// Farben der Menupunkte (ausgelagert in header.inc) !!!
/// var active_menu1_color = '#ABD0F4';
/// var active_menu2_color = '#FF0000';
/// var active_menu3_color = '#FF0000';
//alert(active_menu1_color);


///////////////////////////
function highLight(dateiname,ebene) {

//alert(dateiname + ' - ' + ebene);
//alert(old_menupoint1_id);

// Zurücksetzen Variable clicked2 im Menuframe - sonst kein Mouseover
if(top.frames['topmenu'] && top.frames['topmenu'].clicked2) top.frames['topmenu'].clicked2='';
if(top.frames['submenu'] && top.frames['submenu'].clicked2) top.frames['submenu'].clicked2='';
if(top.frames['menu']    && top.frames['menu'].clicked2)    top.frames['menu'].clicked2='';
if(top.frames['intro']   && top.frames['intro'].clicked2)   top.frames['intro'].clicked2='';

// Zurücksetzen Variable clicked1 im Menuframe - sonst kein Mouseover *** TEST ***
if(top.frames['topmenu'] && top.frames['topmenu'].clicked1) top.frames['topmenu'].clicked1='';


////////////////// DEAKTIVIEREN
/////////
if(ebene == '1') {
   //alert(dateiname + ' - ' + ebene);
   // alten aktiven Punkt auf Ebene 1 deaktivieren
   if(active_1 = document.getElementById('active_1')) {deactivate_menupoint(active_1,1);}

   // evtl. aktiven Punkt auf Ebene 2 deaktivieren
   if(active_2 = document.getElementById('active_2')) {deactivate_menupoint(active_2,2);}

   // evtl. aktiven Punkt auf Ebene 3 deaktivieren
   if(active_3 = document.getElementById('active_3')) {deactivate_menupoint(active_3,3);}

   // evtl. aktives sub_div deaktivieren
   if(active_sub = document.getElementById('active_sub')) {
      active_sub.style.display='none';
      active_sub.id=old_active_sub_id;
   }

   // evtl. aktives subsub_div deaktivieren
   if(active_subsub = document.getElementById('active_subsub')) {
      active_subsub.style.display='none';
      active_subsub.id=old_active_subsub_id;
   }

}


if(ebene == '2') {
   //alert(dateiname + ' - ' + ebene);
   // alten aktiven Punkt auf Ebene 2 deaktivieren
   if(active_2 = document.getElementById('active_2')) {deactivate_menupoint(active_2,2);}

   // evtl. aktiven Punkt auf Ebene 3 deaktivieren
   if(active_3 = document.getElementById('active_3')) {deactivate_menupoint(active_3,3);}

   // evtl. aktives subsub_div deaktivieren
   if(active_subsub = document.getElementById('active_subsub')) {
      active_subsub.style.display='none';
      active_subsub.id=old_active_subsub_id;
   }
}

if(ebene == '3') {

   // alten aktiven Punkt auf Ebene 3 deaktivieren
   if(active_3 = document.getElementById('active_3')) {deactivate_menupoint(active_3,ebene);}

   // aktiven Punkt auf Ebene 2 deaktivieren
   // Sonderfall: deaktivieren Ebene 2 bei Klick auf Ebene 3 im Menu (keine Pullouts - aufklappendes DIV)
   if(menu_deact_E2_if_E3) {
     if(active_2 = document.getElementById('active_2')) {deactivate_menupoint(active_2,2);}
   }
}


////////////////// AKTIVIEREN

if(menupoint = document.getElementById(dateiname)) {

if(ebene == '1') {

   activate_menupoint(menupoint,1)

   // evtl. vorhandenes subdiv aktivieren
   if(menupoint_sub = document.getElementById('subdiv' +dateiname)) {
      menupoint_sub.style.display='inline';
      old_active_sub_id = menupoint_sub.id;
      menupoint_sub.id='active_sub';
      //alert();
   }
}

if(ebene == '2') {

   activate_menupoint(menupoint,2)

   // evtl. vorhandenes subsubdiv aktivieren
   if(menupoint_subsub = document.getElementById('subsubdiv' +dateiname)) {
      menupoint_subsub.style.display='inline';
      old_active_subsub_id = menupoint_subsub.id;
      menupoint_subsub.id='active_subsub';
      //alert();
   }
}

if(ebene == '3') {
   activate_menupoint(menupoint,3)
}

}

//alert();

////////////////// ALLES DEAKTIVIEREN wenn kein Dateiname (Sitemap, etc.)
// Frame-Name angeben für highLight_from_page() !!!!

if(!dateiname) {

   //alert();
   // alten aktiven Punkt auf Ebene 1 deaktivieren
   if(active_1 = document.getElementById('active_1')) {deactivate_menupoint(active_1);}

   // evtl. aktiven Punkt auf Ebene 2 deaktivieren
   if(active_2 = document.getElementById('active_2')) {deactivate_menupoint(active_2);}

   // evtl. aktiven Punkt auf Ebene 3 deaktivieren
   if(active_3 = document.getElementById('active_3')) {deactivate_menupoint(active_3);}

   // evtl. aktives sub_div deaktivieren
   if(active_sub = document.getElementById('active_sub')) {
      active_sub.style.display='none';

      //active_sub.id=active_sub.name;
      active_sub.id=old_active_sub_id;


   }

   // evtl. aktives subsub_div deaktivieren
   if(active_subsub = document.getElementById('active_subsub')) {
      active_subsub.style.display='none';

      //active_subsub.id=active_subsub.name;
      active_subsub.id=old_active_subsub_id;
   }

}

} // Ende Funktion



///////////////////////////
function activate_menupoint(menupoint,ebenennummer) {

   if(ebenennummer == 1) menupoint.style.background=active_menu1_color;
   if(ebenennummer == 2) menupoint.style.background=active_menu2_color;
   if(ebenennummer == 3) menupoint.style.background=active_menu3_color;

   //alert(active_menu1_fontcolor);

   if(active_menu1_fontcolor && ebenennummer == 1) menupoint.style.color=active_menu1_fontcolor;
   if(active_menu2_fontcolor && ebenennummer == 2) menupoint.style.color=active_menu2_fontcolor;
   if(active_menu3_fontcolor && ebenennummer == 3) menupoint.style.color=active_menu3_fontcolor;

   if(ebenennummer == 1) old_menupoint1_id = menupoint.id;
   if(ebenennummer == 2) old_menupoint2_id = menupoint.id;
   if(ebenennummer == 3) old_menupoint3_id = menupoint.id;

   // TEST - wenn weitere Tabelle im Menu (für Pfeil) - FLVW
   //if(active_menu1_fontcolor && ebenennummer == 1) menupoint.firstChild.firstChild.style.color=active_menu1_fontcolor;


   menupoint.id='active_' + ebenennummer;


   ////////////// SPECIAL - MENUBILD
   // Highlight Menubild
   // Bild muss in menu.php die ID 'menubild_DATATABLE' haben !

   //alert(menupoint.id);
   //alert(old_menupoint1_id);
   //alert(old_menupoint2_id);

   if(ebenennummer == 1) {
   if(document.getElementById('menubild_'+old_menupoint1_id)) {
     //alert('ACT >>> menubild_'+old_menupoint1_id);
     document.getElementById('menubild_'+old_menupoint1_id).src = document.getElementById('menubild_'+old_menupoint1_id).src.replace('_low.','_high.');
     document.getElementById('menubild_'+old_menupoint1_id).id = 'menubild_active_1';
   }
   }

   if(ebenennummer == 2 || ebenennummer == 3) {
   if(document.getElementById('menubild_'+old_menupoint2_id)) {
     //alert('ACT >>> menubild_'+old_menupoint2_id);
     document.getElementById('menubild_'+old_menupoint2_id).src = document.getElementById('menubild_'+old_menupoint2_id).src.replace('_low.','_high.');
     document.getElementById('menubild_'+old_menupoint2_id).id = 'menubild_active_2';
   }
   }
}


///////////////////////////
function deactivate_menupoint(menupoint,ebenennummer) {

   //alert(ebenennummer);

   if(ebenennummer == 1) menupoint.style.background = inactive_menu1_color;  //'red'; //
   if(ebenennummer == 2) menupoint.style.background = inactive_menu2_color;
   if(ebenennummer == 3) menupoint.style.background = inactive_menu3_color;

   if(ebenennummer == 1) menupoint.style.color = inactive_menu1_fontcolor;
   if(ebenennummer == 2) menupoint.style.color = inactive_menu2_fontcolor;
   if(ebenennummer == 3) menupoint.style.color = inactive_menu3_fontcolor;

   // TEST - wenn weitere Tabelle im Menu (für Pfeil) - FLVW
   //if(active_menu1_fontcolor && ebenennummer == 1) menupoint.firstChild.firstChild.style.color=inactive_menu1_fontcolor;


   //menupoint.style.background='none';
   //menupoint.id=menupoint.name;
   //alert(menupoint.name);

   //alert(menupoint.id);
   //alert(ebenennummer);

   if(ebenennummer == 1) menupoint.id = old_menupoint1_id;
   if(ebenennummer == 2) menupoint.id = old_menupoint2_id;
   if(ebenennummer == 3) menupoint.id = old_menupoint3_id;

   //alert(old_menupoint_id);


   ////////////// SPECIAL - MENUBILD
   if(document.getElementById('menubild_active_1')) {
     //alert('DEACT >>> menubild_'+old_menupoint1_id);
     document.getElementById('menubild_active_1').src = document.getElementById('menubild_active_1').src.replace('_high.','_low.');
     document.getElementById('menubild_active_1').id = 'menubild_'+old_menupoint1_id;
   }

   if(document.getElementById('menubild_active_2')) {
     //alert('DEACT >>> menubild_'+old_menupoint2_id);
     document.getElementById('menubild_active_2').src = document.getElementById('menubild_active_2').src.replace('_high.','_low.');
     document.getElementById('menubild_active_2').id = 'menubild_'+old_menupoint2_id;
   }

}

//-->

