  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);
	  
	  // login
	 if (document.getElementById('login')) {	
	 	var login = document.getElementById('login');
		  if (login.value) {
		  	var invalid = " "; // espaço = caractere invalido
			var minLength = 6; // mínimo de caracteres
		  
			if (login.value.length < minLength) {
				 var errorMessage = "Your username must have at least 6 characters.";
				 wFORMS.behaviors['validation'].showError(login, errorMessage);
				 msgTopo('<li>'+errorMessage+'</li>','erro',tempoPadrao);
				// we need to prevent the submission:
				return wFORMS.helpers.preventEvent(e);
			} else if (login.value.indexOf(invalid) > -1) {
				 var errorMessage = "Username with white spaces are not allowed.";
				  msgTopo('<li>'+errorMessage+'</li>','erro',tempoPadrao);
				 wFORMS.behaviors['validation'].showError(login, errorMessage);
				// we need to prevent the submission:
				return wFORMS.helpers.preventEvent(e);
			}
	  	}
	 }
		
		
	  // senhas
	  if (document.getElementById('senha1') && document.getElementById('senha2')) {
		  var passwordField = document.getElementById('senha1');
		  var confirmField  = document.getElementById('senha2');
		   
		  if (passwordField.value) {
		  	var invalid = " "; // espaço = caractere invalido
			var minLength = 6; // mínimo de caracteres
		  
			if (passwordField.value.length < minLength) {
				 var errorMessage = "Your password must have at least 6 characters.";
				  msgTopo('<li>'+errorMessage+'</li>','erro',tempoPadrao);
				 wFORMS.behaviors['validation'].showError(confirmField, errorMessage);
				// we need to prevent the submission:
				return wFORMS.helpers.preventEvent(e);
			} else if (passwordField.value.indexOf(invalid) > -1) {
				 var errorMessage = "Password with white spaces are not allowed.";
				  msgTopo('<li>'+errorMessage+'</li>','erro',tempoPadrao);
				 wFORMS.behaviors['validation'].showError(confirmField, errorMessage);
				// we need to prevent the submission:
				return wFORMS.helpers.preventEvent(e);
			}
	  	}
		  
		  if(passwordField.value != confirmField.value) {
			// passwords don't match, show error message:
			var errorMessage = "Passwords don't match.";
			 msgTopo('<li>'+errorMessage+'</li>','erro',tempoPadrao);
			wFORMS.behaviors['validation'].showError(confirmField, errorMessage);
			// we need to prevent the submission:
			return wFORMS.helpers.preventEvent(e);     
		  }
	  }
      // otherwise all is good, 
      return true;                        
  }
  }