
	var ie=(document.all)? true:false;
	var ns=(document.layers)? true:false;
	var ns6=navigator.appName.indexOf("Netscape")!=1&& parseInt(navigator.appVersion)>=5 ;

	hide = new Array ();
	
	function openPopup(pPath,pTitle) {
		var width = 400;
		var height = 600;
		var left = 50;
		var top = 50;
		var popfen=window.open( pPath, pTitle, 'width='+width+', height='+height+', left='+left+', top='+top+', screenx='+left+', screeny='+top+', resizable=no, scrollbars=no');
		popfen.focus();
	}
	
	function openPopupSmall(pPath,pTitle) {
		//var title = "Beschreibung";
		var width = 350;
		var height = 500;
		var PosX = screen.width/2 - 380;
		var PosY = screen.height/2 - 250;
		var resize = 'no';
		var scroll = 'no';
		var popfen=window.open( pPath, pTitle, 'width='+width+', height='+height+', left='+PosX+', top='+PosY+', screenx='+PosX+', screeny='+PosY+', resizable = '+resize+', scrollbars='+scroll+'');
		popfen.focus();
	}
	
	function openPopupRandom() {
		var files = new Array('../../popup/Erde_popup.php','../../popup/Feuer_popup.php','../../popup/Holz_popup.php','../../popup/Metall_popup.php','../../popup/Wasser_popup.php');
		var index = Math.floor(Math.random() * 5);
		var pPath = files[index];
		var title = "Beschreibung";
		var width = 760;
		var height = 550;
		//var PosX = 100;
		//var PosY = 100;
		var PosX = screen.width/2 - 380;
		var PosY = screen.height/2 - 230;
		var resize = 'no';
		var scroll = 'no';
		var popfen=window.open( pPath, title, 'width='+width+', height='+height+', left='+PosX+', top='+PosY+', screenx='+PosX+', screeny='+PosY+', resizable = '+resize+', scrollbars='+scroll+'');
		popfen.focus();
	}
		
	function popupClose() {
		if (!ie) {
			var aName = self.name;
			window.close(aName);
		}
		else {
			window.close();
		}
	}

	function turnLayerVisibility(pLayerName,pVisibility) {
		_turnLayerVisibility(false,pLayerName,pVisibility);
	}
	function turnLayerVisibilityOpener(pLayerName,pVisibility) {
		_turnLayerVisibility(true,pLayerName,pVisibility);
	}
	function _turnLayerVisibility(pOpenerFlag,pLayerName,pVisibility) {
		var windowObj = window;
		if (true == pOpenerFlag && opener) {
			windowObj = opener;
		}
		if(ie) {
			if (pVisibility == true) {
	    		windowObj.document.all[pLayerName].style.visibility="visible";
			}
			else {
	    		windowObj.document.all[pLayerName].style.visibility="hidden";
	    	}
	   	}
		if(ns) {
			if (pVisibility == true) {
	    		windowObj.document.layers[pLayerName].visibility="show";
			}
			else {
	    		windowObj.document.layers[pLayerName].visibility="hide";
	    	}
	    }
		if(ns6) {
			if (pVisibility == true) {
	    		windowObj.document.getElementById(pLayerName).style.visibility="visible";
			}
			else {
	    		windowObj.document.getElementById(pLayerName).style.visibility="hidden";
    		}
	   	}
	}

	function turnLayerDisplay(pLayerName,pVisibility) {
		_turnLayerDisplay(false,pLayerName,pVisibility);
	}

	function turnLayerDisplayOpener(pLayerName,pVisibility) {
		_turnLayerDisplay(true,pLayerName,pVisibility);
	}

	function _turnLayerDisplay(pOpenerFlag,pLayerName,pVisibility) {
		var windowObj = window;
		if (true == pOpenerFlag && opener) {
			windowObj = opener;
		}
		if(ie) {
			if (pVisibility == true) {
				windowObj.document.all[pLayerName].style.display="";
			}
			else {
				windowObj.document.all[pLayerName].style.display="none";
			}
	   	}
		if(ns) {
			if (pVisibility == true) {
	    		windowObj.document.layers[pLayerName].display="";
			}
			else {
	    		windowObj.document.layers[pLayerName].display="none";
	    	}
	    }
		if(ns6) {
			if (pVisibility == true) {
	    		windowObj.document.getElementById(pLayerName).style.display="";
			}
			else {
	    		windowObj.document.getElementById(pLayerName).style.display="none";
    		}
	   	}
	}

    function setLayerColor(pLayerName,pColor,pLinkItem,pLinkColor) {

  		document.getElementById(pLinkItem).style.color=pLinkColor;

		if(ie) {
	   		document.all[pLayerName].style.backgroundColor=pColor;
	   	}
		if(ns) {
	   		document.layers[pLayerName].backgroundColor=pColor;
	    }
		if(ns6) {
			document.getElementById(pLayerName).style.backgroundColor=pColor;
	   	}
	}

    function zwrEscape(pString) {
            var s1=pString;
                  var s2=escape(s1);
        //Zeilenumbrueche verkuerzen
        var a1=s2.split("%0D");
        s2="";
        for (i=0;i<a1.length;i++) {
          s1=a1[i];
          if (s1.substring(0,3)=="%0A") { s1=s1.substring(3,s1.length); }
          s2+="%0D"+s1;
        }
        s2=s2.substring(3,s2.length);
        //Leerzeichen ohne Code
        var a2=s2.split("%20");
        s2="";
        for (i=0;i<a2.length;i++) {
                s1=a2[i]; s2+=" "+s1;
        }
            s2=s2.substring(1,s2.length);
            return s2;
    }
    
    
    //fŸr Flashnavigation
    function changeHTML(pURL) {
    	//alert (pURL);
    	window.location.href = pURL;
    }

	/***************************************************************************/
	
	function turnLayerOpacity(pLayerName,pOpacity) {

		if(ie) {
			if (pOpacity == true) {
				document.all[pLayerName].style.display="";
			}
			else {
				document.all[pLayerName].style.filter="Alpha(opacity=10)";
				// object.style.filter="Alpha(opacity=wert)"; // IE
				// object.style.MozOpacity="wert"; // Mozilla
			}
	   	}
		if(ns) {
			if (pOpacity == true) {
	    		document.layers[pLayerName].MozOpacity="1";
			}
			else {
	    		document.layers[pLayerName].MozOpacity="0.1";
	    	}
	    }
		if(ns6) {
			if (pOpacity == true) {
	    		document.getElementById(pLayerName).style.MozOpacity="1";
			}
			else {
	    		document.getElementById(pLayerName).style.MozOpacity="0.1";
    		}
	   	}
	}
	
	/****************************************************************************/
	//-------------- FUNKTIONEN ZUM SCROLLEN --------------------------------------------------------------------------------------------
	
	/*
		textScroller.js
		
		anwenundung:
		onload="initTextScroller('pClipLayer','pContentLayer','pUpLayer','pDownLayer')"
		
		konfigurieren:
		txsc_scrollTime = setzen des scroll timeout, normal 30
		txsc_scrollJump = wieviel px sollen gescrollt werden
		
	*/
	
	var txsc_scrollTime = 30;
	var txsc_scrollJump = 5;
	
	var txsc_ie=(document.all)? true:false;
	var txsc_ns=(document.layers)? true:false;
	var txsc_ns6=navigator.appName.indexOf("Netscape")!=1&& parseInt(navigator.appVersion)>=5 ;
	
	var txsc_clipingDivElement;
	var txsc_contentDivElement;
	var txsc_currentScrollPositionV=0;
	var txsc_doScroll = false;
	var	txsc_clipHeight;
	var	txsc_clipWidth;
	var txsc_contHeight;
	var txsc_savedStartScrollPosition;
	
	
	function initTextScroller(pClipLayer,pContentLayer,pUpLayer,pDownLayer) {
	
		//alert('Layer= '+pUpLayer);
	
		if(txsc_ns) {
			txsc_clipingDivElement = document.layers[pClipLayer];
			txsc_contentDivElement = document.layers[pContentLayer];
		}
		if(txsc_ie) {
			txsc_clipingDivElement = document.all[pClipLayer];
			txsc_contentDivElement = document.all[pContentLayer];
		}
		if(txsc_ns6) {
			txsc_clipingDivElement = document.getElementById(pClipLayer);
			txsc_contentDivElement = document.getElementById(pContentLayer);
		}
		//alert('txsc_ns='+txsc_ns+', txsc_ie='+txsc_ie+', txsc_ns6='+txsc_ns6+'\nns='+ns+', ie='+ie+', ns6='+ns6);
		
		txsc_clipHeight = txsc_clipingDivElement.clientHeight;
		txsc_clipWidth = txsc_clipingDivElement.clientWidth;
		
		txsc_contHeight = txsc_contentDivElement.clientHeight;
		
		
		txsc_currentScrollPositionV = txsc_contentDivElement.offsetTop;
		txsc_savedStartScrollPosition = txsc_currentScrollPositionV;
		
		// hier testen ob die layer Ÿberhaupt sichtbar sien sollen
		if (txsc_clipHeight + txsc_scrollJump >= txsc_contHeight) {
			turnLayerVisibility(pUpLayer,false);
			turnLayerVisibility(pDownLayer,false);
		}
	}
	
	
	function stopScroll() {
		txsc_doScroll = false;
	}
	function startScrollUp() {
		txsc_doScroll = true;
		up();
	}
	function startScrollDown() {
		txsc_doScroll = true;
		down();
	}
	
	
	function up() {
	
		//alert ('up');
	
		if (true == txsc_doScroll) {
			txsc_currentScrollPositionV-=txsc_scrollJump;
			curContentBottom = txsc_currentScrollPositionV + txsc_contHeight;
			if (curContentBottom > txsc_clipHeight) {
				txsc_contentDivElement.style.top = txsc_currentScrollPositionV;
				timer=setTimeout('up()',txsc_scrollTime);
			}
		}
		
	}
	
	
	function down() {
	
		//alert ('down');
	
		if (true == txsc_doScroll) {
			txsc_currentScrollPositionV+=txsc_scrollJump;
			if (txsc_currentScrollPositionV < txsc_clipingDivElement.style.top) {
				txsc_contentDivElement.style.top=txsc_currentScrollPositionV;
				timer=setTimeout('down()',txsc_scrollTime);
			}
			else {
				txsc_currentScrollPositionV = txsc_savedStartScrollPosition;
				txsc_contentDivElement.style.top = txsc_currentScrollPositionV;
				txsc_doScroll = false;
			}
		}
		
	}
	
	
	
	//-------------- FUNKTIONEN ZUM SCROLLEN --------------------------------------------------------------------------------------------
	
	/******************** Klasse aendern ***************************/

	function setLayerClass (pLayerName,pClassName) {

		if(ie) {
			document.all[pLayerName].className = pClassName;
	   	}
		if(ns) {
    		document.layers[pLayerName].className = pClassName;
	    }
		if(ns6) {
    		document.getElementById(pLayerName).className = pClassName;
	   	}
	   	alert (pName);
	}
	/******************** Klasse aendern ***************************/
	
	
    function getUrlQuery(pAram) {
    	var result = "";
		var url = String(window.location);
		if(url && url.search != "") {
			var undef = url.split("?");
			if (undef != "") {
				var args = undef[1].split("&");
				for(i = 0; i < args.length; i++) {
					var a = args[i].split("=");
					if(a[0] == pAram) {
						result = a[1];
					}
				}
			}
		}
		return result;
	}
	
	
