
	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 basename(pString,pKeepExt) {
		if (pString) {
			var result = "";
			//String(pString);
			var index = pString.lastIndexOf("/");
			if (index == -1) {
				index = pString.lastIndexOf("\\");
			}
			if (index > -1) {
				result = pString.substring(index+1);
				if (!pKeepExt) {
					index = pString.indexOf(".");
					if (index > -1) {
						result = pString.substring(0,index);
					}
				}
			}
			if (result == "") result = pString;
		}
		return result;
	}
	function extension(pString) {
		if (pString) {
			var index = pString.indexOf(".");
			if (index > -1) {
				pString = pString.substring(index+1);
			}
		}
		return pString;
	}

	function openPopup(pPath) {
		var title = "Beschreibung";
		var width = 775;
		var height = 550;
		var PosX = 50;
		var PosY = 50;
		//var PosX = screen.width/2 - 380;
		//var PosY = screen.height/2 - 275;
		var resize = 'yes';
		var scroll = 'yes';
		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 openPopupAdmin(pPath) {
		//alert('openPopupAdmin 760x600');
		var title = "Projekte";
		var width = 780;
		var height = 650;
		var PosX = 0;
		var PosY = 0;
		var resize = 'yes';
		var scroll = 'yes';
		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 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 - 275;
		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) {
				// axel 20060220, offenbar führt display="inherit" zu fehlern
				windowObj.document.all[pLayerName].style.display="";
			}
			else {
				windowObj.document.all[pLayerName].style.display="none";
			}
	   	}
		if(ns) {
			if (pVisibility == true) {
	    		windowObj.document.layers[pLayerName].display="inherit";
			}
			else {
	    		windowObj.document.layers[pLayerName].display="none";
	    	}
	    }
		if(ns6) {
			if (pVisibility == true) {
	    		windowObj.document.getElementById(pLayerName).style.display="inherit";
			}
			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;
    }


