  function isValidEmail(email)
  {
     var regex = /^([\w\._-]+)@([\w-]+)\.([\w]{2,4})(\.[\w]{2,4})?$/;
  		     
     if (email.match(regex))
  	  return true;
     else
     	  return false;
  }

if (typeof newsletter != "object")
 newsletter = 
 {
   validarForm: function (itemObj) 
   {
      var email = itemObj.email.value;
      var nome  = itemObj.nome.value;
      	
      if (fcForm.isBlank(itemObj.nome)) 
      {
      	alert('Por favor, complete todos os dados');
          itemObj.nome.focus();
      	
      	return false;
      }
      
      if (!isValidEmail(email)) {
        alert('Por favor, coloque um e-mail válido');
        itemObj.email.focus();
        
        return false;
      }

      $(itemObj).ajaxSubmit({dataType: 'script'});

      //itemObj.reset();
          
      return false;
   },
   
   backToForm: function()
   {
      $('#informativoTextMessage').hide();
      $('#formInformativo form').resetForm();       
      $('#formInformativo').show();       
   },
  
   success: function ()
   {
     $('#informativoTextMessage').html('<strong>Newsletter foi cadastrado com sucesso</strong><br /><br /><a href="javascript:void(0)" onclick="javascript:newsletter.backToForm()">Voltar</a>').fadeIn();

     $('#formInformativo').hide(); 
     
   }
   
 }
 