function loginverify()

{

var valid2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var ok = "yes";

if (document.logintoaccount.username.value == "")

{

alert("Please enter your username");
return false;

}

var temp1;
for (var i=0; i<document.logintoaccount.username.value.length; i++) {
temp1 = "" + document.logintoaccount.username.value.substring(i, i+1);
if (valid2.indexOf(temp1) == "-1") ok = "no";
}
if (ok == "no") {
alert("Your username may only include letters and numbers");
return false;
}

if (document.logintoaccount.password.value == "")

{

alert("Please enter your password");
return false;

}

var temp2;
for (var i=0; i<document.logintoaccount.password.value.length; i++) {
temp2 = "" + document.logintoaccount.password.value.substring(i, i+1);
if (valid2.indexOf(temp2) == "-1") ok = "no";
}
if (ok == "no") {
alert("Your password may only include letters and numbers");
return false;
}

else

{

return true;

}

}

















function ltaverify()

{

var valid1 = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-'&";

var ok = "yes";
var d = new Date();

var currentdateyIndex = document.getElementById("setyear").selectedIndex;
var currentdatey = document.getElementById('setyear')[currentdateyIndex].value;
var currentdatemIndex = document.getElementById("setmonth").selectedIndex;
var currentdatem = document.getElementById('setmonth')[currentdatemIndex].value;
var currentdatedIndex = document.getElementById("setday").selectedIndex;
var currentdated = document.getElementById('setday')[currentdatedIndex].value;

var currentdatey = parseInt(currentdatey);
var currentdatem = parseInt(currentdatem);
var currentdated = parseInt(currentdated);


if (document.addreminder.subject.value == "")

{

alert("Please enter a subject");
return false;

}

if (document.addreminder.subject.value.length > "50")

{

alert("Please enter a shorter subject");
return false;

}


var temp1;
for (var i=0; i<document.addreminder.subject.value.length; i++) {
temp1 = "" + document.addreminder.subject.value.substring(i, i+1);
if (valid1.indexOf(temp1) == "-1") ok = "no";
}
if (ok == "no") {
alert("The subject may only include:" + '\n' +  '\n' + "Alphanumeric characters," + '\n' + "dashes, ampersands and apostrophes.");
return false;
}


if (document.addreminder.message.value == "")

{

alert("Please enter a message");
return false;

}


if (document.addreminder.message.value.length > "2000")

{

alert("Please enter a shorter message");
return false;

}


if (document.addreminder.setyear.value < d.getYear())

{

alert("Please select a date in the future.");
return false;

}

if (document.addreminder.setyear.value <= d.getYear() && document.addreminder.setmonth.value <= d.getMonth())

{

alert("Please select a date in the future.");
return false;

}

else if (document.addreminder.setyear.value <= d.getYear() && document.addreminder.setmonth.value <= d.getMonth()+1 && document.addreminder.setday.value <= d.getDate())

{

alert("Please select a date in the future.");
return false;

}


switch (currentdatem)
{
case 1:
	$datevalidate = "ok";
  break;
case 2:
	if (currentdatey != "2012" && currentdated > "28") { alert ('Invalid date - You can not select more than 28 days'); return false; }
	if (currentdatey == "2012" && currentdated > "29") { alert ('Invalid date - You can not select more than 29 days'); return false; }
	if (currentdatey == "2016" && currentdated > "29") { alert ('Invalid date - You can not select more than 29 days'); return false; }
	if (currentdatey == "2020" && currentdated > "29") { alert ('Invalid date - You can not select more than 29 days'); return false; }
 break;
case 3:
	$datevalidate = "ok";
  break;
case 4:
	if (currentdated > "30") { alert ('Invalid date - You can not select more than 30 days'); return false; };
  break;
case 5:
	$datevalidate = "ok";
  break;
case 6:
	if (currentdated > "30") { alert ('Invalid date - You can not select more than 30 days'); return false; };
  break;
case 7:
	$datevalidate = "ok";
  break;
case 8:
	$datevalidate = "ok";
  break;
case 9:
	if (currentdated > "30") { alert ('Invalid date - You can not select more than 30 days'); return false; };
  break;
case 10:
	$datevalidate = "ok";
  break;
case 11:
	if (currentdated > "30") { alert ('Invalid date - You can not select more than 30 days'); return false; };
  break;
default:
	$datevalidate = "ok";
}



if (document.addreminder.repeat.value == "Please Select")

{

alert("Please select whether to repeat the reminder");
return false;

}


if (document.addreminder.repeat.value == "Yes" && document.addreminder.yearly.value == "0" && document.addreminder.monthly.value == "0" && document.addreminder.weekly.value == "0" && document.addreminder.daily.value == "0")

{

alert("Please select a repeat period or change 'Repeat' to 'No'");
return false;

}


if (document.addreminder.active.value == "Please Select")

{

alert("Please select whether to activate reminder");
return false;

}



else

{

return true;

}

}

















function upaccverify()

{

valid2 = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
valid3 = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
ok = "yes";



if (""==document.updateacc.firstname.value)

 {

alert("You must specify a first name.");

return false;
 
 }


var temp1;
for (var i=0; i<document.updateacc.firstname.value.length; i++) {
temp1 = "" + document.updateacc.firstname.value.substring(i, i+1);
if (valid3.indexOf(temp1) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid character in first name");
return false;
}


if (""==document.updateacc.surname.value)

 {

alert("You must specify a surname.");

return false;
 
 }


var temp2;
for (var i=0; i<document.updateacc.surname.value.length; i++) {
temp2 = "" + document.updateacc.surname.value.substring(i, i+1);
if (valid3.indexOf(temp2) == "-1") ok = "no";
}
if (ok == "no") {
alert("Invalid character in surname");
return false;
}


if (""==document.updateacc.usernameac.value)

 {

alert("You must specify a username.");

return false;
 
 }


var temp3;
for (var i=0; i<document.updateacc.usernameac.value.length; i++) {
temp3 = "" + document.updateacc.usernameac.value.substring(i, i+1);
if (valid2.indexOf(temp3) == "-1") ok = "no";
}
if (ok == "no") {
alert("Usernames may only include:" + '\n' +  '\n' + "Alphanumeric characters.");
return false;
}


if (""==document.updateacc.passwordac.value)

 {

alert("You must specify a password.");

return false;
 
 }


var temp4;
for (var i=0; i<document.updateacc.passwordac.value.length; i++) {
temp4 = "" + document.updateacc.passwordac.value.substring(i, i+1);
if (valid2.indexOf(temp4) == "-1") ok = "no";
}
if (ok == "no") {
alert("Passwords may only include:" + '\n' +  '\n' + "Alphanumeric characters.");
return false;
}



if (document.updateacc.passwordac.value != document.updateacc.passwordchk.value)

 {

alert("Your passwords do not match.");

return false;
 
 }


if(""==document.updateacc.email.value)

 { 

alert("You must specify your e-mail address.");
return false; 

 }

if (!/^([\w+_-]+(?:\.[\w+_-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i.test(document.updateacc.email.value))

{

alert("Not a valid e-mail address");

return false;

}


else

{

return true;

}


}




