<!--
	function isloginok()
	{
		var myerror = document.getElementById('notrlyok');
		var mymobno = document.getElementById('mobno');
		var mypass = document.getElementById('password');
		var founderror = false;

		myerror.style.display = "none";

		if (mymobno.value == "") 
		{
			founderror = true;
			document.getElementById('cusmobile').innerHTML = "<font color='#d11f13'><strong>* Mobile Number:</strong></font>";
		}
		else
		{
			document.getElementById('cusmobile').innerHTML = "<font color='#333333'>Mobile Number:</font>";
		}
		
		if (mypass.value == "") 
		{
			founderror = true;
			document.getElementById('cuspass').innerHTML = "<font color='#d11f13'><strong>* Password:</strong></font>";
		}
		else
		{
			document.getElementById('cuspass').innerHTML = "<font color='#333333'>Password:</font>";
		}
		
		
		if (founderror) 
		{
			return false;
		}
		else
		{
			return true;
		}
		
	}

	function checkgender()
	{
		var mygen = document.getElementById('gender');
		
		if (mygen.value != "Male" && mygen.value != "Female") 
		{
			mygen.value = "-- Select One --";
		}
	}
	
	
	function openDetails(divid)
	{
		var mydiv = document.getElementById(divid);
		
		if (mydiv.style.display == "block") {
			mydiv.style.display = "none";
		}
		else {
			mydiv.style.display = "block";
		}
	}
	
	
	  function isNumberKey(evt)
	  {
		 var charCode = (evt.which) ? evt.which : event.keyCode
		 if (charCode > 31 && (charCode < 48 || charCode > 57))
			return false;
		 return true;
	  }

	
	
	function IsNumeric(sText)
	{		
		var ValidChars = "0123456789";
		for (i = 0; i < sText.length; i++) 
		{
			if (ValidChars.indexOf(sText.charAt(i)) == -1) 
			{
				return false;
			}
		}
		return true;
	}
	
	
	function checkregform() {
		var idcardno = document.getElementById('idcardno').value;
		var firstname = document.getElementById('firstname').value;
		var lastname = document.getElementById('lastname').value;
		var mobno = document.getElementById('mobno').value;
		var password = document.getElementById('password').value;
		var confpassword = document.getElementById('confpassword').value;
		var dob1 = document.getElementById('dobday').value;
		var dob2 = document.getElementById('dobmonth').value;
		var dob3 = document.getElementById('dobyear').value;		
		var locality = document.getElementById('locality').value;
		var gender = document.getElementById('gender').value;
		var drink = document.getElementById('drink').value;
		var email = document.getElementById('email').value;
		var terms = document.getElementById('termsandconditions').checked;
		var privacy = document.getElementById('privacypolicy').checked;		
		var mygroup = document.getElementById('mygroup').value;
		var errorfound = false;
		var error = "";
		
		if (idcardno == "") 
		{
			errorfound = true;
			document.getElementById('cusidcardno').innerHTML = "<font color='#d11f13'><strong>* ID Card No:</strong></font>";
		}
		else
			document.getElementById('cusidcardno').innerHTML = "<font color='#333333'>ID Card No:</font>";
		
		if (firstname == "") 
		{
			errorfound = true;
			document.getElementById('cusname').innerHTML = "<font color='#d11f13'><strong>* First Name:</strong></font>";
		}
		else
			document.getElementById('cusname').innerHTML = "<font color='#333333'>First Name:</font>";
			
		if (lastname == "") 
		{
			errorfound = true;
			document.getElementById('cuslastname').innerHTML = "<font color='#d11f13'><strong>* Last Name:</strong></font>";
		}
		else
			document.getElementById('cuslastname').innerHTML = "<font color='#333333'>Last Name:</font>";
		
		if (mygroup != -1)
		{
			var codestatus = document.getElementById('codestatus').value;
			if (codestatus == 'notok')
			{
				errorfound = true;
				error += "&bull; The group selected or group code you entered is invalid <br />";
			}
		}
			
		if (!terms) 
		{
			errorfound = true;
			error += "&bull; Please agree with the terms and conditions <br />";
				
		}
		
		if (!privacy) 
		{
			errorfound = true;
			error += "&bull; Please agree with the privacy policy <br />";
				
		}
		
		
		
		if (locality == "-- Select One --") 
		{
			errorfound = true;
				document.getElementById('cuslocality').innerHTML = "<font color='#d11f13'><strong>* Locality:</strong></font>";
		}
		else
			document.getElementById('cuslocality').innerHTML = "<font color='#333333'>Locality:</font>";
		
		if (gender == "Male or Female?") 
		{
			errorfound = true;
				document.getElementById('cusgender').innerHTML = "<font color='#d11f13'><strong>* Gender:</strong></font>";
		}
		else	
		{				
			document.getElementById('cusgender').innerHTML = "<font color='#333333'>Gender:</font>";
		}
		
		if (drink == "-- Select One --") 
		{
			errorfound = true;
				document.getElementById('cusdrink').innerHTML = "<font color='#d11f13'><strong>* Favourite Drink:</strong></font>";
		}
		else
			document.getElementById('cusdrink').innerHTML = "<font color='#333333'>Favourite Drink:</font>";
		
		if (dob1 == "day" || dob1 == "" || dob1 < 0 || dob1 > 31)
		{			 
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else		
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
		
		if (dob2 == "month" || dob2 == "" || dob2 < 0 || dob2 > 12)
		{
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
			
		if (dob3 == "year" || dob3 == "" || dob3.length < 4)
		{
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
		
		if (mobno == "") 
		{
			errorfound = true;
				document.getElementById('cusmobno').innerHTML = "<font color='#d11f13'><strong>* Mobile Number:</strong></font>";
		}
		else
			document.getElementById('cusmobno').innerHTML = "<font color='#333333'>Mobile Number:</font>";
		
		if (password == "") 
		{
			errorfound = true;
			document.getElementById('cuspassword').innerHTML = "<font color='#d11f13'><strong>* Password:</strong></font>";
		}
		else {
			if (password.length < 6) 
			{
				errorfound = true;
				document.getElementById('cuspassword').innerHTML = "<font color='#d11f13'><strong>* Password:</strong></font>";
				error += "&bull; Password must be at least 6 characters (for your own safety)<br /><br/>";
			}
			else
				document.getElementById('cuspassword').innerHTML = "<font color='#333333'>Password:</font>";
		}
		if ((confpassword == "") || (password != confpassword))
		{
			errorfound = true;
			document.getElementById('cusconfpassword').innerHTML = "<font color='#d11f13'><strong>*Confirm Password:</strong></font>";
		}
		else
			document.getElementById('cusconfpassword').innerHTML = "<font color='#333333'>Confirm Password:</font>";
		
		if (email == "") 
		{
			errorfound = true;
			document.getElementById('cusemail').innerHTML = "<font color='#d11f13'><strong>* E-mail Address:</strong></font>";
		}
		else {
			if (echeck(email)==false){
				errorfound = true;
				error += "&bull; Email address was not in the correct format (xxx@xxx.xxx)<br />";
				document.getElementById('cusemail').innerHTML = "<font color='#d11f13'><strong>* E-mail Address:</strong></font>";
			}	
			else
				document.getElementById('cusemail').innerHTML = "<font color='#333333'>E-mail Address:</font>";		
		}
		
		if (errorfound) 
		{
			document.getElementById('regerror').innerHTML = error;
			document.getElementById('regerror').style.display = "block";
			return false;
		}
		
		return true;
	}
	
	function checkupdateform() {
	
		var firstname = document.getElementById('firstname').value;
		var lastname = document.getElementById('lastname').value;		
		var password = document.getElementById('password').value;
		var confpassword = document.getElementById('confpassword').value;
		var dob1 = document.getElementById('dobday').value;
		var dob2 = document.getElementById('dobmonth').value;
		var dob3 = document.getElementById('dobyear').value;
		var locality = document.getElementById('locality').value;
		var gender = document.getElementById('gender').value;
		var drink = document.getElementById('drink').value;
		var email = document.getElementById('email').value;
		var errorfound = false;
		var error = "";
		var codestatus = document.getElementById('codestatus').value;
		
		if (firstname == "") 
		{
			errorfound = true;
			document.getElementById('cusname').innerHTML = "<font color='#d11f13'><strong>* First Name:</strong></font>";
		}
		else
			document.getElementById('cusname').innerHTML = "<font color='#333333'>First Name:</font>";
			
		if (lastname == "") 
		{
			errorfound = true;
			document.getElementById('cuslastname').innerHTML = "<font color='#d11f13'><strong>* Last Name:</strong></font>";
		}
		else
			document.getElementById('cuslastname').innerHTML = "<font color='#333333'>Last Name:</font>";
			
		
		if (locality == "-- Select One --") 
		{
			errorfound = true;
				document.getElementById('cuslocality').innerHTML = "<font color='#d11f13'><strong>* Locality:</strong></font>";
		}
		else
			document.getElementById('cuslocality').innerHTML = "<font color='#333333'>Locality:</font>";
		
		if (gender == "Male or Female?") 
		{
			errorfound = true;
				document.getElementById('cusgender').innerHTML = "<font color='#d11f13'><strong>* Gender:</strong></font>";
		}
		else
			document.getElementById('cusgender').innerHTML = "<font color='#333333'>Gender:</font>";
		
		if (drink == "-- Select One --") 
		{
			errorfound = true;
				document.getElementById('cusdrink').innerHTML = "<font color='#d11f13'><strong>* Favourite Drink:</strong></font>";
		}
		else
			document.getElementById('cusdrink').innerHTML = "<font color='#333333'>Favourite Drink:</font>";
		
		if (dob1 == "day" || dob1 == "")
		{			 
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else		
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
		
		if (dob2 == "month" || dob2 == "")
		{
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
			
		if (dob3 == "year" || dob3 == "" || dob3.length < 4)
		{
			errorfound = true;
				document.getElementById('cusdob').innerHTML = "<font color='#d11f13'><strong>* Date of Birth:</strong></font>";
		}
		else
			document.getElementById('cusdob').innerHTML = "<font color='#333333'>Date of Birth:</font>";
				
		if (password != confpassword)
		{
			errorfound = true;
			document.getElementById('cusconfpassword').innerHTML = "<font color='#d11f13'><strong>*Confirm Password:</strong></font>";
		}
		else
			document.getElementById('cusconfpassword').innerHTML = "<font color='#333333'>Confirm Password:</font>";
		
		if (email == "") 
		{
			errorfound = true;
			document.getElementById('cusemail').innerHTML = "<font color='#d11f13'><strong>* E-mail Address:</strong></font>";
		}
		else {
			if (echeck(email)==false){
				errorfound = true;
				error += "&bull; Email address was not in the correct format (xxx@xxx.xxx)<br />";
				document.getElementById('cusemail').innerHTML = "<font color='#d11f13'><strong>* E-mail Address:</strong></font>";
			}	
			else
				document.getElementById('cusemail').innerHTML = "<font color='#333333'>E-mail Address:</font>";		
		}
		
		if (codestatus == 'notok')
		{
			document.getElementById('cuscodestatus').style.color = "red";
			document.getElementById('cuscodestatus').style.color = "black";	
			return false;
		}
		
		if (errorfound) 
		{
			document.getElementById('regerror').innerHTML = error;
			document.getElementById('regerror').style.display = "block";
			return false;
		}
		return true;
	}
		
		
	function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true					
	}
	
	function showGroupQuestion(groupid)
	{
		$("#questions").html("<br/ >Loading...");
		$.ajax({
				type:"GET",
				url: "ajax/showgroupquestion.asp",
				dataType: "application/x-www-form-urlencoded",
				data:  "groupid=" + groupid + "&r=" + Math.random(),
				async: false,
				success: function(msg){ 
					$("#questions").html(msg);
				}
			});
	}
	
	function showGroupQuestionRegister(groupid, mobno)
	{
		$("#questions").html("<br/ >Loading...");
		$.ajax({
				type:"GET",
				url: "ajax/showgroupquestionRegister.asp",
				dataType: "application/x-www-form-urlencoded",
				data:  "groupid=" + groupid + "&mobno=" + mobno + "&r=" + Math.random(),
				async: false,
				success: function(msg){ 
					$("#questions").html(msg);
				}
			});
	}
	
	
	
	function chkmobnolength(mobno)
	{
		if (mobno.length == 8)
		{
			//document.getElementById("groupdetails").style.display = "block";
			
			//$("#groupdetails").load("ajax/showusergroups.asp?mobno="+mobno+"&r="+Math.random());	
		}
		else
		{
			//document.getElementById("groupdetails").style.display = "none";
			//document.getElementById("mygroup").value = -1;
			//document.getElementById("codestatus").value = "notok";
			//document.getElementById("questiondiv").style.display = "none";
			//document.getElementById("groupcode").value = "";
		}
	}
-->	
