function trocaClass(){document.getElementById("divVoltarCarrossel").className="voltarCarrosselRolantes"}function trocaClassInterno(){document.getElementById("divVoltarCarrossel").className="voltarCarrosselInterno"}function paneSelect(B,A){stacker.selectChild(B);dojo.forEach(dojo.query(".current"),function(C){dojo.toggleClass(C,"current",false)});dojo.toggleClass(A,"current",true)}function PopUp(B){var A="toolbar=no,statusbar=false,status=false,menubar=no,location=false";A=A+",scrollbars=yes,resizable=yes,height=500,width=800";newWin=window.open(B,"TellObj",A);newWin.opener=top}function pesquisar(){if(dijit&&dijit.byId){var F=dijit.byId("pesquisaForm")}var C="/portal/public/index/pesquisa/";var B="";var G="";var H="";if(F==undefined){var A=dojo.byId("searchword");if(A==undefined){return }H="searchword/"+A.value+"/"}else{var E=F.attr("value");H="searchword/"+E.searchword+"/";for(var D=0;D<E["area[]"].length;D++){B+=E["area[]"][D]+"+"}if(B.length>0){B="area/"+B.substr(0,B.length-1)+"/"}for(var D=0;D<E["recurso[]"].length;D++){G+=E["recurso[]"][D]+"+"}if(G.length>0){G="recurso/"+G.substr(0,G.length-1)+"/"}}location.href=C+B+G+H}function doPesquisar(){var B=pesquisaDoForm.attr("value"),D=dojo.date.locale.format(B.dataIni,{datePattern:"yyyyMMdd",selector:"date"}),C=dojo.date.locale.format(B.dataFim,{datePattern:"yyyyMMdd",selector:"date"}),E=escape(B.termo);var A="/portal/public/diario/pesquisar/dataIni/"+D+"/dataFim/"+C+"/termo/"+E;location.href=A}function fotoShow(E){var A=dojo.byId("tituloLink"),C=dojo.byId("fotoLink"),D=dojo.byId("fotoImagem"),B=dojo.byId("descLink");if(!A||!C||!D||!B){return }A.href=E.link;A.innerHTML=E.title;C.href=E.link;D.src=E.largeUrl;B.href=E.link;B.innerHTML=E.data.desc}function validate_article_tools_error_submit(A,C){var B=document.getElementById(A);if((B.nome.value=="")||(B.email_from.value=="")||(B.descricao.value=="")||(B.email_to.value=="")||(B.email_to.value=="selecione")){alert("Favor preencher campos faltosos.")}else{article_tools_error_submit(A,C)}}function article_tools_error_submit(B,D){if(typeof hideComunicaErro=="function"){hideComunicaErro()}if(typeof hideContatoRodape=="function"){hideContatoRodape()}var C=document.getElementById(B),A=new Object;A.nome=C.nome.value;A.emailFrom=C.email_from.value;A.descricao=C.descricao.value;A.emailTo=C.email_to.value;dojo.xhrPost({url:"/portal/public/index/senderror/",handleAs:"json",load:function(F,E){alert(D);return F},error:function(F,E){alert("Um erro nos nossos servidores impossibilitou o registro da ocorrência. Tente reenviar mais tarde.");return F},content:A});return false}function showMenuHome(){document.getElementById("a-home").className="currentHome"}function hideMenuHome(){document.getElementById("a-home").className="home"}function showMenuInstitucional(){document.getElementById("menuInstitucional").style.display="block";document.getElementById("menuInstitucional").style.zIndex="999";document.getElementById("a-institucional").className="currentInstitucional"}function hideMenuInstitucional(){document.getElementById("menuInstitucional").style.display="none";document.getElementById("a-institucional").className="institucional"}function showMenuAreaRestrita(){document.getElementById("menuAreaRestrita").style.display="block";document.getElementById("menuAreaRestrita").style.zIndex="999";document.getElementById("a-areaRestrita").className="currentAreaRestrita"}function hideMenuAreaRestrita(){document.getElementById("menuAreaRestrita").style.display="none";document.getElementById("a-areaRestrita").className="areaRestrita"}function showMenuAdm(){document.getElementById("a-adm").className="currentAdm"}function hideMenuAdm(){document.getElementById("a-adm").className="adm"}function showMenuMapa(){document.getElementById("a-mapa").className="currentMapa"}function hideMenuMapa(){document.getElementById("a-mapa").className="mapa"}function showMenuLogin(){document.getElementById("a-login").className="currentLogin"}function hideMenuLogin(){document.getElementById("a-login").className="login"}function showMenuInterno(){document.getElementById("menuInterno").style.display="block";document.getElementById("menuInterno").style.zIndex="999";document.getElementById("a-menuInterno").className="currentInterno"}function hideMenuInterno(){document.getElementById("menuInterno").style.display="none";document.getElementById("a-menuInterno").className="interno"}function showContatoRodape(){document.getElementById("boxContatoRodape").style.display="block";document.getElementById("boxContatoRodape").style.zIndex="999"}function hideContatoRodape(){document.getElementById("boxContatoRodape").style.display="none"}var eventoStore=new dojo.data.ItemFileReadStore({url:urlAplicacao+"public/evento/buscareventopublicado/id/"+idAreaEvento});dojo.addOnLoad(function(){var C=dojo.byId("divEventoDia");var B=dojo.byId("divVoltarCarrossel");var A=dijit.byId("divCalendarioEvento");if(!C||!B||!A){return }dojo.connect(C,"onmouseover",function(){dojo.byId("divVoltarCarrossel").style.display="block"});dojo.connect(C,"onmouseout",function(){dojo.byId("divVoltarCarrossel").style.display="none"});dojo.connect(B,"onmouseover",function(){dojo.byId("divVoltarCarrossel").style.display="block"});dojo.connect(B,"onmouseout",function(){dojo.byId("divVoltarCarrossel").style.display="none"});dojo.connect(A,"attr",function(D,E){if(D=="value"&&E!=undefined){buscaEventoByData(E)}})});function buscaEventoByData(F){F=dojo.date.locale.format(F,{datePattern:"MM/dd/yyyy",selector:"date"});F=new Date(F);var A=0;var C="";var E="";eventoStore.fetch({query:{},onItem:function(I){if(I.idEvento!=0){var G=new Date(I.dataInicioEvento[0]);var H=new Date(I.dataFimEvento[0]);if((F.getTime()>=G.getTime())&&(F.getTime()<=H.getTime())){C+=I.eventoPequeno;E+=I.conteudo;A++}}}});var B=dojo.byId("divEventoDia");var D=dojo.byId("divEventoCarrossel");if(A>0){if(A>1){B.style.overflow="auto";B.innerHTML=C}else{B.innerHTML=E;B.style.overflow=""}mudaDivMostraEvento(D,B)}}function mudaDivMostraEvento(B,A){B.style.display="none";A.style.display="block";dojo.byId("divVoltarCarrossel").style.display="none"}function carregaCalendarioEvento(){var A=new Array();eventoStore._forceLoad();eventoStore.fetch({query:{},onItem:function(E){if(E.idEvento!=0){var B=new Date(E.dataInicioEvento[0]);var C=new Date(E.dataFimEvento[0]);var D=B.getTime();while(D<=C.getTime()){A.push(D);D+=86400000}}else{dijit.byId("divEventoCarrossel").displayButton("none")}}});return A};
