var aktiv;
var subnavnummer;
var lastaktiv=100;
var mainactive=1;


function doActive(nr)
{
	mainactive=nr;
	
	document.getElementById("nav"+mainactive).style.background="#ffffff";
        document.getElementById("nav"+mainactive).style.border='1px solid #6E6E6E';
		
}




function getNav(nr)
{
 document.getElementById(nr).style.background="#ffffff";
 document.getElementById(nr).style.border='1px solid #6E6E6E';
 document.getElementById(nr).style.color="#000000";
 window.clearTimeout(aktiv);
 

  document.getElementById("nav"+subnavnummer).style.background="#ffffff";
  document.getElementById("nav"+subnavnummer).style.border='1px solid #6E6E6E';

}

function wegNav(nr)
{
 //document.getElementById(nr).style.background="#C0D4CB";
 document.getElementById(nr).style.border='1px solid #E5E5E5';
 aktiv = window.setTimeout("subnavweg()",100);
 
  document.getElementById(nr).style.background="#E5E5E5";
 
 document.getElementById(nr).style.color="#000000";
}


function subnavsweg()
{
 for(var i=1;i<6;i++)
 { 
  document.getElementById("layer"+i).style.visibility="hidden";	
  
 }
 if(lastaktiv!=100 && lastaktiv!=mainactive)
 {
  document.getElementById("nav"+lastaktiv).style.background='#E5E5E5';
  document.getElementById("nav"+lastaktiv).style.border='1px solid #e5e5e5';
	
 }

}


function subnavweg()
{
document.getElementById("layer"+subnavnummer).style.visibility="hidden";	
if(subnavnummer!=mainactive)
{
	document.getElementById("nav"+subnavnummer).style.background='#E5E5E5';
  document.getElementById("nav"+subnavnummer).style.border='1px solid #e5e5e5';
}

lastaktiv=100;
}

function subnavwegtimer(nr)
{
lastaktiv=subnavnummer;
subnavnummer=nr;
aktiv = window.setTimeout("subnavweg()",450);	
}


function getSubNav(nr)
{
subnavsweg();
lastaktiv=subnavnummer;
subnavnummer=nr;
window.clearTimeout(aktiv);
document.getElementById("layer"+subnavnummer).style.visibility="visible";	

 document.getElementById("nav"+subnavnummer).style.background="#ffffff";
  document.getElementById("nav"+subnavnummer).style.border='1px solid #6E6E6E';

}



function doLink(link)
{
 document.location.href=link;
}





function startSearch()
{
	error = "Bitte geben Sie einen Suchbegriff ein.";
	f = document.we_global_form;
	if(f.we_lv_search_0.value=='')
		{
		alert(error);
		f.we_lv_search_0.focus();
		return;		
		}
	f.submit();
}
	




function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function scroller()
{
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
	step = 2;

	while ((x != 0) || (y != 0)) {
		scroll (x, y);
		step += (step * step / 100);
		x -= step;
		y -= step;
		if (x < 0) x = 0;
		if (y < 0) y = 0;
	} 
	scroll (0, 0);
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


//für kampagne 1
function changethei(nr){
document.bigimg.src = '/zahnrad/img/kampagne/1/' + nr + 'g.jpg'


document.w1.style.borderColor = '#999999'
document.w2.style.borderColor = '#999999'
document.w3.style.borderColor = '#999999'
document.w4.style.borderColor = '#999999'

if(nr == '1'){
document.w1.style.borderColor = '#000000'
}
if(nr == '2'){
document.w2.style.borderColor = '#000000'
}
if(nr == '3'){
document.w3.style.borderColor = '#000000'
}
if(nr == '4'){
document.w4.style.borderColor = '#000000'
}
}
// ende kampagne 1
