var Menu2 = new Array('<div class="Rand20"><div id="Button20" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">About Us</div></div><div class="Rand21"><div id="Button21" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Concept</div></div><div class="Rand22"><div id="Button22" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Location</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)">Positioning</div></div><div class="Rand22"><div id="Button22" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Dock & Yard</div></div><div class="Rand23"><div id="Button23" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Project Management</div></div><br />',
                      '',
                      '',
                      '',
                      '<div class="Rand20"><div id="Button20" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Contact Person</div></div><div class="Rand21"><div id="Button21" class="ButtonSub" onMouseOver="javascript:highLightSub(this)" onMouseOut="javascript:downLightSub(this)" onClick="javascript:activateSub(this)">Directions</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")) {          // Site map
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("sitemap.html");
  }
  if (element == document.getElementById("Button10")) {          // Our Company
  	document.getElementById("MenuZeile2").innerHTML = Menu2[0];
  	highLightSub(document.getElementById("Button20"));
	  activateSub(document.getElementById("Button20"));
  }
  if (element == document.getElementById("Button11")) {          // Service Offerings
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
          getInhalt("serviceofferings.html");
 }
 if (element == document.getElementById("Button12")) {          // Topics
  	document.getElementById("MenuZeile2").innerHTML = Menu2[2]; 
  	highLightSub(document.getElementById("Button20"));
	  activatedSub = document.getElementById("Button20");
	  activateSub(document.getElementById("Button20"));
  }
  if (element == document.getElementById("Button13")) {          // References
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
          getInhalt("references.html");
  }
  if (element == document.getElementById("Button14")) {          // Network
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("network.html");
  }
  if (element == document.getElementById("Button15")) {          // Partners
  	document.getElementById("MenuZeile2").innerHTML = '<br />';
 	  getInhalt("partner_traloco.html");
  }
  if (element == document.getElementById("Button16")) {          // Contact
  	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);                     
        
        // our company subs
        if (activated == document.getElementById("Button10")) {  
  	if (element == document.getElementById("Button20"))
  	  getInhalt("about_us.html");
  	if (element == document.getElementById("Button21"))
 	  getInhalt("concept_traloco.html");
        if (element == document.getElementById("Button22"))
  	    getInhalt("location.html");
        }
        
	//topics Subs
	if (activated == document.getElementById("Button12")) {   
	if (element == document.getElementById("Button20"))
	  getInhalt("simulation.html");
	if (element == document.getElementById("Button21"))
	  getInhalt("positioning.html");
	if (element == document.getElementById("Button22"))
	  getInhalt("yardmanagement.html");
              if (element == document.getElementById("Button23"))
	  getInhalt("projectmanagement.html");	
              }

        //contact subs
	if (activated == document.getElementById("Button16")) {   
  	if (element == document.getElementById("Button20"))
  	  getInhalt("contactperson.html");
  	if (element == document.getElementById("Button21"))
  	  getInhalt("direction.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 direction() {
	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_e_popup.jpg", "DynamicSimulation", "dependant=yes, height=620px, width=580px, 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("about_us.html");
}


