	// XHTTP
	function getHTTPObject()
	{ 
		if (typeof XMLHttpRequest != 'undefined') 
		{ 
			return new XMLHttpRequest(); 
		} 
		try 
		{ 
			return new ActiveXObject("Msxml2.XMLHTTP"); 
		} 
		catch (e) 
		{ 
			try 
			{ 
				return new ActiveXObject("Microsoft.XMLHTTP"); 
			} 
			catch (e) 
			{
				return false;
			} 
		} 
		return false; 
	}
	
	var http = getHTTPObject();
	if(!http)
	{
		alert( "AJAX (XMLHTTP) not supported!\nPlease update your System and/or inform your Administrator!" );
	}
	
	function readData( url, name, param) // Lesen
	{ 
		http.open("GET", url + "?name=" + name + "&" + param, true);
		http.onreadystatechange = useHttpResponse;
		http.send(null);
	}
	
	function useHttpResponse()
	{
		if (http.readyState == 4) 
		{
			var contents = http.responseText.split( "#~#" );
			var divname = (contents[0]);
			var inhalte = unescape(contents[1]);
			document.getElementById(divname).innerHTML = inhalte;
		}
	}
	
function getX()
{
	if (self.innerHeight) // all except Explorer
	{
		x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		x = document.documentElement.clientWidth;
	}
	else if (document.body) // other Explorers
	{
		x = document.body.clientWidth;
	}
	return x;
}

function getY()
{
	if (self.innerHeight) // all except Explorer
	{
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
		// Explorer 6 Strict Mode
	{
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		y = document.body.clientHeight;
	}
	return y;
}

function makewin(param)
{
	var t = http.open("GET", "/_ajax/yellowmap_stadtplan_code.php?query=" + escape(escape(param)), true);
	http.onreadystatechange = setInhalt;
	http.send(null);
}

function makewin_route(param)
{
	var t = http.open("GET", "/_ajax/yellowmap_routenplan_code.php?query=" + escape(escape(param)), true);
	http.onreadystatechange = setInhalt;
	http.send(null);
}

function makewin_route2(param)
{
	var t = http.open("GET", "/_ajax/yellowmap_routenplan2_code.php?query=" + escape(escape(param)), true);
	http.onreadystatechange = setInhalt;
	http.send(null);
}

function makewin_rze(param1,param2,param3,param4,param5,param6,param7,param8,param9)
{
	var t = http.open("GET", "/_ajax/yellowmap_zentrale_code.php?woher="+escape(escape(param1))+"&zzip="+escape(escape(param2))+"&zcity="+escape(escape(param3))+"&zstreet="+escape(escape(param4))+"&kennung="+escape(escape(param5))+"&splz="+escape(escape(param6))+"&shauptort="+escape(escape(param7))+"&sstrasse="+escape(escape(param8))+"&sland="+escape(escape(param9))+"", true);
	http.onreadystatechange = setInhalt;
	http.send(null);
}

function setInhalt()
{
	if (http.readyState == 4) 
	{
		if (http.status == 200) 
		{
			x = getX();
			y = getY();
			
			var inhalte = unescape(http.responseText);
			document.getElementById('overlay').style.zIndex = "3";
			document.getElementById('overlay').style.display = "block";
			document.getElementById('overlay').style.backgroundcolor = "#000";
			document.getElementById('overlay').style.height = (document.getElementById('wrap').offsetHeight + 520)+"px";
			document.getElementById('overlay').style.width = (document.getElementById('wrap').offsetWidth )+"px";
			
			document.getElementById('loading').style.display = "block";
			document.getElementById('loading').style.position = "absolute";
			document.getElementById('loading').style.overflow = "hidden";
			document.getElementById('loading').style.top = "390px";
			document.getElementById('loading').style.left = "585px";
			document.getElementById('loading').style.zIndex = "10";
			
			document.getElementById('ajax').style.display = "block";
			document.getElementById('ajax').style.width = "750px";
			document.getElementById('ajax').style.height = "600px";
			document.getElementById('ajax').style.position = "absolute";
			document.getElementById('ajax').style.overflow = "hidden";
			document.getElementById('ajax').style.top = "90px";
			document.getElementById('ajax').style.left = "210px";
			document.getElementById('ajax').style.backgroundcolor = "#fff";
			document.getElementById('ajax').style.backgroundImage = "url(/images/white.gif)";
			document.getElementById('ajax').style.backgroundRepeat = "repeat";
			document.getElementById('ajax').style.border = "1px solid #8c8c8c";
			document.getElementById('ajax').style.zIndex = "4";
			document.getElementById('ajax').innerHTML = inhalte;
		} 
		else 
		{
			alert('Bei dem Aufruf für die von Ihnen gewünsche Funktion, ist ein Problem aufgetreten.\n');  
		}
	}
}

function this_close()
{
	document.getElementById('ajax').style.display = "none";
	document.getElementById('ajax').innerHTML = "";
	document.getElementById('overlay').style.display = "none";
	document.getElementById('overlay').style.height = "1px";
	document.getElementById('overlay').style.width = "1px";
	document.getElementById('overlay').style.backgroundcolor = "#ffffff";
	document.getElementById('overlay').style.zIndex = "999";
	document.getElementById('overlay').style.display = "none";
}
