var xmlHttp = createXMLHttpRequestObject();
wechsel = window.setTimeout("hideItNow()", 1500000);

function createXMLHttpRequestObject() {
	
	var xmlHttp;
	
	if(window.ActiveXObject) {
		
		try {
			
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");	
		}	catch(e) {
			
			xmlHttp = false;
		}
	}else {
		
		try {
			
			xmlHttp = new XMLHttpRequest();	
		}catch(e) {
			
			xmlHttp = false;	
		}
	}
	
	if(!xmlHttp) {
		
		alert("Error creating the XMLHttpRequest object");	
	}else {
		
		return xmlHttp;	
	}
}

function process(resid) {
	
	window.clearTimeout(wechsel);
	
	if(xmlHttp.readyState == 4 || xmlHttp.readyState == 0) {
		
		xmlHttp.open("GET","getGourmetfinderData.php?id="+resid,true);
		xmlHttp.onreadystatechange = handleServerResponse;
		xmlHttp.send(null);
	}else {
		
		setTimeout('process(resid)', 1000);	
	}
}

function handleServerResponse() {
	
	if(xmlHttp.readyState == 4) {
		
		if(xmlHttp.status	== 200) {
			
			xmlResponse = xmlHttp.responseXML;
			xmlDocumentElement = xmlResponse.documentElement;
			message = xmlDocumentElement.firstChild.data;
			
			document.getElementById("gourmetfindertext").innerHTML = message;	
		}else {
			
			alert("There was a problem accessing the server: "+xmlHttp.statusText);	
		}
	}	
}

function hideContent() {
	
	window.clearTimeout(wechsel);
	hideItNow();		
	wechsel = window.setTimeout("hideItNow()", 100);		
	
}

function hideItNow() {
	
	document.getElementById("gourmetfindertext").innerHTML = "<a href='restaurants.php?region=Wien'><span>></span> Wien </a><br/>"+
			"<a href='restaurants.php?region=Nieder&ouml;sterreich'><span>></span> Nieder&ouml;sterreich <br/>"+
			"<a href='restaurants.php?region=Burgenland'><span>></span> Burgenland <br/>"+
			"<a href='restaurants.php?region=Steiermark'><span>></span> Steiermark <br/>"+
			"<a href='restaurants.php?region=K&auml;rnten'><span>></span> K&auml;rnten <br/>"+
			"<a href='restaurants.php?region=Salzburg'><span>></span> Salzburg <br/>"+
			"<a href='restaurants.php?region=Ober&ouml;sterreich'><span>></span> Ober&ouml;sterreich <br/>"+
			"<a href='restaurants.php?region=Tirol'><span>></span> Tirol <br/>"+
			"<a href='restaurants.php?region=Vorarlberg'><span>></span> Vorarlberg <br/>";
}