//Developed by Chris Mulholland.
//Used in conjunction with genForm.js

//*****Set-up variables. Do not change or remove.
var pass;
var initFocus;

//*****Customized fields
// Enter field name to focus on when form loads. Comment out if not desired.
initFocus = "accountNumber"; 


//Update the fields below, following this format. 

var validationSet = {
		'gen': {// Do not remove this. <span id="genError"></span> should be added to top of the document
			'genError': "<img class='warningTriangle' src='/img/warningTriangle.gif'/>There's a problem with some of the details you've entered.<br />Please re-enter the information where indicated below."
		},
		'accountNumber': {
			'emptyError': 'Please enter your Yell customer account number.',
			'invalidError': 'Your account number must be 8 digits.'
		},
		'email': {
			'emptyError': 'Please enter your email address.',
			'invalidError': 'This must be a valid email address.'
		},
		'userID': {
			'emptyError': 'Please enter your Yell username.'
		},
		'password': {
			'emptyError': 'Please enter your password.'
		}
	};

//Add the validation functions below. Full list of functions available can be found in genForm.js
function checkForm(myform){
	//sets pass variable to true. Do not remove.
	pass = true;
	
	//Call a function for each field. Modify this
	customRegExp('accountNumber',/^[0-9]{8}$/);
	checkEmail('email');

	//Sets pass variables. Do not remove.
	if(!pass){
		failed();
		return false;
	}else{passed();}
}
function checkForm2(myform){
	//sets pass variable to true. Do not remove.
	pass = true;
	
	//Call a function for each field. Modify this
	notEmpty('userID');
	notEmpty('password');

	//Sets pass variables. Do not remove.
	if(!pass){
		failed();
		return false;
	}else{passed();}
}