
///////////////////////////////////////////////////////////////////////
// CONFIGURATION
///////////////////////////////////////////////////////////////////////

// Main background color (the large area)
	if (typeof fcolor == 'undefined') { var fcolor = "#f0f0f0";}
// Border color and color of caption
	if (typeof backcolor == 'undefined') { var backcolor = "#797979";}
// Text color
	if (typeof textcolor == 'undefined') { var textcolor = "#000000";}
// Text size
	if (typeof textsize == 'undefined') { var textsize = "-2";}
// Text face
	if (typeof textface == 'undefined') { var textface = "Arial";}
// Color of the caption text
	if (typeof capcolor == 'undefined') { var capcolor = "#F0F0F0";}
// Color of "Close" when using Sticky
	if (typeof closecolor == 'undefined') { var closecolor = "#FFFFBF";}
// Width of the popups in pixels
	if (typeof width == 'undefined') { var width = "200";}
// How thick the border should be in pixels
	if (typeof border == 'undefined') { var border = "1";}
// How many pixels to the right/left of the cursor to show the popup
	if (typeof offsetx == 'undefined') { var offsetx = 10;}
// How many pixels to the below the cursor to show the popup
	if (typeof offsety == 'undefined') { var offsety = 10;}	
///////////////////////////////////////////////////////////////////////
// END CONFIGURATION
///////////////////////////////////////////////////////////////////////

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// Microsoft Version
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) {
		ie5 = true;
	} else {
		ie5 = false; }
} else {
	ie5 = false;
}
////////////////////////////////////////////////////////////////////////////////////
//  NAV
////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////
//  setInfoText(txt)

function setInfoText(txt) {

	if ( ie4 ) {
		if ( txt != "" ) {
			
			if (txt.length > 50) {
				var sInfo = "<font style='font-family:Trebuchet MS,Verdana,Arial,Helvetica,Sans serif; font-size:9pt; color:#FFFFFF'><b><marquee width='100%' align=middle height=20 hspace=10 scrollamount='3'>" + txt + "</marquee></b></font>"
				//var sInfo = "<font style='font-family:Trebuchet MS,Verdana,Arial,Helvetica,Sans serif; font-size:9pt; color:#668557'><b><marquee width='100%' align=middle height=20 hspace=10 scrollamount='3'>" + txt + "</marquee></b></font>"
			} else {
				var sInfo = "<center><font style='font-family:Trebuchet MS,Verdana,Arial,Helvetica,Sans serif; font-size:9pt; color:#FFFFFF'><b>" + txt + "</b></font></center>"
			}
			
			targetElement = document.Select.all("title_t")
			targetElement.style.display = "none"
	
			targetElement = document.Select.all("info_t")
			targetElement.style.display = ""
	
			document.Select.all("info_t_z1").innerHTML = sInfo
			
		} else {
			
			targetElement = document.Select.all("title_t")
			if (targetElement) {
				targetElement.style.display = ""
			}
	
			targetElement = document.Select.all("info_t")
			targetElement.style.display = "none"
			
		}
	}
}	

////////////////////////////////////////////////////////////////////////////////////
//  setBez()

function setBez()
{
	var docMapTitle = top.body.map.document.title
	var docSMapTitle = top.body.panel.panelbot.smap.document.title
   	var bez = parseInt(document.Select.Bez.value)
	
	if ( bez >= 1 && bez <= 23 ) {
		if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			var frmMap = top.body.map.document.Select
		
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				frmMap.Bez.value = document.Select.Bez.value
	        }
	    }
	    if (top.body && top.body.panel && top.body.panel.panelbot && top.body.panel.panelbot.smap && top.body.panel.panelbot.smap.document && top.body.panel.panelbot.smap.document.Select) {
			var docSMapTitle = top.body.panel.panelbot.smap.document.title
			var frmSMap = top.body.panel.panelbot.smap.document.Select

			if ( docSMapTitle == "ADVGdvMoKANIS - SMap" ) {
				//frmSMap.Bez.value = document.Select.Bez.value
			}
		}	
	} else {
		document.Select.Bez.value = ""
	}
}

////////////////////////////////////////////////////////////////////////////////////
//  setRes(res)

function setRes(res)
{
	// Focus nehmen
	if (top.body && top.body && top.body.map) {
		top.body.map.focus()
	}
		
	if (res == "low") {
		
		document.Select.low.src = "../images/a_low.gif"
		document.Select.medium.src = "../images/medium.gif"
		document.Select.high.src = "../images/high.gif"
		document.Select.align.src = "../images/align.gif"
		
		if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			var frmMap = top.body.map.document.Select
		
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				frmMap.MapRes.value = "Low"
			}
		}
	}
		
	if (res == "medium") {
		document.Select.low.src = "../images/low.gif"
		document.Select.medium.src = "../images/a_medium.gif"
		document.Select.high.src = "../images/high.gif"
		document.Select.align.src = "../images/align.gif"
			
		if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			var frmMap = top.body.map.document.Select
		
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				frmMap.MapRes.value = "Medium"
			}
		}
	}
	
	if (res == "high") {
		document.Select.low.src = "../images/low.gif"
		document.Select.medium.src = "../images/medium.gif"
		document.Select.high.src = "../images/a_high.gif"
		document.Select.align.src = "../images/align.gif"
		if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			var frmMap = top.body.map.document.Select
		
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				frmMap.MapRes.value = "High"
			}
		}
	}
	
	if (res == "align") {
	
		document.Select.low.src = "../images/low.gif"
		document.Select.medium.src = "../images/medium.gif"
		document.Select.high.src = "../images/high.gif"
		document.Select.align.src = "../images/a_align.gif"
		
		if (top.body && top.body && top.body.map) {
			//var clientWidth = top.body.map.document.body.clientWidth
			//var clientHeight = top.body.map.document.body.clientHeight
			if (ns4) {
				var clientWidth = top.body.map.innerWidth
				var clientHeight = top.body.map.innerHeight - 25
			} else {
				var clientWidth = top.body.map.document.body.offsetWidth
				var clientHeight = top.body.map.document.body.offsetHeight			
			}
			document.Select.ClientWidth.value = clientWidth
			document.Select.ClientHeight.value = clientHeight
			var frmMap = top.body.map.document.Select
			frmMap.ClientWidth.value = clientWidth
			frmMap.ClientHeight.value = clientHeight
		}
		
		if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			var frmMap = top.body.map.document.Select
		
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				frmMap.MapRes.value = "Align"
			}
		}
	}

	fu('Redraw')
}

////////////////////////////////////////////////////////////////////////////////////
//  setZoomfac()

function setZoomfac()
{	
	var zoomfac = parseInt(document.Select.Zoomfac.value)

	if ( zoomfac < 2 || zoomfac > 40 ) {
		zoomfac = 2
		document.Select.Zoomfac.value = zoomfac
	} 
	
	if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
		var docMapTitle = top.body.map.document.title
		var frmMap = top.body.map.document.Select
		
		if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
			frmMap.Zoomfac.value = zoomfac
		}
	}
	
	if (top.body && top.body.panel && top.body.panel.panelbot && top.body.panel.panelbot.smap && top.body.panel.panelbot.smap.document && top.body.panel.panelbot.smap.document.Select) {
		var docSMapTitle = top.body.panel.panelbot.smap.document.title
		var frmSMap = top.body.panel.panelbot.smap.document.Select

		if ( docSMapTitle == "ADVGdvMoKANIS - SMap" ) {
			//frmSMap.Zoomfac.value = zoomfac
		}
	}
}


////////////////////////////////////////////////////////////////////////////////////
//  doKeypress()

function doKeypress(code)
{
	var ua = window.navigator.userAgent;
    var msie = ua.indexOf ( "MSIE " )
    	
	if ( msie > 0 ) {
		if ( window.event.keyCode == 13 ) {
			fu('Redraw')
		}
	}
}

////////////////////////////////////////////////////////////////////////////////////
//  maximize()
function maximize(){}

////////////////////////////////////////////////////////////////////////////////////
//  openprintpage()

function openprintpage()
{	
	var URL = "";

	if (top.body && top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
		var docMapTitle = top.body.map.document.title

		if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
						
			//var sURL = "/gdvmo/scripts/esrimap.dll"
			var sURL = "../scripts/esrimap.dll"
       		var frmMap = top.body.map.document.Select

			dimHeightScreen = 860
			dimWidthScreen = 1080

			var sArg = "width=" + dimWidthScreen + ",height=" + dimHeightScreen + ",locationbar=yes,toolbar=yes,resizable=yes,scrollbars=yes,menubar=yes,status=yes"
		
			sURL = sURL + "?Name=" + frmMap.Name.value
			sURL = sURL + "&Cmd=NewWindowMap"
				
			sURL = sURL + "&Left=" + frmMap.Left.value
			sURL = sURL + "&Bottom=" + frmMap.Bottom.value
			sURL = sURL + "&Right=" + frmMap.Right.value
			sURL = sURL + "&Top=" + frmMap.Top.value
		
			if (frmMap.Laybez.value == 'on')
				sURL = sURL + "&Laybez=" + frmMap.Laybez.value
			if (frmMap.Laykggrenzen.value == 'on')
				sURL = sURL + "&Laykggrenzen=" + frmMap.Laykggrenzen.value
			if (frmMap.Layadrstr.value == 'on')
				sURL = sURL + "&Layadrstr=" + frmMap.Layadrstr.value
			if (frmMap.Layadrhnr.value == 'on')
				sURL = sURL + "&Layadrhnr=" + frmMap.Layadrhnr.value
			if (frmMap.Layhaltung.value == 'on')
				sURL = sURL + "&Layhaltung=" + frmMap.Layhaltung.value
			if (frmMap.Layschacht.value == 'on')
				sURL = sURL + "&Layschacht=" + frmMap.Layschacht.value
			sURL = sURL + "&CheckLayOEV=" + frmMap.CheckLayOEV.value

			var PrintWindows= window.open(sURL,"PrintWindow",sArg);

			document.Select.print.src = "../images/print.gif"
			
		}
	}
}


////////////////////////////////////////////////////////////////////////////////////
//  switchhelp()

function switchhelp()
{
	var b = document.Select.mousehelp.src
	var status = document.Select.mousehelp.value

	if (status == 'on') {
		bImg = '../images/' + 'mousehelp.gif'
		document.Select.mousehelp.src = bImg
		document.Select.mousehelp.value = "off"
	} else {
		bImg = '../images/' + 'a_mousehelp.gif'
		document.Select.mousehelp.src = bImg
		document.Select.mousehelp.value = "on"
	}		
	//alert(status);
}


////////////////////////////////////////////////////////////////////////////////////
//  ShowToolTip(eSrc)

function ShowToolTip(eSrc)
{

	//var eSrc = window.event.srcElement	

	//alert(eSrc.id);
	//alert(eSrc);

	var mousehelp = document.Select.mousehelp.value
	
	if (mousehelp == 'off') {
		return
	}
	
	if (typeof eSrc.id != 'undefined')
	{
	//alert(eSrc.id);
	
		switch(eSrc.id)
		{
			case 'zoomin_center':
				offsetx=15;
				offsety=-5;
				width=120;
				drs('ZoomIn zentrisch'); return true;
				//break;
			case 'zoomout_center':
				offsetx=15;
				offsety=-5;
				width=130;
				drs('ZoomOut zentrisch'); return true;
				//break;
			case "fullview":
				offsetx=15;
				offsety=-5;
				width=150;
				drs('Ganz Wien darstellen'); return true;
				//break;
			case "redraw":
				offsetx=15;
				offsety=-5;
				width=100;
				drs('Neu Zeichnen'); return true;
				//break;
			case "adr":
				offsetx=15;
				offsety=-5;
				width=250;
				drs('Eingabemaske für ADRESSENSUCHE'); return true;
				//break;
			case "help":
				offsetx=15;
				offsety=-5;
				width=110;
				drs('Hilfestellung'); return true;
				//break;
			case "print":
				offsetx=15;
				offsety=-5;
				width=340;
				drs('Karte für Druck (800x600 Querformat) aufbereiten'); return true;
				//break;
			case "low":
				offsetx=15;
				offsety=-5;
				width=230;
				drs('Geringe Auflösung (400x300 Pixel)'); return true;
				//break;
			case "medium":
				offsetx=15;
				offsety=-5;
				width=240;
				drs('Mittlere Auflösung (640x480 Pixel)'); return true;
				//break;
			case "high":
				offsetx=15;
				offsety=-5;
				width=230;
				drs('Hohe Auflösung (800x600 Pixel)'); return true;
				//break;
			case "align":
				offsetx=15;
				offsety=-5;
				width=210;
				drs('Optimal angepasste Auflösung'); return true;
				//break;
			case "pan":
				offsetx=15;
				offsety=-15;
				width=100;
				drs('Verschieben'); return true;
				//break;
			case "zoomin":
				offsetx=15;
				offsety=-15;
				width=180;
				drs('Vergrößern und Verschieben'); return true;
				//break;
			case "zoomout":
				offsetx=15;
				offsety=-15;
				width=190;
				drs('Verkleinern und Verschieben'); return true;
				//break;
			case "identify":
				offsetx=15;
				offsety=-15;
				width=260;
				drs('Information zum aktiven Thema abrufen'); return true;
				//break;
			case "order":
				offsetx=15;
				offsety=-15;
				width=220;
				drs('Gebiet für Bestellung definieren'); return true;
			case "measure":
				offsetx=15;
				offsety=-15;
				width=120;
				drs('Strecke messen'); return true;
				//break;
		}
	}
	
	if (typeof eSrc != 'undefined')
	{
			switch(eSrc)			
		{
			case 'bez':
				offsetx=15;
				offsety=-10;
				width=200;
				drs('1. Bezirksnummer eingeben<br>2. Return drücken'); return true;
			case 'width':
				offsetx=15;
				offsety=-7;
				width=250;
				drs('1. Breite des Bildausschnitts eingeben<br>2. Return drücken'); return true;
				//break;
			case 'zoom':
				offsetx=15;
				offsety=-10;
				width=270;
				drs('Zoomfaktor für Zoomfunktionen bestimmen'); return true;
				//break;
		}
	}
}


////////////////////////////////////////////////////////////////////////////////////
//  HideToolTip()

function HideToolTip()
{
	nd(); return true;	
}

////////////////////////////////////////////////////////////////////////////////////
//  OnMouseOverEvent()

function OnMouseOverEvent() {
	var eSrc = window.event.srcElement	
	var sMapRes = ""
	var sOnClick = ""
	var sKooType = ""
	var sSrcImg
	var bIsBusy = parseInt(document.Select.IsBusy.value)
	var mousehelp = document.Select.mousehelp.value

	if (mousehelp == 'on') {
		ShowToolTip(eSrc);
	}
    
    if (bIsBusy) {
		//alert('busy')
		return
	}
	if (document.Select && document.Select.MapRes) {
		sMapRes = document.Select.MapRes.value	
		sMapRes = sMapRes.toLowerCase()
	}
	if (document.Select && document.Select.OnClick) {
		sOnClick = document.Select.OnClick.value
		sOnClick = sOnClick.toLowerCase()	
	}
	//alert(sOnClick)
	//alert(eSrc)
	//alert(eSrc.id)
	//alert(sKooType)
	if (document.Select && document.Select.KooType) {
		sKooType = document.Select.KooType.value
	}
	if (eSrc.id == "koo") {
		if (sKooType == "" && mousehelp == "on") {
			return
		}
		if (sKooType == "LP") {
			sSrcImg = '../images/' + 's_xy.gif'
			document.images("koo").src = sSrcImg
			if (mousehelp == 'on') {
				offsetx=15;
				offsety=-12;
				width=300;
				drs('Umschalten auf die Ausgabe von<br>Gauß-Krüger-Koordinaten in der Statuszeile');
			}
			return
		}
		if (sKooType == "BL") {
			sSrcImg = '../images/' + 's_lamphi.gif'
			document.images("koo").src = sSrcImg
			if (mousehelp == 'on') {
				offsetx=15;
				offsety=-12;
				width=230;
				drs('Umschalten auf die Ausgabe von<br>Weltkoordinaten in der Statuszeile');
			}
			return
		}
		if (sKooType == "GK") {
			sSrcImg = '../images/' + 's_blatt.gif'
			document.images("koo").src = sSrcImg
			if (mousehelp == 'on') {
				offsetx=15;
				offsety=-12;
				width=230;
				drs('Umschalten auf die Ausgabe von<br>Blattnummern in der Statuszeile');
			}
			return
		}
	}
	
	if (sMapRes == "" || eSrc.id == sMapRes) {
		ShowToolTip(eSrc);
		return
	} 
	if (sOnClick == "" || eSrc.id == sOnClick) {
		return
	}

	if (eSrc.id == 'mousehelp') {
		if (mousehelp == "off") {
			sSrcImg = '../images/' + 's_mousehelp.gif'
			document.images(eSrc.id).src = sSrcImg
		}
		offsetx=15;
		offsety=-5;
		width=180;
		drs('Sie können die automatische Mausinfo ein/ausschalten');
		return
	}

	sSrcImg = '../images/' + 's_' + eSrc.id + '.gif'
    document.images(eSrc.id).src = sSrcImg
    //alert (sSrcImg);
}

////////////////////////////////////////////////////////////////////////////////////
//  OnMouseOutEvent()

function OnMouseOutEvent() {
    var eSrc = window.event.srcElement
    var sMapRes = ""
    var sOnClick = ""
    var sKooType = ""
    var sSrcImg
    var bIsBusy = parseInt(document.Select.IsBusy.value)
	var mousehelp = document.Select.mousehelp.value
    
	HideToolTip();

    if (bIsBusy) {
		//alert('busy')
		return
	}	
	if (document.Select && document.Select.MapRes) {
		sMapRes = document.Select.MapRes.value
		sMapRes = sMapRes.toLowerCase()	
	}
	if (document.Select && document.Select.OnClick) {
		sOnClick = document.Select.OnClick.value
		sOnClick = sOnClick.toLowerCase()	
	}
	if (document.Select && document.Select.KooType) {
		sKooType = document.Select.KooType.value
	}
	if (eSrc.id == "koo") {
		if (sKooType == "") {
			return
		}
		if (sKooType == "LP") {
			sSrcImg = '../images/' + 'xy.gif'
			sSrcImg = '../images/' + 'lamphi.gif'
			document.images("koo").src = sSrcImg
		}
		if (sKooType == "BL") {
			sSrcImg = '../images/' + 'blatt.gif'
			document.images("koo").src = sSrcImg
		}
		if (sKooType == "GK") {
			sSrcImg = '../images/' + 'lamphi.gif'
			sSrcImg = '../images/' + 'xy.gif'
			document.images("koo").src = sSrcImg
		}
		return
	}
	if (sMapRes == "" || eSrc.id == sMapRes) {
		return
	}
	if (sOnClick == "" || eSrc.id == sOnClick) {
		return
	}

	if (eSrc.id == 'mousehelp') {
		if (mousehelp == "off") {
			sSrcImg = '../images/' + 'mousehelp.gif'
			document.images(eSrc.id).src = sSrcImg
		}
		return
	}

    sSrcImg = '../images/' + eSrc.id + '.gif'
    document.images(eSrc.id).src = sSrcImg
}



////////////////////////////////////////////////////////////////////////////////////
//  LAYER
////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////
//  setLayer()

function setLayer(lay)
{
	var docMapTitle = top.body.map.document.title
	var docSMapTitle = top.body.panel.panelbot.smap.document.title
	var laystat
	//alert(lay);


	if (lay == "bez") {
		if (document.Select.Laybez.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Laybez.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}

	if (lay == "kggrenzen") {
		if (document.Select.Laykggrenzen.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Laykggrenzen.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}

	if (lay == "adrstr") {
		if (document.Select.Layadrstr.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Layadrstr.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}
	
	if (lay == "adrhnr") {
		if (document.Select.Layadrhnr.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Layadrhnr.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}
	
	if (lay == "haltung") {
		if (document.Select.Layhaltung.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Layhaltung.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}

	if (lay == "schacht") {
		if (document.Select.Layschacht.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Layschacht.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}

	if (lay == "index") {
		if (document.Select.Layindex.checked) {
			laystat = "on"
		} else {
			laystat = "off"
		}
		if (top.body && top.body && top.body.map && top.body.map.document.Select) {
			var docMapTitle = top.body.map.document.title
			if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
				top.body.map.document.Select.Layindex.value = laystat
				top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
			}
		}
	}

}

////////////////////////////////////////////////////////////////////////////////////
//  doExpand()

function doExpand(){

	var targetElement, targetID, srcElement

	srcElement = window.event.srcElement

	if (srcElement.className == "ExpandLayer") {
	
		targetID = srcElement.id + "d"
		imgExpandLayer = srcElement.id + "exp"
		targetElement = document.Select.all(targetID)
			
		if (targetElement.style.display == "none") {
			targetElement.style.display = ""
			document.Select.all(imgExpandLayer).src = "../images/up.gif"
		} else {
			targetElement.style.display = "none"
			document.Select.all(imgExpandLayer).src = "../images/down.gif"
		}
	}
}



////////////////////////////////////////////////////////////////////////////////////
//  checkLayRBW(lay) 
function checkLayRBW(lay) {}


////////////////////////////////////////////////////////////////////////////////////
//  checkLayKAT(lay)
function checkLayKAT(lay) {}

////////////////////////////////////////////////////////////////////////////////////
//  checkLayOEV(lay)

function checkLayOEV(lay) {
	
	var checkoev = 0		

	if ( document.Select.Layoev.checked ) {	
		checkoev += Math.pow(2,0)	
	}
		
	if (top.body && top.body.map && top.body.map.document && top.body.map.document.Select) {
		var docMapTitle = top.body.map.document.title
		var frmMap = top.body.map.document.Select
		
		if ( docMapTitle == "ADVGdvMoKANIS - Map" ) {
			frmMap.CheckLayOEV.value = checkoev
			top.nav.document.Select.redraw.src = "../images/redraw_red.gif"
		}
	}
}


////////////////////////////////////////////////////////////////////////////////////
//  Neue Routine um Fehler abzufangen//  ATOS ORIGIN DM
////////////////////////////////////////////////////////////////////////////////////
function stopErrors() 
{
 return true;
}


////////////////////////////////////////////////////////////////////////////////////
//  MA30 Seiten//  NETSCAPE
////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////
//  over functions()
function allover() {	

	window.onerror = stopErrors;

	var eSrc = window.event.srcElement;
	var eSrcId = eSrc.id;
	document.all(eSrcId).style.color="#000099";

}
function nsallover() {	
	//alert(document.preisinfo.name);
	alert(document.preisinfo.name);
	//document.preisinfo.style.color="#000099";
}





////////////////////////////////////////////////////////////////////////////////////
//  out functions()
function allout() {	

	window.onerror = stopErrors;
	
	var eSrc = window.event.srcElement;
	var eSrcId = eSrc.id;
	document.all(eSrcId).style.color="white";

}

////////////////////////////////////////////////////////////////////////////////////
//  

var x = 0;var y = 0;
var snow = 0;
var sw = 0;
var cnt = 0;
var dir = 1;
//var tr = 1;//alert(ns4);//alert(ie4);
if (ns4) {
	//alert(document.overDiv);
	if (typeof (document.overDiv) != 'undefined') {
		if (ns4) over = document.overDiv
		document.onmousemove = mouseMove
		if (ns4) document.captureEvents(Event.MOUSEMOVE)
		//alert(over);
	}}
if (ie4) {
	//alert(overDiv);
	if (typeof (overDiv) != 'undefined') {
		if (ie4) over = overDiv.style
		document.onmousemove = mouseMove
		//alert(over);
	}}
//if ( (ns4) || (ie4) ) {
//	if (ns4) over = document.overDiv
//	if (ie4) over = overDiv.style
//	document.onmousemove = mouseMove
//	if (ns4) document.captureEvents(Event.MOUSEMOVE)
//}

// Public functions to be used on pages.

// Simple popup right
function drs(text) {
	dts(1,text);
}

// Caption popup right
function drc(text, title) {
	dtc(1,text,title);
}

// Sticky caption right
function src(text,title) {
	stc(1,text,title);
}

// Simple popup left
function dls(text) {
	dts(0,text);
}

// Caption popup left
function dlc(text, title) {
	dtc(0,text,title);
}

// Sticky caption left
function slc(text,title) {
	stc(0,text,title);
}

// Simple popup center
function dcs(text) {
	dts(2,text);
}

// Caption popup center
function dcc(text, title) {
	dtc(2,text,title);
}

// Sticky caption center
function scc(text,title) {
	stc(2,text,title);
}

// Clears popups if appropriate
function nd() {
	if ( cnt >= 1 ) { sw = 0 };
	if ( (ns4) || (ie4) ) {
		if ( sw == 0 ) {
			snow = 0;
			hideObject(over);
		} else {
			cnt++;
		}
	}
}

// Non public functions. These are called by other functions etc.

// Simple popup
function dts(d,text) {
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Comic Sans MS\" COLOR=\""+textcolor+"\" SIZE=\""+textsize+"\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	//txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Comic Sans MS\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	//txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><FONT FACE=\"Arial,Helvetica\" COLOR=\""+textcolor+"\" SIZE=\"-2\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
}

// Caption popup
function dtc(d,text, title) {
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT SIZE=\""+textsize+"\" FACE=\""+textface+"\" COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT SIZE=\""+textsize+"\" FACE=\""+textface+"\" COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
}

// Sticky
function stc(d,text, title) {
	sw = 1;
	cnt = 0;
	txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT SIZE=\""+textsize+"\" FACE=\""+textface+"\" COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT SIZE=\""+textsize+"\" COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT size=\""+textsize+"\"+ face=\""+textface+"\"+ COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
	//txt = "<TABLE WIDTH="+width+" BORDER=0 CELLPADDING="+border+" CELLSPACING=0 BGCOLOR=\""+backcolor+"\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD><SPAN ID=\"PTT\"><B><FONT COLOR=\""+capcolor+"\">"+title+"</FONT></B></SPAN></TD><TD ALIGN=RIGHT><A HREF=\"/\" onMouseOver=\"cClick();\" ID=\"PCL\"><FONT COLOR=\""+closecolor+"\">Close</FONT></A></TD></TR></TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\""+fcolor+"\"><TR><TD><SPAN ID=\"PST\"><FONT COLOR=\""+textcolor+"\">"+text+"</FONT><SPAN></TD></TR></TABLE></TD></TR></TABLE>"
	layerWrite(txt);
	dir = d;
	disp();
	snow = 0;
}

// Common calls
function disp() {
	if ( (ns4) || (ie4) ) {
		if (snow == 0) 	{
			if (dir == 2) { // Center
				moveTo(over,x+offsetx-(width/2),y+offsety);
			}
			if (dir == 1) { // Right				//offsetx=20
				moveTo(over,x+offsetx,y+offsety);
			}
			if (dir == 0) { // Left
				moveTo(over,x-offsetx-width,y+offsety);
			}
			showObject(over);
			snow = 1;
		}
	}
// Here you can make the text goto the statusbar.
}

// Moves the layer
function mouseMove(e) {
	if (ns4) {x=e.pageX; y=e.pageY;}
	if (ie4) {x=event.x; y=event.y;}
	if (ie5) {x=event.x+document.body.scrollLeft; y=event.y+document.body.scrollTop;}
	if (snow) {
		if (dir == 2) { // Center
			moveTo(over,x+offsetx-(width/2),y+offsety);
		}
		if (dir == 1) { // Right
			moveTo(over,x+offsetx,y+offsety);
		}
		if (dir == 0) { // Left
			moveTo(over,x-offsetx-width,y+offsety);
		}
	}
}

// The Close onMouseOver function for Sticky
function cClick() {
	hideObject(over);
	sw=0;
}

// Writes to a layer
function layerWrite(txt) {
        if (ns4) {
                var lyr = document.overDiv.document
                lyr.write(txt)
                lyr.close()
        }
        else if (ie4) document.all["overDiv"].innerHTML = txt
//		if (tr) { trk(); }
}

// Make an object visible
function showObject(obj) {
        if (ns4) obj.visibility = "show"
        else if (ie4) obj.visibility = "visible"
}

// Hides an object
function hideObject(obj) {
        if (ns4) obj.visibility = "hide"
        else if (ie4) obj.visibility = "hidden"
}

// Move a layer
function moveTo(obj,xL,yL) {
        obj.left = xL
        obj.top = yL
}

//function trk() {
//	if ( (ns4) || (ie4) ) {
//			nt=new Image(32,32); nt.src="http://www.nedstat.nl/cgi-bin/nedstat.gif?name=ol2t";
//			bt=new Image(1,1); bt.src="http://www.bosrup.com/web/overlib/o2/tr.gif";
//			refnd=new Image(1,1); refnd.src="http://www.nedstat.nl/cgi-bin/referstat.gif?name=ol2t&refer="+escape(top.document.referrer);
//			
//	}
//	tr = 0;
//}

