 /* Zusatzfunktionen von Toni */
 
 function prototype_varsescape($vars){
	$vars = escape($vars);
	$vars = $vars.split("%3D").join("=");
	$vars = $vars.split("%26").join("&");
	$vars = $vars.split("%3F").join("?");
	return $vars;
}

function prototype_divaustauschen($url, $divid){
	$url = $rootsrc+$url;
	$url = prototype_varsescape($url);
	new Ajax.Request($url, {
			method:'get',
			onSuccess: function(transport){
				var response = transport.responseText || "Die Anfrage konnte nicht empfangen werden.";
				document.getElementById($divid).innerHTML = response;
			},
			onFailure: function(){ alert('Die Anfrage konnte nicht empfangen werden.')}
	   }); 
}

function prototype_divaustauschen_post($url, $vars, $divid){
	$url = $rootsrc+$url;
	$vars = prototype_varsescape($vars);
	new Ajax.Request($url, {
			method:'post',
			postBody: $vars,
			onSuccess: function(transport){
				var response = transport.responseText || "Die Anfrage konnte nicht empfangen werden.";
				document.getElementById($divid).innerHTML = response;
				if($divid=="div_ansprechpartner"){pm_contentheight();}
				//alert(response);
			},
			onFailure: function(){ alert('Die Anfrage konnte nicht empfangen werden.')}
	   }); 
}

function prototype_divaustauschen_success($url, $divid, $successfunction){
	$url = $rootsrc+$url;
	$url = prototype_varsescape($url);
	new Ajax.Request($url, {
			method:'get',
			onSuccess: function(transport){
				var response = transport.responseText || "Die Anfrage konnte nicht empfangen werden.";
				document.getElementById($divid).innerHTML = response;
				if($successfunction!=false){
					eval($successfunction);
				}
			},
			onFailure: function(){ alert('Die Anfrage konnte nicht empfangen werden.')}
	   }); 
}

function prototype_divaustauschen_success_post($url, $vars, $divid, $successfunction){
	$url = $rootsrc+$url;
	$vars = prototype_varsescape($vars);
	new Ajax.Request($url, {
			method:'post',
			postBody: $vars,
			onSuccess: function(transport){
				var response = transport.responseText || "Die Anfrage konnte nicht empfangen werden.";
				document.getElementById($divid).innerHTML = response;
				if($successfunction!=false){
					eval($successfunction);
				}
			},
			onFailure: function(){ alert('Die Anfrage konnte nicht empfangen werden.')}
	   }); 
}
