 var app=navigator.appName;     // Browseridentifikation
var vers=navigator.appVersion;
if (vers.length<1) vers="3.0";
vers=vers.substring(0,1);

var s=0;			// Aufrufende Rubrik (Ebene)
var i=0;			// Id der Kapsel in der Ebene
var flg=new Array();	// Flag je Kind-Kapsel
var boxv=new Array();	// Fenstervariable
var bxh=new Array();	// Fenstergröße
var bxhe="";		// Breite mal Höhe aus Eingabe
var bxha="";		//  aktuelles Fensterformat
var bxh_stand="width=500,height=500";	// Standard-Fensterformat
var a1="width=400,height=470";	// Fensterformat BuergermeisterIndex	
var a2="width=510,height=480";	// Fensterformat BotschaftenIndex
var a3="width=550,height=450";	// Fensterformat VerordneteIndex
var b1="width=501,height=490,left=0,top=0";	// Fensterformat Standardbilder
var user_left=440;				// Abstand linker Rand, 2. Ebene
var user_top=screen.height-500;				// Abstand von oben, 2. Ebene
var b2="width=500,height=490,left="+user_left+",top="+user_top;	// Fensterformat Standardbilder 2.Ebene
//var parm=',resizable=yes,scrollbars,status=yes,location=yes,menubar=no';
var parm=',resizable=yes,scrollbars,status=no,location=no,menubar=no';
var htm="";                    // Speicherort der gerufenen htm
var eb="";		// Speicherebene der rufenden htm
var quelle="";                 // anzuzeigende Datei, relativ
var qold="";		// angezeigte Datei, relativ
var winbox="";		// Fensternamen box+s+i
var n;		// Vierter Aufruf-Parameter, wenn vorhanden, dann
			// wird eine neue Kapselstufe geöffnet
			// 0 -ohne scrollbars; 1 -mit scrollbars
var serie=""		// Name der Serie für Dia-Show

function box(htm_in,bxhe_in,eb_in)     // Anzeigen der Fensterbox
{
htm=htm_in;bxhe=bxhe_in;eb=eb_in;
n=arguments.length;

for (k=1;k<=30;k++)		// Vordergrund erneuern
	{
	if (bxh[k]!=null)
		{
		if ((boxv[k]!=null)&&(boxv[k].closed==false)) boxv[k].focus();		
		}
	}

i=1;
if (bxhe_in=="") bxha=bxh_stand; else bxha=bxhe;
for (k=1;k<=30;k++)		// Gleichformatiges Fenster vorhanden?
	{
	if (bxh[k]!=null)
		{
		i=k+1;
		if (bxh[k]==bxha) 
		{	
			i=k;break}
		}	//ja
	}
if (serie!="" && parent.opener!=null) i=i+1;	// Aufruf Dia im schweb. Fenster
bxh[i]=bxha;		// Formatierung aus Eingabe speichern
//alert("Angefordert bxh["+i+"]:"+bxh[i]+"; "+htm);
winbox="box_"+s+"_"+i;
zugriff(htm,eb);
//alert("winbox "+s+"_"+i);
  if (boxv[i]!=null)			// ob Fenster schon geöffnet wurde
  {  if (boxv[i].closed==true)	// aber evtl. durch Nutzer geschlossen wurde
	 {  	HisAnz=1;							// Anzahl zum Blättern
		HisRueck=1;						
		HisVor=1;
         boxv[i]=window.open(quelle,winbox,bxha+parm);flg[i]=1;qold=quelle;	//  dann wieder öffnen	 
	 } 
     else 
         {if (quelle!=qold)		// ob Inhalt wechselt
		{
//alert("Inhalt wechseln  "+quelle);
                boxv[i]=window.open(quelle,winbox,bxha+parm);	// Inhalt wechseln
		flg[i]=1;qold=quelle;
		if (vers>3) {Timer()}}	// Fenster nach vorn holen
 
	 else  	

		 if (n==4)
		{
//alert("n=4 ");
		var quelle1=quelle;zugriff(serie,eb);
//		alert(quelle);
		boxv[i]=window.open(quelle,winbox,bxha+parm);
//		alert(quelle1);
		boxv[i]=window.open(quelle1,winbox,bxha+parm);	
		}
		else
		{
		if ((app!="Netscape")&&(vers==3))	// Wenn MS 3.x
			{boxv[i].close();qold="";j=1;	// Schließen bei wiederholtem Drücken
			for (k=0;k<=30;k++)
			 {if (boxv[k]!=null) {j=j+1;}}
			bxh[i]=j;flg[i]=0}
		else 
			{boxv[i].focus();}
		}
		
         }	// Ende Fenster aktualisieren
  }	// Ende Fenster war schon geöffnet
  else {	
	if ((parent.opener!=null)&&(n==3))
	 {
//	alert("Inhalt ersetzen"+quelle);
	     if (parent.opener.HisVor<parent.opener.HisAnz) parent.opener.HisAnz=parent.opener.HisVor;
	     parent.opener.HisAnz=parent.opener.HisAnz+1;			// Anzahl zum Blättern
	     parent.opener.HisRueck=parent.opener.HisRueck+1;
	     parent.opener.HisVor=parent.opener.HisAnz;
	     self.location.href=quelle;}		//im schwebenden Fenster bleiben


	else
         {
//	alert("neues Fenster "+winbox+"  "+quelle);
	   	HisAnz=1;							// Anzahl zum Blättern
		HisRueck=1;						
		HisVor=1;
//alert("Anzopen="+HisAnz);
	   boxv[i]=window.open(quelle,winbox,bxha+parm);flg[i]=1;qold=quelle;}	// neues Fenster
       }
}	// Ende box

function winclear()         // Aufräumen am Ende
{

for (k=1;k<=15;k++)
	{
	if (vers>3)
		{if ((boxv[k]!=null)&&(boxv[k].closed==false)) boxv[k].close();}
	else
		if ((boxv[k]!=null)&&(flg[k]==1)) {boxv[k].close();}
	}
}

function zugriff(htm,eb)      // spezifischer Zugriff
{ 
if (eb==0) quelle="/"+htm;
if (eb==1) quelle="../"+htm;
if (eb==2) quelle="../../"+htm;
if (eb==3) quelle="../../../"+htm;
if (eb==4) quelle="../../../../"+htm;
}

function Timer()
{
ruf="NachVorn()"
setTimeout(ruf,100);
setTimeout(ruf,1000);
setTimeout(ruf,2000);
}

function NachVorn()
{boxv[i].focus();}

function SetNavigation(idn,file){
term=idn+"?"+file;
if (parent.frames.length>0){;}
else {if (!parent.opener) Writtext(term);}
}

function Writtext(txt){
document.writeln("<table border=3 cellspacing=5 cellpadding=5><tr><td align=center >");
document.writeln("<p><a href='../../../Lexikon/indexlex.htm#"+txt+"' target=_top onMouseOver='if (window.click) click()'>");
document.writeln("<img src='../../../Lexikon/Allgemein/rettring.gif' alt='To Navigation!' width=80 height=60 border=0></a></p>");
document.writeln("<p>Keine Tasten zur Navigation angezeigt?<br> Greifen Sie zum Ring, und es wird Ihnen weiter geholfen!</p>");
document.writeln("</td></tr></table>");
}

function SetAktDat(erst){
if (Date.parse(document.lastModified)!=0)
	{pos=document.lastModified.indexOf(':');
	document.write(document.lastModified.substr(0,pos-3));}
else
	document.write(erst)
}

function dia(ser,pos){
serie=ser;		// Name der Dia-Serien-htm
//			   pos ist die Schachtelungstiefe der Aufrufposition
//alert(arguments.length+" "+serie);
if (parent.opener!=null) s=parent.opener.s+1;	//jede Serie im eigenen Fenster
if (arguments.length==3) box('Abbild/_navi/dia/Bildformat_Serie.htm',b2,pos,arguments[2])
 else
	{
	if (parent.opener!=null)
		{box('Abbild/_navi/dia/Bildformat_Serie.htm',b2,pos,0);}
	else
		{box('Abbild/_navi/dia/Bildformat_Serie.htm',b1,pos);}
	}
}

var ih;	// Bildmaße
var iw;
function ScreenSize(){
if(navigator.appName=="Netscape")
   {ih=innerHeight;iw=innerWidth;} 
   else
   {ih=document.body.offsetHeight;iw=document.body.offsetWidth;}
}// size
function wahl4(){
top.Punkt=4;
top.pr="all";
top.prfxa="../../lexikon/Alle/_Navi/L_all";
parent.Suchen.location="Allgemein/Lex_lokal.htm";
parent.Splitt.location="Alle/_Navi/L_all.htm";
parent.Pfad.location.href="Lex_Pfad.htm";
parent.Inhalt.location.href="txt_all.htm";
}

function wahl2(){
top.Punkt=2;
top.pr="mit";
top.prfxa="../../lexikon/Mitte/_navi/L_mit";
parent.Suchen.location="Allgemein/Lex_lokal.htm";
parent.Splitt.location="Mitte/_navi/L_mit.htm";
parent.Pfad.location.href="Lex_Pfad.htm";
parent.Indexv.location.href="Mitte/_navi/L_mit0000.htm";
parent.Inhalt.location.href="txt_mit.htm";

}

function wahl3(){
top.Punkt=3;
top.pr="fkr";
top.prfxa="../../lexikon/FrKr/_Navi/L_fkr";
parent.Suchen.location="Allgemein/Lex_lokal.htm";
parent.Splitt.location="FrKr/_Navi/L_fkr.htm";
parent.Pfad.location.href="Lex_Pfad.htm";
parent.Indexv.location.href="FrKr/_navi/L_fkr0000.htm";
parent.Inhalt.location.href="txt_fkr.htm";
}

function wahl5(){
top.Punkt=5;
top.pr="chw";
top.prfxa="../../lexikon/Chawi/_Navi/L_chw";
parent.Suchen.location="Allgemein/Lex_lokal.htm";
parent.Splitt.location="Chawi/_Navi/L_chw.htm";
parent.Pfad.location.href="Lex_Pfad.htm";
parent.Indexv.location.href="Chawi/_navi/L_chw0000.htm";
parent.Inhalt.location.href="txt_chw.htm";
}

var HisAnz;			//  Anzahl beim Blättern
var HisRueck;			//  im rufenden Frame.Inhalt. gesetzt. Aus dem Sekundärfenster 
var HisVor;			//  wird über parent.opener. zugegriffen

function Historie(l_anz){	//  Blättern im Sekundärfenster, Script beim Aufruf
ScreenSize();
if (parent.opener!=null){
if (parent==self) que=opener
else que=parent.opener;
HisAnz=que.HisAnz;HisRueck=que.HisRueck;HisVor=que.HisVor;
anz=HisAnz;rue=HisRueck;vor=HisVor;
document.write('<div id="his"><nobr>');
if (rue>1) document.write('<a href="javascript:Rueck()"><img src="../../Allgemein/show_l.gif" border=0 alt="r&uuml;ckw&auml;rts"></a>');
else document.write('<img src="../../Allgemein/pxl.gif" border=0 width=11 height=12>');
if (anz>1) document.write('<span class="kl"> Gesehenes </span>');
if (vor<anz) document.write('<a href="javascript:Vor()"><img src="../../Allgemein/show_r.gif" border=0 alt="vorw&auml;rts"></a>');
else document.write('<img src="../../Allgemein/pxl.gif" border=0 width=11 height=12>');
document.write('&#160;</nobr></div>');
}
} // Historie

function Rueck(anz){			//Blättern rückwärts
if (parent==self) que=opener
 else que=parent.opener;
que.HisRueck=que.HisRueck-1;que.HisVor=que.HisVor-1;
if (que.HisRueck==1) que.HisVor=1;
history.back();
}

function Vor(anz){			//Blättern vorwärts
if (parent==self) que=opener
 else que=parent.opener;
que.HisVor=que.HisVor+1;
que.HisRueck=que.HisRueck+1;
//alert("Vor:   A="+que.HisAnz+"    R="+que.HisRueck+"    V="+que.HisVor);
history.forward();
}


