function initMenu(){$('.sanfona div').hide();$('.sanfona a').click(function(){var checkElement=$(this).next();if((checkElement.is('div.resposta'))&&(checkElement.is(':visible'))){return false}if((checkElement.is('div.resposta'))&&(!checkElement.is(':visible'))){$('.sanfona div.resposta:visible').slideUp('normal');checkElement.slideDown('normal');return false}})}function respostaAjax(txt){$("div.blockMsg").html(txt);$('div.blockOverlay').attr("title","Clique para continuar").click($.unblockUI);$("div.blockOverlay").click(function(){$(this).removeAttr("title")})}function msgStatus(loading,msg){var status=loading==true?"<img src=\"imagens/carregando.gif\" alt=\"carregando\" class=\"carregando\" />"+msg:msg;$.blockUI({message:status,centerY:false,overlayCSS:{cursor:"auto"},css:{padding:"10px",width:"500px",paddingTop:"13px",textAlign:"left",left:($(window).width()-520)/2+"px",top:0,color:"#000",border:"solid 1px #333",borderTop:"none",backgroundColor:"#fff",cursor:"auto"}})}function cadastrar(form,action){msgStatus(true,"Cadastrando, aguarde...");var opcoes={url:action,type:"post",success:function(resposta){respostaAjax(resposta)}};$(form).ajaxSubmit(opcoes)}function enviar(form,action){msgStatus(true,"Enviando, aguarde...");var opcoes={url:action,type:"post",success:function(resposta){respostaAjax(resposta)}};$(form).ajaxSubmit(opcoes)}$(window).load(function(){$("#cidade option:first").text("Aguarde...");$.ajax({url:"cidades.php?uf=es",type:"get",success:function(resposta){$("#cidade").html(resposta)}})});$(document).ready(function(){$(document).pngFix();initMenu();$("input[type=text], textarea, select").focus(function(){$(this).addClass("foco");$(this).prev("label").addClass("foco")}).blur(function(){$(this).removeClass("foco");$(this).prev("label").removeClass("foco")});$("a[rel=externo], a.link-externo").attr("target","_blank");$("a:not('a.detalhes-produto, a.detalhes-produto-destaque'), img, input, textarea, select").livequery(function(){$(this).tooltip({track:true,delay:0,showURL:false,fade:250})});$("#estado").change(function(){var estado=$(this).val();if(estado=="nulo"){alert("Selecione um estado!");$(this).focus();return false}else{$("#cidade").attr("disabled","disabled");$("#cidade option:selected").text("Aguarde...");$.ajax({url:"cidades.php?uf="+estado,type:"get",success:function(resposta){$("#cidade").html(resposta);$("#cidade").removeAttr("disabled")}})}});$("#cadastro").submit(function(){var nome=$("#nome");var email=$("#email");if(nome.val()==""){alert("Digite seu nome!");nome.focus();return false}if(email.val()==""){alert("Digite seu e-mail!");email.focus();return false}else{cadastrar($(this),$(this).attr("action"));return false}});$("#estado").change(function(){var estado=$(this).val();if(estado=="nulo"){alert("Selecione um estado!");$(this).focus();return false}else{$("#cidade option:first").text("Aguarde...");$.ajax({url:"cidades.php?uf="+estado,type:"get",success:function(resposta){$("#cidade").html(resposta)}})}});$("#contato").submit(function(){var nome=$("#nome");var email=$("#email");var tel=$("#tel");var cidade=$("#cidade");var estado=$("#estado");var assunto=$("#assunto");var msg=$("#msg");if(nome.val()==""){alert("Informe seu nome!");nome.focus();return false}if(email.val()==""){alert("Informe seu e-mail!");email.focus();return false}if(tel.val()==""){alert("Informe um telefone para contato!");tel.focus();return false}if(cidade.val()=="nulo"){alert("Selecione a cidade!");cidade.focus();return false}if(estado.val()=="nulo"){alert("Selecione o estado!");estado.focus();return false}if(assunto.val()==""){alert("Informe o assunto!");assunto.focus();return false}if(msg.val()==""){alert("Digite uma mensagem!");msg.focus();return false}else{enviar($(this),$(this).attr("action"));return false}});var site_atual;$("a#site-atual").toggle(function(){site_atual=true;$("fieldset#dados-site-atual").slideDown()},function(){$("fieldset#dados-site-atual input, fieldset#dados-site-atual textarea").val("");$("fieldset#dados-site-atual").slideUp("fast");site_atual=false});$("#orcamento").submit(function(){var n=$("#nome");var e=$("#email");var tel=$("#tel");var cid=$("#cidade");var uf=$("#estado");var emp=$("#empresa");var dom=$("#dominio");var cor=$("#cores");if(n.val()==""){alert("Informe seu nome!");n.focus();return false}if(e.val()==""){alert("Informe seu e-mail!");e.focus();return false}if(tel.val()==""){alert("Informe um telefone para contato!");tel.focus();return false}if(cid.val()=="nulo"){alert("Selecione a cidade!");cid.focus();return false}if(uf.val()=="nulo"){alert("Selecione o estado!");uf.focus();return false}if(emp.val()==""){alert("Informe o nome da empresa, negócio ou site!");emp.focus();return false}if(dom.val()==""){alert("Informe o domínio pretendido!");dom.focus();return false}if(cor.val()==""){alert("Informe as cores a serem utilizadas!");cor.focus();return false}else{enviar($(this),$(this).attr("action"));return false}})});