/****   This function is for change language ***/
function test1(urlvar)
{
	//alert("hello" + urlvar);
	if(document.getElementById('txtuserid'))
	{
		var u=document.getElementById('txtuserid').value;
		document.location=urlvar+"&ud=" + u;
	}
	else
	{
		document.location=urlvar;
	}

}
/***************/

/******   This function is for golfcourseoperators if id and password are blank ***/


function NumberValidation(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		return false;
	}
	else
	{
		return true;
	}
}


function isNumberKey1(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
	{
		return false;
	}
	else
	{
		return true;
	}
}

/****** toggle button for left side when customer login  date : 22 june  *****/
function cou(id, checkval)
{
	//alert("hello ====>" + id);
	//alert("hello ====>" + checkval);
	var xmlhttp = false;
	try {
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');
	}
	catch (e)
	{	
		try
		{
			xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		catch (E)
		{
			xmlhttp = false;
		}
	}
	if(!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{	
		xmlhttp = new XMLHttpRequest();
	}
	if(checkval == "fstbtn")
	{
		if(document.tglbnt.fstbtn.value == "On")
		{
			document.tglbnt.fstbtn.value = "Off";
			var file = "ajaxCustomerTogglebtn.php?fbtn=Off";
//			var file = "togglebutton1.php?fbtn=" + id;
		}
		else
		{
			document.tglbnt.fstbtn.value = "On";
			var file = "ajaxCustomerTogglebtn.php?fbtn=On";
		}
			xmlhttp.open('GET', file, true);
			//window.open(file);
			xmlhttp.send(null);
			return;
	}
	if(checkval == "sndbtn")
	{
		if(document.tglbnt.sndbtn.value == "On")
		{
			document.tglbnt.sndbtn.value = "Off";
			var file1 = "ajaxCustomerTogglebtn.php?sbtn=Off";
		}
		else
		{
			document.tglbnt.sndbtn.value = "On";
			var file1 = "ajaxCustomerTogglebtn.php?sbtn=On";
		}
			xmlhttp.open('GET', file1, true);
			//window.open(file);
			xmlhttp.send(null);
			return;
	}
	if(checkval == "trdbtn")
	{
		if(document.tglbnt.trdbtn.value == "On")
		{
			document.tglbnt.trdbtn.value = "Off";
			var file2 = "ajaxCustomerTogglebtn.php?tbtn=Off";
//			var file = "togglebutton1.php?fbtn=" + id;
		}
		else
		{
			document.tglbnt.trdbtn.value = "On";
			var file2 = "ajaxCustomerTogglebtn.php?tbtn=On";
		}
			xmlhttp.open('GET', file2, true);
			//window.open(file);
			xmlhttp.send(null);
			return;

	}

}
/*****/

/**********  this funciton is for golfers.php ***/
function golfers_locate(id,checkVal)
{
			//alert(id);
			//alert(checkVal);
				var xmlhttp=false; 
				
				try {
					xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); 
				} 
				catch (e){
					try	{
						xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
					} 
					catch (E){
						xmlhttp = false;
					}
				}
				if (!xmlhttp && typeof XMLHttpRequest!='undefined') 
				{
							xmlhttp = new XMLHttpRequest(); 
				}
				
				if(checkVal == "country")
					var file = "golfersCountryCode.php?country="+id; 
		    
				xmlhttp.open('GET', file, true); 
				
			  //window.open(file);
		
			   xmlhttp.onreadystatechange=function() 
			   {
		        if (xmlhttp.readyState==4) 
		        {
		          var content3 = xmlhttp.responseText; 
					 		if( content3 )
					 		{ 
										//alert(content3);
								var valArr  = content3.split("*");
								countryVal = valArr[0];
								document.getElementById('countryCode').innerHTML = countryVal; 
							}    	
				   }
			   }
			    xmlhttp.send(null); //Nullify the XMLHttpRequest
			    return;	
}//Over Function

/****/
/*
function golfers_blank()
{
/*  if(document.frm_golfers.country.selectedIndex == 0)
  {
    alert("Select Country");
    document.frm_golfers.country.focus();
    return false;
  } 
  if(document.frm_golfers.countryMobileno.value == "")
  {
    alert("Please enter your mobile number.");
    document.frm_golfers.countryMobileno.focus();
    return false;
  }
  if(document.frm_golfers.txtpwd.value == "")
  {
    alert("Please enter your password.");
    document.frm_golfers.txtpwd.focus();
    return false;
  }
}
*/
// Useful for preference form for customer

function preference_savingsBlank()
{	
	if(document.prefSavings.cmbsaving.selectedIndex == 0)
	{
		alert("Please select minimum savings.");
		document.prefSavings.cmbsaving.focus();
		return false;
	}	
	/*if(document.prefSavings.cmbplyr.selectedIndex == 0)	
	{
		alert("Please Select No of Players");
		document.prefSavings.cmbplyr.focus();
		return false;
	}*/
} // End function