
re = /^\d+(\d+)+$/ 



function submitCard(theForm) {
	if (!theForm.terms.checked) {
		alert("You must agree to the Terms and Conditions.")
		return false;
	}

	if(re.test(theForm.textCard.value)){ 
		if(theForm.textCard.value.length == 12 || theForm.textCard.value.length == 6){
			return true;		
		
		}else{ 
			alert("Please check the scratch card is 12 digits long.")
				theForm.textCard.focus()
				theForm.textCard.select()
				return false;


		}
	
	}else{
			alert("Please check the scratch card is 12 digits long and Numeric.")
				theForm.textCard.focus()
				theForm.textCard.select()
				return false;

	}

}

function submitReq(theForm) {
	if(!re.test(theForm.txtMobileNumber.value)){ 
		alert("Please check the number is in international format with no characters e.g. 447932555555")
				theForm.txtMobileNumber.focus()
				theForm.txtMobileNumber.select()
				return false;
}
	return true;

}

function submitReg(theForm) {
	if(!re.test(theForm.txtMobileNumber.value)){ 
		alert("Please check the number is in international format with no characters e.g. 447932555555")
				theForm.txtMobileNumber.focus()
				theForm.txtMobileNumber.select()
				return false;

	
	}else if(theForm.txtPin == null){
			return true;

	}else if(!(theForm.txtPin.value == theForm.txtConfirmPin.value)){
			alert("Please make sure the pins are the same.")
				theForm.txtPin.value = "";
				theForm.txtConfirmPin.value ="";
				theForm.txtPin.focus()
				theForm.txtPin.select()
				return false;

	}else if(theForm.txtPin.value.length != 4){
		alert("Please make sure the pin in 4 digits long.")
				theForm.txtPin.value = "";
				theForm.txtConfirmPin.value ="";
				theForm.txtPin.focus()
				theForm.txtPin.select()
				return false;

	}else { return true;}





}

function submitLogin(theForm) {
	

	if( (!re.test(theForm.txtPhone.value)) || (!re.test(theForm.txtPin.value)) ){
			return false;

	}else if( (!(theForm.txtPin.value.length > 0)) || (!(theForm.txtPhone.value.length > 0)) ){
			return false;

	}else { return true;}





}


