wFORMS.functionName_formValidation = "doPostBack";
  function doPostBack(e) { 
    if(!e) e = window.event;    
    
    //  call the default error management.  
    if(wFORMS.behaviors['validation'].run(e)) {            
      //  doing our custom validation here:

      // if needed, the form element can be obtained with:
      
var f = wFORMS.helpers.getSourceElement(e);
var foo = (f.name.substr(8,1)); 

//if ((f.name) != 'contact_'+foo) {return false;};


go(foo);

       // we need to prevent the submission:
        return wFORMS.helpers.preventEvent(e);     
      }
      // otherwise all is good, 
      return true;                        
  }

function go(foo){
new Ajax.Updater('result_'+foo,'includes/sendmail.php', {onLoading: function(request){new Effect.Appear('progress_'+foo);},onComplete: function(request){handelrequest(foo);},parameters: Form.serialize(document.forms['contact_'+foo]), insertion: Insertion.Bottom, asynchronous:true})

}
  
  	function sendmail(foo) {
			//Make the Progress Bar Appear
			new Effect.Appear('progress_'+foo);
			//progress.style.display = "inline";
		}
		function handelrequest(foo) {
                setTimeout("new Effect.Fade('progress_'+foo);",1800);
                new Effect.Fade('cform_'+foo); 
                var gogo = document.getElementById('result_'+foo);
               gogo.style.display ="block";

		}
