
	function ImagePreloader(images, cback)
	{
	   	this.cback = cback;
	   	this.nLoaded = 0;
	   	this.nProcessed = 0;
	   	this.aImages = new Array;
			this.nImages = images.length;
	
	   	for ( var i = 0; i < images.length; i++ ) 
				this.preload(images[i]);
	}
	ImagePreloader.prototype.preload = function(image)
	{
	   var oImage = new Image;
	   this.aImages.push(oImage);
	   oImage.onload = ImagePreloader.prototype.onload;
	   oImage.onerror = ImagePreloader.prototype.onerror;
	   oImage.onabort = ImagePreloader.prototype.onabort;
	
	   oImage.oImagePreloader = this;
	   oImage.bLoaded = false;
	   oImage.src = image;
	}
	ImagePreloader.prototype.onComplete = function()
	{
	   this.nProcessed++;
	
	   if ( this.nProcessed == this.nImages )
	   {
	      this.cback(this.aImages, this.nLoaded);
	   }
	}
	ImagePreloader.prototype.onload = function()
	{
	   this.bLoaded = true;
	   this.oImagePreloader.nLoaded++;
	   this.oImagePreloader.onComplete();
	}
	ImagePreloader.prototype.onerror = function()
	{
	   this.bError = true;
	   this.oImagePreloader.onComplete();
	}
	ImagePreloader.prototype.onabort = function()
	{
	   this.bAbort = true;
	   this.oImagePreloader.onComplete();
	}
	function hide(id) 
	{ 
		if(document.getElementById)
		{
			if(document.getElementById(id))
			{
				document.getElementById(id).style.visibility = "hidden";
			}
		} 
	}	
	function show(id) 
	{ 
		if(document.getElementById)
		{
			document.getElementById(id).style.visibility = "visible";
		}
	}
	function changepic(id,pic)
	{ 
		if(document.images && window.document.images[id] != null)
			window.document.images[id].src = pic.src; 
	}
	function geschzeitenTimer()
	{
		if(!wasClicked && document.getElementById("img_geschzeiten"))
		{
			hidegeschzeiten();
		}
	}
	function hidegeschzeiten()
	{
		changepic('img_geschzeiten',g2);
	}
	function closegeschzeiten()
	{
		wasClicked = true;
		hide('geschzeiten');
	}	
	function ShowImage(w,h,imageurl,titlestr) 
	{
        x = screen.availWidth/2-w/2;
        y = screen.availHeight/2-h/2;
        var popupWindow = window.open('','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
       // popupWindow.document.write(site);
		
		popupWindow.document.writeln('<html><head>');
		popupWindow.document.writeln("<script type='text/javascript' language='JavaScript'>");
		popupWindow.document.writeln("function click() { window.close(); } ");  // bei click  schliessen
		popupWindow.document.writeln("document.onmousedown=click; ");
		popupWindow.document.writeln('window.status = "'+titlestr+'";');
		popupWindow.document.writeln("</script>");
		popupWindow.document.writeln('<title>'+titlestr+'</title></head>');
		popupWindow.document.writeln('<body onblur="window.close()" '); // bei Focusverlust schliessen
		popupWindow.document.writeln('marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">');
		popupWindow.document.writeln('<center>');
		popupWindow.document.writeln('<img src="'+ imageurl +'"border="0">');
		popupWindow.document.writeln('<center>');
		popupWindow.document.writeln('</body></html>');
		popupWindow.document.close();
    }	
	function ShowUrl(w,h,url) 
	{
        x = screen.availWidth/2-w/2;
        y = screen.availHeight/2-h/2;
        var popupWindow = window.open('','','width='+w+',height='+h+',left='+x+',top='+y+',screenX='+x+',screenY='+y);
       // popupWindow.document.write(site);
		
		popupWindow.document.writeln('<html><head></head>');
		popupWindow.document.writeln('<body onload="window.location = \''+url+'\'" '); // bei Focusverlust schliessen
		popupWindow.document.writeln('marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">');
		popupWindow.document.writeln('</body></html>');
		popupWindow.document.close();
    }
	function handlegeschzeiten()
	{
		wasClicked = true;
		if(window.document.images['img_geschzeiten'].src == g1.src)
		{
			changepic('img_geschzeiten',g2);
		}
		else
		{
			changepic('img_geschzeiten',g1);
		}
	}
	function getMouseXY(e) 
	{
		if (IE) { 
			tempX = event.clientX + document.body.scrollLeft;
			tempY = event.clientY + document.body.scrollTop;
	  	} else {
			if (e.pageX < 0){tempX = 0}else{tempX = e.pageX;}
			if (e.pageY < 0){tempY = 0}else{tempY = e.pageY;}
	 	 }    
		
		if (document.getElementById)
		{		
			if ( document.getElementById('hilfe') )
			{
				if ( document.getElementById('hilfe').style.visibility == "visible") 
				{
					if(tempX > 700)
					{
						document.getElementById('hilfe').style.left = tempX - parseInt(document.getElementById('hilfe').style.width) - 15;
						document.getElementById('hilfe').style.top = tempY;	
					}
					else
					{
						document.getElementById('hilfe').style.left = tempX + 15;
						document.getElementById('hilfe').style.top = tempY;	
					}
				}
			}
		}	
	  return true
	}	
	function zindex(id,z) 
	{ 
		if(document.getElementById)
		{
			document.getElementById(id).style.zIndex = z;
		}
	}	
	function ShowHelp(msg)
	{
		var over = 0;
		if ( msg.length <= 5 )
		{
			over = 10;
		}
		
		if (document.getElementById)
		{		
			document.getElementById('hilfe').style.left = tempX + 15;
			document.getElementById('hilfe').style.top = tempY;	
			
			if ( document.getElementById('hilfe').style.visibility == "hidden") 
			{
				document.getElementById('hilfe').style.width = ( msg.length * 8.2 ) + over;
				document.getElementById('hilfe').style.height = 17;
				
				if(tempX > 700)
				{
					document.getElementById('hilfe').style.left = tempX - parseInt(document.getElementById('hilfe').style.width) - 15;
					document.getElementById('hilfe').style.top = tempY;	
				}
				else
				{
					document.getElementById('hilfe').style.left = tempX + 15;
					document.getElementById('hilfe').style.top = tempY;	
				}
				
				document.getElementById('hilfe').innerHTML = msg;
				window.status = msg;
				document.getElementById('hilfe').style.visibility = "visible";
				window.setTimeout("zindex('hilfe',500)", 50);
			}

		}	
	}
	function SetBgColor(id,color)
	{
		if(document.getElementById)
		{
			document.getElementById(id).style.backgroundColor = color;
		}
	}	
	function ShowFixHelp(msg,offset)
	{
		var over = 0;
		if ( msg.length <= 5 )
		{
			over = 10;
		}
		
		if (document.getElementById)
		{		
			document.getElementById('hilfe').style.left = tempX + 15;
			document.getElementById('hilfe').style.top = tempY;	
			
			if ( document.getElementById('hilfe').style.visibility == "hidden") 
			{
				document.getElementById('hilfe').style.width = ( msg.length * 8.2 ) + over - offset;
				document.getElementById('hilfe').style.height = 17;
				
				if(tempX > 700)
				{
					document.getElementById('hilfe').style.left = tempX - parseInt(document.getElementById('hilfe').style.width) - 15;
					document.getElementById('hilfe').style.top = tempY;	
				}
				else
				{
					document.getElementById('hilfe').style.left = tempX + 15;
					document.getElementById('hilfe').style.top = tempY;	
				}				
				
				document.getElementById('hilfe').innerHTML = msg;
				window.status = msg;
				document.getElementById('hilfe').style.visibility = "visible";
				window.setTimeout("zindex('hilfe',500)", 50);
			}

		}	
	}
	function HideHelp()
	{
		if (document.getElementById)
		{
			if ( document.getElementById('hilfe').style.visibility == "visible") 
			{
				document.getElementById('hilfe').style.width = 0;
				document.getElementById('hilfe').style.height = 0;
				document.getElementById('hilfe').style.zIndex = -1;
				document.getElementById('hilfe').style.visibility = "hidden";
				window.status = "";
				document.getElementById('hilfe').innerHTML = "";
			}
		}	
	}
	
		// Mouse xy
	var IE = document.all?true:false
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	
	document.onmousemove = getMouseXY;
	var tempX = 0;
	var tempY = 0;
	
	var bmenuisactive = 0;
	var bbuttonisactive = 0;
	var wasClicked = false;
