// 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.affiliate.value.length == 0 || document.register.affiliate.value == "Affiliation") {
         alert ("Please provide your 'Affiliation' when you click OK the correct field will be brought to focus.");
		 document.register.affiliate.focus();
         return false;
     }
	 if(document.register.institution.value.length == 0 ||document.register.institution.value == "Name of Institute") { 
         alert ("Please provide the name of your 'Institution' when you click OK the correct field will be brought to focus.");
		 document.register.institution.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.fees[1].checked && document.register.bcsnumber.value == "BCS ID") {
         alert ("Please enter your 'BCS Number' when you click OK the correct field will be brought to focus.");
		 document.register.bcsnumber.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;
    }
}
//-->
