//################################################################
// Copyright (c) 2001-2005 Rüdiger Stippa, all rights reserved
// Landeshauptstadt Erfurt - Stadtverwaltung
//
//################################################################


function newWIN(Url,Name,Opt) {
	if (Opt == 0) { // HP
	fenster = window.open(Url,Name,""); }
	else if (Opt == 1) { // URI
	fenster = window.open(Url,Name,"width=500,height=400,screenX=20,screenY=20,resizable=yes,menubar=no,scrollbars=yes"); }

//	fenster.focus();
}

function info(url) {
if (parent.NF.IF_status == 1) {
   	  newWIN(url,'ef_stadtplan_info',1);
	} else {
 	  parent.IF.location.href=url;
	}
	parent.NF.IF_url=url;
}

function P(id, name, sel)
{this.id=id;this.name=name;this.sel=sel;}
var p = new Array();

function Typ(nr, id, name, visi, art, uart, scale, z, ob_anz, objekte)
{this.nr=nr;this.id=id;this.name=name;this.visi=visi;this.art=art;this.uart=uart;this.scale=scale;this.z=z;this.ob_anz=ob_anz;this.objekte=objekte;}
var typ = new Array();

function Ob(tab, nr, id, name, left, top, s1, s2, n1, n2)
{this.tab=tab;this.nr=nr;this.id=id;this.name=name;this.left=left;this.top=top;this.s1=s1;this.s2=s2;this.n1=n1;this.n2=n2;}
var ob = new Array();

function TA1(sy_id, format, b, h)
{this.sy_id=sy_id;this.format=format;this.b=b;this.h=h;}
var ta1 = new Array();

function TA2(uart, bg_color, txt_color, f_family, f_size, f_style, f_weight)
{this.uart=uart;this.bg_color=bg_color;this.txt_color=txt_color;this.f_family=f_family;this.f_size=f_size;this.f_style=f_style;this.f_weight=f_weight;}
// weight=[normal,bold,bolder,lighter]
// style=[normal,italic]
// size=[xx-smal,x-smal,smal,medium,large,x-large,xx-large,smaller,larger]
// family=[Verdana, ....]
var ta2 = new Array();

function TA3(sbd_id, dicke, laenge, mx, modus, fg, bg)
{this.sbd_id=sbd_id;this.dicke=dicke;this.laenge=laenge;this.mx=mx;this.modus=modus;this.fg=fg;this.bg=bg;}
var ta3 = new Array();

function TA4(grid_id, dicke, color)
{this.grid_id=grid_id;this.dicke=dicke;this.color=color}
var ta4 = new Array();

function TA5(l_id, img, b, h, transparenz)
{this.l_id=l_id;this.img=img;this.b=b;this.h=h;this.transparenz=transparenz}
var ta5 = new Array();

function LL(nr,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25)
{this.nr=nr;this.p1=p1;this.p2=p2;this.p3=p3;this.p4=p4;this.p5=p5;this.p6=p6;this.p7=p7;this.p8=p8;this.p9=p9;
	this.p10=p10;this.p11=p11;this.p12=p12;this.p13=p13;this.p14=p14;this.p15=p15;this.p16=p16;this.p17=p17;this.p18=p18;this.p19=p19;
	this.p20=p20;this.p21=p21;this.p22=p22;this.p23=p23;this.p24=p24;this.p25=p25;}
var ll = new Array();

function obt(typ_nr,ob_nr)
{ if (Mode == 2) {return;} // wg. target-Problem
 var obt_z = 20000;
 var obt_zx = 20001;
 name = "T"+typ[typ_nr].id+"O"+ob[ob_nr].id;
 namex = "TX"+typ[typ_nr].id+"O"+ob[ob_nr].id;
 if (document.all)   // Netscape eval('document.layers[name].zIndex = obt_z');
 {
   if  ( typ[typ_nr].art <= 2 )
   {
	eval('document.all.'+name+'.style.borderStyle="solid"');
	eval('document.all.'+name+'.style.borderWidth="thin"');
	eval('document.all.'+name+'.style.borderColor="#000000"');
   }
   if  ( typ[typ_nr].art == 3 )
	 if (ob[ob_nr].n1 != 0 || ob[ob_nr].n2 != 0) // Anzeige 
		eval('document.all.'+namex+'.style.zIndex='+obt_zx);
   eval('document.all.'+name+'.style.zIndex='+obt_z);
 }
 else
 if (document.getElementById)
 {
   if  ( typ[typ_nr].art <= 2 )
   {
	eval('document.getElementById("'+name+'").style.borderStyle="solid"');
	eval('document.getElementById("'+name+'").style.borderWidth="thin"');
	eval('document.getElementById("'+name+'").style.borderColor="#000000"');
   }
   if  ( typ[typ_nr].art == 3 )
	 if (ob[ob_nr].n1 != 0 || ob[ob_nr].n2 != 0) // Anzeige 
		eval('document.getElementById("'+namex+'").style.zIndex='+obt_zx);
   eval('document.getElementById("'+name+'").style.zIndex='+obt_z);
 } 
}

function obb(typ_nr,ob_nr)
{ if (Mode == 2) {return;} // wg. target-Problem
  name = "T"+typ[typ_nr].id+"O"+ob[ob_nr].id;
  namex = "TX"+typ[typ_nr].id+"O"+ob[ob_nr].id;
  if (document.all)  // Netscape 4.x eval('document.layers[name].zIndex=typ[typ_nr].z');
  {
    if  ( typ[typ_nr].art <= 2 )
	eval('document.all.'+name+'.style.borderStyle="none"');
    eval('document.all.'+name+'.style.zIndex = typ[typ_nr].z');
    if ( typ[typ_nr].art == 3 )
	 if (ob[ob_nr].n1 != 0 || ob[ob_nr].n2 != 0) // Anzeige 
    	eval('document.all.'+namex+'.style.zIndex = typ[typ_nr].z');
  }
  else
  if (document.getElementById)
  {
    if  ( typ[typ_nr].art <= 2 )
	eval('document.getElementById("'+name+'").style.borderStyle="none"');
    eval('document.getElementById("'+name+'").style.zIndex = typ[typ_nr].z');
    if ( typ[typ_nr].art == 3 )
	 if (ob[ob_nr].n1 != 0 || ob[ob_nr].n2 != 0) // Anzeige 
		eval('document.getElementById("'+namex+'").style.zIndex = typ[typ_nr].z');    
  }
}

function GetTypNr(typ_id)
{
	for (var i=0; i < typ.length; i++)
	{
		if (typ[i].id == typ_id){
			return typ[i].nr;
		}
	}
}

function GetObNr(ob_id)
{
	for (var i=0; i < ob.length; i++)
	{
		if (ob[i].id == ob_id){
			return ob[i].nr;
		}
	}
	if (i == ob.length) return 0;
}

function Obb2(typ_id,ob_id)
{
	if (GetObNr(ob_id))
		obb(GetTypNr(typ_id),GetObNr(ob_id));
}

function Obt2(typ_id,ob_id)
{
	if (GetObNr(ob_id))
		obt(GetTypNr(typ_id),GetObNr(ob_id));
}

function PosObLocation(typ_id,ob_id)
{
	for (i=0; i < ob.length; i++)
	{
		if (ob[i].id == ob_id){
		 if (document.getElementById) {
			if (document.getElementById("LOCATION")) {document.getElementById("LOCATION").style.visibility = "hidden";}
			document.getElementById("ObLocation").style.left=ob[i].left - loc_h_w + left_korr;
			document.getElementById("ObLocation").style.top=ob[i].top - loc_h_h;
			document.getElementById("ObLocation").style.visibility = "visible";
			}
		 else if (document.all) {
			if (document.all.LOCATION) {document.all.LOCATION.style.visibility = "hidden";}
			document.all.ObLocation.style.left= ob[i].left - loc_h_w + left_korr;
			document.all.ObLocation.style.top= ob[i].top - loc_h_h;
			document.all.ObLocation.style.visibility = "visible";
			}
		 else if (document.layers) {
			if (document.layers["LOCATION"]) {document.layers["LOCATION"].visibility = "hide";}
			document.layers["ObLocation"].left=ob[i].left - loc_h_w + left_korr;
			document.layers["ObLocation"].top=ob[i].top - loc_h_h;
			document.layers["ObLocation"].visibility = "visible";
			}
//		obt(GetTypNr(typ_id),i);
		i = ob.length; // Gefunden
		}
		else {
			if (document.layers) { document.layers["ObLocation"].visibility = "hide"; }
			else if (document.getElementById) { document.getElementById("ObLocation").style.visibility = "hidden"; }
			else if (document.all) { document.all.ObLocation.style.visibility = "hidden"; }
		}
	}
}

function CreateCssABC(i)
{
	if (typ[i].scale != 0) // Maßstabsabhängige Skalierung des TX
	{
		if (typ[i].scale == -1)
		{ // vergrößern, Basiswert f_size für ME1
			fsize = Math.round((eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_size') * (Math.pow(3,ME-1)) / 20)) + eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_size');
		}
		else
		{ // verkleinern, Basiswert f_size für ME4
			fsize=Math.abs(eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_size') - Math.round((eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_size') * 27 / (Math.pow(3,ME-1)) / 20)));
		}
	}
	else
	{
		fsize=eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_size');
	}
	inhalt = 'div.t'+typ[i].id+'a'+typ[i].uart+', td.t'+typ[i].id+'a'+typ[i].uart+' { position:absolute;background-color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.bg_color')+';}';
	document.writeln(inhalt);
	inhalt = 'a.t'+typ[i].id+'a'+typ[i].uart+':link, a.t'+typ[i].id+'a'+typ[i].uart+':visited, a.t'+typ[i].id+'a'+typ[i].uart+':active {color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.txt_color')+'; font-family:'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_family')+'; font-size:'+fsize+'pt; font-style:'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_style')+'; font-weight:'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.f_weight')+'; text-decoration:none;}';
//	inhalt = 'a.t'+typ[i].id+'a'+typ[i].uart+':link, a.t'+typ[i].id+'a'+typ[i].uart+':visited, a.t'+typ[i].id+'a'+typ[i].uart+':active {color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.txt_color')+'; text-decoration:none;}';
	document.writeln(inhalt);
}


function CreateCssSBD(i)
{
	inhalt = 'div.t'+typ[i].id+'a'+typ[i].uart+' {border-style:solid;border-width:1px;border-color:#000000;}';
	document.writeln(inhalt);
}

function CreateCssGRID(i)
{
	if (Mode == 1 || Mode == 5) { // Drucken
		w = 650;
		h = 600;
	} else {
		w = 390;
		h = 360;
	}
	inhalt = 'div.h'+typ[i].id+'a'+typ[i].uart+' {width:'+w+'px;height:'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke')+'px;layer-background-color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.color')+';background-color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.color')+';font-size:1px;}';
	document.writeln(inhalt);
	inhalt = 'div.v'+typ[i].id+'a'+typ[i].uart+' {width:'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke')+'px;height:'+h+'px;layer-background-color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.color')+';background-color:#'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.color')+';font-size:1px;}';
	document.writeln(inhalt);

}

function CreateCssL(i)
{
}

function CreateCssTags()
{
 for (i=0; i < typ.length; ++i)
 {
	switch(typ[i].art){
	case 1:
	  break;
	case 2:
	  CreateCssABC(i);
	  break;
	case 3:
	  CreateCssSBD(i);
	  break;
	case 4:
	  CreateCssGRID(i);
	  break;
	case 5:
//	  CreateCssL(i);
	  break;
	}
 }
}

function CreateCssOb()
{
var k=0;
var l=0;
var visi, inhalt;

for (i=0; i < typ.length; ++i)
{
  if (typ[i].art == 5)
  {
    visi = (typ[i].visi == 0) ? "hidden" : "visible";
   	inhalt = '#T'+typ[i].id+'L'+typ[i].nr+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:0px; top:0px;}';
	document.writeln(inhalt);
  }
// objekte
 if ( typ[i].objekte == 1 )
 {
  for (j=0; j < typ[i].ob_anz; ++j)
  {
   visi = (typ[i].visi == 0) ? "hidden" : "visible";
   if (typ[i].art == 3)
   {
 	if (eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.modus') == 0) { // Säule
     	  var sbd_bg_h = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.laenge');
     	  vleft = ob[k].left + left_korr; // PX-Korr
     	  vtop = ob[k].top - sbd_bg_h;
	}
	else {
     	  var sbd_bg_w = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke');
     	  vleft = ob[k].left + left_korr; // PX-Korr
     	  vtop = ob[k].top - sbd_bg_w;
     	}
	inhalt = '#T'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+vtop+'px;}';
	document.writeln(inhalt);

	if (document.layers){ kl = 3; kt = 6;} else {kl = 0; kt = 0;}
 	if (eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.modus') == 0) { // Säule
//	  var sbd_fg_h = Math.round(ob[k].n1 * sbd_bg_h / ob[k].n1);
	  var sbd_fg_h = Math.round(ob[k].n2 * sbd_bg_h / ob[k].n1); //
	  vleft = ob[k].left + 1 + kl + left_korr; // PX-Korr
	  vtop = ob[k].top - sbd_fg_h + 1 + kt;
	}
	else {
	  var sbd_fg_w = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke');
	  vleft = ob[k].left + left_korr; // PX-Korr
	  vtop = ob[k].top - sbd_fg_w + 1 + kl;
	}
	if (ob[k].n1 != 0 || ob[k].n2 != 0) { // Anzeige 
     inhalt = '#TX'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+vtop+'px;}';
	 document.writeln(inhalt);
	}
   }
   else if (typ[i].art == 1)
   {
	if (typ[i].scale != 0) // Maßstabsabhängige Skalierung des SY
	{
		if (typ[i].scale == -1) { //MUL
		// Offset von 7 Pixeln Achtung!!!
		vleft = left_korr + Math.round(ob[k].left - (Math.pow(3,ME-1) * (ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b')) / 2));
		vtop = Math.round(ob[k].top - (Math.pow(3,ME-1) * (ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h')) / 2));
		} else { // DIV 27
		vleft = left_korr + Math.round(ob[k].left - ((ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b') / (Math.pow(3,ME_max) / 3 / Math.pow(3,ME-1))) / 2));
		vtop = Math.round(ob[k].top - ((ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h') / (Math.pow(3,ME_max) / 3 / Math.pow(3,ME-1))) / 2));
		}
	}
	else
	{
		// Offset von 7 Pixeln Achtung!!!
		vleft = left_korr + Math.round(ob[k].left - ((ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b')) / 2));
		vtop = Math.round(ob[k].top - ((ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h')) / 2));
	}

	inhalt = '#T'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+vtop+'px;}';
	document.writeln(inhalt);
   }
   else if (typ[i].art == 4)
   {
     	if ( Mode == 1) { // Drucken
     	  l = 0; t = 50; // 10 -> 0
     	} else {
     	  l = t = 5; // Rand
     	}
     	vleft = left_korr + ob[k].left; // PX-Korr
     	vtop = ob[k].top; // PY-Korr
		inhalt = '#TH'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+l+'px; top:'+vtop+'px;}';
		document.writeln(inhalt);
		inhalt = '#T'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+t+'px;}';
		document.writeln(inhalt);
   }
   else if (typ[i].art == 2)
   {
     	vleft = left_korr + ob[k].left; // PX-Korr
     	vtop = ob[k].top; // PX-Korr seit Neu anders
     	inhalt = '#T'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+vtop+'px;}';
		document.writeln(inhalt);
   }
   else
   {
     	vleft = left_korr + ob[k].left; // PX-Korr
     	vtop = top_korr + ob[k].top; // PX-Korr
     	inhalt = '#T'+typ[i].id+'O'+ob[k].id+' {z-index:'+typ[i].z+'; visibility:'+visi+'; left:'+vleft+'px; top:'+vtop+'px;}';
		document.writeln(inhalt);
   }
   k++;
   }
 } // IF Objekte
} // For Typ
} // Function End

function CreateStyle()
{
	document.writeln('<STYLE TYPE="text/css">');
	document.writeln('<!--');
 	CreateCssTags();
	CreateCssOb();
	document.writeln('-->');
	document.writeln('</STYLE>');

}

function CreateDivSY(i,k)
{
	var sy = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.sy_id')+'.'+eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.format');
	var w = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b');
	var h = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h');
	if (typ[i].scale != 0) // Maßstabsabhängige Skalierung des SY; default=0
	{
		if (typ[i].scale == -1) { // MUL
		var w = Math.pow(3,ME-1) * ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b');
		var h = Math.pow(3,ME-1) * ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h');
		} else { // DIV 27 
		var w = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b') / (Math.pow(3,ME_max) / 3 / Math.pow(3,ME-1));
		var h = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h') / (Math.pow(3,ME_max) / 3 / Math.pow(3,ME-1));
		}
	}
	else
	{
		var w = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.b');
		var h = ob[k].n1 / 100 * eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.h');
	}
	url = "../cgi-bin/info.plx?L="+L+"&typ="+typ[i].id+"&tab="+ob[k].tab+"&ob="+ob[k].id+"";
	inhalt = '<DIV ID="T'+typ[i].id+'O'+ob[k].id+'"><A HREF="javascript:info(\''+url+'\');"';
	document.write(inhalt);
	if (document.all || document.getElementById) { // OB on Top funktioniert bei Netscape 4.x nicht!
	 inhalt = ' onMouseOver="obt('+typ[i].nr+','+ob[k].nr+')" onMouseOut="obb('+typ[i].nr+','+ob[k].nr+')"';
	 document.write(inhalt);
	}
	inhalt = '><IMG SRC="../html/img/layer/'+sy+'" WIDTH='+w+' HEIGHT='+h+' BORDER=0 ALT="'+typ[i].name+': '+ob[k].name+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'"></A></DIV>';
	document.writeln(inhalt);
}

function CreateDivABC(i,k)
{
	 url = "../cgi-bin/info.plx?L="+L+"&typ="+typ[i].id+"&tab="+ob[k].tab+"&ob="+ob[k].id+"";
	 inhalt = '<DIV ID="T'+typ[i].id+'O'+ob[k].id+'" class="t'+typ[i].id+'a'+typ[i].uart+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'"><A class="t'+typ[i].id+'a'+typ[i].uart+'" HREF="javascript:info(\''+url+'\');"';
	 document.write(inhalt);
	 if (document.all || document.getElementById) { // OB on Top funktioniert bei Netscape 4.x nicht!
	  inhalt = ' onMouseOver="obt('+typ[i].nr+','+ob[k].nr+')" onMouseOut="obb('+typ[i].nr+','+ob[k].nr+')"';
	  document.write(inhalt);
	 }
	 inhalt = '>'+ob[k].name+'</A></DIV>';
	 document.writeln(inhalt);
}

function CreateDivSBD(i,k)
{ // variabler Text typabhängig organisieren!
  var sbd_bg = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.bg');
  var sbd_fg = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.fg');
  var sbd_diff = ob[k].n1 - ob[k].n2;
  if (eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.modus') == 0) {
	var sbd_bg_w = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke');
	var sbd_fg_w = sbd_bg_w;
	var sbd_bg_h = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.laenge');
	var sbd_fg_h = Math.round(ob[k].n2 * sbd_bg_h / ob[k].n1);
  }
  else {
	var sbd_bg_h = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.dicke');
	var sbd_fg_h = sbd_bg_h;
	var sbd_bg_w = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.laenge');
	var sbd_fg_w = Math.round(ob[k].n2 * sbd_bg_w / ob[k].n1);
  }
  url = "../cgi-bin/info.plx?L="+L+"&typ="+typ[i].id+"&tab="+ob[k].tab+"&ob="+ob[k].id+"";
  inhalt = '<DIV ID="T'+typ[i].id+'O'+ob[k].id+'" class="t'+typ[i].id+'a'+typ[i].uart+'"><A HREF="javascript:info(\''+url+'\');"';
  document.write(inhalt);
  if (document.all || document.getElementById) { // OB on Top funktioniert bei Netscape 4.x nicht!
  inhalt = ' onMouseOver="obt('+typ[i].nr+','+ob[k].nr+')" onMouseOut="obb('+typ[i].nr+','+ob[k].nr+')"';
  document.write(inhalt);
  }
  inhalt = '><IMG SRC="../html/img/layer/'+sbd_bg+'.gif" WIDTH='+sbd_bg_w+' HEIGHT='+sbd_bg_h+' BORDER=0 ALT="'+typ[i].name+': '+ob[k].name+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'; '+sbd_diff+'&nbsp;'+ob[k].s1+'&nbsp;'+ob[k].s2+'&nbsp;'+ob[k].n1+'"></A></DIV>';
  document.writeln(inhalt);

  if (ob[k].n1 != 0 || ob[k].n2 != 0) { // Anzeige 
  url = "../cgi-bin/info.plx?L="+L+"&typ="+typ[i].id+"&tab="+ob[k].tab+"&ob="+ob[k].id+"";
  inhalt = '<DIV ID="TX'+typ[i].id+'O'+ob[k].id+'"><A HREF="javascript:info(\''+url+'\');"';
  document.write(inhalt);

  if (document.all || document.getElementById) { // OB on Top funktioniert bei Netscape 4.x nicht!
  inhalt = ' onMouseOver="obt('+typ[i].nr+','+ob[k].nr+')" onMouseOut="obb('+typ[i].nr+','+ob[k].nr+')"';
  document.write(inhalt);
  }
	 
  inhalt = '><IMG SRC="../html/img/layer/'+sbd_fg+'.gif" WIDTH='+sbd_fg_w+' HEIGHT='+sbd_fg_h+' BORDER=0 ALT="'+typ[i].name+': '+ob[k].name+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'; '+sbd_diff+'&nbsp;'+ob[k].s1+'&nbsp;'+ob[k].s2+'&nbsp;'+ob[k].n1+'"></A></DIV>';
  document.writeln(inhalt);
  }

}

function CreateDivGRID(i,k)
{ // </A> hilft für die korrekte Dicke!
	 inhalt = '<DIV ID="TH'+typ[i].id+'O'+ob[k].id+'" class="h'+typ[i].id+'a'+typ[i].uart+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'"></A></DIV>';
	 document.writeln(inhalt);
	 inhalt = '<DIV ID="T'+typ[i].id+'O'+ob[k].id+'" class="v'+typ[i].id+'a'+typ[i].uart+'" TITLE="'+typ[i].name+':&#10'+ob[k].name+'"></A></DIV>';
	 document.writeln(inhalt);
}

function CreateDivL(i,l)
{	z = 200 - i;
	transparenz_ie = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.transparenz');
	transparenz = eval('ta'+typ[i].art+'['+typ[i].uart+']'+'.transparenz')/100;
	inhalt = '<DIV ID="T'+typ[i].id+'L'+typ[i].nr+'" STYLE="z-index:'+z+'">';
	document.write(inhalt);

	if (Mode == 1) // Drucken
		{ var k_left = 0; var k_top = 50; var z_sp_count = 5; var diff = 2;} // 10 -> 0
	else
		if (Mode == 5) // 5x5
		{ var k_left = 5; var k_top = 5; var z_sp_count = 5; var diff = 2;}
		else
		{ var k_left = 5; var k_top = 5; var z_sp_count = 3; var diff = 1;}
	var p = 1; var zaehler = 0;

	var Yvar = Y - diff;
	if (ME == 1 && (Mode == 1 || Mode == 5)) { Yvar++;}
	var z_top = 0
	for (z=0; z < z_sp_count; z++)
	{
		z_top = 120 * z + k_top;
		var Xvar = X - diff;
		if (ME == 1 && (Mode == 1 || Mode == 5)) { Xvar++;}
		s_left = 0;
		for (s=0; s < z_sp_count; s++)
		{
			s_left = 130 * s + k_left;
			if ( eval('ll[l].p'+p) == 1 )
			{
				if (ME == 1 && (Mode == 1 || Mode == 5)) {
				inhalt = '<DIV STYLE="top:'+z_top+'px; left:'+s_left+'px;"><IMG SRC="../layer/l'+ll[l].nr+'/me'+ME+'/y'+Yvar+'/xx'+Xvar+'.gif" width="130" height="120" style="filter:alpha(opacity='+transparenz_ie+'); opacity:'+transparenz+'; -moz-opacity:'+transparenz+';" border="0"></DIV>';
		//		alert(inhalt);
				} else {
				inhalt = '<DIV STYLE="top:'+z_top+'px; left:'+s_left+'px;"><IMG SRC="../layer/l'+ll[l].nr+'/me'+ME+'/y'+Yvar+'/x'+Xvar+'.gif" width="130" height="120" style="filter:alpha(opacity='+transparenz_ie+'); opacity:'+transparenz+'; -moz-opacity:'+transparenz+';" border="0"></DIV>';
				}
				document.writeln(inhalt);
				zaehler++;
			}
			p++;
			Xvar++;
		}
		Yvar++;
	}

	typ[i].ob_anz = zaehler;
	inhalt = '</DIV>';
	document.writeln(inhalt);
}

function CreateDiv()
{
// Art: SY, ABC, SBD, GRID, L
var inhalt;
var k=0;
var l=0;
var l_div=0; // Test
for (i=0; i < typ.length; ++i)
{
// objekte
 if ( typ[i].objekte == 1 )
 {
	for (j=0; j < typ[i].ob_anz; ++j)
	{
	   switch(typ[i].art)
	   {
		case 1:
			CreateDivSY(i,k);
			break;
		case 2:
			 CreateDivABC(i,k);
			break;
		case 3:
			CreateDivSBD(i,k);
			break;
		case 4:
			CreateDivGRID(i,k);
		 	break;
	    }
    	k++;
	}
 }
 if (typ[i].art == 5)
 {
   CreateDivL(i,l);
   l++;
 }

}

// ObLocation
inhalt='<div id="ObLocation" style="position:absolute;z-index:10000;visibility:hidden;left:0px;top:0px"><img src="../html/img/navigat/loc_gf.gif" border="0" width="'+loc_ob_w+'" heigth="'+loc_ob_h+'"></div>';
document.writeln(inhalt);
// Warten aus
	if (document.layers) { document.layers["WARTEN"].visibility = "hide"; }
	else if (document.getElementById) { document.getElementById("WARTEN").style.visibility = "hidden"; }
	else if (document.all) { document.all.WARTEN.style.visibility = "hidden"; }
	
if (document.all && Mode == 0 || Mode == 5) CreateDivGK();

}


