		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;
		}
		
		///////////////////////////////////////////////////////////////////////////////////////// general ajx function

		function ajaxCtntMe(phppage,qrylst,divid)
		{
			//alert (divid);
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst;
			//url=url+"&sid="+Math.random();
			//alert (url);
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChanged(divid); }

			xmlHttp.send(null);
			
			return false;
		}
		
		function onstateChanged(ctrlname) 
		{ 
			//alert (ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = 	xmlHttp.responseText;
				//alert(document.getElementById(ctrlname).style.display);
				document.getElementById(ctrlname).innerHTML = rslt;
				//document.getElementById(ctrlname).style.display = "block";
			}
		
		}

		function check_available(phppage,qrylst,divid,ctr)
		{
			//alert (divid);
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			url=url+"?"+qrylst;
			//url=url+"&sid="+Math.random();
			//alert (url);
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChanged1(divid,ctr); }

			xmlHttp.send(null);
			
			return false;
		}
		
		function vote_to_party(phppage,party_id,user_id,divid)
		{
			//alert (phppage);
			//alert (user_id);
			//alert (match_id);
			//alert (home_vote);
			//alert (away_vote);
			//alert (divid);
				
			xmlHttp=GetXmlHttpObject();
			
			if (xmlHttp==null)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
			
			var url=phppage;
			
			url=url+"?user_id="+user_id;
			url=url+"&party_id="+party_id;

			
			//url=url+"&sid="+Math.random();
			//alert (url);
			
			xmlHttp.open('GET',url,true);

			xmlHttp.onreadystatechange=function(){ onstateChanged2(divid); }

			xmlHttp.send(null);
			
			
		return false;
		}
		
		function onstateChanged1(ctrlname,ctr) 
		{ 
			//alert (ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = 	xmlHttp.responseText;
				//alert(document.getElementById(ctrlname).style.display);
				document.getElementById(ctrlname).innerHTML = rslt;
				if (rslt != "Available")
					document.getElementById(ctr).focus();
				//document.getElementById(ctrlname).style.display = "block";
			}
		
		}
		
		function onstateChanged2(ctrlname) 
		{ 
			if(xmlHttp.readyState==4)
			{ 
				var rslt = 	xmlHttp.responseText;
				
				document.getElementById(ctrlname).innerHTML = rslt;
				document.getElementById("vote_match_msg1").style.display = "block";				
			}
		
		}
		
		function onstateChanged3(ctrlname) 
		{ 
			//alert (ctrlname);
			if(xmlHttp.readyState==4)
			{ 
				var rslt = 	xmlHttp.responseText;
				//alert(document.getElementById(ctrlname).style.display);
				//alert(rslt); 
				document.getElementById(ctrlname).innerHTML = rslt;
				
				//document.getElementById(ctrlname).style.display = "block";
			}
		
		}
		////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		
