function check(form){

	validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
	
	strfield1 = document.reg.firstname.value 
	strfield2 = document.reg.lastname.value 
	strfield3 = document.reg.address1.value 
	strfield4 = document.reg.country.value 
	strfield5 = document.reg.postcode.value 
	strfield6 = document.reg.emailadd.value 
	strfield7 = document.reg.telno.value 
	
	strfield8 = document.reg.username.value 
	strfield9 = document.reg.password1.value
    strfield10 = document.reg.password2.value 	
	
	strfield11 = document.reg.location.value 	
	strfield12 = document.reg.description.value
	strfield13 = document.reg.title.value 	
	
	
	// checking field
	if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    	alert("Firstname is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield2 == "" || strfield2 == null || !isNaN(strfield2) || strfield2.charAt(0) == ' ')
    {
    	alert("Lastname is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield3 == "" || strfield3 == null || !isNaN(strfield3) || strfield3.charAt(0) == ' ')
    {
    	alert("Address1 is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield4 == "" || strfield4 == null || !isNaN(strfield4) || strfield4.charAt(0) == ' ')
    {
    	alert("Country is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield5 == "" || strfield5 == null || strfield5.charAt(0) == ' ')
    {
    	alert("Postcode is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	
	// check email field
	if (strfield6 == "" || strfield6 == null || strfield6.charAt(0) == ' ')
    {
    	alert("Email address is a mandatory field.\nPlease amend and retry.")
		return false;
	}else{
		if (strfield6.search(validRegExp) == -1) 
   		{
      		alert('A valid e-mail address is required.\nPlease amend and retry');
      		return false;
   		}
	}
	if (strfield7 == "" || strfield7 == null || strfield7.charAt(0) == ' ')
    {
    	alert("Telno is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	
	if (strfield8 == "" || strfield8 == null || !isNaN(strfield8) || strfield8.charAt(0) == ' ')
    {
    	alert("Username is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield10 == "" || strfield10 == null || !isNaN(strfield10) || strfield10.charAt(0) == ' ')
    {
    	alert("Password is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield9 != strfield10 )
    {
    	alert("Password does not match.\nPlease amend and retry.")
		return false;
	}
	if (strfield11 == "" || strfield11 == null || !isNaN(strfield11) || strfield11.charAt(0) == ' ')
    {
    	alert("Location is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	
	if (strfield12 == "" || strfield12 == null || !isNaN(strfield12) || strfield12.charAt(0) == ' ')
    {
    	alert("Description is a mandatory field.\nPlease amend and retry.")
		return false;
	}
	if (strfield13 == "" || strfield13 == null || !isNaN(strfield13) || strfield13.charAt(0) == ' ')
    {
    	alert("Title is a mandatory field.\nPlease amend and retry.")
		return false;
	}
}