	// 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){
		x = self.innerWidth;
	}else if (document.documentElement && document.documentElement.clientHeight){
		x = document.documentElement.clientWidth;
	}else if (document.body){
		x = document.body.clientWidth;
	}
	return x;
}

function getY(){
	if (self.innerHeight){
		y = self.innerHeight;
	}else if (document.documentElement && document.documentElement.clientHeight){
		y = document.documentElement.clientHeight;
	}else if (document.body){
		y = document.body.clientHeight;
	}
	return y;
}

function open_country_selector(param,param2,param3){
  if(param==1){
	  http.open("GET", "/_ajax/homelayer_code.php?mu="+param3+"&sc="+param2, true);
	  http.onreadystatechange = setInhalt;
	  http.send(null);
  }
}

function setInhalt(){
	if (http.readyState == 4){
		if (http.status == 200){
			x = getX();
			y = getY();
			document.getElementById('overlay').style.zIndex = "3";
			document.getElementById('overlay').style.display = "block";
			document.getElementById('overlay').style.backgroundcolor = "#000";
			document.getElementById('ajax').style.display = "block";
			document.getElementById('ajax').style.position = "absolute";
			document.getElementById('ajax').style.top = "0px";
			document.getElementById('ajax').style.left = "190px";
			document.getElementById('ajax').style.zIndex = "4";
			document.getElementById('ajax').innerHTML = unescape(http.responseText);
		} else {
			alert('Bei dem Aufruf für die von Ihnen gewünsche Funktion, ist ein Problem aufgetreten.');
		}
	}
}

function this_close(){
	document.getElementById('ajax').style.display = "none";
	document.getElementById('ajax').innerHTML = "";
	document.getElementById('overlay').style.display = "none";
}
