function validate(form){ 
// 
// Create a basic array containing the numbers that we can use to check if a field contains anything but numbers 
// 
var digits="0123456789()// " 
var alpha="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " 
var at="@"
var dot="."
var com="com"
var temp 



//-------------------------------------First Name -------------------------------------------------
//
// 
if (document.form.firstName.value.length <2 ) { 

alert("Please Enter Your First Name") 
return false 
} 

for (var i=0;i<document.form.firstName.value.length;i++){ 
temp=document.form.firstName.value.substring(i,i+1) 
if (alpha.indexOf(temp)==-1){ 

alert("Sorry, your first name contains a " + temp +", This is not allowed.") 
return false 
} 
}


//------------------------------------- Last name -------------------------------------------------
//
// 
if (document.form.surName.value.length <2 ) { 

alert("Please Enter Your Last Name") 
return false 
} 

for (var i=0;i<document.form.surName.value.length;i++){ 
temp=document.form.surName.value.substring(i,i+1) 
if (alpha.indexOf(temp)==-1){ 

alert("Sorry, your last name contains a " + temp +", This is not allowed.") 
return false 
} 
}

//------------------------------------- Email --------------------------------------------------- 
//
// Check if the Email field is empty - that is, its value is null 
if (document.form.email.value.length <8 ) { 

alert("Please check your email address, Invalid Length") 
return false 
}

if (document.form.email.value.indexOf(at)==-1){
		   alert("Invalid E-mail address, Please check & re-enter")
		   return false
		}

if (document.form.email.value.indexOf(dot)==-1){
		   alert("Invalid E-mail address, Please check & re-enter")
		   return false
		}
		
if (document.form.email.value.indexOf(com)==-1){
		   alert("Invalid E-mail address, Please check & re-enter")
		   return false
		}



//------------------------------------- Mobile ---------------------------------------------------
//
// Check if the Contact Number field is empty - that is, its value is null 
//
if (document.form.mobileNumber.value=="") { 

alert("You Forgot Your Contact Number, Please enter it into the form") 
return false 
}
// Check if the Contact Number field is empty - that is, its value is null 
if (document.form.mobileNumber.value.length <8 ) { 

alert("You Forgot Your Contact Number, Please enter it into the form") 
return false 
}

for (var i=0;i<document.form.mobileNumber.value.length;i++){ 
temp=document.form.mobileNumber.value.substring(i,i+1) 
if (digits.indexOf(temp)==-1){ 

alert("Sorry, your Contact Number contains a " + temp +", this is not allowed.") 
return false 
   } 
  } 
  



return true 
} 
