var Menu2 = new Array('<div class="Rand20"><div id="Button20" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Über uns</div></div><div class="Rand21"><div id="Button21" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Selbstverständnis</div></div><div class="Rand21"><div id="Button22" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Standort</div></div><div class="Rand23"><div id="Button23" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Aktuelles</div></div><br />',
                      '',
                      '<div class="Rand20"><div id="Button20" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Simulation</div></div><div class="Rand21"><div id="Button21" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Ortung</div></div><div class="Rand22"><div id="Button22" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Hof- Management</div></div><div class="Rand23"><div id="Button23" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Projekt- Management</div></div><br />',
                      '',
                      '',
                      '',
                      '<div class="Rand20"><div id="Button20" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Ansprechpartner</div></div><div class="Rand21"><div id="Button21" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Anfahrt</div></div><br />');

function handleResponse() 
{ 
	if (http.readyState == 4)
		document.getElementById("Inhalt").innerHTML = http.responseText;
}

function getInhalt(seite)
{
  http.open("GET", "getInhalt.php?Seite=" + seite, true);
	http.onreadystatechange = handleResponse;
	http.send(null);
}

function getHTTPObject() {

  var xmlhttp;

  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}

var http = getHTTPObject();

var activated;
var activatedSub;

function activate(element) {
	var old = activated;
	activated = element;
	if (old != activated)
  	downLight(old);
  if (element == document.getElementById("Button02")) {          // Impressum
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("impressum.html");
  }
  if (element == document.getElementById("Button03")) {          // Sitemap
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("sitemap.html");
  }
  if (element == document.getElementById("Button10")) {          // Das Unternehmen
  	document.getElementById("MenuZeile2").innerHTML = Menu2[0];
  	highLightSub(document.getElementById("Button20"));
	  activateSub(document.getElementById("Button20"));
  }
  if (element == document.getElementById("Button11")) {          // Dienstleistungen
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
          getInhalt("dienstleistungen.html");
  }
  
  
  if (element == document.getElementById("Button12")) {          // Themen
  	document.getElementById("MenuZeile2").innerHTML = Menu2[2]; 
  	highLightSub(document.getElementById("Button20"));
	  activatedSub = document.getElementById("Button20");
	  activateSub(document.getElementById("Button20"));
  }
  
  
  
  if (element == document.getElementById("Button13")) {          // Referenzen
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
          getInhalt("referenzen.html");
  }
  if (element == document.getElementById("Button14")) {          // Netzwerk
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("netzwerk.html");
  }
  if (element == document.getElementById("Button15")) {          // Partner
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("partner.html");
  }
  if (element == document.getElementById("Button16")) {          // Kontakt
  	document.getElementById("MenuZeile2").innerHTML = Menu2[6]; 
  	highLightSub(document.getElementById("Button20"));
	  activatedSub = document.getElementById("Button20");
	  activateSub(document.getElementById("Button20"));
  }
}

function highLight(element) {
	element.style.color = "white";
	element.style.backgroundColor = "#005CB8";
}

function downLight(element) {
	if (element != activated) {
  	element.style.color = "black";
	  element.style.backgroundColor = "#CCCCCC";
	}
}

function activateSub(element) {
	var old = activatedSub;
	activatedSub = element;
	downLightSub(old);  
	
	//Unternehmen Subs
        if (activated == document.getElementById("Button10")) {  
  	if (element == document.getElementById("Button20"))
  	  getInhalt("ueber_uns.html");
  	if (element == document.getElementById("Button21"))
 	  getInhalt("selbstverstaendnis.html");
        if (element == document.getElementById("Button22"))
  	  getInhalt("standort.html");
	if (element == document.getElementById("Button23"))
	  getInhalt("aktuelles.html");
        }

  	//Themen Subs
	if (activated == document.getElementById("Button12")) {   
	if (element == document.getElementById("Button20"))
	  getInhalt("simulation.html");
	if (element == document.getElementById("Button21"))
	  getInhalt("ortung.html");
	if (element == document.getElementById("Button22"))
	  getInhalt("hofmanagement.html");
	if (element == document.getElementById("Button23"))
	  getInhalt("projektmanagement.html");
	}
        
        //Kontakt Subs
	if (activated == document.getElementById("Button16")) {   
  	if (element == document.getElementById("Button20"))
  	  getInhalt("ansprechpartner.html");
  	if (element == document.getElementById("Button21"))
  	  getInhalt("anfahrt.html");
               }
}

function highLightSub(element) {
	element.style.color = "white";
	element.style.backgroundColor = "#FFB871";
}

function downLightSub(element) {
	if (element != activatedSub) {
  	element.style.color = "black";
	  element.style.backgroundColor = "#CCCCCC";
	}
}

function anfahrt() {
	var old = activated;
	activated = document.getElementById("Button16");
        downLight(old);
        downLightSub(activatedSub);
 	document.getElementById("MenuZeile2").innerHTML = Menu2[6];
        highLight(activated);
        activatedSub = document.getElementById("Button20");
        activateSub(document.getElementById("Button21"));
        highLightSub(document.getElementById("Button21"));
}

function showWilhelmstr() {
	window.open("bilder/Standort_PopUP.jpg", "Wilhelmstr", "dependant=yes, height=500px, width=628px, menubar=no, resizeable=no, scrollbars=no, status=no, toolbar=no");
}

function showSimulation() {
	window.open("bilder/traloco_Simulation_PopUp.jpg", "Simulation", "dependant=yes, height=620px, width=580 , menubar=no, resizeable=no, scrollbars=no, status=no, toolbar=no");
}


function init() {
	highLight(document.getElementById("Button10"));
	activated = document.getElementById("Button10");
 	document.getElementById("MenuZeile2").innerHTML = Menu2[0];
	highLightSub(document.getElementById("Button20"));
	activatedSub = document.getElementById("Button20");
          getInhalt("ueber_uns.html");
}


