var noticias = new Object();
noticias = {
	validar : function() {
		jQuery('#form-comentario').validate( {
			rules: {
				nome_comentario_noticia: { required: true },
				email_comentario_noticia: { required: true },
				texto_comentario_noticia: { required: true }
			},
			invalidHandler: function(e, validator) {
				var errors = validator.numberOfInvalids();
				if (errors) {
					jQuery("#mensagem").msgError('Formulário com ' + errors + ' erro(s), verificar campos em vermelho!').flashMessage();
				}
			},
			messages: {
				nome_comentario_noticia: "Digitar seu nome!",
				email_comentario_noticia: "Digitar seu e-mail!",
				texto_comentario_noticia: "Digitar um comentário!"
			}
		});			
	}
}

$(document).ready(function(){
	noticias.validar();
});


