var xmlhttp;
function stateChanged(){if (
xmlhttp.readyState==4){
var res="<div><a style='color:#fff;' href='http://www.showtribe.com/show/directory'><b >View All Shows</b></a></div>" + xmlhttp.responseText;
document.getElementById("livesearch").innerHTML=res;
document.getElementById("livesearch").style.border="1px none #A5ACB2";}

}
function GetXmlHttpObject()
{
  if(window.XMLHttpRequest){
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
  if(window.ActiveXObject){
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
  return null;
}

function showResult(str){
	if(str.length===0){
	document.getElementById("livesearch").style.display='none';
	document.getElementById("livesearch").innerHTML="";
	document.getElementById("livesearch").style.border="0px";
	return;
	}else{document.getElementById("livesearch").style.display='block';}
	xmlhttp=GetXmlHttpObject();

	if (xmlhttp===null){alert ("Browser does not support HTTP Request");return;}
	var url=siteurl + "livesearch.php";
	url=url+"?q="+str;
	url=url+"&sid="+Math.random();
	
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=stateChanged ;
	xmlhttp.send(null);
}


       
