///////////////////////////////////////////// AZUBI_MENU /////////////////////////////////////////////////////
function SimpleSwap(el,which){
  el.src=el.getAttribute(which || "origsrc");
}
function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
      
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}
var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}


//////////////////////////////////////////////////////////////////////////////////////////////////

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}

function update_auswahl()
{
var kategorieAuswahl = document.getElementById('bereich')

if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Vehicle-Engineering")
{
MM_showHideLayers('contact_ve','','show','contact_ps','','hide','contact_es','','hide','contact_c','','hide');
MM_changeProp('contact_ve','','style.width','300px','DIV');
MM_changeProp('contact_ps','','style.width','0px','DIV');
MM_changeProp('contact_es','','style.width','0px','DIV');
MM_changeProp('contact_c','','style.width','0px','DIV');
MM_changeProp('contact_ve','','style.height','25px','DIV');
MM_changeProp('contact_ps','','style.height','0px','DIV');
MM_changeProp('contact_es','','style.height','0px','DIV');
MM_changeProp('contact_c','','style.height','0px','DIV');
}
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Powertrain-Solutions")
{
MM_showHideLayers('contact_ve','','hide','contact_ps','','show','contact_es','','hide','contact_c','','hide');
MM_changeProp('contact_ve','','style.width','0px','DIV');
MM_changeProp('contact_ps','','style.width','300px','DIV');
MM_changeProp('contact_es','','style.width','0px','DIV');
MM_changeProp('contact_c','','style.width','0px','DIV');
MM_changeProp('contact_ve','','style.height','0px','DIV');
MM_changeProp('contact_ps','','style.height','25px','DIV');
MM_changeProp('contact_es','','style.height','0px','DIV');
MM_changeProp('contact_c','','style.height','0px','DIV');
}
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Electronics-Solutions")
{
MM_showHideLayers('contact_ve','','hide','contact_ps','','hide','contact_es','','show','contact_c','','hide');
MM_changeProp('contact_ve','','style.width','0px','DIV');
MM_changeProp('contact_ps','','style.width','0px','DIV');
MM_changeProp('contact_es','','style.width','300px','DIV');
MM_changeProp('contact_c','','style.width','0px','DIV');
MM_changeProp('contact_ve','','style.height','0px','DIV');
MM_changeProp('contact_ps','','style.height','0px','DIV');
MM_changeProp('contact_es','','style.height','25px','DIV');
MM_changeProp('contact_c','','style.height','0px','DIV');
}
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Consulting")
{
MM_showHideLayers('contact_ve','','hide','contact_ps','','hide','contact_es','','hide','contact_c','','show');
MM_changeProp('contact_ve','','style.width','0px','DIV');
MM_changeProp('contact_ps','','style.width','0px','DIV');
MM_changeProp('contact_es','','style.width','0px','DIV');
MM_changeProp('contact_c','','style.width','300px','DIV');
MM_changeProp('contact_ve','','style.height','0px','DIV');
MM_changeProp('contact_ps','','style.height','0px','DIV');
MM_changeProp('contact_es','','style.height','0px','DIV');
MM_changeProp('contact_c','','style.height','25px','DIV');
}
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Bereichsauswahl")
{
MM_showHideLayers('contact_ve','','hide','contact_ps','','hide','contact_es','','hide','contact_c','','hide');
MM_changeProp('contact_ve','','style.width','0px','DIV');
MM_changeProp('contact_ps','','style.width','0px','DIV');
MM_changeProp('contact_es','','style.width','0px','DIV');
MM_changeProp('contact_c','','style.width','0px','DIV');
MM_changeProp('contact_ve','','style.height','0px','DIV');
MM_changeProp('contact_ps','','style.height','0px','DIV');
MM_changeProp('contact_es','','style.height','0px','DIV');
MM_changeProp('contact_c','','style.height','0px','DIV');
}

//////////////////////////////////////////// PRESSE-FORMULAR ////////////////////////////////////////////////////////
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value == "Sonstige")
{
MM_showHideLayers('medium_add','','show');
MM_changeProp('medium_add','','style.width','225px','DIV');
MM_changeProp('medium_add','','style.height','25px','DIV');
}
else if (kategorieAuswahl.options
[kategorieAuswahl.selectedIndex].
value !== "Sonstige")
{
MM_showHideLayers('medium_add','','hide');
}
}


function openPopup(link)
{
	if (link == 0)
	{
window.open('http://www.mbtech-group.com/index.php?id=384&L=1','popup0',
'width=488, height=550, resizable=no,scrollbars=auto');
	}
	if (link == 1)
	{
window.open('http://www.mbtech-group.com/index.php?id=384&L=5','popup1',
'width=488, height=550, resizable=no,scrollbars=auto');
	}
}

function IAAPopup() {
 NeuesFenster =
 window.open('index.php?id=1063', 'width=639,height=440,scrollbars="no"');
 NeuesFenster.focus();
}


var browserName = navigator.appName;
var browserVer = parseInt(navigator.appVersion);
var version = "";
var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror" || browserName=="Opera") {version = "n3";} else {version = "n2";}
	// Blurring links:
function blurLink(theObject)	{	//
	if (msie4)	{theObject.blur();}
	}
	

moz=document.getElementById&&!document.all
mozHeightOffset=20

function resize_iframe(){
document.getElementById("iframe_id").height=100 // required for Moz bug, value can be "", null, or integer
document.getElementById('iframe_id').height=window.frames["iframe_name"].document.body.scrollHeight+(moz?mozHeightOffset:0)
}

/////////////////// WEIHNACHTSSPIEL 08 //////////////////////////

function showLayer() {
 	document.getElementById('X-MasLayer').style.visibility='visible';
}
function hideLayer() {
 	document.getElementById('X-MasLayer').style.visibility='hidden';
}



