var xmlhttpSearch

var im
im = new Image();
im.src ="js/ajax-loader3.gif";

function showSearch(cPage,str)
{

document.getElementById("searchWord").innerHTML ="Your search for <b><font color=#2e79b2>&nbsp;&nbsp;"+ str +"</b> </font>&nbsp;returned the following results: "

if (str.length==0)
  {
  document.getElementById("SearchRes").innerHTML="";
  str = ' ';
  //return;
  }

 var ss = document.getElementById("SearchRes");
 ss.innerHTML = "<p align='center'><br><br><img  src='"+ im.src +"'></p>"
xmlhttpSearch=GetXmlHttpObjectSearch();
if (xmlhttpSearch==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="AjaxSearch1.asp";
url=url+"?frmSearchString="+str;
url=url+"&currentpage="+cPage;
url=url+"&sid="+Math.random();
xmlhttpSearch.onreadystatechange=stateChangedSearch;
//alert(url)
xmlhttpSearch.open("GET",url,true);
xmlhttpSearch.send(null);

}

function stateChangedSearch()
{
	
if (xmlhttpSearch.readyState==4)
  {
	 
	  var xxx = xmlhttpSearch.responseText;
	  var ss = document.getElementById("SearchRes");
	  ss.style.display='block'
	  ss.innerHTML = '';
      ss.innerHTML = xxx;
	//  document.getElementById("txtHint").innerHTML=xmlhttpSearch.responseText;
  }
}
//Mouse over function




function GetXmlHttpObjectSearch()
{
	var http_request = false;
	if(window.XMLHttpRequest)
	 {
		try
		{
			netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
		} catch (e) 
		{
			//alert("Boss, please help I am trying to update the security level for the browser.");
         }
 	         // alert("yes boss : I support XMLHttpRequest");
         http_request = new XMLHttpRequest();
			//alert("yes boss : I support XMLHttpRequest");
             if(http_request.overrideMimeType)
                {
                   http_request.overrideMimeType('text/xml');
		        }
		}
     else if(window.ActiveXObject)
	   {
          //alert("yes boss : I support ActiveX");
           try
		   {
	          http_request = new ActiveXObject("Msxml2.XMLHTTP");
			   //alert("t yes boss : I support ActiveX");
           }
           catch(e)
           {
	          http_request = new ActiveXObject("Microsot.XMLHTTP");
			  //alert("c yes boss : I support ActiveX");
           }
	  }
	if(! http_request)
		{
			//alert("oh, sorry dear I am not able to do this task");
			return null;
		}
			
		return http_request;
//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 ASearch(cPage,sW)
		{
			if(cPage=='')
				cPage=1
			if(sW=='')
				sW = ' '
			showSearch(cPage,sW);
		}
		
		function delSearchString()
		{
			if(document.getElementById('fSearch').value == 'Search...')
				document.getElementById('fSearch').value = ''
		}
		
		function SearchFun()
		{
			if(window.event.keyCode==13)
			{
				ASearch('1', document.getElementById('fSearch').value);
				
			}

		}

