function submit_form(x,num) {

	if(num==0) {		
		x.acao.value = 0
	} else {
		if(num==1) {
			x.acao.value = 1
		} else {
			return false;
		}
	}

	x.submit();	
}

function valida_form_usuario(x) {

	if(x.login.value=="") {
		alert("O campo login não foi preenchido.");
		x.login.focus();
		return false;
	}

	if(x.nome.value=="") {
		alert("O campo nome não foi preenchido.");
		x.nome.focus();
		return false;
	}

	if(x.sobrenome.value=="") {
		alert("O campo sobrenome não foi preenchido.");
		x.sobrenome.focus();
		return false;
	}

	if(x.email.value=="") {
		alert("O campo email não foi preenchido.");
		x.email.focus();
		return false;
	}

	if(x.senha.value=="" || x.confirme.value=="") {
		alert("O campo senha não foi preenchido.");
		x.senha.value = "";
		x.confirme.value = "";
		x.senha.focus();
		return false;
	}

	if(x.senha.value!=x.confirme.value) {
		alert("As senhas digitadas são diferentes.");
		x.senha.value = "";
		x.confirme.value = "";
		x.senha.focus();
		return false;
	}
}

function valida_form_coment(x) {

	if(x.comentario.value=="") {
		alert("Por favor, digite seu comentário.");
		x.comentario.focus();
		return false;
	}
}


function valida_form_noticia(x) {

	if(x.titulo.value=="") {
		alert("Por favor, digite o título da notícia.");
		x.titulo.focus();
		return false;
	}

	if(x.subtitulo.value=="") {
		alert("Por favor, digite o subtítulo da notícia.");
		x.subtitulo.focus();
		return false;
	}

	if(x.noticia.value=="") {
		alert("Por favor, digite a notícia.");
		x.noticia.focus();
		return false;
	}
}