function successAjaxProg(a,b,c){if("true"===a.status){var d,e,f,g=a.posts?a.posts.length:0,h="";if(g){if(b>=g){for($(".jcarousel-programacao").parent().find(".jcarousel-control-prev, .jcarousel-control-next, .jcarousel-pagination, .links").css("display","none"),h+='
'+a.posts[d].label+"
'+a.posts[d].label+"
'+a.posts[d].label+"
'+a.posts[d].label+"
'+a.posts[d].label+"
'+a.posts[d].label+"
"+c.posts[d].tags+'
'+c.posts[d].tags+'
"+a(this).attr("data-content")+"
"),a(".bienal-details a").attr("href",a(this).attr("data-link"))}),a("#slider_search").on("click",function(b){b.preventDefault();var c=a(this),d=c.parent(),e=d.find(".text-search");c.hasClass("active")?d.find("form").trigger("submit"):(setTimeout(function(){e.focus()},10),c.toggleClass("active"),d.toggleClass("open"),a(document).on("click.slidersearch",function(b){a(b.target).closest(d)[0]!==d[0]&&(console.log("fecha"),a(document).off("click.slidersearch"),c.toggleClass("active"),d.toggleClass("open"))}))}),a(".taxonomy").on("click",function(b){b.preventDefault(),a(".taxonomy").removeClass("active"),a(this).fadeIn("fast").addClass("active"),a(".programacao-links").removeClass("active"),a(".bx-"+a(this).attr("slug")).addClass("active")}),a(".menu-menu-fixed-top-container .menu-item a, .menu-menu-fixed-pt-container .menu-item a, .menu-menu-fixed-en-container .menu-item a, footer .container #menu-bottom li a").on("click",function(b){if(a(this).attr("href")&&a(this).attr("href").match(/#/)){var c=a("#"+a(this).attr("href").split("#")[1]);c.length&&a("html,body").animate({scrollTop:c.offset().top-200},800)}});var k="";a(".load-more-search").on("click",function(b){k=a(".load-more-search span").text(),b.preventDefault(),a(".load-more-search span").text("Carregando...");var c=1==a(this).attr("autor")?"&autor=1":"";a.ajax({url:a("body").attr("data-get_template_directory_uri")+"/ajax-search.php?s="+a(this).attr("s")+"&paged="+a(this).attr("paged")+c,type:"GET",dataType:"html",success:function(b){var c=parseInt(a(".load-more-search").attr("paged"),10)+1;a(".load-more-search").attr("paged",c),""!==b?a(".append-ajax").append(b):a(".load-more-search").parent().parent().fadeOut("fast"),a(".load-more-search span").text(k)}})}),a(".blog-load-more").on("click",function(b){k=a(".blog-load-more span").text(),b.preventDefault(),a(".blog-load-more").text("Carregando..."),a.ajax({url:window.location.href+"?carregar=sim&pagina="+a(this).attr("paged"),type:"GET",dataType:"html",success:function(b){var c=parseInt(a(".blog-load-more").attr("paged"),10)+1;a(".blog-load-more").attr("paged",c),""!==b?(a(".container-more-posts").append(b),FB.XFBML.parse(),twttr.widgets.load()):a(".blog-load-more").parent().fadeOut("fast"),a(".blog-load-more").text(k)}})}),a(".clipping-load-more").on("click",function(b){k=a(".clipping-load-more span").text(),b.preventDefault(),a(".clipping-load-more").text("Carregando..."),a.ajax({url:window.location.href+"?carregar=sim&pagina="+a(this).attr("paged"),type:"GET",dataType:"html",success:function(b){var c=parseInt(a(".clipping-load-more").attr("paged"),10)+1;a(".clipping-load-more").attr("paged",c),""!==b?(a(".container-more-posts").append(b),FB.XFBML.parse(),twttr.widgets.load()):a(".clipping-load-more").parent().fadeOut("fast"),a(".clipping-load-more").text(k)}})}),a(".button-open-search").on("click",function(){var b=a(this),c=b.parent(),d=c.find(".text-search");b.hasClass("active")?c.find("form").trigger("submit"):(setTimeout(function(){d.focus()},10),b.toggleClass("active"),c.toggleClass("open"),a(document).on("click.internalmenusearch",function(d){a(d.target).closest(c)[0]!==c[0]&&(a(document).off("click.internalmenusearch"),b.toggleClass("active"),c.toggleClass("open"))}))}),a(".filtrar-tags-galeria").css("display","none"),a(".pesquisa-tags").on("click",function(){a(".filtrar-tags-galeria").slideToggle()}),b(),a(".descricao-galeria").css("display","none"),a(".galeria-show").first().attr("data-image")?(a(".galeria-container").html(a(".galeria-show").first().attr("data-image")),a(".descricao-"+a(".galeria-show").first().attr("data-id")).fadeIn()):a(".galeria-show").first().attr("data-iframe")&&(a(".galeria-container").html(''),a(".descricao-"+a(".galeria-show").first().attr("data-id")).fadeIn()),a(".galeria-show").parent().parent().find("li").first().addClass("active");var l=a(".jcarousel-programacao");l.on("jcarousel:reload jcarousel:create",function(){var b=a(this),c=b.innerWidth();600>c&&c>=350&&(c/=2),b.jcarousel("items").css("width",Math.ceil(c)+"px")}).jcarousel({wrap:"circular"}),a(".jcarousel-control-prev").on("click",function(){var b=a(".jcarousel-programacao ul li").length,c=a(".jcarousel-pagination a.active").index(),d=c-1,e=0;d>c&&(e=d-c,l.jcarousel("scroll","+="+e)),c>d&&(e=c-d,l.jcarousel("scroll","-="+e)),a(".jcarousel-pagination a").removeClass("active"),a(".jcarousel-pagination a:eq("+d+")").addClass("active"),-1===d&&(a(".jcarousel-pagination a").removeClass("active"),a(".jcarousel-pagination a:eq("+(b-1)+")").addClass("active"))}),a(".jcarousel-control-next").on("click",function(){var b=a(".jcarousel-programacao ul li").length,c=a(".jcarousel-pagination a.active").index(),d=c+1,e=0;d>c&&(e=d-c,l.jcarousel("scroll","+="+e)),c>d&&(e=c-d,l.jcarousel("scroll","-="+e)),a(".jcarousel-pagination a").removeClass("active"),a(".jcarousel-pagination a:eq("+d+")").addClass("active"),d===b&&(a(".jcarousel-pagination a").removeClass("active"),a(".jcarousel-pagination a").first().addClass("active"))});var m=a(".jcarousel");m.on("jcarousel:reload jcarousel:create",function(){var b=a(this),c=b.innerWidth();c>=600?c/=4:c>=350&&(c/=2),b.jcarousel("items").css("width",Math.ceil(c)+"px"),a(".jcarousel-control-prev").jcarouselControl({target:"-=1"}),a(".jcarousel-control-next").jcarouselControl({target:"+=1"}),a(".jcarousel-pagination").on("jcarouselpagination:active","a",function(){a(this).addClass("active")}).on("jcarouselpagination:inactive","a",function(){a(this).removeClass("active")}).on("click",function(a){a.preventDefault()}).jcarouselPagination({perPage:1,item:function(a){return''+a+""}})}).jcarousel({wrap:"circular"}),a("#form-pesquisa-programacao").on("submit",function(b){b.preventDefault();var d=8,e="",f="",g="";a.each(a(".bx-apresentacao .programacao-filtro.active"),function(){e+=a(this).attr("slug")+","}),a.each(a(".bx-datas .programacao-filtro.active"),function(){f+=a(this).attr("slug")+","}),a.each(a(".bx-locais .programacao-filtro.active"),function(){g+=a(this).attr("slug")+","}),a.ajax({url:window.location.href,dataType:"json",type:"get",data:{eventos:e,datas:f,locais:g,search:a("#form-pesquisa-programacao input").val(),ajax:"ajax-programacao"},success:function(a){successAjaxProg(a,d,c)},beforeSend:function(){a(".loader").show()},complete:function(){a(".loader").hide()}})}),a(".pesquisa-programacao b").on("click",function(){a("#form-pesquisa-programacao input").toggle()}),a(".clear-filter").on("click",function(b){b.preventDefault(),a(".programacao-filtro").removeClass("active"),a(".programacao-filtro").first().addClass("active"),d()}),a(".programacao-filtro").on("click",function(b){b.preventDefault();var c=a(this);"todos-os-eventos"===c.attr("slug")?a(".programacao-filtro").removeClass("active"):a('.programacao-filtro[slug="todos-os-eventos"]').removeClass("active"),c.toggleClass("active"),d()}),a(".programacao-filtro").length>0&&d(),a(".galeria-filtro").on("click",function(b){b.preventDefault(),"todas-as-tags"===a(this).attr("slug")?a(".galeria-filtro").removeClass("active"):a(".galeria-filtro").first().removeClass("active"),a(this).hasClass("active")?a(this).removeClass("active"):a(this).addClass("active"),a(".galeria-filtro.active").length||a(".galeria-filtro").first().addClass("active"),e()}),a(".clear-filter-galeria").on("click",function(b){b.preventDefault(),a(".pesquisa-tags").trigger("click"),a(".galeria-filtro").first().click()}),g(),a(".menu-fixed-top-interna").length&&(a("body").hasClass("home")||a(".menu-fixed-top-interna").addClass("original").clone().insertAfter(".menu-fixed-top-interna").addClass("cloned").css("position","fixed").css("top","0").css("margin-top","0").css("z-index","500").css("display","block").removeClass("original").hide(),setInterval(h,10))});