function Validation(theForm,data)
{
	 var search_text =  theForm.keyword.value;
	// alert(search_text);
	  if(search_text == ' ' || search_text == '')
	  {
		   document.getElementById('searchtext').innerHTML = data;
		   theForm.keyword.focus();
		   return false;
	  }
	  //var searchtext = theForm.search_keyword.value;
	var len = search_text.length;
	if(len < 2)
	{
		document.getElementById('searchtext').innerHTML = data;
		theForm.keyword.focus();
		return false;
	}
	document.getElementById('searchtext').innerHTML = '';
	  return true; 
}
function getHTTPObject()
{
	var xmlhttp = '';
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		try 
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	
		}
		catch (E)
		{
			xmlhttp = false;
		}
	
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		try
		{
			xmlhttp = new XMLHttpRequest();
		}
		catch (e)
		{
			xmlhttp = false;
		}
	}
	 
	return xmlhttp;
}
function ajaxLoader(url)
{
   http = new getHTTPObject();
   http.onreadystatechange = function(){
   if(http.readyState == 4)
   {
     var x = http.responseText;
	 if(x)
	 {
	    document.getElementById('loader_test').style.display = 'none';
		document.getElementById('loaderout').style.display = 'block';
	 }
	   
   }
   }
   http.open("GET",url);
   http.send(null);
}
function getAddtoContact(comid,code,num)
{
  var url = '/includes/addtocontact.php?comid='+comid+'&code='+code+'&num='+num;
   http1 = new getHTTPObject();
   http1.onreadystatechange = function(){
   if(http1.readyState == 4)
   {
     var res = http1.responseText;
	 if(res != '')
	   window.location.href = 'tel:'+num;
   }
   }
   http1.open("GET",url);
   http1.send(null);
}
function getBannerClick(bannervars)
{
  var url = '/includes/bannerclicks.php?bannervar='+bannervars;
   http2 = new getHTTPObject();
   http2.onreadystatechange = function(){
   if(http2.readyState == 4)
   {
     var res1 = http2.responseText;
	 if(res1 != '')
	   window.location.href = 'tel:'+res1;
   }
   }
   http2.open("GET",url);
   http2.send(null);
}


