var activeNav0=0;
var activeNav1=0;
var nav1Reset;

var navi=new Array();
// Array: Seite Klartext , Navigationstext, Content-Link
navi[0]=new Array();
navi[0][0]=new Array("Home","home","home/index.html");
navi[1]=new Array();
navi[1][0]=new Array("Für Patienten","patienten","patienten/index.html");
navi[1][1]=new Array("Ästhetik","aesthetik","patienten/aesthetik.html");
navi[1][2]=new Array("Zirkonoxid","zirkonoxid","patienten/zikonoxid1.html");
navi[1][3]=new Array("Vollkeramik","vollkeramik","patienten/vollkeramik.html");
navi[1][4]=new Array("Implantologie","implantologie","patienten/implantologie1.html");
navi[1][5]=new Array("Galvano","galvano","patienten/galvano.html");
navi[1][6]=new Array("Totalprothetik","totalprothetik","patienten/vollprothetik.html");
navi[2]=new Array();
navi[2][0]=new Array("Für Zahnärzte","zahnaerzte","zahnaerzte/index.html");
navi[2][1]=new Array("Zirkonoxid","zirkonoxid","zahnaerzte/zirkonoxid1.html");
navi[2][2]=new Array("Vollkeramik","vollkeramik","zahnaerzte/vollkeramik.html");
navi[2][3]=new Array("Implantologie","implantologie","zahnaerzte/implantologie1.html");
navi[2][4]=new Array("Galvano","galvano","zahnaerzte/galvano1.html");
navi[2][5]=new Array("Totalprothetik","totalprothetik","zahnaerzte/totalprothetik.html");
navi[3]=new Array();
navi[3][0]=new Array("Über uns","ueberuns","ueberuns/index.html");
navi[3][1]=new Array("Philosophie","philosophie","ueberuns/philosophie.html");
navi[3][2]=new Array("Team","team","ueberuns/team.html");
navi[3][3]=new Array("Geschichte","geschichte","ueberuns/geschichte.html");
navi[3][4]=new Array("Mitgliedschaften","mitgliedschaften","ueberuns/mitgliedschaften.html");
navi[4]=new Array();
navi[4][0]=new Array("Service","service","service/index.html");
navi[5]=new Array();
navi[5][0]=new Array("Kontakt","kontakt","kontakt/index.html");

function toggle(nav1,nav2) {
	for(var i=0;i<navi.length;i++) {
		document.getElementById("na"+i).src=(nav1==i)?"images/navi/"+navi[i][0][1]+"_1.gif":"images/navi/"+navi[i][0][1]+"_0.gif";
		document.getElementById("nj"+i).style.display=(nav1==i)?"inline":"none";
		for(var j=1;j<navi[i].length;j++) {
			document.getElementById("na"+i+"b"+j).src=(nav1==i && nav2==j)?"images/navi/"+navi[i][j][1]+"_1.gif":"images/navi/"+navi[i][j][1]+"_0.gif";
		}
	}
}

function doNavReset() {
	toggle(activeNav0,activeNav1);
}

function startTimedNav1Reset() {
	nav1Reset=window.setTimeout("doNavReset();",3000)
}

function stopTimedNav1Reset() {
	window.clearTimeout(nav1Reset);
}

function writeNavigation() {
	document.open();
	document.writeln('<div id="navlevel1">');
	for (var i=0;i<navi.length;i++) {
		document.writeln('	<div class="nav">');
		document.writeln('		<a href="content/'+navi[i][0][2]+'" target="contentframe" onmouseover="stopTimedNav1Reset();toggle('+i+',-1);" onmouseout="startTimedNav1Reset();" onclick="activeNav0='+i+';activeNav1=0;this.blur();changeVisual();"><img id="na'+i+'" src="images/navi/'+navi[i][0][1]+'_0.gif" alt="'+navi[i][0][0]+'" border="0" style="display:block;"></a>');
		document.writeln('		<div id="nj'+i+'" class="navlevel2">');
		for (var j=1;j<navi[i].length;j++) {
			document.writeln('			<a href="content/'+navi[i][j][2]+'" target="contentframe" onmouseover="stopTimedNav1Reset();toggle('+i+','+j+');" onmouseout="startTimedNav1Reset();" onclick="activeNav0='+i+';activeNav1='+j+';this.blur();changeVisual();"><img id="na'+i+'b'+j+'" src="images/navi/'+navi[i][j][1]+'_0.gif" alt="'+navi[i][j][0]+'" border="0"></a>');
			if (j<navi[i].length-1) {document.writeln('			<img src="images/navi/nav1_sep.gif" width="1" height="16" alt="" border="0">');}
		}
		document.writeln('		</div>');
		document.writeln('	</div>');
		if (i<navi.length-1) {document.writeln('	<div class="nav"><img src="images/navi/nav0_sep.gif" alt="" border="0" height="18" width="1"></div>');}
	}
	document.writeln('</div>');
	document.close();			
}

function changeVisual() {
	document.getElementById("visualframe").src="visual/visual_"+((activeNav0==-1)?0:activeNav0)+""+((activeNav1==-1)?0:activeNav1)+".html";
}

function changeVisualAndToggle(nav1,nav2) {
	activeNav0=nav1;
	activeNav1=nav2;
	toggle(nav1,nav2);
	changeVisual();
}
