function SearchProducts()
{
	
	var searchText = document.getElementById('search').value;
	var xmlHttp;
	var randomNumber = Math.random();
	var url= "/searchresults.do?reqCode=searchProduct&productName="+searchText+"&RNo="+randomNumber+'&AjaxToggle='+AjaxToggle;
	showWaitImage();
	
	try
		{
		//Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
		}
	catch (e)
		{		
		//Internate Explorer
		try
		  {
		  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		  }
		catch (e)
			{
			try
		 	{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		 	}
			catch (e)
			{
			alert("Your browser does not support AJAX!");
			return false;
			}
	  	}
	}
	xmlHttp.onreadystatechange=function()
	{
  	if(xmlHttp.readyState==4)
		{
		if (xmlHttp.status ==200)
			{	
				document.all('dvProductCenter').innerHTML = "";
				document.all('dvLeftMenu').innerHTML = "";
				document.all('dvProductCenter').style.display = 'none';
				document.all('dvMain').style.display='block';
				document.all('dvMain').innerHTML = xmlHttp.responseText;
			    hideWaitImage();
			}
		}
	}
	//alert(url);
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function validateKeyCode()
{
	if(document.implementation.createDocument) {
	document.onkeyup = alertkey;
	}
	else
	{
		if(window.event.keyCode==13)
		SearchProducts();
	}
}
function alertkey(e)
{
if(e.which==13)
		SearchProducts();
}

function onSearchFocus()
{
	
	document.getElementById('search').value ='';
}