/* ---------------------------- */
/* XMLHTTPRequest Enable 		*/
/* ---------------------------- */
function createObject() {
	var request_type;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer"){
	request_type = new ActiveXObject("Microsoft.XMLHTTP");
	}else{
		request_type = new XMLHttpRequest();
	}
		return request_type;
}

var http = createObject();

/* -------------------------- */
/* SEARCH	 1				 */
/* -------------------------- */
function autosuggest(txtField, resultArea) {
var q = document.getElementById(txtField).value;
// Set te random number to add to URL request

nocache = Math.random();

http.open('get', 'http://www.housesaleshungary.com/demo/ajax/search1.php?q='+q+'&nocache = '+nocache +'&txt_Field='+txtField +'&result_Area='+resultArea );

//http.open('get', 'http://vv2/first/hshungary/lib/search1.php?q='+q+'&nocache = '+nocache +'&txt_Field='+txtField +'&result_Area='+resultArea );


http.onreadystatechange = autosuggestReply;

http.send(null);
}
function autosuggestReply() {
if(http.readyState == 4){
	var response = http.responseText;
	var e = document.getElementById('results_location');
	if(response!=""){
		e.innerHTML=response;
		e.style.display="block";
	} else {
		e.style.display="none";
	}
}
}



function display(word, resultArea)
{
	document.getElementById('location').value = word;
	document.getElementById(resultArea).style.display = 'none';
	document.getElementById('location').focus();
}



