var xmlHttpSearch

function showHint(str)
{
	//document.getElementById("sugMain").style.display="block";
	
if (str.length==0)
  { 
  document.getElementById("SearchtxtHint").innerHTML="";
  document.getElementById("sugMain").style.display="none";
  return;
  }
xmlHttpSearch=GetXmlHttpObject();
if (xmlHttpSearch==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var searchurl="http://raniduonline.com/blog/wp-content/themes/ranidu/search/gethint.php";
searchurl=searchurl+"?q="+str;
searchurl=searchurl+"&sid="+Math.random();
xmlHttpSearch.onreadystatechange=stateChanged;
xmlHttpSearch.open("GET",searchurl,true);
xmlHttpSearch.send(null);
} 

function stateChanged() 
{ 
if (xmlHttpSearch.readyState==4)
{ 
document.getElementById("SearchtxtHint").innerHTML=xmlHttpSearch.responseText;
//document.getElementById("SearchtxtHint").innerHTML="test";
$("#sugMain").slideDown("slow");
}
}

function GetXmlHttpObject()
{
var xmlHttpSearch=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttpSearch=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttpSearch=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttpSearch=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttpSearch;
}

function setSearchTag(searchVal){
	document.getElementById("txt1").value=searchVal;
	//document.getElementById("sugMain").style.display="none";
	$("#sugMain").slideUp("slow");
}

$(document.body).click(function () {
$("#sugMain").slideUp("slow");
    });
