// JavaScript Document
function checkdata()
{
     var uppervalue;
	 if (document.register.firstname.value.length == 0 || document.register.firstname.value == "First Name") {
         alert ("Please provide your 'First Name' when you click OK the correct field will be brought to focus.");
		 document.register.firstname.focus();
         return false;
     }
	 if (document.register.lastname.value.length == 0 || document.register.lastname.value == "Surname") {
         alert ("Please provide your 'Surname' when you click OK the correct field will be brought to focus.");
		 document.register.lastname.focus();
         return false;
     }
	 if (document.register.institution.value == 0) { 
         alert ("Please provide the name of your 'Institution' OR give details in the text box below it, when you click OK the correct field will be brought to focus.");
		 document.register.institution.focus();
         return false;
     }
	 if (document.register.address.value.length == 0) {
         alert ("Please provide your 'Institutions Address' when you click OK the correct field will be brought to focus.");
		 document.register.address.focus();
         return false;
     }
	 if (document.register.email.value.length == 0 || document.register.email.value == "Email Address") {
         alert ("Please provide your 'Email Address' when you click OK the correct field will be brought to focus.");
		 document.register.email.focus();
         return false;
     }
	 if (document.register.email2.value.length == 0 || document.register.email2.value == "Confirm Email Address") {
         alert ("Please confirm your 'Email Address' when you click OK the correct field will be brought to focus.");
		 document.register.email2.focus();
         return false;
     }
	 if (document.register.arrivalDate.value.length == 0) {
         alert ("Please provide your 'Arrival Date' when you click OK the correct field will be brought to focus.");
	     document.register.arrivalDate.focus();
         return false;
     } 
	 if (document.register.departureDate.value.length == 0) {
         alert ("Please provide your 'Departure Date' when you click OK the correct field will be brought to focus.");
	 	 document.register.departureDate.focus();
         return false;
     }
	 
if (document.layers||document.getElementById||document.all)
return checkemail()

else
return true
}

var testresults
function checkemail(){
var str=document.register.email.value
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))
testresults=true
else{
alert("Please input a valid email address!")
testresults=false
}
return (testresults)
}


function checkEmail(theForm) {
    if (document.register.email.value != document.register.email2.value)
    {
        alert('The emails you have provided do not match');
        return false;
    } else {
        return true;
    }
}
//-->
