
/*****************************  user search***********************************/
var xmlHttp

function userSearch(str,id)
{
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="search_user.php?q="+str+"&page="+id
	//url=url+"&sid="+(Math.random()/0.1)
//alert(url);
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange=stateChanged; 
	
}

function stateChanged() 
{ 
	
	if (xmlHttp.readyState==4 )
	{ 
		//
		document.getElementById("tesstst").innerHTML=xmlHttp.responseText 
		//alert (document.getElementById("tesstst").innerHTML)
	} 
}
function GetXmlHttpObject1()
	{
		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;
	}
			
/**********************  GETTING HOST ID************************/	
	
	 
		function getHostId()
		{ 	
		
			xmlHttp=GetXmlHttpObject2()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
			var url = "check_hostid.php?param_host=";
			
			
			
			/* Print the message to use while checking the database: */
			document.getElementById("reghostid").innerHTML = "Checking..."; 
			/* We\'re assuming your username input ID is "username" */ 
			var host_id = document.register.hostid.value;
			xmlHttp.open("GET", url + escape(host_id), true);
			
			xmlHttp.onreadystatechange = handleHttpResponse2; 
			xmlHttp.send(null); 
		}
		 
		function handleHttpResponse2() 
		{ 
			if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
			{ 
				
				document.getElementById("reghostid").innerHTML = xmlHttp.responseText; 
				 if(document.getElementById("chk_avi_host").value==0)
				 {
				 document.getElementById("hostid").value="";
				
				 }
				
				
			}
		 }
		 
		 function GetXmlHttpObject2()
			{
				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;
			}
		


		
/**************************CHECKING EMAIL FOR REGISTRATION****************************************/		
		 
		function check_for_Email()
		{ 	
			xmlHttp=GetXmlHttpObject3()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
			var url = "check_email.php?param_email=";
			
			if(document.register.email.value != ""){
				if((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.register.email.value))==false) 
				{
					document.getElementById("regemail").innerHTML="Enter a Valid Email Address.";
					document.register.email.focus();
					return false;
				}
			}
			/* Print the message to use while checking the database: */
			document.getElementById("regemail").innerHTML = "Checking..."; 
			/* We\'re assuming your username input ID is "username" */ 
			var name = document.register.email.value;
			//alert(url);
			xmlHttp.open("GET", url + escape(name), true);
			xmlHttp.onreadystatechange = handleHttpResponse3; 
			xmlHttp.send(null); 
		}
		 
		function handleHttpResponse3() 
		{ 
			if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
			{ 
				
				document.getElementById("regemail").innerHTML = xmlHttp.responseText; 
				 if(document.getElementById("chk_email").value==0)
				 {
					 document.register.email.value="";
				 }
				
				
			}
		 }
		 /****************************************************************/	
	function GetXmlHttpObject3()
	{
		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 getHTTPObject()
{
	var xmlhttp; 
	if (!xmlhttp && typeof XMLHttpRequest != "undefined") 
	{ 
		try
		{
			 xmlhttp = new XMLHttpRequest();
		} 
		catch (e) 
		{ 
			xmlhttp = false; 
		}
	} 
	return xmlhttp; 
} 
var http = getHTTPObject();*/

/********************************************************************/

	var xmlHttp;
	 
		function giveManagerId(id)
		{ 	
		
			if(id==0){
			if(document.getElementById("mantable").style.display=="")
			document.getElementById("mantable").style.display="none";
			} else {
				if(document.getElementById("mantable").style.display=="none")
				document.getElementById("mantable").style.display="";
				//document.getElementById("managerial").value=id;
			}

			xmlHttp=GetXmlHttpObject_des()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
			var url = "select_manager.php?id=" +id;
			
			
			xmlHttp.open("GET",url,true)
			xmlHttp.send(null)
			xmlHttp.onreadystatechange=handleHttpResponse_des 
		}
		 
		function handleHttpResponse_des() 
		{ 
			if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
			{ 
				document.getElementById("manager").innerHTML = xmlHttp.responseText; 
			}
		 }
		 
		 function GetXmlHttpObject_des()
			{
				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;
			}
		
/***********************************************/

/*************** getting admin user *****************************************/

function adminUserSearch(str,id)
{
	xmlHttp=GetXmlHttpObject_admin()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="search_admin_user.php?q="+str+"&page="+id
	//url=url+"&sid="+(Math.random()/0.1)
//alert(url);
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange=stateChanged_admin; 
	
}

function stateChanged_admin() 
{ 
	
	if (xmlHttp.readyState==4 )
	{ 
		//
		document.getElementById("admintest").innerHTML=xmlHttp.responseText 
		//alert (document.getElementById("tesstst").innerHTML)
	} 
}
function GetXmlHttpObject_admin()
	{
		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;
	}
			

/***************************************************/
/********************** cehck for admin user ***************/

	 
		function check_admin_user()
		{ 	
				id = isWhitespace(document.adminreg.username.value);
				if ( id == true ) 
				{
					document.getElementById("ad_user").innerHTML="Enter User Name";
					document.adminreg.username.focus();
					return false;
				}
				id = document.adminreg.username.value;
				if (isAllCharacters(id) == false ) 
				{
					document.getElementById("ad_user").innerHTML=" Enter Valid User Name";
					document.adminreg.username.focus();
					return false;
				}
				
				if (id.length <= 4) 
				{
					document.getElementById("ad_user").innerHTML=" Enter atleast 5 character for username ";
					document.adminreg.username.focus();
					return false;
				}
			xmlHttp=GetXmlHttpObject_chk()
			if (xmlHttp==null)
			{
				alert ("Browser does not support HTTP Request")
				return
			} 
			var url = "check_adminuser.php?param_host=";
			
			
			
			/* Print the message to use while checking the database: */
			document.getElementById("ad_user").innerHTML = "Checking..."; 
			/* We\'re assuming your username input ID is "username" */ 
			var user_un = document.adminreg.username.value;
			xmlHttp.open("GET", url + escape(user_un), true);
			
			xmlHttp.onreadystatechange = handleHttpResponse_chk; 
			xmlHttp.send(null); 
		}
		 
		function handleHttpResponse_chk() 
		{ 
			if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
			{ 
				
				document.getElementById("ad_user").innerHTML = xmlHttp.responseText; 
				 if(document.getElementById("chk_avi_admin").value==0)
				 {
				document.adminreg.username.value="";
				
				 }
				
				
			}
		 }
		 
		 function GetXmlHttpObject_chk()
			{
				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;
			}
		

/******************************************************/
		 
			
		 /**************************CHECKING EMAIL FOR REGISTRATION****************************************/		
		 		 
		 		function check_for_Edit_Email(email)
		 		{ 	
		 			xmlHttp=GetXmlHttpObject_edit()
		 			if (xmlHttp==null)
		 			{
		 				alert ("Browser does not support HTTP Request")
		 				return
		 			} 
		 			var url = "check_edit_email.php?email=" + email +"&param_email=";
		 			
		 			if(document.profileform.useremail.value != ""){
		 				if((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.profileform.useremail.value))==false) 
		 				{
		 					document.getElementById("profile_email").innerHTML="Enter a Valid Email Address.";
		 					document.profileform.useremail.focus();
		 					return false;
		 				}
		 			}
		 			/* Print the message to use while checking the database: */
		 			document.getElementById("profile_email").innerHTML = "Checking..."; 
		 			/* We\'re assuming your username input ID is "username" */ 
		 			var name = document.profileform.useremail.value;
		 			//alert(url);
		 			xmlHttp.open("GET", url + escape(name), true);
		 			xmlHttp.onreadystatechange = handleHttpResponse_edit; 
		 			xmlHttp.send(null); 
		 		}
		 		 
		 		function handleHttpResponse_edit() 
		 		{ 
		 			if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
		 			{ 
		 				
		 				document.getElementById("profile_email").innerHTML = xmlHttp.responseText; 
		 				 if(document.getElementById("chk_email").value==0)
		 				 {
		 					 document.profileform.useremail.value="";
		 				 }
		 				
		 				
		 			}
		 		 }
		 		 /****************************************************************/	
		 	function GetXmlHttpObject_edit()
		 	{
		 		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;
		 	}
		 			
	/****************************************************************************************************/
			
		 	/**************************CHECKING EMAIL FOR REGISTRATION****************************************/		
		 			 
		 			function check_for_concierge_Email()
		 			{ 	
		 				xmlHttp=GetXmlHttpObject_cononcierge()
		 				if (xmlHttp==null)
		 				{
		 					alert ("Browser does not support HTTP Request")
		 					return
		 				} 
		 				var url = "check_concierge_email.php?param_email=";
		 				
		 				if(document.conform.email.value != ""){
		 					if((/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.conform.email.value))==false) 
		 					{
		 						document.getElementById("conemail").innerHTML="Enter a Valid Email Address.";
		 						document.conform.email.focus();
		 						return false;
		 					}
		 				}
		 				/* Print the message to use while checking the database: */
		 				document.getElementById("conemail").innerHTML = "Checking..."; 
		 				/* We\'re assuming your username input ID is "username" */ 
		 				var name = document.conform.email.value;
		 				//alert(url);
		 				xmlHttp.open("GET", url + escape(name), true);
		 				xmlHttp.onreadystatechange = handleHttpResponse_cononcierge; 
		 				xmlHttp.send(null); 
		 			}
		 			 
		 			function handleHttpResponse_cononcierge() 
		 			{ 
		 				if (xmlHttp.readyState == 4 || xmlHttp.readyState=="complete") 
		 				{ 
		 					
		 					document.getElementById("conemail").innerHTML = xmlHttp.responseText; 
		 					 if(document.getElementById("chk_email").value==0)
		 					 {
		 						 document.conform.email.value="";
		 					 }
		 					
		 					
		 				}
		 			 }
		 			 /****************************************************************/	
		 		function GetXmlHttpObject_cononcierge()
		 		{
		 			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 SearchPaidAmountUser(str,id)
		 		{
		 			xmlHttp=GetXmlHttpObjectPaid()
		 			if (xmlHttp==null)
		 			{
		 				alert ("Browser does not support HTTP Request")
		 				return
		 			} 
		 			
		 			var url="search_user_paid.php?q="+str+"&page="+id
		 			//url=url+"&sid="+(Math.random()/0.1)
		 		//alert(url);
		 			xmlHttp.open("GET",url,true)
		 			xmlHttp.send(null)
		 			xmlHttp.onreadystatechange=stateChanged; 
		 			
		 		}

		 		function stateChanged() 
		 		{ 
		 			
		 			if (xmlHttp.readyState==4 )
		 			{ 
		 				//
		 				document.getElementById("tesstst").innerHTML=xmlHttp.responseText 
		 				//alert (document.getElementById("tesstst").innerHTML)
		 			} 
		 		}
		 		function GetXmlHttpObjectPaid()
		 			{
		 				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;
		 			}
//=====================================================================================================
// Admin search Concierge Members Ajax Script
var xmlHttp

function conciergeMember(str,id)
{
	alert('str-------->'+str);
	alert('id--------->'+id);
	xmlHttp=GetXmlHttpObject1()
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request")
		return
	} 
	
	var url="search_admin_conciege_member.php?q="+str+"&page="+id
	//url=url+"&sid="+(Math.random()/0.1)
    alert(url);
	xmlHttp.open("GET",url,true)
	xmlHttp.send(null)
	xmlHttp.onreadystatechange=stateChangedConciergeMember; 
	
}

function stateChangedConciergeMember() 
{ 
	
	if (xmlHttp.readyState==4 )
	{ 
		alert(xmlHttp.responseText);
		//document.getElementById("displayconciergemember").innerHTML=xmlHttp.responseText 
		//alert (document.getElementById("tesstst").innerHTML)
	} 
}
function GetXmlHttpObject1()
	{
		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;
	}
//=====================================================================================================