// JavaScript Document

/* script valida form */

function validarCampos()
{
	Aviso()
	
	var obrigatorio = Valida()
	
	return  obrigatorio 
}

function Valida()
{
	with(document.form) 
	{	
	     if (nome.value == "") {
			nome.style.background = "FDEFE2";
			return false; }
		if (email.value == "") {
			email.style.background = "FDEFE2";
			return false; }
		if (assunto.value == "") {
			assunto.style.background = "FDEFE2";
			return false; }
		 if (msg.value == "") {
			msg.style.background = "FDEFE2";
			return false; }
	}
}

function Aviso()
{

    // Preencher um vetor com todos os elementos de nome "erro" 

    var vetor = document.getElementsByTagName("span")
	
	
    // Para cada elemento do vetor, mudar o valor do display para "inline"
    for (var i = 0; i < vetor.length; i++)
        vetor[i].style.display = "inline"
 
}


