// jquery ajax get-request
	function jquery_ajax_get(URL, container){
		$.get(URL, function(text){
			$(container).fadeOut('fast',function(){
				$(container).html(text).fadeIn('normal');
			});
		});
	}
	
	function header_location(id,page,node){
		if(page == 1){ 
			page = "bildergalerie";
		}
		if(page == 3){ 
			page = "page";
		}
		if(page == 2){ 
			page = "news";
		}
		document.location.href="index.php?page="+ page +"&id="+ id +"&node="+ node;
	}



// url-variablen abfragen
	function getURLVar(urlVarName) {
		//divide the URL in half at the '?' 
		var urlHalves = String(document.location).split('?');
		var urlVarValue = '';
		if(urlHalves[1]){
			//load all the name/value pairs into an array 
			var urlVars = urlHalves[1].split('&');
			//loop over the list, and find the specified url variable 
			for(i=0; i<=(urlVars.length); i++){
				if(urlVars[i]){
					//load the name/value pair into an array 
					var urlVarPair = urlVars[i].split('=');
					if (urlVarPair[0] && urlVarPair[0] == urlVarName) {
						//I found a variable that matches, load it's value into the return variable 
						urlVarValue = urlVarPair[1];
					}
				}
			}
		}
		return urlVarValue;   
	}
// --------------------------------------------------------------------------------------

//Preloader
function overlayLoading() {
	elem = document.getElementById("prepage");
	 elem.style.visibility="hidden";
	elem = document.getElementById("page");
	 elem.style.visibility="visible";
}

// Show Hide Layer
	function aLs(layerID){
		var isIE = false;
		var isOther = false;
		var isNS4 = false;
		var isNS6 = false;
		if(document.getElementById){
			if(!document.all){
				isNS6=true;
			}
			if(document.all){
				isIE=true;
			}
		}else{
			if(document.layers){
				isNS4=true;
			}else{
				isOther=true;
			}
		}
		var returnLayer;
			if(isIE){
				returnLayer = eval("document.all." + layerID + ".style");
			}
			if(isNS6){
				returnLayer = eval("document.getElementById('" + layerID + "').style");
			}
			if(isNS4){
				returnLayer = eval("document." + layerID);
			}
			if(isOther){
				returnLayer = "null";
				alert("-[Error]-\nDue to your browser you will probably not\nbe able to view all of the following page\nas it was designed to be viewed. We regret\nthis error sincerely.");
			}
		return returnLayer;
	}
	function HideShow(ID){
		/*if((aLs(ID).visibility == "visible") || (aLs(ID).visibility == "")){
			aLs(ID).visibility = "hidden";
			aLs(ID).position = "absolute";
			SetCookie(ID,'closed',null,'/');
		}else if(aLs(ID).visibility == "hidden"){
			aLs(ID).visibility = "visible";
			aLs(ID).position = "relative";
			SetCookie(ID,'opened',null,'/');
		}*/
		
		if((aLs(ID).display == "block") || (aLs(ID).display == "")){
			aLs(ID).display = "none";
			aLs(ID).visibility = "hidden";
			SetCookie(ID,'closed',null,'/');
			//getDocHeight('afterPostLayer');
		}else if(aLs(ID).display == "none"){
			aLs(ID).display = "block";
			aLs(ID).visibility = "visible";
			SetCookie(ID,'opened',null,'/');
			//getDocHeight('afterPostLayer');
		}
		
	}
	function HideShowAbsolute(ID){
		if((aLs(ID).visibility == "visible") || (aLs(ID).visibility == "")){
			aLs(ID).visibility = "hidden";
			aLs(ID).position = "absolute";
		}else if(aLs(ID).visibility == "hidden"){
			aLs(ID).visibility = "visible";
			aLs(ID).position = "absolute";
		}
	}
