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+='
  • ',d=0;g>d;d++)f="",1===a.posts[d].status?f='

    '+a.posts[d].label+"

    ":2===a.posts[d].status?f='

    '+a.posts[d].label+"

    ":0===a.posts[d].status&&(f='

    '+a.posts[d].label+"

    "),h+='';h+="
  • "}else if(g>b){$(".jcarousel-programacao").parent().find(".jcarousel-control-prev, .jcarousel-control-next, .jcarousel-pagination, .links").css("display","block");var i=Math.ceil(g/b),j=0;for(d=0,e=0;i>e;e++){for(h+='
  • ',d;(e+1)*b>d&&g>j;d++)j++,f="",1===a.posts[d].status?f='

    '+a.posts[d].label+"

    ":2===a.posts[d].status?f='

    '+a.posts[d].label+"

    ":0===a.posts[d].status&&(f='

    '+a.posts[d].label+"

    "),h+='';h+="
  • "}}}else h="
  • "+a.message+"

  • ";$(".jcarousel-programacao ul").html("").append(h),c()}}var wScroll=0;jQuery(document).ready(function(a){function b(){a(".galeria-show").on("click",function(b){b.preventDefault(),a(".descricao-galeria").css("display","none"),a(this).parent().parent().find("li").removeClass("active"),a(this).parent().addClass("active"),a(this).attr("data-image")?(a(".galeria-container").html(a(this).attr("data-image")),a(".descricao-"+a(this).attr("data-id")).fadeIn()):a(this).attr("data-iframe")&&(a(".galeria-container").html(''),a(".descricao-"+a(this).attr("data-id")).fadeIn()),a("html,body").animate({scrollTop:a("#galeria").offset().top-170},800)})}function c(){var b;for(l=l.jcarousel("reload"),a(".jcarousel-pagination").html(""),b=1;b<=a(".jcarousel-programacao li").length;b++)a(".jcarousel-pagination").append(''+b+"");a(".jcarousel-pagination a").first().addClass("active"),a(".jcarousel-pagination").on("click","a",function(){var b=a(this).index(),c=a(".jcarousel-pagination a.active").index(),d=0;b>c&&(d=b-c,l.jcarousel("scroll","+="+d)),c>b&&(d=c-b,l.jcarousel("scroll","-="+d)),a(".jcarousel-pagination a").removeClass("active"),a(this).addClass("active")})}function d(){var b=8,d="",e="",f="";a.each(a(".bx-apresentacao .programacao-filtro.active"),function(){d+=a(this).attr("slug")+","}),a.each(a(".bx-datas .programacao-filtro.active"),function(){e+=a(this).attr("slug")+","}),a.each(a(".bx-locais .programacao-filtro.active"),function(){f+=a(this).attr("slug")+","}),a.ajax({url:"json/todos-eventos.json",type:"get",dataType:"json",data:{eventos:d,datas:e,locais:f,ajax:"ajax-programacao"},success:function(a){successAjaxProg(a,b,c)},beforeSend:function(){a(".loader").show()},complete:function(){a(".loader").hide()}})}function e(){var c="";a.each(a(".bx-galeria .galeria-filtro.active"),function(){c+=a(this).attr("slug")+","}),a.ajax({url:a("body").attr("data-get_template_directory_uri")+"ajax-galeria.php",type:"get",dataType:"json",data:{tags:c,ajax:"ajax-galeria"},success:function(c){if(c&&c.posts&&c.posts.length>0){var d,e="";for(d=0;d
    \">

    "+c.posts[d].tags+'

    ":c.posts[d].video&&(e+='
  • '+c.posts[d].tags+'

  • ");a(".carousel-galeria ul").html(e),a(".jcarousel").jcarousel(),b(),a(".galeria-show:first").trigger("click")}},beforeSend:function(){a(".loader").show()},complete:function(){a(".loader").hide()}})}function f(b){var c,d,e="";for(c in b)b.hasOwnProperty(c)&&(d=b[c],e+='
    ');a(".instagram-content").append(e)}function g(){var b,c=[],d="BienalSESCdeDanca",e="https://api.instagram.com/v1/tags/"+d+"/media/recent/?client_id=f2f0c6249522475db0c8f2231f872fd4&count=6";a.ajax({type:"GET",dataType:"jsonp",cache:!1,url:e,success:function(a){var d;if(void 0!=a.data){for(d=0;d=c){var d=a(".original"),e=d.offset(),f=e.left,g=d.css("width");a(".cloned").css({width:g,left:f,top:0}).show(),a(".original").css("visibility","hidden")}else a(".cloned").hide(),a(".original").css("visibility","visible")}a("body").hasClass("home")&&(a(window).scrollTop()>=a(".sobre-a-bienal").offset().top?(a(".menu-fixed-top-interna").addClass("fixed").css({top:a(".menu-topo").height()}),a(window).width()>768&&a(".menu-topo").css({position:"fixed",top:0,"z-index":999})):(a(".menu-fixed-top-interna").removeClass("fixed"),a(".menu-topo").css({position:"relative",top:0,"z-index":999})))}}if(a(".jcarousel").jcarousel(),jQuery("#form-contact").on("submit",function(b){return b.stopPropagation(),a.ajax({url:a("body").attr("data-get_template_directory_uri")+"send-mail.php",type:"POST",dataType:"json",data:a(this).serialize(),beforeSend:function(){jQuery(".status").text("Aguarde ...")},success:function(a){"ok"===a.status?(jQuery(".status").text(a.msg),jQuery("#form-contact input[type=text] , #form-contact textarea").val("")):jQuery(".status").text(a.msg),setTimeout(function(){jQuery(".status").text("")},5e3)}}),!1}),a(".menu-topo-mob-toggle").on("click",function(b){b.preventDefault(),a(this).toggleClass("active"),a("#menu-menu-topo").slideToggle()}),a(".menu-mobile-ico").on("click",function(b){b.preventDefault(),a(this).toggleClass("active"),a(".menu-menu-fixed-top-container").slideToggle()}),window.location.hash&&a("body").hasClass("home")){var i=window.location.hash,j=a(i);j.length&&a("html,body").animate({scrollTop:j.offset().top-240},800)}a(".blog-load-more").on("click",function(a){a.preventDefault()}),a(".action-bienal").on("click",function(b){b.preventDefault(),a(".bienal-details img").remove(""),a(".bienal-details p").remove(""),a(".bienal-details").prepend("

    "+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))});