$(document).ready(function() {
	for(var i = 1; i <= 6; i++) {
		var titleh = $('#noticia'+i+' > .texto > a > h2').height();
		var boxh = $('#noticia'+i+' > .texto > a > p').height();
		if (titleh == 18) {
			$('#noticia'+i+' > .texto > a > p').height(51);
		}
	}
});
function validar() {
	if ($('#de').val() == "") {
		alert("Preencha seu nome");
		return false;
	}
	if ($('#cidade').val() == "") {
		alert("Preencha sua cidade");
		return false;
	}
	if (checkMail($('#email2').val()) != true) {
		alert("Preencha um email valido");
		return false;
	}
	if ($('#texto').val() == "") {
		alert("Preencha um texto");
		return false;
	}
	return true;
}
function validarNewsletter() {
	if (checkMail($('#email').val()) != true) {
		alert('Preencha seu email valido');
		return false;
	}
	return true;
}
function checkMail(mail){
	var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
	if (typeof(mail) == "string") {
		if (er.test(mail)) { return true; }
	} else if (typeof(mail) == "object") {
		if (er.test(mail.value)) { 
			return true; 
		}
	} else{
		return false;
	}
}
