function exibeFlash(d,c,a,e,b){noCache=b||b==undefined?"":"?"+new Date();if(e==undefined){e="opaque"}monta_swf="";monta_swf+='<object id="'+d+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+c+'" height="'+a+'" title="">';monta_swf+='<param name="movie" value="'+d+noCache+'" >';monta_swf+='<param name="quality" value="high" >';monta_swf+='<param name="menu" value="0" >';monta_swf+='<param name="allowScriptAccess" value="always" >';monta_swf+='<param name="wmode" value="'+e+'" >';monta_swf+='<embed src="'+d+noCache+'" quality="high" wmode="'+e+'" menu="0" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+c+'" height="'+a+'"></embed>';monta_swf+="</object>";document.write(monta_swf)}function janela(e,d,b){var a=window.screen.height-160;var c=window.screen.width;var g=(a-d)/2;var f=(c-b)/2;win=window.open(e,"nova","top="+g+",left="+f+",width="+b+",height="+d+",toolbar=no,location=no,status=no,menubar=no,scrollbars=no,scrolling=no,resizable=no");win.focus()}function FormataHora(a,c,d){var b=d.keyCode;vr=document[c][a].value;vr=vr.replace(":","");tam=vr.length+1;if(b!=9&&b!=8){if(tam>2&&tam<5){document[c][a].value=vr.substr(0,tam-2)+":"+vr.substr(tam-2,tam)}}}function FormataData(a,c,d){var b=d.keyCode;vr=document[c][a].value;vr=vr.replace(".","");vr=vr.replace("/","");vr=vr.replace("/","");tam=vr.length+1;if(b!=9&&b!=8){if(tam>2&&tam<5){document[c][a].value=vr.substr(0,tam-2)+"/"+vr.substr(tam-2,tam)}if(tam>=5&&tam<=10){document[c][a].value=vr.substr(0,2)+"/"+vr.substr(2,2)+"/"+vr.substr(4,4)}}}function evita_letra2(a){if(a.keyCode<48||a.keyCode>57){a.returnValue=false}}function criaObjetoAjax(){var a=null;if(window.XMLHttpRequest){a=new XMLHttpRequest()}else{if(window.ActiveXObject){try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}}}if(a!=null&&a!=undefined){return a}else{return null}}function fechar(){document.getElementById("popup").style.display="none"}function refresh(){location="ajaxcontador.php"}function valida_login(a){if(a.usuario.value==""){alert("Campo login vazio.");a.usuario.focus();return false}if(a.senha.value==""){alert("Campo senha vazio.");a.senha.focus();return false}a.submit()}function mostrar_texto(b){var a=document.getElementById("teste");if(b.style.display=="none"){b.style.display="block"}else{b.style.display="none"}return false}function createRequestObject(){var b;var a=navigator.appName;if(a=="Microsoft Internet Explorer"){b=new ActiveXObject("Microsoft.XMLHTTP")}else{b=new XMLHttpRequest()}return b}var http=createRequestObject();function getInfo2(a){http.open("get",a);http.onreadystatechange=handleInfo;http.send(null)}function getInfo(){http.open("get","ajaxcontador.php");http.onreadystatechange=handleInfo;http.send(null)}function handleInfo(){if(http.readyState==4){var a=http.responseText;document.getElementById("contador").innerHTML=a}}var xmlhttp=createRequestObject();function _getAjax(e,d){var a="";var b;for(b=0;b<d.elements.length;b++){if(d.elements[b].tagName=="TEXTAREA"){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}if(d.elements[b].tagName=="INPUT"){if(d.elements[b].type=="text"){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}if(d.elements[b].type=="hidden"){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}if(d.elements[b].type=="password"){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}if(d.elements[b].type=="checkbox"){if(d.elements[b].checked){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}else{a+=d.elements[b].name+"=&"}}if(d.elements[b].type=="radio"){if(d.elements[b].checked){a+=d.elements[b].name+"="+escape(d.elements[b].value)+"&"}}}else{if(d.elements[b].tagName=="SELECT"){var c=d.elements[b];a+=c.name+"="+escape(c.options[c.selectedIndex].value)+"&"}}}_makeRequest(e,a);return false}function getPage(b,a){var d=criaObjetoAjax();var c=document.getElementById(a);if(d==null){alert("Requisição não aceita, tente novamente");return false}else{c.innerHTML='<img src="images/loading.gif" style="margin-top:30%;">';document.body.scrollTop="0"}d.open("GET",b,true);d.onreadystatechange=function(){if(d.readyState==4){var e=d.responseText;c.innerHTML=e}};d.send(null)}function _makeRequest(url,parameters){var _httpRequest=criaObjetoAjax();if(_httpRequest==null){document.getElementById("load").style.display="none";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=false}alert("Requisição não aceita, tente novamente");return false}else{document.getElementById("load").style.display="block";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=true}}_httpRequest.onreadystatechange=function(){if(_httpRequest.readyState==4){if(_httpRequest.status==200){document.getElementById("load").style.display="none";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=false}result=_httpRequest.responseText;eval(result)}}};_httpRequest.open("POST",url,true);_httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=ISO-8859-1");_httpRequest.setRequestHeader("Content-length",parameters.length);_httpRequest.setRequestHeader("Connection","close");_httpRequest.send(parameters)}function _alertContents(){if(_httpRequest.readyState==4){var status="";try{status=_httpRequest.status}catch(e){alert("Problemas de conexão com a internet, verifique sua conexão e tente novamente.");document.getElementById("load").style.display="none";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=false}return false}if(status==200){document.getElementById("load").style.display="none";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=false}result=_httpRequest.responseText;eval(result)}else{alert("Problemas de conexão com a internet, verifique sua conexão e tente novamente.");document.getElementById("load").style.display="none";if(document.getElementById("btnSalvar")!=null){document.getElementById("btnSalvar").disabled=false}return false}}}function mudaDiv(a){obj=document.getElementById(a);if(obj.style.display=="none"){obj.style.display="block"}else{obj.style.display="none"}}function habilitaDiv(a){obj=document.getElementById(a);if(obj.style.display=="none"){obj.style.display="block"}}function desabilitaDiv(a){obj=document.getElementById(a);if(obj.style.display=="block"){obj.style.display="none"}}function mostraMsgAlerta(b,c,a){document.getElementById("divMsgAlert").innerHTML=c;$("#divMsgAlert").fadeIn("fast");setTimeout("$(\"#divMsgAlert\").fadeOut('slow');",a)}function acoesFadeout(){$("#divMsgAlert",parent.document.body).click(function(){parent.Shadowbox.close()});$("#divMsgAlert",parent.document.body).fadeOut("slow",function(){parent.Shadowbox.close()})}function mostraMsgAlerta2(c,e,b){var d=parent.document.getElementById("icoAcerto");var a=parent.document.getElementById("icoErro");if(c=="acerto"){d.style.display="block";a.style.display="none"}else{if(c=="erro"){d.style.display="none";a.style.display="block"}else{d.style.display="none";a.style.display="none"}}parent.document.getElementById("MsgAlertTexto").innerHTML=e;$("#divMsgAlert",parent.document.body).fadeIn("fast");if(c=="acerto"){setTimeout("acoesFadeout()",b)}else{if(c=="erro"){setTimeout("$(\"#divMsgAlert\", parent.document.body).fadeOut('5000')",b)}else{setTimeout("$(\"#divMsgAlert\", parent.document.body).fadeOut('5000')",b);setTimeout("acoesFadeout()",b)}}}function mostraMsgAlertaPromocao(c,e,b){var d=document.getElementById("icoAcertoPromocao");var a=document.getElementById("icoErroPromocao");if(c=="acerto"){d.style.display="block";a.style.display="none"}else{if(c=="erro"){d.style.display="none";a.style.display="block"}else{d.style.display="none";a.style.display="none"}}document.getElementById("MsgAlertTextoPromocao").innerHTML=e;$("#divMsgAlertPromocao").fadeIn("fast");setTimeout("$(\"#divMsgAlertPromocao\").fadeOut('slow');",b)}function filtroCidade(b,a){getPage("ajaxCidade.php?uf="+a,b)}function trocaFoto(d,b){var c="uploads/galeria/"+b+"/";var a="fotoPeq"+d;document.getElementById("fotoGrande").src=c+d+".jpg";document.getElementById(a).src=c+d+"_thumb_pb.jpg"}function trocaFotoLegenda(e,a,c){$("#load").fadeIn("fast");var d="uploads/"+a+"/";var b="fotoPeq"+e;document.getElementById("fotoGrande").src=d+e+".jpg";document.getElementById(b).src="imagem_layout.php?img="+d+e+"_thumb_pb.jpg&largura=75&altura=58";document.getElementById("legendaFoto").innerHTML=c;$("#load").fadeOut("fast")}function limitaTexto(b,d,a,c){total=b.length;if(total<=d){resto=d-total;document.getElementById(c).value=resto;document.getElementById(c+"_span").innerHTML=resto}else{document.getElementById(a).value=b.substr(0,d);document.getElementById(c+"_span").innerHTML=b.substr(0,d)}}function abreDivComLente(d){var b=document.getElementById("lente");var a=document.getElementById(d);var c=document.getElementById("radio");b.style.display="block";a.style.visibility="visible";b.onclick=function(){fechaDivComLente(d)}}function fechaDivComLente(d){var b=document.getElementById("lente");var a=document.getElementById(d);var c=document.getElementById("radio");a.style.visibility="hidden";b.style.display="none";b.onclick=function(){}}function trocaAudio(d,a){var b=document.getElementById("audioAtivo");var c={movie:"radio/mediaplayer.swf",width:"320",height:"20",majorversion:"7",build:"0",bgcolor:"#000000",flashvars:"file=xml/historico_audio.php?id="+d+"&displayheight=0&repeat=false&autostart=true&lightcolor=0x666666&backcolor=000000&frontcolor=0xFFFFFF&overstretch=true"};UFO.create(c,"playerAudio");document.getElementById("musicaTocando").innerHTML="&#8226; "+a;document.getElementById("nomeAudio"+b.value+"_ativo").style.display="none";document.getElementById("nomeAudio"+b.value+"_inativo").style.display="block";document.getElementById("nomeAudio"+d+"_ativo").style.display="block";document.getElementById("nomeAudio"+d+"_inativo").style.display="none";b.value=d}function bloquearBotao(b){var a=document.getElementById(b);a.disabled=true}function desbloquearBotao(b){var a=document.getElementById(b);a.disabled=false}function mudaImg(c,b){var a=document.getElementById(c);a.src="images/"+c+b+".gif"}function atualizaLink(a,c){tmp=c.split("++");var e=tmp[0];var b=tmp[1];var d=document.getElementById(a);d.innerHTML='Clique para saber mais sobre a promoção "'+b+'"';d.onclick=function(){openShadowboxComTamanho("promocao_lista.php?id="+e,"iframe","",800,600)}};
