
/* ------------------- LEFTMENU ------------------- */ 

var Select1 = "";
var Select2 = "";
var MenuIt1 = "";
var MenuIt2 = "";
var NameEle = "Item_";
var NameTab = "Tab_";

var Within = false;
var Idle = true;
var Timer;

var Colors = new Array();
Colors[0] = "#FFFFFF";    /* Schriftfarbe Hauptmenü nicht ausgewählt    */
Colors[1] = "#000000";    /* Hintergrund Hauptmenü nicht ausgewählt     */
Colors[2] = "#000000";    /* Schriftfarbe Hauptmenü ausgewählt          */
Colors[3] = "#FFFFFF";    /* Hintergrund Hauptmenü ausgewählt           */

var Left = new Array();
Left[100] = "";
Left[101] = "";
Left[102] = "";
Left[103] = "";
Left[104] = "";
Left[105] = "";

function InitMenu()
{ Timer = window.setInterval("TestIdle()", 650); 
  //InitForm();
}

function ExitMenu()
{ window.clearInterval(Timer);
  SwitchOff(true);
}

function ShowLeft(nID, bHow)
{ var cBez = NameEle + "0_" + nID.toString();
  var oTxt = document.getElementById(cBez);
  Within = bHow;
  if (bHow)
  { oTxt.style.color = Colors[2];
    oTxt.style.backgroundColor = Colors[3];
    Idle = false;
    if (cBez != MenuIt1)
    { SwitchOff(true);
	}
	if (Left[nID].length > 0)
	{ var oBox = document.getElementById(Left[nID]);
	  oBox.style.visibility = "visible";
	  Select1 = Left[nID];
	  MenuIt1 = cBez;
	}
  }
  else if (Left[nID].length == 0)
  { oTxt.style.color = Colors[0];
    oTxt.style.backgroundColor = Colors[1];
  }
}

function SwitchOff(bHow)
{ var oBox, oMTxt, oMTab, cTab;
  if ((Select1.length > 0) && bHow)
  { oBox = document.getElementById(Select1);
    oBox.style.visibility = "hidden";
    Select1 = "";
    oMTx = document.getElementById(MenuIt1);
    oMTx.style.color = Colors[0];
    oMTx.style.backgroundColor = Colors[1];
    MenuIt1 = "";
  }
}

/* ------------------- SUCHE BUTTON NORMAL------------------- */ 

  Normal = new Image();
Normal.src = "../img/design/button_suche.jpg";
Highlight = new Image();
Highlight.src = "../img/design/button_suche_highlight.jpg";
  
  function Bildwechsel (Bildnr, Bildobjekt) {
  document.suche.src = Bildobjekt.src;
  }
  
/* ------------------- SUCHE BUTTON ENGLISCH------------------- */ 

  Normal_eng = new Image();
Normal_eng.src = "../img/design/button_suche_eng.jpg";
Highlight_eng = new Image();
Highlight_eng.src = "../img/design/button_suche_highlight_eng.jpg";
  
  function Bildwechsel_eng (Bildnr, Bildobjekt) {
  document.suche.src = Bildobjekt.src;
  }
  
/* ------------------- SUCHE BUTTON FRANZÖSISCH------------------- */ 

  Normal_fra = new Image();
Normal_fra.src = "../img/design/button_suche_fra.jpg";
Highlight_fra = new Image();
Highlight_fra.src = "../img/design/button_suche_highlight_fra.jpg";
  
  function Bildwechsel_fra (Bildnr, Bildobjekt) {
  document.suche.src = Bildobjekt.src;
  }
  
/* ------------------- TOPMENU ------------------- */ 

var Main = new Array();
Main[0] = "Menu0";
Main[1] = "Menu1";
Main[2] = "Menu2";
Main[3] = "Menu3";
Main[4] = "Menu4";
Main[5] = "Menu5";



var Item1 = new Array();
Item1[1] = "";
Item1[2] = "";

var Item2 = new Array();
Item2[1] = "";
Item2[2] = "";
Item2[3] = "";
Item2[4] = "";
Item2[5] = "";
Item2[6] = "";
Item2[7] = "";
Item2[8] = "";
Item2[9] = "";

var Item3 = new Array();
Item3[1] = "";
Item3[2] = "";
Item3[3] = "";
Item3[4] = "";
Item3[5] = "";
Item3[6] = "";
Item3[7] = "";
Item3[8] = "";
Item3[9] = "";

var Item4 = new Array();
Item4[1] = "";
Item4[2] = "";

var Item5 = new Array();
Item5[1] = "";
Item5[2] = "";
Item5[3] = "";
Item5[4] = "";

var Item6 = new Array();
Item6[1] = "";
Item6[2] = "";
Item6[3] = "";
Item6[4] = "";


function ShowMain(nID, bHow)
{ var cBez = NameEle + "0_" + nID.toString();
  var oTxt = document.getElementById(cBez);
  Within = bHow;
  if (bHow)
  { oTxt.style.color = Colors[2];
    oTxt.style.backgroundColor = Colors[3];
    Idle = false;
    if (cBez != MenuIt1)
    { SwitchOff(true);
	}
	if (Main[nID].length > 0)
	{ var oBox = document.getElementById(Main[nID]);
	  oBox.style.visibility = "visible";
	  Select1 = Main[nID];
	  MenuIt1 = cBez;
	}
  }
  else if (Main[nID].length == 0)
  { oTxt.style.color = Colors[0];
    oTxt.style.backgroundColor = Colors[1];
  }
}

function ShowMenu(nWhich, nID, bHow)
{ var cBez = "Item_" + nWhich.toString() + "_" + nID.toString();
  var oTxt = document.getElementById(cBez);
  var oTab = document.getElementById(cBez);
  Within = bHow;
  if (bHow)
  { oTxt.style.color = Colors[2];
    oTab.style.backgroundColor = Colors[3];    
    Idle = false;
  }
  else
  { oTxt.style.color = Colors[0];
    oTab.style.backgroundColor = Colors[1];
  }
}
 
function TestIdle()
{ if (Idle)
  { SwitchOff(true)
  }
  else if (!Within)
  { Idle = true;
  }
}

 /* ------------------------- Sprache (Nur Deutsch, Englisch und Französisch vorhanden) ------------------------------ */
 
  function SetVersion(Ver, Mod)
{ var New;
  var Folders = new Array();
  if (Mod)
  { var Old = parent.mitte.location.href;
    var Pos = Old.lastIndexOf(".");
	var Ext = Old.slice(Pos + 1);
	if (Ext == "html")
	{ Pos = Old.lastIndexOf("/");
	  New = Old.slice(Pos + 1);
	  var Path = Old.substr(0, Pos);
	  var Verz = "";
	  var Pos2 = Path.lastIndexOf("/");
	  var Last = Path.slice(Pos2 + 1);
	  for (var i = 0; i < Folders.length; i++)
	  { if (Folders[i] == Last)
	    { Verz = Folders[i];
		  break;
		}
	  }
	  if (Verz.length > 0)
	  { New = Verz + "/" + New;
	  }
	}
	else
	{ New = "home.html";
	}
  }
  else
  { New = "home.html";
  }
  
 
  if (Ver=="deu") {
  // Sprachenauswahl deaktiviert für alle Sprachen außer Deutsch, Englisch und Französisch
  if (New.search("construction")!=-1) {
	  
	  
	  top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../deu/home.html" }
  else {
	  
   top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../" + Ver + "/" + New;
  }
  }
  else {
	    if (Ver=="eng") {
		if (New.search("construction")!=-1) {
	  		top.oben.location.href = "../" + Ver + "/index_head.html";
  		parent.mitte.location.href = "../eng/home.html" }
  		else {
	  
   			top.oben.location.href = "../" + Ver + "/index_head.html";
  		parent.mitte.location.href = "../" + Ver + "/" + New;
  		}
		}
 		 else {
	    		if (Ver=="fra") {
				if (New.search("construction")!=-1) {
	  				top.oben.location.href = "../" + Ver + "/index_head.html";
  				parent.mitte.location.href = "../fra/home.html" }
  				else {
	  
   					top.oben.location.href = "../" + Ver + "/index_head.html";
  				parent.mitte.location.href = "../" + Ver + "/" + New;
  				}
				}
				else {
  // Umleitung auf Konstruktionsseite für alle anderen Sprachen
  				parent.mitte.location.href="construction_"+Ver+".html";
  		}
  }
}  
}

var OnField = false;
 
 
 /* ------------------------- Sprache (Nur Deutsch und Englisch vorhanden) ------------------------------ */
/*
 function SetVersion(Ver, Mod)
{ var New;
  var Folders = new Array();
  if (Mod)
  { var Old = parent.mitte.location.href;
    var Pos = Old.lastIndexOf(".");
	var Ext = Old.slice(Pos + 1);
	if (Ext == "html")
	{ Pos = Old.lastIndexOf("/");
	  New = Old.slice(Pos + 1);
	  var Path = Old.substr(0, Pos);
	  var Verz = "";
	  var Pos2 = Path.lastIndexOf("/");
	  var Last = Path.slice(Pos2 + 1);
	  for (var i = 0; i < Folders.length; i++)
	  { if (Folders[i] == Last)
	    { Verz = Folders[i];
		  break;
		}
	  }
	  if (Verz.length > 0)
	  { New = Verz + "/" + New;
	  }
	}
	else
	{ New = "home.html";
	}
  }
  else
  { New = "home.html";
  }
  
 
  if (Ver=="deu") {
  // Sprachenauswahl deaktiviert für alle Sprachen außer Deutsch und Englisch
  if (New.search("construction")!=-1) {
	  
	  
	  top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../deu/home.html" }
  else {
	  
   top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../" + Ver + "/" + New;
  }
  }
  else {
	    if (Ver=="eng") {
		if (New.search("construction")!=-1) {
	  		top.oben.location.href = "../" + Ver + "/index_head.html";
  		parent.mitte.location.href = "../eng/home.html" }
  		else {
	  
   			top.oben.location.href = "../" + Ver + "/index_head.html";
  		parent.mitte.location.href = "../" + Ver + "/" + New;
  		}
		}
		else {
  // Umleitung auf Konstruktionsseite für alle anderen Sprachen
  		parent.mitte.location.href="construction_"+Ver+".html";
  		}
  }
}  


var OnField = false;
*/

 /* ------------------------- Sprache (Nur Deutsch vorhanden) ------------------------------ */
/*
 function SetVersion(Ver, Mod)
{ var New;
  var Folders = new Array();
  if (Mod)
  { var Old = parent.mitte.location.href;
    var Pos = Old.lastIndexOf(".");
	var Ext = Old.slice(Pos + 1);
	if (Ext == "html")
	{ Pos = Old.lastIndexOf("/");
	  New = Old.slice(Pos + 1);
	  var Path = Old.substr(0, Pos);
	  var Verz = "";
	  var Pos2 = Path.lastIndexOf("/");
	  var Last = Path.slice(Pos2 + 1);
	  for (var i = 0; i < Folders.length; i++)
	  { if (Folders[i] == Last)
	    { Verz = Folders[i];
		  break;
		}
	  }
	  if (Verz.length > 0)
	  { New = Verz + "/" + New;
	  }
	}
	else
	{ New = "home.html";
	}
  }
  else
  { New = "home.html";
  }
  
 
  
  if (Ver=="deu") {
  // Sprachenauswahl deaktiviert für alle Sprachen außer Deutsch
  if (New.search("construction")!=-1) {
	  
	  
	  top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../deu/home.html" }
  else {
	  
   top.oben.location.href = "../" + Ver + "/index_head.html";
  parent.mitte.location.href = "../" + Ver + "/" + New;
  }
  }
  else {
  // Umleitung auf Konstruktionsseite für alle anderen Sprachen
  parent.mitte.location.href="construction_"+Ver+".html";
  
  }
}

var OnField = false;
*/
 /* ------------------------- Suche Funktion ------------------------------ */

function InitForm()
{ if (document.forms[0].elements[0].type == "text")
  { document.forms[0].elements[0].focus();
  }
}

function SetOn(How)
{ OnField = How;
}

function DoSearch()
{ if (TestEin())
  { document.Suche.submit();
  }
}

function TestEin()
{ var Inp = document.Suche.Text.value;
  var Ret = true;
  if (Inp.length < 2)
  { alert("Es ist eine Eingabe von mindestens 2 Zeichen erforderlich!\nYou need to fill in at least 2 characters!");
    Ret = false;
  }
  return Ret
}

