String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

var innerHTMLObjf;
var innerHTMLObjb;
var innerHTMLObji;

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 stateChanged() 
{ 
	if (xmlHttp.readyState==4)
	{   
	    document.getElementById('productlist').style.display='block'
		document.getElementById("productlist").innerHTML=xmlHttp.responseText;
	}
}


var xmlHttp

function searchproduct(val)
{	 
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
	var url="getsearch.php?key="+val;
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function showkey(sval){
	 document.getElementById('keyval').value=sval
	 document.getElementById('productlist').style.display='none'
	 
}