<!-- hide from old browsers

var days = new Array();
days[0] = "Sunday";
days[1] = "Monday";
days[2] = "Tuesday";
days[3] = "Wednesday";
days[4] = "Thursday";
days[5] = "Friday";
days[6] = "Saturday";

var months = new Array();
months[0] = "January";
months[1] = "February";
months[2] = "March";
months[3] = "April";
months[4] = "May";
months[5] = "June";
months[6] = "July";
months[7] = "August";
months[8] = "September";
months[9] = "October";
months[10] = "November";
months[11] = "December";

function checkEmail(strng) {
	var error = "";
	var emailFilter=/^.+@.+\..{2,6}$/;
	if (!(emailFilter.test(strng))) {
		return false;
	}
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\] ']/
	if (strng.match(illegalChars)) {
		return false;
	}
	return true;
}
function formVal(thefields,emailfields) {
	thereturn = true;
	if (thefields!='') {
		fparts = thefields.split(",");
		for (i = 0; i < fparts.length; i++) {
			if (document.getElementById(fparts[i]).value=='') {
				document.getElementById(fparts[i]).style.background='#ff0000';
				thereturn = false;
			}else{
				document.getElementById(fparts[i]).style.background='#ffffff';
			}
		}
	}
	if (emailfields!='') {
		fparts = emailfields.split(",");
		for (i = 0; i < fparts.length; i++) {
			if (!checkEmail(document.getElementById(fparts[i]).value)) {
				document.getElementById(fparts[i]).style.background='#ff0000';
				thereturn = false;
			}else{
				document.getElementById(fparts[i]).style.background='#ffffff';
			}
		}
	}
	
	if (thereturn==false) { alert('You must complete all required fields'); }
	return thereturn;
}


function newsletter_validator(theForm)
{
	thereturn = true;
 	if(theForm.fname.value == "" || theForm.fname.value == "your forename") {
 		 alert("Please enter your forename.");
 		 theForm.fname.focus();
 		 thereturn = false;
 	}

 	 if(theForm.lname.value == "" || theForm.lname.value == "your surname") {
	 	 alert("Please enter your surname.");
	 	 theForm.lname.focus();
	 	 thereturn = false;
 	}

 	if(theForm.fname.value == theForm.lname.value) {
	 	 alert("Your firstname and surname cannot be identical");
	 	 theForm.lname.focus();
	 	 thereturn = false;
	 }

 	 if(!checkEmail(theForm.email.value)) {
	 	 alert("Please enter a valid email address.");
	 	 theForm.email.focus();
	 	 thereturn = false;
 	}

	if (thereturn==true) { theForm.submit(); }

}

// - end hiding -->