//FUNÇOES DE ENTRADA EM PAGINAS -------------------------------------------
function chamaTexto(tipo) {
	$("#imgAjuda").html("<center>Carregando...</center>");
	$("#textoAjuda").html("<center>Carregando...</center>");
	chamaImg(tipo);
		$.ajax({
			type: "POST",
			cache: false,
			url: "produtosServicosTextos.php",
			data: "tipo="+tipo,
			success: function(dados){
				if (dados){
					$("#textoAjuda").html(dados);
			}else {
					$("#textoAjuda").html(dados);
				}
			}
		});
}


function chamaImg(tipo) {
	$("#imgAjuda").html("<center>Carregando...</center>");
	$("#textoAjuda").html("<center>Carregando...</center>");
		$.ajax({
			type: "POST",
			cache: false,
			url: "produtosServicosImgs.php",
			data: "tipo="+tipo,
			success: function(dados){
				if (dados){
					$("#imgAjuda").html(dados);
			}else {
					$("#imgAjuda").html(dados);
				}
			}
		});
}

function valida(){
	var campo = document.getElementById("nome");
	if(campo.value == ""){
		$("#ajuda").html("<span style='border: 1px #C00 dashed; background: #FCC;'>&nbsp;&nbsp;&nbsp;&nbsp;Preencha seu nome.&nbsp;&nbsp;&nbsp;&nbsp;</span>");
		campo.style.borderColor="#ff0000";
        campo.focus();
		return false;
	}else{
		campo.style.borderColor="#cccccc";
		$("#ajuda").html("");
	}

var campo = document.getElementById("empresa");
	if(campo.value == ""){
		$("#ajuda").html("<span style='border: 1px #C00 dashed; background: #FCC;'>&nbsp;&nbsp;&nbsp;&nbsp;Preencha o nome da sua empresa.&nbsp;&nbsp;&nbsp;&nbsp;</span>");
		campo.style.borderColor="#ff0000";
        campo.focus();
		return false;
	}else{
		campo.style.borderColor="#cccccc";
		$("#ajuda").html("");
	}

var campo = document.getElementById("telefone");
	if(campo.value == ""){
		$("#ajuda").html("<span style='border: 1px #C00 dashed; background: #FCC;'>&nbsp;&nbsp;&nbsp;&nbsp;Preencha o seu telefone.&nbsp;&nbsp;&nbsp;&nbsp;</span>");
		campo.style.borderColor="#ff0000";
        campo.focus();
		return false;
	}else{
		campo.style.borderColor="#cccccc";
		$("#ajuda").html("");
	}

var campo = document.getElementById("email");
	if(campo.value == ""){
		$("#ajuda").html("<span style='border: 1px #C00 dashed; background: #FCC;'>&nbsp;&nbsp;&nbsp;&nbsp;Preencha o seu e-mail.&nbsp;&nbsp;&nbsp;&nbsp;</span>");
		campo.style.borderColor="#ff0000";
        campo.focus();
		return false;
	}else{
		campo.style.borderColor="#cccccc";
		$("#ajuda").html("");
	}

var campo = document.getElementById("descricao");
	if(campo.value == ""){
		$("#ajuda").html("<span style='border: 1px #C00 dashed; background: #FCC;'>&nbsp;&nbsp;&nbsp;&nbsp;Preencha o seu e-mail.&nbsp;&nbsp;&nbsp;&nbsp;</span>");
		campo.style.borderColor="#ff0000";
        campo.focus();
		return false;
	}else{
		campo.style.borderColor="#cccccc";
		$("#ajuda").html("");
	}

}
			
