// 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.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.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.supervisorName.value.length == 0 || document.register.supervisorName.value == "Supervisors Full Name") {
         alert ("Please provide your 'Supervisors Full Name' when you click OK the correct field will be brought to focus.");
		 document.register.supervisorName.focus();
         return false;
     }
	 if (document.register.supervisorEmail.value.length == 0 || document.register.supervisorEmail.value == "Supervisors Email Address") {
         alert ("Please provide your 'Supervisors Email Address' when you click OK the correct field will be brought to focus.");
		 document.register.supervisorEmail.focus();
         return false;
     }
	 if (document.register.totalCost.value.length == 0) {
         alert ("Please provide the 'Total Cost' when you click OK the correct field will be brought to focus.");
		 document.register.totalCost.focus();
         return false;
     }
	 if (document.register.totalICTIR.value.length == 0) {
         alert ("Please provide the amount requested from 'ICTIR' when you click OK the correct field will be brought to focus.");
		 document.register.totalICTIR.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;
    }
}
//-->
