
function faq_ShowHideForm() {
    show	=	top.document.faq_form.show.value;
	if(show==0){
		top.document.getElementById("faq_form").style.display = "block";
		top.document.faq_form.show.value	=	1;

	}else{
		top.document.getElementById("faq_form").style.display = "none";
		top.document.faq_form.show.value	=	0;
	}
}

function faq_SendQuestion() {
	document.getElementById("faq_inputs").style.display	=	"none";
	document.getElementById("faq_retorno").style.display=	"block";

	document.getElementById("faq_retorno").innerHTML = "<div style='text-align:center'><img src='../img/loading2.gif' width='30' height='29' /><br/><span>Enviando...</span></div>";

	nome	=	document.faq_form.faq_nome.value;
	email	=	document.faq_form.faq_email.value;
	pergunta=	document.faq_form.faq_pergunta.value;

	xmlhttp	=	mount_XMLHttp();
	url	=	"../ajax/faq.envia_pergunta.php?nome="+nome+'&email='+email+'&pergunta='+pergunta;
	xmlhttp.open("POST", url,true);

	xmlhttp.onreadystatechange=function() {
		if(xmlhttp.readyState==4){
			retorno	=	xmlhttp.responseText;
			if(retorno == "OK"){
				document.getElementById("faq_retorno").innerHTML = "<p style='text-align:center; font-weight:bold;'>Sua pergunta foi enviada com êxito. Em breve responderemos. <br />Obrigado!</p>";
				document.faq_form.reset();
					self.setTimeout('faq_ShowForm()', 5000) ;
			}else{
				document.getElementById("faq_retorno").innerHTML = "<p style='text-align:center; font-weight:bold;'>"+retorno+"</p>";
					self.setTimeout('faq_ShowForm()', 4000) ;
			}
		}
	}
	xmlhttp.send(null);
}


function faq_ShowForm(){
   	document.getElementById("faq_inputs").style.display = "block";
	document.getElementById("faq_retorno").style.display = "none";
}
