function over(id) {

	document.getElementById(id).style.backgroundColor = "black";
	document.getElementById(id).style.color = "white";	
}

function out(id) {
	document.getElementById(id).style.backgroundColor = "white";
	document.getElementById(id).style.color = "black";
}

function hclick(link) {
	document.searchHotelForm.search_input.value = link;
	searchHotel();
	//goToHotel(link);
	document.url_form.url_input.value = link;
	
	document.url_form.submit();
	document.getElementById("replyField").innerHTML = "Loading...";
	
} 

function searchHotel() {
	
	var searchString = document.searchHotelForm.search_input.value;

	var req = null;
	if (window.XMLHttpRequest) {
    		req = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
    		req = new ActiveXObject("Microsoft.XMLHTTP");
	}

	if (req != null) {
    		req.open("POST", "fileadmin/eeh_booking/displaySpecials/searchHotel.php", true);
    		req.onreadystatechange = aendern;
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    		req.send("searchString="+searchString);

	}

	function aendern() {
		if (req.readyState == 4) {
			document.getElementById("replyField").innerHTML = "";
			document.getElementById("replyField").innerHTML = req.responseText;
		} else {
			document.getElementById("replyField").innerHTML = "Loading...";
		}
	}
	return false;
}

function clearSearchField() {
	if (typeof document.searchHotelForm == 'object') {
		document.searchHotelForm.search_input.value = "";
	}
}

window.onload = clearSearchField;
