
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}
function searchSuggest(str,page)
{
	
/* This validation is for checking input text field*/
if (str.length==0)
  { 
  		if(page=='main')
  		document.getElementById("search_suggest").innerHTML="";
		else
		document.getElementById("search_suggest1").innerHTML="";
  return;
  }
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  } 
var url="searchproduct.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
if(page=='main')
xmlHttp.onreadystatechange=stateChanged;
else
xmlHttp.onreadystatechange=stateChanged1;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function stateChanged() 
{ 
	//alert(page)
	if (xmlHttp.readyState==4)
	{ 
		
		document.getElementById("search_suggest").innerHTML=xmlHttp.responseText;
		
	}
}
function stateChanged1() 
{ 
	
	if (xmlHttp.readyState==4)
	{ 
		
		document.getElementById("search_suggest1").innerHTML=xmlHttp.responseText;
		
	}
}


// JavaScript Document
