// If JavaScript is enabled remove 'no-js' class and give 'js' class jQuery("html").removeClass("no-js").addClass("js"),jQuery(document).ready(function(e){e.fn.cycle.transitions.fixedScrollHorz=function(t,n,r){e(".image-gallery-slider-nav a").on("click",function(e){t.data("dir",""),e.target.className.indexOf("prev")>-1&&t.data("dir","prev")}),t.css("overflow","hidden"),r.before.push(e.fn.cycle.commonReset);var i=t.width();r.cssFirst.left=0,r.cssBefore.left=i,r.cssBefore.top=0,r.animIn.left=0,r.animOut.left=0-i,t.data("dir")==="prev"&&(r.cssBefore.left=-i,r.animOut.left=i)},e.fn.slideHorzShow=function(e,t,n){this.animate({marginLeft:"show",marginRight:"show",paddingLeft:"show",paddingRight:"show",width:"show"},e,t,n)},e.fn.slideHorzHide=function(e,t,n){this.animate({marginLeft:"hide",marginRight:"hide",paddingLeft:"hide",paddingRight:"hide",width:"hide"},e,t,n)},e.fn.hasParent=function(t){t=e(t);var n=!1;return e(this[0]).parents().andSelf().each(function(){if(e.inArray(this,t)!=-1)return n=!0,!1}),n},function(){Modernizr.touch&&e("body").addClass("touch-device")}(),function(){var t=e("#main-nav").children("ul"),n='';t.on("mouseenter","li",function(){var t=e(this),n=t.children("ul");n.length&&t.addClass("hover"),n.hide().stop(!0,!0).fadeIn(200)}).on("mouseleave","li",function(){e(this).removeClass("hover").children("ul").stop(!0,!0).fadeOut(50)}),t.find("li").each(function(){var t=e(this),r=t.children("a"),i=t.parents("ul").length-1,s="";if(i)while(i>0)s+=" - ",i--;n+='"}).end().after('"),e(".responsive-nav").on("change",function(){window.location=e(this).val()})}(),function(){function t(){e("#content").css("min-height",e(window).outerHeight(!0)-(e("body").outerHeight(!0)-e("body").height())-e("#header").outerHeight(!0)-(e("#content").outerHeight(!0)-e("#content").height())+(e(".page-title").length?Math.abs(parseInt(e(".page-title").css("margin-top"))):0)-e("#footer").outerHeight(!0)-e("#footer-bottom").outerHeight(!0))}t(),e(window).on("resize",function(){var e=window.setTimeout(function(){window.clearTimeout(e),t()},30)})}(),function(){var t=e(".single-image, .image-gallery, .iframe");e(".single-image, .image-gallery").fancybox({type:"image",openEffect:"fade",closeEffect:"fade",nextEffect:"fade",prevEffect:"fade",helpers:{title:{type:"inside"},buttons:{},media:{}},afterLoad:function(){this.title=this.group.length>1?"Image "+(this.index+1)+" of "+this.group.length+(this.title?" - "+this.title:""):this.title}}),e(".iframe").fancybox({type:"iframe",openEffect:"fade",closeEffect:"fade",nextEffect:"fade",prevEffect:"fade",helpers:{title:{type:"inside"},buttons:{},media:{}},width:"70%",height:"70%",maxWidth:800,maxHeight:600,fitToView:!1,autoSize:!1,closeClick:!1}),e(window).load(function(){t.each(function(){var t=e(this);!t.hasClass("none")&&!t.children(".entry-image").length&&!t.parents(".image-gallery-slider").length&&t.css({height:t.children().height()!==0?t.children().height():"auto",width:t.children().width()!==0?t.children().width():"auto"}),t.append(' ')})})}(),function(){var t=e("#features-slider");if(t.length){if(t.data("init")===!0)return!1;t.data("init",!0).smartStartSlider({pos:0,width:940,height:380,contentSpeed:450,showContentOnhover:!0,hideContent:!1,contentPosition:"",timeout:3e3,pause:!1,pauseOnHover:!0,hideBottomButtons:!1,type:{mode:"random",speed:400,easing:"easeInOutExpo",seqfactor:100}});if(Modernizr.touch){function n(t,n){var r=e(t.currentTarget);n==="left"&&r.find(".pagination-container .next").trigger("click"),n==="right"&&r.find(".pagination-container .prev").trigger("click")}t.swipe({swipeLeft:n,swipeRight:n,allowPageScroll:"auto"})}}}(),function(){var t=e("#logos-slider");if(t.length){if(t.data("init")===!0)return!1;t.data("init",!0).smartStartSlider({pos:0,width:940,height:380,contentSpeed:450,showContentOnhover:!0,hideContent:!1,contentPosition:"center",timeout:3e3,pause:!1,pauseOnHover:!0,hideBottomButtons:!1,type:{mode:"random",speed:400,easing:"easeInOutExpo",seqfactor:100}});if(Modernizr.touch){function n(t,n){var r=e(t.currentTarget);n==="left"&&r.find(".pagination-container .next").trigger("click"),n==="right"&&r.find(".pagination-container .prev").trigger("click")}t.swipe({swipeLeft:n,swipeRight:n,allowPageScroll:"auto"})}}}(),function(){var t=e("#photos-slider");if(t.length){if(t.data("init")===!0)return!1;t.data("init",!0).smartStartSlider({pos:0,width:940,height:380,contentSpeed:450,showContentOnhover:!0,hideContent:!1,contentPosition:"bottom",timeout:3e3,pause:!1,pauseOnHover:!0,hideBottomButtons:!1,type:{mode:"random",speed:400,easing:"easeInOutExpo",seqfactor:100}});if(Modernizr.touch){function n(t,n){var r=e(t.currentTarget);n==="left"&&r.find(".pagination-container .next").trigger("click"),n==="right"&&r.find(".pagination-container .prev").trigger("click")}t.swipe({swipeLeft:n,swipeRight:n,allowPageScroll:"auto"})}}}(),function(){var t=e(".projects-carousel, .post-carousel");if(t.length){var n;function r(){e(window).width()<480?n=1:e(window).width()<768?n=2:e(window).width()<960?n=3:n=4}function i(t){t.each(function(){var t=e(this);t.jcarousel({animation:600,easing:"easeOutCubic",scroll:n,itemVisibleInCallback:function(){o(t),o(t)}})})}function s(){t.each(function(){var t=e(this),n=t.children("li");newWidth=n.length*n.first().outerWidth(!0)+100,r();if(t.width()!==newWidth){t.css("width",newWidth).data("resize","true"),i(t),t.jcarousel("scroll",1);var s=window.setTimeout(function(){window.clearTimeout(s),t.data("resize",null)},600)}})}function o(e){e.data("resize")&&e.css("left","0")}r(),i(t);if(Modernizr.touch){function u(t,n){var r=e(t.currentTarget);n==="left"&&r.parent(".jcarousel-clip").siblings(".jcarousel-next").trigger("click"),n==="right"&&r.parent(".jcarousel-clip").siblings(".jcarousel-prev").trigger("click")}t.swipe({swipeLeft:u,swipeRight:u,allowPageScroll:"auto"})}e(window).on("resize",function(){var e=window.setTimeout(function(){window.clearTimeout(e),s()},30)})}}(),function(){var t=e(".image-gallery-slider > ul");if(t.length){e(window).load(function(){t.each(function(n){var r=e(this);r.css("height",r.children("li:first").height()).after('').cycle({before:function(t,n,r){var i=e(this);i.parent().stop().animate({height:i.height()},r.speed)},containerResize:!1,easing:"easeInOutExpo",fx:"fixedScrollHorz",fit:!0,next:".image-gallery-slider-nav-next-"+n,pause:!0,prev:".image-gallery-slider-nav-prev-"+n,slideExpr:"li",slideResize:!0,speed:600,timeout:0,width:"100%"}).data("slideCount",t.children("li").length)});var n=e(".image-gallery-slider-nav a");n.css("margin-top",-n.height()/2),e(".image-gallery-slider-nav a").on("mouseenter",function(){e(this).parent().prev().cycle("pause")}).on("mouseleave",function(){e(this).parent().prev().cycle("resume")}),t.data("slideCount")<=1&&t.next(".image-gallery-slider-nav").hide()}),e(window).on("resize",function(){t.each(function(){var t=e(this);t.css("height",t.children("li:visible").height())})});if(Modernizr.touch){function n(t,n){var r=e(t.currentTarget);r.data("slideCount")>1&&(r.data("dir",""),n==="left"&&r.cycle("next"),n==="right"&&(r.data("dir","prev"),r.cycle("prev")))}t.swipe({swipeLeft:n,swipeRight:n,allowPageScroll:"auto"})}}}(),function(){var t=e("#portfolio-items");if(t.length){var n=e("#portfolio-items-filter"),r;e("article",t).each(function(t){var n=e(this);n.addClass(n.attr("data-categories"))}),e(window).on("load",function(){t.isotope({itemSelector:"article",layoutMode:"fitRows"})}),n.on("click","a",function(r){var i=e(this),s=i.attr("data-categories");n.find("a").removeClass("active"),i.addClass("active"),s&&(s!=="*"&&(s=s.replace(s,"."+s)),t.isotope({filter:s})),r.preventDefault()}),n.find("a").first().addClass("active"),n.find("a").not(".active").hide(),n.on("mouseenter",function(){var t=e(this);clearTimeout(r),r=setTimeout(function(){e(window).width()>=960&&t.find("li a").stop(!0,!0).slideHorzShow(300)},100)}).on("mouseleave",function(){clearTimeout(r),e(window).width()>=960&&e(this).find("li a").not(".active").stop(!0,!0).slideHorzHide(150)})}}(),function(){var t=e(".video-js");if(t.length){function n(){t.each(function(t){var n=e(this);playerWidth=n.parent().width(),playerHeight=playerWidth/(n.children(".vjs-tech").data("aspect-ratio")||1.78),playerWidth<=300?n.addClass("vjs-player-width-300"):n.removeClass("vjs-player-width-300"),playerWidth<=250?n.addClass("vjs-player-width-250"):n.removeClass("vjs-player-width-250"),n.css({height:playerHeight,width:playerWidth}).attr("height",playerHeight).attr("width",playerWidth)})}n(),e(window).on("resize",function(){var e=window.setTimeout(function(){window.clearTimeout(e),n()},30)})}}(),function(){function t(){var t=e(".fluid-width-video-wrapper");t.each(function(){var t=e(this);playerWidth=t.parent().width(),playerHeight=playerWidth/t.data("aspectRatio"),t.css({height:playerHeight,width:playerWidth})})}e(".container").each(function(){var n=["iframe[src^='http://player.vimeo.com']","iframe[src^='http://www.youtube.com']","iframe[src^='http://blip.tv']","iframe[src^='http://www.kickstarter.com']","object","embed"],r=e(this).find(n.join(","));r.each(function(){var n=e(this);if(n.hasClass("vjs-tech")||this.tagName.toLowerCase()=="embed"&&n.parent("object").length||n.parent(".fluid-width-video-wrapper").length)return;var r=n.attr("height")||n.height(),i=n.attr("width")||n.width();n.css({height:"100%",width:"100%"}).removeAttr("height").removeAttr("width").wrap('
').parent(".fluid-width-video-wrapper").css({height:r,width:i}).data("aspectRatio",i/r).addClass(e(this).attr("class")),t()})}),e(window).on("resize",function(){var e=window.setTimeout(function(){window.clearTimeout(e),t()},30)})}(),function(){var t=e(".APV1_wrapper");if(t.length){t.each(function(t){var n=e(this);n.prev("audio").hide().end().wrap('
')});function n(n){t.each(function(t){var r=e(this),i=r.children("li"),s=r.children("li.APV1_container"),o=r.parent().width(),u=0;n||r.prev("audio").hide(),o<=300?r.addClass("APV1_player_width_300"):r.removeClass("APV1_player_width_300"),o<=250?r.addClass("APV1_player_width_250"):r.removeClass("APV1_player_width_250"),o<=200?r.addClass("APV1_player_width_200"):r.removeClass("APV1_player_width_200"),i.each(function(){var t=e(this);u+=t.width()}),r.width(r.parent().width()),s.width(o-(u-s.width()))})}n(),e(window).on("resize",function(){var e=window.setTimeout(function(){window.clearTimeout(e),n(resize=!0)},30)})}}(),function(){var t=e("#map");t.length&&t.gMap({address:"Iesfrosur Plantel Motozintla, De Las Canoas San Antonio 30900 Motozintla de Mendoza, Chiapas‎",zoom:16,markers:[{lat:"15.360777",lng:"-92.247392",address:"Iesfrosur Plantel Motozintla, De Las Canoas San Antonio 30900 Motozintla de Mendoza, Chiapas‎"}]})}(),function(){var t=e(".acc-container"),n=e(".acc-trigger");t.hide(),n.first().addClass("active").next().show();var r=t.outerWidth(!0);n.css("width",r),t.css("width",r),n.on("click",function(t){e(this).next().is(":hidden")&&(n.removeClass("active").next().slideUp(300),e(this).toggleClass("active").next().slideDown(300)),t.preventDefault()}),e(window).on("resize",function(){r=t.outerWidth(!0),n.css("width",n.parent().width()),t.css("width",t.parent().width())})}(),function(){var t=e(".tabs-nav"),n=t.children("li"),r=e(".tab-content");t.each(function(){var t=e(this);t.next().children(".tab-content").stop(!0,!0).hide().first().show(),t.children("li").first().addClass("active").stop(!0,!0).show()}),n.on("click",function(t){var n=e(this);n.siblings().removeClass("active").end().addClass("active"),n.parent().next().children(".tab-content").stop(!0,!0).hide().siblings(n.find("a").attr("href")).fadeIn(),t.preventDefault()})}(),function(){function t(t,n){n.html('Loading...'),e.ajax({url:t,dataType:"html",timeout:1e4,type:"GET",error:function(e,t,r){n.html("An error occured: "+r)},success:function(e,t,r){n.html(e)}})}var n=e(".tweets-feed");n.length&&t("php/tweets.php",n);var r=e(".flickr-feed");r.length&&t("php/flickr.php",r)}(),function(){var t=e(".contact-form"),n='Loading...';t.append('