function visualizar_inicial(visualizar) {
	if (visualizar == 'CadastroConcluido') {
		document.getElementById('msg_cadastro').innerHTML = "<div style=\"float:left; width: 450px; background: #EBFFEE; color:#009900; padding: 10px 2px 2px 2px; border: 1px solid #009900; margin: 5px 0 0 0; height: 30px; text-align: center;\"><img src=\"images/icone_msg_ok.gif\" style=\"margin: 0 5px -4px 0;\"><strong>Parab&eacute;ns!!! Seu coment&aacute;rio foi enviado com sucesso.</strong></div>";
		document.getElementById('msg_cadastro').style.display = 'block'
	}
}


function isEmail(a){
	email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	return email.test(a);
}
//Fim

function formComentario(){
	alert_cadastro = false;
	
	if (!document.getElementById('nome').value) { document.getElementById('nome').style.border = '1px solid #FF0000'; alert_cadastro = true; } else { document.getElementById('nome').style.border = '0px'; }
	if (!document.getElementById('email').value) { document.getElementById('email').style.border = '1px solid #FF0000'; alert_cadastro = true; } else { document.getElementById('email').style.border = '0px'; }
	if (!document.getElementById('comentario').value) { document.getElementById('comentario').style.border = '1px solid #FF0000'; alert_cadastro = true; } else { document.getElementById('comentario').style.border = '0px'; }
	
	if (!isEmail(document.getElementById("email").value) && document.getElementById("email").value){
		document.getElementById('email').style.border = '1px solid #FF0000';
		document.getElementById('msg_cadastro').innerHTML = "<div style=\"width: 450px; background: #ffebeb; color:#d00200; padding: 2px; border: 1px solid #ffa6a6;\"><img src=\"images/icone_msg_no.gif\" style=\"margin: 0 5px -4px 0;\"><b>Por favor, insira um e-mail v&aacute;lido.</b></div>";
		document.getElementById('msg_cadastro').style.display = 'block';
		
		return false;
	}
	
	if(alert_cadastro){
		document.getElementById('msg_cadastro').innerHTML = "<div style=\"width: 450px; background: #ffebeb; color:#d00200; padding: 2px; border: 1px solid #ffa6a6;\"><img src=\"images/icone_msg_no.gif\" style=\"margin: 0 5px -4px 0;\"><b>Por favor, preencha todos os campos.</b></div>";
		document.getElementById('msg_cadastro').style.display = 'block';
	} else {
		document.forms.formulario.submit();	
	}
}