function sendForm(nameOfForm) {

//-->> Do not forget to set up the following CSS styles <<---
// --> 1) #warningText
// --> 2) .FormText
// --> 3) .FormTextFail

//Set all variables--------
send = "yes"
formList = ""
x = 0
formElementName = ""
emailError = "no"
filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
FormName = nameOfForm
//-------------------------

// Check all elements
while (x < document.forms[FormName].elements.length) {
 
   formElementName = document.forms[FormName].elements[x].name
   emailError = "no"
       
    // Lets change the colour on blank fields    
    if (document.getElementById(formElementName)) {
    
		//Check to see if an email address needs verifying
		if (formElementName.match("email")) {
    	
    	// We have got an email to verify		
			str = eval("document.forms[FormName]."+formElementName+".value")
									
			if (filter.test(str)){
				emailError = "no" }  // Passed
			else {
				emailError = "yes" } // Error
    		} // verification complete
    		
    		
		//Check to see if field should be numeric
		if (formElementName.match("num")) {
    	    	
    	// We have got mumeric field to verify		
			valueToCheck = eval("document.forms[FormName]."+formElementName+".value")
			
			if (isNaN(valueToCheck)){
				emailError = "yes" }  // Error
    		} // verification complete


    	// Check for uncompleted fields
    		if (document.forms[FormName].elements[x].value == ""  || emailError == "yes") {
    		
    			// means the field has failed and the colour set to error
    			document.getElementById(formElementName).className = "FormTextFail"	
    			send = "no"
    				}
    		else {
    			// means the field has passed so set the colour to normal
    			document.getElementById(formElementName).className = "FormText"
    		}
		}
	x ++   // Get the next form element  
	}
   
// Send the form if it has passed OR display error if it hasn't
if (send=="no") {
document.getElementById('warningText').style.display="block"
return false  // form failed
}

if (send == "yes") {
return true  // form sent

}
}