function submitForm()
{
	frm = document.forms.f1;

	if (frm.lastName.value == '')
	{
		alert("Please enter your Last Name");
		frm.lastName.focus();
		return false;
	}
	
	if (frm.firstName.value == '')
	{
		alert("Please enter your First name");
		frm.firstName.focus();
		return false;
	}
	
	if (frm.sex.value == '')
	{
		alert("Please enter your Gender");
		frm.sex.focus();
		return false;
	}
	
	if (frm.occupation.value == '')
	{
		alert("Please enter your Profession/Occupation");
		frm.occupation.focus();
		return false;
	}
	
	if (frm.organisation.value == '')
	{
		alert("Please enter your Organisation");
		frm.organisation.focus();
		return false;
	}
	
	if (frm.country.value == '')
	{
		alert("Please enter your Country");
		frm.country.focus();
		return false;
	}
	
	/*if (frm.address.value == '')
	{
		alert("Please enter your Address");
		frm.address.focus();
		return false;
	}
	
	if (frm.phone.value == '')
	{
		alert("Please enter your Telephone Number");
		frm.phone.focus();
		return false;
	}
	
	if (frm.mobile.value == '')
	{
		alert("Please enter your Mobile Number");
		frm.mobile.focus();
		return false;
	}
	
	if (frm.fax.value == '')
	{
		alert("Please enter your Fax Number");
		frm.fax.focus();
		return false;
	}*/
	
	if (frm.email.value == '')
	{
		alert("Please enter an Email Address");
		frm.email.focus();
		return false;
	}
	
	var validEmail = checkEmail(frm.email.value);
	
	if (!validEmail)
	{
		alert("Please enter a valid Email Address");
		frm.email.focus();
		return false;
	}
	
	// put in try catch block as password field isn't always visible
	try
	{
	    // check password
	    if(frm.password.value == '')
	    {
	        alert("Please enter a Password");
	        frm.password.focus();
	        return false;
	    }
    	
	    if(frm.confirmPassword.value == '')
	    {
	        alert("Please confirm your Password");
	        frm.confirmPassword.focus();
	        return false;
	    }
    	
	    if(frm.password.value != frm.confirmPassword.value)
	    {
	        alert("The Passwords don't match.  Please re-enter");
	        frm.password.focus();
	        return false;
	    }
	}
	catch(err){}
	
	/*if (frm.website.value == '')
	{
		alert("Please enter your Organisation Website");
		frm.website.focus();
		return false;
	}
	
	if (frm.comments.value == '')
	{
		alert("Please enter your Comments");
		frm.comments.focus();
		return false;
	}*/
	
	if(frm.captcha.value == '') { 
        alert("Please type the characters you see in the picture, or click on the speaker and type the numbers you hear."); 
        frm.captcha.focus();
        return false ; 
    }

	showFormProcessing();
}



function checkEmail(s)
{
    var str = s;
    var filter=/^([a-zA-Z0-9_\.\-\'])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
    if (filter.test(str))
        testresults=true
    else
    {
        //alert("Please input a valid email address!")
        testresults=false
    }
    return (testresults)
}

