var xmlHttp3

function showResult( str ) {
	if( str.length == 0 ) {
		document.getElementById( "livesearch" ).innerHTML = "";
		document.getElementById( "livesearch" ).style.border = "0px";
		document.getElementById( "livesearch" ).style.display = "none";
		return

	}

	xmlHttp3 = GetXmlHttpObject()

	if( xmlHttp3 == null ) {
		alert( "Browser does not support HTTP Request" )
		return

	}

	var url = "/global/livesearch.php"
	url = url + "?q=" + str
	url = url + "&sid=" + Math.random()
	xmlHttp3.onreadystatechange = stateChangedSearch
	xmlHttp3.open( "GET", url, true )
	xmlHttp3.send( null )
}

function stateChangedSearch() {
	if( xmlHttp3.readyState == 4 || xmlHttp3.readyState == "complete" ) {
		document.getElementById( "livesearch" ).style.display = "block";
		document.getElementById( "livesearch" ).style.visibility = "visible";
		document.getElementById( "livesearch" ).innerHTML = xmlHttp3.responseText;
	}
}

function GetXmlHttpObject() {
	var xmlHttp3 = null;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp3 = new XMLHttpRequest();
	} catch( e ) {
		// Internet Explorer
		try {
			xmlHttp3 = new ActiveXObject( "Msxml2.XMLHTTP" );
		} catch( e ) {
			xmlHttp3 = new ActiveXObject( "Microsoft.XMLHTTP" );
		}
	}
	return xmlHttp3;
}