$(document).ready(function(){
	$('.produto').hover(function() {
		$(this).children('div').show();	
		$(this).children('h2.nome-produto').hide();
	},function() {
		$(this).children('div').hide();		
		$(this).children('h2.nome-produto').show();
	});
});

var dip = {};
	dip.fale = {
	validador: [],

	preparaValidacao: function() {
	this.validador = $('form#formFale').jForm({
		//faleEmpresa:		$('#faleEmpresa').jField({ name: 'Empresa', empty: 'no', minLength: 3 }),
		faleContato:		$('#faleContato').jField({ name: 'Contato', empty: 'no', minLength: 3 }),
		//faleTelefone:		$('#faleTelefone').jField({ name: 'Telefone', empty: 'no', minLength: 3 }),
		//faleCelular:		$('#faleCelular').jField({ name: 'Celular', empty: 'no', minLength: 3 }),			
		//faleAssunto:		$('#faleAssunto').jField({ name: 'Assunto', empty: 'no', minLength: 3 }),
		faleEmail:			$('#faleEmail').jField({ name: 'E-mail', type: 'email', empty: 'no', minLength: 3 }),
		faleMensagem:		$('#faleMensagem').jField({ name: 'Mensagem', type: 'select', empty: 'no' })
	});		
		
		$('#faleTelefone').unmask();
		$('#faleCelular').unmask();		
		$('#faleTelefone').mask('(99) 9999-9999');
		$('#faleCelular').mask('(99) 9999-9999');		
	},

	envia: function() {
		return jQuery.jForm.checkFields( this.validador );
	}
};

	dip.news = {
	validador: [],
	
		preparaValidacao: function() {
		this.validador = $('form#formNewsletter').jForm({
			newsNome:		$('#newsNome').jField({ name: 'Nome', empty: 'no', minLength: 3 }),
			newsEmail:		$('#newsEmail').jField({ name: 'E-mail', type: 'email', empty: 'no', minLength: 3 })	
			//newsEmpresa:	$('#newsEmpresa').jField({ name: 'Empresa', empty: 'no', minLength: 3 })
		});			
	},

	envia: function() {
		var enviou = jQuery.jForm.checkFields( this.validador );
		if (enviou != false) {
			if ($('#newsEmail').val() != '') {
				$.ajax({
					type: "POST",
					url: "newsletter.php",
					data: "newsEmail=" + $('#newsEmail').val() + "&newsNome=" + $('#newsNome').val() +"&newsEmpresa=" + $('#newsEmpresa').val(),
					success: function() {
						$('.flash-success').show();
					}
				});		
			}
		}
		return enviou;
	}
	
};