



function checkEmail(form){
var valid  = true;
var Temp   = form.emailAddress;
var AtSym  = Temp.value.indexOf('@');
var Period = Temp.value.lastIndexOf('.');
var Space  = Temp.value.indexOf(' ');
var Length = Temp.value.length - 1
if ((AtSym < 1) || (Period <= AtSym+1) || (Period == Length) || (Space != -1)) {
valid = false;
}
return valid;
}
function handleErrors() {
if (typeof qs['errorCode'] != "undefined") {
switch (qs['errorCode']) {
case '1':
if (typeof qs['fullErrorCode'] != "undefined") {
var fullErrorCode = qs['fullErrorCode'];
if (typeof fullErrorCode == "object") {
for (var pp = 0; pp < fullErrorCode.length; pp++) {
var errorWhere = fullErrorCode[pp].substring(0,3);
var errorWhat  = fullErrorCode[pp].substring(3,6);
printError(errorWhere,errorWhat);
}
} else {
var errorWhere = fullErrorCode.substring(0,3);
var errorWhat  = fullErrorCode.substring(3,6);
printError(errorWhere,errorWhat);
}
}
break;
case '2':
document.write('Internal Systems Error, Please Try Later');
break;
}
}
}
function printError(where,what) {
var whereMsg = "";
switch (where) {
case '101': whereMsg = "Title:";break;
case '102': whereMsg = "First Name";break;
case '103': whereMsg = "Surname";break;
case '104': whereMsg = "E-Mail Address";break;
case '105': whereMsg = "Mobile Telephone Number";break;
case '106': whereMsg = "UK Home Telephone Number<br><span class='regMainTextSmall'>(inc. STD, starting 01 or 02)</span>";break;
case '107': whereMsg = "Address Line 1";break;
case '108': whereMsg = "Town or City";break;
case '110': whereMsg = "Country";break;
case '111': whereMsg = "Town or City";break;
case '112': whereMsg = "Username";break;
case '113': whereMsg = "Password";break;
case '114': whereMsg = "Password Hint";break;
case '115': whereMsg = "Terms and Conditions";break;
case '116': whereMsg = "Receive Newsletters";break;
case '117': whereMsg = "Date of Birth";break;
case '118': whereMsg = "Address Line 2";break;
case '119': whereMsg = "Work Telephone Number";break;
case '121': whereMsg = "Address Line 3";break;
case '122': whereMsg = "Third Party Contact";break;
case '123': whereMsg = "Home ISP";break;
case '124': whereMsg = "What is your supporter status?";break;
case '125': whereMsg = "Home Game Attendance";break;
case '126': whereMsg = "Away Game Attendance";break;
case '127': whereMsg = "Marital status";break;
case '128': whereMsg = "Number of Children";break;
case '129': whereMsg = "Sky Sports Supplier";break;
case '130': whereMsg = "Contact Telephone Number";break;
case '131': whereMsg = "Sky Card Number";break;
}
var whatMsg = "";
switch (what) {
case '101': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " must be filled in.";}break;
case '102': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " is of invalid length.";}break;
case '103': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " is not an e-mail address.";}break;
case '104': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " has invalid characters.";}break;
case '105': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " has an invalid value.";}break;
case '106': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " must consist of numbers, plus signs and whitespace only";}break;
case '107': if (whereMsg != "") {whatMsg = "That username exists already, please try another,<br> or use the suggest username button.";}break;
case '108': if (whereMsg != "") {whatMsg = "The field " + whereMsg + " is not a valid date.";}break;
}
document.writeln(whatMsg + "<br>");
}
var userName = "";
if (typeof qs['userName'] != "undefined") {
userName = qs['userName'];
}

