var i;
var AnzahlSpalten=1;
var AnzahlZeilen=10;


var curs=new Array (AnzahlSpalten);

for (i=0; i<AnzahlSpalten; i++)
    {
      curs[i]=new Array(AnzahlZeilen);
    }

curs[0]=["<img src='cw.gif'>"];
curs[1]=["<img src='cs.gif'>"];
curs[2]=["<img src='cn.gif'>"];
curs[3]=["<img src='co.gif'>"];
curs[4]=["<img src='cnw.gif'>"];
curs[5]=["<img src='cno.gif'>"];
curs[6]=["<img src='ct.gif'>"];
curs[7]=["<img src='cs.gif'>"];
curs[8]=["<img src='cn.gif'>"];
curs[9]=["<img src='ct.gif'>"];

var i;
var AnzahlSpalten=1;
var AnzahlZeilen=8;


var ddt=new Array (AnzahlSpalten);

for (i=0; i<AnzahlSpalten; i++)
    {
      ddt[i]=new Array(AnzahlZeilen);
    }

ddt[0]=["s_cn.gif"];
ddt[1]=["s_cno.gif"];
ddt[2]=["s_co.gif"];
ddt[3]=["s_cso.gif"];
ddt[4]=["s_cs.gif"];
ddt[5]=["s_csw.gif"];
ddt[6]=["s_cw.gif"];
ddt[7]=["s_cnw.gif"];

AnzahlSpalten=1;
AnzahlZeilen=10;
var ziel = new Array (AnzahlSpalten);
var z=0;
var t="";
for (i=0; i<AnzahlSpalten; i++)
    {
      ziel[i]=new Array(AnzahlZeilen);
    }

function pop(ort,bak,dir)
{
switch(schema)
 {
 case "0":
		if (dir==7) 
			{
			dir=1;
			}
		if (dir==8) 
			{
			dir=2;
			}
		if (dir==9) 
			{
			dir=6;
			}
 		break;
 case "1":
		if (dir==1 || dir==7) 
			{
			dir=1;
			}
		else
			{	
			dir=6;
			}
 		break;
 case "2":
		if (dir==1 || dir==7) 
			{
			dir=1;
			}
		else
			{	
			if (dir==0 || dir==2 || dir==4)
		 		{
				 dir=4;
				}
			if (dir==3 || dir==5 || dir==8)
		 		{
	 			dir=5;
	 			}
		 	}
	 	break;
	}
var hdl=curs[dir];
var msg=ziel[dir];
if (msg.length > 0)
{
		var c ="<span style='background-color: #FFFFCC'><font face=Arial size=1>"+hdl+" "+msg+"&nbsp;</FONT></span>";
		if(isNS4){s.document.open();s.document.write(c);s.document.close();s.visibility="visible";}
		if(isNS6){document.getElementById("d1").style.position="absolute";document.getElementById("d1").style.left=x;document.getElementById("d1").style.top=y;document.getElementById("d1").innerHTML=c;s.visibility="visible";}
		if(isIE){document.all("d1").innerHTML=c;s.visibility="visible";}
}
}


function get_mouse(e){
x=(isNS4||isNS6)?e.pageX:event.clientX+document.body.scrollLeft;
y=(isNS4||isNS6)?e.pageY:event.clientY+document.body.scrollLeft;
if(isIE&&navigator.appVersion.indexOf("MSIE 4")==-1)y+=document.body.scrollTop;
s.left=x+Xo;s.top=y+Yo;
}

function kill(){s.visibility="hidden";}

function disp(ort,richt,spot)
//Richtung auslesen, neuen Standort definieren 
{

switch(schema)
 {
 case "0":
		if (richt==7) 
			{
			richt=1;
			}
		if (richt==8) 
			{
			richt=2;
			}
		if (richt==9) 
			{
			richt=6;
			}
 		break;
 case "1":
		richt=6;
 		break;
 case "2":
		if (richt==0 || richt==1 || richt==2 || richt==4)
	 		{
			 richt=4;
			}
		if (richt==3 || richt==5 || richt==7 || richt==8)
	 		{
	 		richt=5;
	 		}
		 break;
	}

var hier=db[ort][richt];

if (spot==1)
	{
	kill()
	}
disppic(hier,spot,richt)
dispbut(hier)
}	
	
function dispbut(hier)
// Buttons anzeigen
{
  if (hier>0)
  {
	var buttons=hier*1;
	var info=dbb[buttons][5];
	var audio=dbb[buttons][6];
	var video=dbb[buttons][7];
	if (dbb[buttons][0] > 0) { window.document.foto1.src=kennf+dbb[buttons][0]+"s.jpg"; }
	else {	window.document.foto1.src="foto_s.gif";	}
	if (dbb[buttons][1] > 0) { window.document.foto2.src=kennf+dbb[buttons][1]+"s.jpg"; }
	else {	window.document.foto2.src="foto_s.gif";	}
	if (dbb[buttons][2] > 0) { window.document.foto3.src=kennf+dbb[buttons][2]+"s.jpg"; }
	else {	window.document.foto3.src="foto_s.gif";	}
	if (dbb[buttons][3] > 0) { window.document.foto4.src=kennf+dbb[buttons][3]+"s.jpg"; }
	else {	window.document.foto4.src="foto_s.gif";	}
	if (dbb[buttons][4] > 0) { window.document.foto5.src=kennf+dbb[buttons][4]+"s.jpg"; }
	else {	window.document.foto5.src="foto_s.gif";	}
	if (info > 0) { window.document.rs_tx.src="book02.jpg"; } else  { window.document.rs_tx.src="book02_no.jpg"; }
	if (audio > 0) { window.document.rs_au.src="ear.jpg"; } else { window.document.rs_au.src="ear_no.jpg"; }
	if (video > 0) { window.document.rs_vi.src="eye.jpg"; } else { window.document.rs_vi.src="eye_no.jpg"; }
  }
}	
	
function clickbut(hier,button)
// Buttons click ausführen
{
if (hier>0)
	{
	var buttons=hier*1;
	switch(button)
 		{
 			case "0":
 			if (dbb[buttons][0]>0)
 				{
 				big_foto(dbb[buttons][0])
 				}
 			break;
 			case "1":
 			if (dbb[buttons][1]>0)
 				{
 				big_foto(dbb[buttons][1])
 				}
 			break;
 			case "2":
 			if (dbb[buttons][2]>0)
 				{
 				big_foto(dbb[buttons][2])
 				}
 			break;
 			case "3":
 			if (dbb[buttons][3]>0)
 				{
 				big_foto(dbb[buttons][3])
 				}
 			break;
 			case "4":
 			if (dbb[buttons][4]>0)
 				{
 				big_foto(dbb[buttons][4])
 				}
 			break;
 			case "5":
 			if (dbb[buttons][5]>0)
 				{
				new_window(dbb[buttons][5])
 				}
 			break;
 			case "6":
 			if (dbb[buttons][6]>0)
 				{
				new_wav(dbb[buttons][6])
 				}
 			break;
 			case "7":
 			if (dbb[buttons][7]>0)
 				{
				new_avi(dbb[buttons][7])
 				}
 			break;
		}
	}
}	


function disppic(hier,spot,richt)
// Wegfotos anzeigen	
{
if (hier>0)
	{
	bild=kenn + hier + ".jpg";
	window.document.weg.src=bild;
	standort=hier*1;
// Nummer im Titel mitanzeigen	
	if (check == 1)
		{
  	window.document.anzeige.ort.value = hier + ": " + db[standort][12];
  }
  else
  	{
    window.document.anzeige.ort.value = db[standort][12];
  	}

  //window.document.anzeige.testhier.value = hier;
	var links=db[standort][0]*1; //*1 wandelt in Zahl um
	var ruck=db[standort][1]*1;
	var vor=db[standort][2]*1;
	var rechts=db[standort][3]*1;
	var halbl=db[standort][4]*1;
	var halbr=db[standort][5]*1;
	var turn=db[standort][6]*1;
	clp = db[standort][7];
	xx = db[standort][8];
	yy = db[standort][9];
	dd = db[standort][10];

  //window.document.anzeige.test.value = "nw:"+halbl + ", w:" + links + ", s:" + ruck + ", n:" + vor + ", o:" + rechts + ", no:" + halbr;
	if (halbl > 0)
		{
		window.document.cnw.src="cnw.gif";
		if (check == 1)
			{
	  	window.document.anzeige.halbl.value = halbl+": "+db[halbl][12];
	  	}
	  else
	  	{	
	  	window.document.anzeige.halbl.value = db[halbl][12];
	  	}		
		}
	else
		{
		window.document.cnw.src="_dot.gif";
    window.document.anzeige.halbl.value = " ";
		}	
	if (links > 0)
		{
		window.document.cw.src="cw.gif";
		if (check == 1)
			{
	  	window.document.anzeige.links.value = links+": "+db[links][12];
	  	}
	  else
	  	{	
	  	window.document.anzeige.links.value = db[links][12];
	  	}		
		}
	else
		{
		window.document.cw.src="_dot.gif";
    window.document.anzeige.links.value = " ";
		}	
	if (ruck > 0)
		{
		window.document.cs.src="cs.gif";
		if (check == 1)
			{
	  	window.document.anzeige.ruck.value = ruck+": "+db[ruck][12];
	  	}
	  else
	  	{	
	  	window.document.anzeige.ruck.value = db[ruck][12];
	  	}
		}
	else
		{
		window.document.cs.src="_dot.gif";
    window.document.anzeige.ruck.value = " ";
		}	
	if (vor > 0)
		{
		window.document.cn.src="cn.gif";
		if (check == 1)
			{
	  	window.document.anzeige.vor.value = vor+": "+db[vor][12];
	  	}
	  else
	  	{	
		  window.document.anzeige.vor.value = db[vor][12];
		  }
		}
	else
		{
		window.document.cn.src="_dot.gif";
    window.document.anzeige.vor.value = " ";
		}	
	if (rechts > 0)
		{
		window.document.co.src="co.gif";
		if (check == 1)
			{
	  	window.document.anzeige.rechts.value = rechts+": "+db[rechts][12];
	  	}
	  else
	  	{	
	  	window.document.anzeige.rechts.value = db[rechts][12];
	  	}
		}
	else
		{
		window.document.co.src="_dot.gif";
    window.document.anzeige.rechts.value = " ";
		}	
	if (halbr > 0)
		{
		window.document.cno.src="cno.gif";
		if (check == 1)
			{
	  	window.document.anzeige.halbr.value = halbr+": "+db[halbr][12];
	  	}
	  else
	  	{	
		  window.document.anzeige.halbr.value = db[halbr][12];
		  }
		}
	else
		{
		window.document.cno.src="_dot.gif";
    window.document.anzeige.halbr.value = " ";
		}	
	if (turn > 0)
		{
		window.document.ct.src="ct.gif";
		if (check == 1)
			{
	  	window.document.anzeige.turn.value = turn+": "+db[turn][12];
	  	}
	  else
	  	{	
		  window.document.anzeige.turn.value = db[turn][12];
		  }
		}
	else
		{
		window.document.ct.src="_dot.gif";
    window.document.anzeige.turn.value = " ";
		}
set_cursor()		
}
ortn = standort*1
var x=0;
var t="";
var i;
// von i<10 auf i<8 ausgebessert, weil rest sind nicht Zieladressen sondern Cursorkoordinaten
for (i=0; i<8; i++)
    {
			x=(db[ortn][i])*1;
			if (x==0)
			{
			ziel[i]=""
			}
			else
			{
			t=db[x][12];
			ziel[i]=t
			}
    }
if (spot==1)
		{
		pop(standort,'lightyellow',richt)
		}

}	

function set_cursor()
{
	if (xx<6 || xx>164)
		{
		xx=85;
		}
	if (yy<6 || yy>134)
		{
		yy=70;
		}	
		
	var clip=kennc+clp+".jpg";		
	window.document.clip.src=clip;
	window.document.lo.width=xx-1;
	window.document.lo.height=yy-6;
	window.document.mo.height=yy-6;
	window.document.ro.width=169-xx;
	window.document.ro.height=yy-6;

	window.document.lm.width=xx-6;
	window.document.mm.src=ddt[dd];
	window.document.rm.width=164-xx;
	
	window.document.lu.width=xx-1;
	window.document.lu.height=134-yy;
	window.document.mu.height=134-yy;
	window.document.ru.width=169-xx;
	window.document.ru.height=134-yy;
}

function big_foto(nr) 
{
		var newWindow;
		var props = 'scrollBars=no,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=680,height=580';
		var bild = kennf+nr+".jpg"
		nr=nr*1
		var text = dptx[nr]
		newWindow = window.open("", nr, props);
		newWindow.document.write("<html><head><title>Einzelfoto - REALSIGHT</title></head><body onBlur='window.focus()' bgcolor='#91C1B1'>")
		newWindow.document.write("<h3>"+text+"</h3>")
		newWindow.document.write("<img src="+bild+" border=1>")
		newWindow.document.write("<form><input type='button' value='Foto schließen' OnClick='window.close()'></form>")
		newWindow.document.write("</body></html>")
}	

function new_avi(nr) 
{
		var newWindow;
		var props = 'scrollBars=no,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=380,height=380';
		var video = kennf+nr+".wmv"
		nr=nr*1
		//var text = dtx[nr]
		newWindow = window.open("", "avi", props);
		newWindow.document.write("<html><head><title>Video - REALSIGHT</title></head><body bgcolor='#91C1B1'>")
		//newWindow.document.write("<h3>"+text+"</h3>")
		newWindow.document.write("<img dynsrc='"+video+"' start='fileopen' alt='Daten werden geladen, bitte warten' width='350' height='290'>")
		newWindow.document.write("<form><input type='button' value='Fenster schließen' OnClick='window.close()'></form>")
		newWindow.document.write("</body></html>")
}	

function new_wav(nr) 
{
		var newWindow;
		var props = 'scrollBars=no,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=300,height=300';
		var wave = kennf+nr+".wav";
		nr=nr*1
		location.href=wave;
		//var text = dtx[nr]
		//newWindow = window.open("", "wav", props);
		//newWindow.document.write("<html><head><title>Wave - REALSIGHT</title></head><body bgcolor='#91C1B1'>")
		//newWindow.document.write("<h3>"+text+"</h3>")
		//newWindow.document.write("<object data='"+wave+"' type='audio/wav'></object>")
		//newWindow.document.write("<form><input type='button' value='Fenster schließen' OnClick='window.close()'></form>")
		//newWindow.document.write("</body></html>")
}	

function new_window(nr) 
{
		var newWindow;
		var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=520,height=460';
		newWindow = window.open(kenni+nr+".htm?rs",nr, props);
}

function big_map(getclp,getx,gety,getd,getstandort) 
{
		var newWindow;
		var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=720,height=540';
		getx=getx*1
		gety=gety*1
		if (getclp=='303' || getclp=='203' || getclp=='103' || getclp=='003')
			{
						var xxx = getx;	
			}
		if (getclp=='302' || getclp=='202' || getclp=='102' || getclp=='002')
			{
						var xxx = getx+170;				
			}
		if (getclp=='301' || getclp=='201' || getclp=='101' || getclp=='001')
			{
						var xxx = getx+340;				
			}
		if (getclp=='300' || getclp=='200' || getclp=='100' || getclp=='000')
			{
						var xxx = getx+510;				
			}
		if (getclp=='203' || getclp=='202' || getclp=='201' || getclp=='200')
			{
						var yyy = gety;	
			}
		if (getclp=='103' || getclp=='102' || getclp=='101' || getclp=='100')
			{
						var yyy = gety+140;				
			}
		if (getclp=='003' || getclp=='002' || getclp=='001' || getclp=='000')
			{
						var yyy = gety+280;				
			}
		newWindow = window.open("map.htm?"+getstandort+"&"+xxx+"&"+yyy+"&"+ddt[getd], "Realsight_big_map", props);
}

function checken() 
{
if (check == 0)
	{
	check = 1;
	}
gehezu = prompt("gehe zu Bild Nummer: (mit führenden Nullen!)","");
if(gehezu != "") disppic(gehezu);
}


function ende() 
{
if (confirm("Spaziergang beenden?")== true)
	{
	window.close();
	}
}

