﻿function limpaErro(obj){
		if (obj.value == 'llene todos los campos') {
			obj.value = '';
			obj.style.color = "#FFFFFF";
		}
}
var form2 = 0;
function enviaContato(){
	
	/* 
	intCountForm++
	arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_PERGUNTA1';
	arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
	arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'pergunta.';
	
	intCountForm++
	arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_PERGUNTA2';
	arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
	arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'pergunta.';
	
	intCountForm++
	arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_PERGUNTA3';
	arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
	arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'pergunta.'; */
	if (form2 == 1) {
			// document.frmDados.submit();
		var intCountForm=0;
		arrForms['FORM_OBJECT'][0] = 'document.frmDados';
		var objForm=arrForms['FORM_OBJECT'][0];
		
		arrForms['FORM_FIELDS'][0] = new Array();
		arrForms['FORM_FIELDS_TYPE'][0] = new Array();
		arrForms['FORM_ERROR_MESSAGES'][0] = new Array();
		

		intCountForm++
		arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_NOMBRE';
		arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
		arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'nome.';
	
		intCountForm++
		arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_APELLIDO';
		arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
		arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'apelidio.';
	
		intCountForm++
		arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_EMAIL';
		arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'email';
		arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'email.';
		
		intCountForm++
		arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_TELEFONO';
		arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'number';
		arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'telefone.';
	
		intCountForm++
		arrForms['FORM_FIELDS'][0][intCountForm] = 'INPUT_DIRECCION';
		arrForms['FORM_FIELDS_TYPE'][0][intCountForm] = 'text';
		arrForms['FORM_ERROR_MESSAGES'][0][intCountForm] = 'endereço.';
		
		if(checkForm(0)){
			document.frmDados.submit();
		}	
	}
	
	if($("#INPUT_PERGUNTA1").val() == "" || $("#INPUT_PERGUNTA2").val() == "" || $("#INPUT_PERGUNTA3").val() == "") {
			if($("#INPUT_PERGUNTA1").val() == ""){
				$("#INPUT_PERGUNTA1").val("llene todos los campos");
				$("#INPUT_PERGUNTA1").css("color", "red");
			}  
			if($("#INPUT_PERGUNTA2").val() == "") {
				$("#INPUT_PERGUNTA2").val("llene todos los campos");
				$("#INPUT_PERGUNTA2").css("color", "red");
			} 
			if ($("#INPUT_PERGUNTA3").val() == "") {
				$("#INPUT_PERGUNTA3").val("llene todos los campos");
				$("#INPUT_PERGUNTA3").css("color", "red");
			}
	} else {
		if($("#INPUT_PERGUNTA1").val() != "llene todos los campos" && $("#INPUT_PERGUNTA2").val() != "llene todos los campos" && $("#INPUT_PERGUNTA3").val() != "llene todos los campos") {
			document.getElementById("form1").style.display = "none";
	     	document.getElementById("form2").style.display = "block";
			form2 = 1;
		}
	}
};

