function InitDfp(){googletag.pubads().enableSingleRequest();googletag.pubads().collapseEmptyDivs(!0);googletag.enableServices()}function LoadDfp(n,t,i,r){(r=="Y"&&$isMobile||r=="N"&&!$isMobile)&&googletag.cmd.push(function(){$dfpSlot=googletag.defineSlot("/21959889555/"+n,t,i).addService(googletag.pubads());SetTarget($dfpSlot);$checkSlot.indexOf($dfpSlot.getSlotElementId())>-1&&($destroySlot=!0);InitDfp();googletag.display(i)})}function SetTarget(n){cat1.length>0&&n.setTargeting("cat1",cat1.split(","));cat2.length>0&&n.setTargeting("cat2",cat2.split(","));col.length>0&&n.setTargeting("col",col);pid.length>0&&n.setTargeting("pid",pid);adt.length>0&&n.setTargeting("adt",adt);content_keyvalues.length>0&&$.each(content_keyvalues,function(t,i){n.setTargeting(i.key,i.values)})}function LoadSkyDfp(n,t){googletag.cmd.push(function(){googletag.defineOutOfPageSlot("/21959889555/"+n,t).addService(googletag.pubads());InitDfp();googletag.display(t)})}function LoadFooterDfp(){if($footerSlot!=null){var n=$footerSlot.getSlotElementId();googletag.cmd.push(function(){googletag.pubads().refresh([$footerSlot]);googletag.pubads().addEventListener("impressionViewable",function(t){t.slot.getSlotElementId()==n&&AdjustFooter()})})}}function PageDFP(){var t,i,r,n,u;$("div.dfp_ad").length&&$("div.dfp_ad").each(function(){t=$(this);typeof t.attr("id")!="undefined"&&t.attr("id").indexOf("div-gpt-ad")>-1&&(n=t.attr("id"),i=t.data("code"),r=t.data("size"),u=t.data("mobile"),n=="div-gpt-ad-1535610191337-0"?LoadSkyDfp(i,n):n=="div-gpt-ad-1529921678922-0"?$isMobile&&LoadDfp(i,r,n,u):$("#mobile-cover").length&&$isMobile?n!="div-gpt-ad-1535610662919-0"&&LoadDfp(i,r,n,u):LoadDfp(i,r,n,u))})}function CheckDFP(){$isMobile&&$("#mobile-cover").length&&!$("#mobile-cover").hasClass("open")&&LoadFooterDfp();$("div.dfp_ad").length&&$("div.dfp_ad").each(function(){var n=$(this),i,t;typeof n.attr("id")!="undefined"&&n.attr("id").indexOf("div-gpt-ad")>-1&&(i=n.find("iframe"),i.length>0&&n.attr("id")!="div-gpt-ad-1529921678922-0"&&(typeof i.attr("src")!="undefined"||n.css("display")=="block"?n.parent().show():(t=n.parent().parent(),typeof t.attr("class")!="undefined"&&t.attr("class").indexOf("300ad")>-1&&t.height()==0&&t.hide())))})}function WatchCoverDFP(){var n=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,t=document.querySelector("div.ad-img>div.dfp_ad"),i=new n(function(n){n.forEach(function(n){n.type=="attributes"&&n.target.id=="div-gpt-ad-1529921678922-0"&&n.target.style.display!="none"&&toggleOverlay("mobile-cover")})});i.observe(t,{attributes:!0,attributeFilter:["style"]})}function SetFooterDFP(){var n=$("#div-gpt-ad-1535610662919-0");n.length&&googletag.cmd.push(function(){$footerSlot=googletag.defineSlot("/21959889555/"+n.data("code"),n.data("size"),n.attr("id")).addService(googletag.pubads());SetTarget($footerSlot);googletag.pubads().enableSingleRequest();googletag.pubads().disableInitialLoad();googletag.enableServices()})}function SetContentDFP(){if($isMobile){var t="",n="",i=$("#main_content").data("category");i||(i="realtime");switch(i){case"realtime":t="01.EBCNews_PAGE_head_RealTime_M1";n="div-gpt-ad-1529920376294-0";break;case"entertainment":t="01.EBCNews_PAGE_head_entertainment_M1";n="div-gpt-ad-1529920297967-0";break;case"society":t="01.EBCNews_PAGE_head_society_M1";n="div-gpt-ad-1529920208529-0";break;case"living":t="01.EBCNews_PAGE_head_living_M1";n="div-gpt-ad-1531469160150-0";break;case"politics":t="01.EBCNews_PAGE_head_Politics_M1";n="div-gpt-ad-1531469285598-0";break;case"business":t="01.EBCNews_PAGE_head_business_M1";n="div-gpt-ad-1531469425385-0";break;case"world":t="01.EBCNews_PAGE_head_world_M1";n="div-gpt-ad-1529920473389-0";break;case"china":t="01.EBCNews_PAGE_head_china_M1";n="div-gpt-ad-1529920499115-0";break;case"america":t="01.EBCNews_PAGE_head_america_M1";n="div-gpt-ad-1529920546709-0";break;case"fun":t="01.EBCNews_PAGE_head_fun_M1";n="div-gpt-ad-1531469473333-0";break;case"story":t="01.EBCNews_PAGE_head_touched_M1";n="div-gpt-ad-1529920832968-0";break;case"astrology":t="01.EBCNews_PAGE_head_Astrology_M1";n="div-gpt-ad-1531469530018-0";break;default:t="01.EBCNews_PAGE_head_else_M1";n="div-gpt-ad-1529920883283-0"}$("div.mobileonly-300ad").first().children("div.ad_300250").first().children("div").first().attr("id",n);LoadDfp(t,[[300,250],[300,600]],n,"Y")}var o=$("div.raw-style"),s=$isMobile?"Y":"N",r,u,f,e=o.find("div.dfp_ad");e.length&&e.each(function(){var n=$(this);typeof n.attr("id")!="undefined"&&(u=n.attr("id"),r=n.data("code"),f=n.data("size"),LoadDfp(r,f,u,s))})}function SetVideoDFP(n){var r=$(n),e=r.data("channel"),u=r.data("program"),f=r.data("check"),i,t;$isMobile?(i="01.ebcnews_vpage_else_m1",t="div-gpt-ad-1533114644595-0"):(i="01.ebcnews_vpage_else_w1",t="div-gpt-ad-1533114618209-0");switch(e){case"LIVE":$isMobile?(i="01.ebcnews_vpage_live_m1",t="div-gpt-ad-1533114528997-0"):(i="01.ebcnews_vpage_live_w1",t="div-gpt-ad-1533114498647-0");break;case"VIDEO":u==f[0]?$isMobile?(i="01.ebcnews_vpage_sot_m1",t="div-gpt-ad-1533114447014-0"):(i="01.ebcnews_vpage_sot_w1",t="div-gpt-ad-1533114416299-0"):u==f[1]?$isMobile?(i="01.ebcnews_vpage_ctime_m1",t="div-gpt-ad-1533114587579-0"):(i="01.ebcnews_vpage_ctime_w1",t="div-gpt-ad-1533114556934-0"):u==f[2]&&($isMobile?(i="01.ebcnews_vpage_original_m1",t="div-gpt-ad-1533111874898-0"):(i="01.ebcnews_vpage_original_w1",t="div-gpt-ad-1533112111416-0"))}r.find("div.ad_336280").first().children("div").first().attr("id",t);LoadDfp(i,[[336,280]],t,$isMobile?"Y":"N")}function onYouTubeIframeAPIReady(){$playerIframe=document.querySelectorAll("div.Flexible-container > iframe");$.each($playerIframe,function(){var n=this.id;(n.indexOf("live-play")==-1||n=="live-play-yt")&&($players[n]=new YT.Player(n,{events:{onReady:onPlayerReady(n),onStateChange:onPlayerStateChange(n)}}))})}function onPlayerReady(n){return function(t){isiOSDevice()||n=="video-play"&&t.target.mute();$("#watch-playlist").length&&n=="video-play"&&(t.target.loadPlaylist($playlist),t.target.setLoop(!0))}}function onPlayerStateChange(n){return function(t){if(t.data==1){if($("#watch-playlist").length>0&&n=="video-play"){let n=t.target.getPlaylistIndex();$("#video-title").text($titlelist[n]);$("#watch-playlist>ul").children("li").attr("class","white-box");$("#watch-playlist>ul").children("li").eq(n).attr("class","nowplaying")}PlayerPause(n)}}}function PlayerPause(n){$.each($players,function(){try{this.getIframe().id!=n&&typeof this!="undefined"&&this.hasOwnProperty("getPlayerState")&&(this.getPlayerState()==1||this.getPlayerState()==3)&&this.pauseVideo()}catch(t){return}})}function PlayerPlay(n){$players[n]=new YT.Player(n,{events:{onReady:function(n){n.target.getPlayerState()==5&&n.target.playVideo()}}})}function LivePlayer(){var n="live-play-yt";$players[n]=new YT.Player(n,{events:{onStateChange:onPlayerStateChange(n)}})}function switchMenu(n,t,i){var r=document.getElementById(t);r.style.display=="none"?(r.style.minWidth=n.clientWidth,r.style.display="block",hideMenu(),VisibleMenu=t):(i!="MouseOver"||VisibleMenu!=t)&&(r.style.display="none",VisibleMenu="")}function hideMenu(){VisibleMenu!=""&&(document.getElementById(VisibleMenu).style.display="none");VisibleMenu=""}function toggleOverlay(n){var r="#"+n,t=document.querySelector(r),u=t.querySelector("button.overlay-close"),i;transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd",transition:"transitionend"};transEndEventName=transEndEventNames[Modernizr.prefixed("transition")];support={transitions:Modernizr.csstransitions};u.addEventListener("click",function(){toggleOverlay(n)});classie.has(t,"open")?(classie.remove(t,"open"),classie.add(t,"close"),i=function(n){if(support.transitions){if(n.propertyName!=="visibility")return;this.removeEventListener(transEndEventName,i)}classie.remove(t,"close")},support.transitions?(t.addEventListener(transEndEventName,i),typeof $dfpSlot!="undefined"&&$dfpSlot!=null&&$destroySlot&&(googletag.destroySlots([$dfpSlot]),$dfpSlot=null),$("#video-content").length&&$("#video-content").remove(),$("#mobile-cover").length&&($("#mobile-cover").remove(),LoadFooterDfp())):i()):classie.has(t,"close")||(classie.add(t,"open"),n=="login-dialog"?Login():$("#overlay-play").length>0&&(PlayerPause($("#overlay-play").attr("id")),SetVideoDFP(r)))}function Sticky_Init(){$winHeight=$(window).height();$winWidth=$(window).width();$("#pc-nav-inner").length>0&&($menuHeight=$("#pc-nav-inner").prop("scrollHeight"));$docHeight=document.body.scrollHeight;$("#main-right").length>0&&($rightLeft=$("#main-right").offset().left,$rightWidth=$("#main-right").width(),$rightHeight=$("#main-right").prop("scrollHeight"),$rightTop=$("#main-right").offset().top,$rightBottom=$rightTop+$rightHeight,$scroll_RH=$rightHeight,$leftLeft=$("#main-left").offset().left,$leftWidth=$("#main-left").width(),$leftHeight=$("#main-left").prop("scrollHeight"),$leftTop=$("#main-left").offset().top,$leftBottom=$leftTop+$leftHeight,$scroll_LH=$leftHeight)}function Sticky_PageShare(){$("#pageshare").length&&($("#sticky_navigation").css("position")=="fixed"?$("#pageshare").css({position:"fixed",top:$menuHeight}):$("#pageshare").css({position:"absolute",top:0}))}var googletag,$playerIframe,$players,VisibleMenu,sticky_navigation_offset_top,sticky_navigation,$winHeight,$winWidth,$docHeight,$menuHeight,$rightWidth,$rightHeight,$rightLeft,$rightTop,$rightBottom,$leftWidth,$leftHeight,$leftLeft,$leftTop,$leftBottom,$scroll_RH,$scroll_LH,$setLeft,$scrollTop;(function(n,t,i,r,u){n[r]=n[r]||[];n[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var e=t.getElementsByTagName(i)[0],f=t.createElement(i),o=r!="dataLayer"?"&l="+r:"";f.defer=!0;f.src="https://www.googletagmanager.com/gtm.js?id="+u+o;e.parentNode.insertBefore(f,e)})(window,document,"script","dataLayer","GTM-MVG34XD");googletag=googletag||{};googletag.cmd=googletag.cmd||[],function(){var n=document.createElement("script"),i,t;n.defer=!0;n.type="text/javascript";i="https:"==document.location.protocol;n.src=(i?"https:":"http:")+"//www.googletagservices.com/tag/js/gpt.js";t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t)}(),function(n,t,i,r,u,f,e){n.GoogleAnalyticsObject=u;n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)};n[u].l=1*new Date;f=t.createElement(i);e=t.getElementsByTagName(i)[0];f.defer=1;f.src=r;e.parentNode.insertBefore(f,e)}(window,document,"script","https://www.google-analytics.com/analytics.js","ga");location.host.toLocaleLowerCase().indexOf("lab")>-1?(ga("create","UA-124878515-1","auto","default"),cate_name.length>0&&ga("default.set","dimension1",cate_name),news_partner!=0&&ga("default.set","dimension2",news_partner),ga("default.send","pageview")):(ga("create","UA-124878515-2","auto","ga1"),ga("create","UA-124878515-7","auto","ga2"),ga("create","UA-124878515-5",{sampleRate:10}),cate_name.length>0&&(ga("ga1.set","dimension1",cate_name),ga("ga2.set","dimension1",cate_name),ga("set","dimension1",cate_name)),news_partner!=0&&(ga("ga1.set","dimension2",news_partner),ga("ga2.set","dimension2",news_partner),ga("set","dimension2",news_partner)),ga("ga1.send","pageview"),ga("ga2.send","pageview"),ga("send","pageview"));ga("create","UA-124878515-10","auto","tracker");ga("tracker.send","pageview");ga("tracker.require","ecommerce");ga("tracker.ecommerce:addTransaction",{id:trans,revenue:"1"});key_values.forEach(function(n){ga("tracker.ecommerce:addItem",{id:trans,name:n,sku:n,price:"1",quantity:"1"})});ga("tracker.ecommerce:send");var isMobileDevice=function(){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))},isiOSDevice=function(){return navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("ipod")>-1},Line_Share=function(n,t,i){var u=top.window.location.href,r;t!=""&&(u=t);r="https://social-plugins.line.me/lineit/share?url=".concat(encodeURIComponent(u));n!=""&&(r+="&text=".concat(encodeURIComponent(n)));i?top.window.open(r):top.window.location.href=r},FB_Share=function(n){var t=top.window.location.href;typeof n!="undefined"&&n!=""&&(t=n);FB.ui({method:"share",href:t},function(){})},FB_Feed=function(n,t,i,r,u){FB.ui({method:"feed",display:"popup",link:t,picture:i,name:n,description:u},function(){})},getGeoLocation=function(n){typeof n=="function"&&(navigator.geolocation?navigator.geolocation.getCurrentPosition(function(t){n({lat:t.coords.latitude,lng:t.coords.longitude})},function(){n()}):n())},geo2Address=function(n,t){if(typeof t=="function")if(typeof google!="undefined"&&typeof google.maps!="undefined"){var i=new google.maps.Geocoder,r=new google.maps.LatLng(n.lat,n.lng);i.geocode({latLng:r},function(n,i){i==google.maps.GeocoderStatus.OK?t(n):t()})}else t()},setCookie=function(n,t,i,r){var u=new Date,f;u.setTime(u.getTime()+i*864e5);f=n+"="+t+";expires="+u.toUTCString()+";path=/";r!=""&&(f+=";domain="+r);document.cookie=f},getCookie=function(n){for(var t,r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),i=0;i<u.length;i++){for(t=u[i].trim();t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""},cutString=function(n,t){for(var u=n.length,r=0,i=0;i<u;i++)if(n[i].match(/[^\x00-\xff]/g)!=null?r+=2:r++,r>=t){r==t&&i++;break}return i==u?n:n.substr(0,i)+"..."},removeHTML=function(n){return n=n.replace(/<[^>]*>/g,""),n=n.replace(/&nbsp;/g,""),n.trim()},matchArray=function(n,t){return t.some(function(t){return n.indexOf(t)>-1})},$isMobile=isMobileDevice(),$dfpSlot=null,$footerSlot=null,$destroySlot=!1,$checkSlot=["div-gpt-ad-1533114498647-0","div-gpt-ad-1533114528997-0","div-gpt-ad-1533114416299-0","div-gpt-ad-1533114447014-0","div-gpt-ad-1533114556934-0","div-gpt-ad-1533114587579-0","div-gpt-ad-1533112111416-0","div-gpt-ad-1533111874898-0","div-gpt-ad-1533114618209-0","div-gpt-ad-1533114644595-0"];(function(n){n.fn.lazyload=function(t){var i={threshold:0,failurelimit:0,event:"scroll",effect:"show",container:window},r;return t&&n.extend(i,t),r=this,"scroll"==i.event&&n(i.container).bind("scroll",function(){var u=0,t;r.each(function(){if(!n.abovethetop(this,i)&&!n.leftofbegin(this,i))if(n.belowthefold(this,i)||n.rightoffold(this,i)){if(u++>i.failurelimit)return!1}else n(this).trigger("appear")});t=n.grep(r,function(n){return!n.loaded});r=n(t)}),this.each(function(){var t=this;undefined==n(t).attr("original")&&n(t).attr("original",n(t).attr("src"));"scroll"!=i.event||undefined==n(t).attr("src")||i.placeholder==n(t).attr("src")||n.abovethetop(t,i)||n.leftofbegin(t,i)||n.belowthefold(t,i)||n.rightoffold(t,i)?(i.placeholder?n(t).attr("src",i.placeholder):n(t).removeAttr("src"),t.loaded=!1):t.loaded=!0;n(t).one("appear",function(){this.loaded||n("<img />").bind("load",function(){n(t).hide().attr("src",n(t).attr("original"))[i.effect](i.effectspeed);t.loaded=!0}).attr("src",n(t).attr("original"))});"scroll"!=i.event&&n(t).bind(i.event,function(){t.loaded||n(t).trigger("appear")})}),n(i.container).trigger(i.event),this};n.belowthefold=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).height()+n(window).scrollTop():n(i.container).offset().top+n(i.container).height(),r<=n(t).offset().top-i.threshold};n.rightoffold=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).width()+n(window).scrollLeft():n(i.container).offset().left+n(i.container).width(),r<=n(t).offset().left-i.threshold};n.abovethetop=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).scrollTop():n(i.container).offset().top,r>=n(t).offset().top+i.threshold+n(t).height()};n.leftofbegin=function(t,i){var r;return r=i.container===undefined||i.container===window?n(window).scrollLeft():n(i.container).offset().left,r>=n(t).offset().left+i.threshold+n(t).width()};n.extend(n.expr[":"],{"below-the-fold":"$.belowthefold(a, {threshold : 0, container: window})","above-the-fold":"!$.belowthefold(a, {threshold : 0, container: window})","right-of-fold":"$.rightoffold(a, {threshold : 0, container: window})","left-of-fold":"!$.rightoffold(a, {threshold : 0, container: window})"})})(jQuery),function(n,t){function r(t){n.fn.cycle.debug&&i(t)}function i(){window.console&&console.log&&console.log("[cycle] "+Array.prototype.join.call(arguments," "))}function u(t,i,r){var u=n(t).data("cycle.opts"),f;u&&(f=!!t.cyclePause,f&&u.paused?u.paused(t,u,i,r):!f&&u.resumed&&u.resumed(t,u,i,r))}function c(r,e,o){function h(t,r,u){if(!t&&!0===r){if(t=n(u).data("cycle.opts"),!t)return i("options not found, can not resume"),!1;u.cycleTimeout&&(clearTimeout(u.cycleTimeout),u.cycleTimeout=0);f(t.elements,t,1,!t.backwards)}}if(r.cycleStop===t&&(r.cycleStop=0),(e===t||null===e)&&(e={}),e.constructor==String)switch(e){case"destroy":case"stop":var s=n(r).data("cycle.opts");return s?(r.cycleStop++,r.cycleTimeout&&clearTimeout(r.cycleTimeout),r.cycleTimeout=0,s.elements&&n(s.elements).stop(),n(r).removeData("cycle.opts"),"destroy"==e&&l(r,s),!1):!1;case"toggle":return r.cyclePause=1===r.cyclePause?0:1,h(r.cyclePause,o,r),u(r),!1;case"pause":return r.cyclePause=1,u(r),!1;case"resume":return r.cyclePause=0,h(!1,o,r),u(r),!1;case"prev":case"next":return(s=n(r).data("cycle.opts"),!s)?(i('options not found, "prev/next" ignored'),!1):("string"==typeof o&&(s.oneTimeFx=o),n.fn.cycle[e](s),!1);default:e={fx:e}}else if(e.constructor==Number)return(s=e,e=n(r).data("cycle.opts"),!e)?(i("options not found, can not advance slide"),!1):0>s||s>=e.elements.length?(i("invalid slide index: "+s),!1):(e.nextSlide=s,r.cycleTimeout&&(clearTimeout(r.cycleTimeout),r.cycleTimeout=0),"string"==typeof o&&(e.oneTimeFx=o),f(e.elements,e,1,s>=e.currSlide),!1);return e}function o(t,i){if(!n.support.opacity&&i.cleartype&&t.style.filter)try{t.style.removeAttribute("filter")}catch(r){}}function l(t,i){i.next&&n(i.next).unbind(i.prevNextEvent);i.prev&&n(i.prev).unbind(i.prevNextEvent);(i.pager||i.pagerAnchorBuilder)&&n.each(i.pagerAnchors||[],function(){this.unbind().remove()});i.pagerAnchors=null;n(t).unbind("mouseenter.cycle mouseleave.cycle");i.destroy&&i.destroy(i)}function a(r,s,c,l,a){var k,b=n.extend({},n.fn.cycle.defaults,l||{},n.metadata?r.metadata():n.meta?r.data():{}),g=n.isFunction(r.data)?r.data(b.metaAttr):null,tt,d,it,et,ot;if(g&&(b=n.extend(b,g)),b.autostop&&(b.countdown=b.autostopCount||c.length),tt=r[0],r.data("cycle.opts",b),b.$cont=r,b.stopCount=tt.cycleStop,b.elements=c,b.before=b.before?[b.before]:[],b.after=b.after?[b.after]:[],!n.support.opacity&&b.cleartype&&b.after.push(function(){o(this,b)}),b.continuous&&b.after.push(function(){f(c,b,0,!b.backwards)}),v(b),n.support.opacity||!b.cleartype||b.cleartypeNoBg||h(s),"static"==r.css("position")&&r.css("position","relative"),b.width&&r.width(b.width),b.height&&"auto"!=b.height&&r.height(b.height),b.startingSlide!==t?(b.startingSlide=parseInt(b.startingSlide,10),b.startingSlide>=c.length||0>b.startSlide?b.startingSlide=0:k=!0):b.startingSlide=b.backwards?c.length-1:0,b.random){for(b.randomMap=[],g=0;g<c.length;g++)b.randomMap.push(g);if(b.randomMap.sort(function(){return Math.random()-.5}),k)for(k=0;k<c.length;k++)b.startingSlide==b.randomMap[k]&&(b.randomIndex=k);else b.randomIndex=1,b.startingSlide=b.randomMap[1]}else b.startingSlide>=c.length&&(b.startingSlide=0);if(b.currSlide=b.startingSlide||0,d=b.startingSlide,s.css({position:"absolute",top:0,left:0}).hide().each(function(t){t=b.backwards?d?t<=d?c.length+(t-d):d-t:c.length-t:d?t>=d?c.length-(t-d):d-t:c.length-t;n(this).css("z-index",t)}),n(c[d]).css("opacity",1).show(),o(c[d],b),b.fit&&(b.aspect?s.each(function(){var t=n(this),i=!0===b.aspect?t.width()/t.height():b.aspect;b.width&&t.width()!=b.width&&(t.width(b.width),t.height(b.width/i));b.height&&t.height()<b.height&&(t.height(b.height),t.width(b.height*i))}):(b.width&&s.width(b.width),b.height&&"auto"!=b.height&&s.height(b.height))),b.center&&(!b.fit||b.aspect)&&s.each(function(){var t=n(this);t.css({"margin-left":b.width?(b.width-t.width())/2+"px":0,"margin-top":b.height?(b.height-t.height())/2+"px":0})}),!b.center||b.fit||b.slideResize||s.each(function(){var t=n(this);t.css({"margin-left":b.width?(b.width-t.width())/2+"px":0,"margin-top":b.height?(b.height-t.height())/2+"px":0})}),(b.containerResize||b.containerResizeHeight)&&1>r.innerHeight()){for(it=g=k=0;it<c.length;it++){var nt=n(c[it]),rt=nt[0],ut=nt.outerWidth(),ft=nt.outerHeight();ut||(ut=rt.offsetWidth||rt.width||nt.attr("width"));ft||(ft=rt.offsetHeight||rt.height||nt.attr("height"));k=ut>k?ut:k;g=ft>g?ft:g}b.containerResize&&0<k&&0<g&&r.css({width:k+"px",height:g+"px"});b.containerResizeHeight&&0<g&&r.css({height:g+"px"})}if((et=!1,b.pause&&r.bind("mouseenter.cycle",function(){et=!0;this.cyclePause++;u(tt,!0)}).bind("mouseleave.cycle",function(){et&&this.cyclePause--;u(tt,!0)}),!1===y(b))||(ot=!1,l.requeueAttempts=l.requeueAttempts||0,s.each(function(){var t=n(this);if(this.cycleH=b.fit&&b.height?b.height:t.height()||this.offsetHeight||this.height||t.attr("height")||0,this.cycleW=b.fit&&b.width?b.width:t.width()||this.offsetWidth||this.width||t.attr("width")||0,t.is("img")&&0===this.cycleH&&0===this.cycleW&&!this.complete){if(a.s&&b.requeueOnImageNotLoaded&&100>++l.requeueAttempts)return i(l.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH),setTimeout(function(){n(a.s,a.c).cycle(l)},b.requeueTimeout),ot=!0,!1;i("could not determine size of image: "+this.src,this.cycleW,this.cycleH)}return!0}),ot))return!1;if(b.cssBefore=b.cssBefore||{},b.cssAfter=b.cssAfter||{},b.cssFirst=b.cssFirst||{},b.animIn=b.animIn||{},b.animOut=b.animOut||{},s.not(":eq("+d+")").css(b.cssBefore),n(s[d]).css(b.cssFirst),b.timeout)for(b.timeout=parseInt(b.timeout,10),b.speed.constructor==String&&(b.speed=n.fx.speeds[b.speed]||parseInt(b.speed,10)),b.sync||(b.speed/=2),k="none"==b.fx?0:"shuffle"==b.fx?500:250;b.timeout-b.speed<k;)b.timeout+=b.speed;if(b.easing&&(b.easeIn=b.easeOut=b.easing),b.speedIn||(b.speedIn=b.speed),b.speedOut||(b.speedOut=b.speed),b.slideCount=c.length,b.currSlide=b.lastSlide=d,b.random?(++b.randomIndex==c.length&&(b.randomIndex=0),b.nextSlide=b.randomMap[b.randomIndex]):b.nextSlide=b.backwards?0===b.startingSlide?c.length-1:b.startingSlide-1:b.startingSlide>=c.length-1?0:b.startingSlide+1,!b.multiFx)if(k=n.fn.cycle.transitions[b.fx],n.isFunction(k))k(r,s,b);else if("custom"!=b.fx&&!b.multiFx)return i("unknown transition: "+b.fx,"; slideshow terminating"),!1;return r=s[d],b.skipInitializationCallbacks||(b.before.length&&b.before[0].apply(r,[r,r,b,!0]),b.after.length&&b.after[0].apply(r,[r,r,b,!0])),b.next&&n(b.next).bind(b.prevNextEvent,function(){return e(b,1)}),b.prev&&n(b.prev).bind(b.prevNextEvent,function(){return e(b,0)}),(b.pager||b.pagerAnchorBuilder)&&w(c,b),p(b,c),b}function v(t){t.original={before:[],after:[]};t.original.cssBefore=n.extend({},t.cssBefore);t.original.cssAfter=n.extend({},t.cssAfter);t.original.animIn=n.extend({},t.animIn);t.original.animOut=n.extend({},t.animOut);n.each(t.before,function(){t.original.before.push(this)});n.each(t.after,function(){t.original.after.push(this)})}function y(t){var u,e=n.fn.cycle.transitions,o,f;if(0<t.fx.indexOf(",")){for(t.multiFx=!0,t.fxs=t.fx.replace(/\s*/g,"").split(","),u=0;u<t.fxs.length;u++)o=t.fxs[u],f=e[o],f&&e.hasOwnProperty(o)&&n.isFunction(f)||(i("discarding unknown transition: ",o),t.fxs.splice(u,1),u--);if(!t.fxs.length)return i("No valid transitions named; slideshow terminating."),!1}else if("all"==t.fx)for(u in t.multiFx=!0,t.fxs=[],e)e.hasOwnProperty(u)&&(f=e[u],e.hasOwnProperty(u)&&n.isFunction(f)&&t.fxs.push(u));if(t.multiFx&&t.randomizeEffects){for(f=Math.floor(20*Math.random())+30,u=0;u<f;u++)t.fxs.push(t.fxs.splice(Math.floor(Math.random()*t.fxs.length),1)[0]);r("randomized fx sequence: ",t.fxs)}return!0}function p(t,i){t.addSlide=function(r,u){var f=n(r),e=f[0];if(t.autostopCount||t.countdown++,i[u?"unshift":"push"](e),t.els&&t.els[u?"unshift":"push"](e),t.slideCount=i.length,t.random&&(t.randomMap.push(t.slideCount-1),t.randomMap.sort(function(){return Math.random()-.5})),f.css("position","absolute"),f[u?"prependTo":"appendTo"](t.$cont),u&&(t.currSlide++,t.nextSlide++),n.support.opacity||!t.cleartype||t.cleartypeNoBg||h(f),t.fit&&t.width&&f.width(t.width),t.fit&&t.height&&"auto"!=t.height&&f.height(t.height),e.cycleH=t.fit&&t.height?t.height:f.height(),e.cycleW=t.fit&&t.width?t.width:f.width(),f.css(t.cssBefore),(t.pager||t.pagerAnchorBuilder)&&n.fn.cycle.createPagerAnchor(i.length-1,e,n(t.pager),i,t),n.isFunction(t.onAddSlide))t.onAddSlide(f);else f.hide()}}function f(i,u,e,o){function p(){var n=0;u.timeout&&!u.continuous?(n=s(i[u.currSlide],i[u.nextSlide],u,o),"shuffle"==u.fx&&(n-=u.speedOut)):u.continuous&&l.cyclePause&&(n=10);0<n&&(l.cycleTimeout=setTimeout(function(){f(i,u,0,!u.backwards)},n))}var l=u.$cont[0],c=i[u.currSlide],h=i[u.nextSlide],v,a,y;e&&u.busy&&u.manualTrump&&(r("manualTrump in go(), stopping active transition"),n(i).stop(!0,!0),u.busy=0,clearTimeout(l.cycleTimeout));u.busy?r("transition active, ignoring new tx request"):l.cycleStop==u.stopCount&&(0!==l.cycleTimeout||e)&&(e||l.cyclePause||u.bounce||!(u.autostop&&0>=--u.countdown||u.nowrap&&!u.random&&u.nextSlide<u.currSlide)?(v=!1,!e&&l.cyclePause||u.nextSlide==u.currSlide?p():(v=!0,a=u.fx,c.cycleH=c.cycleH||n(c).height(),c.cycleW=c.cycleW||n(c).width(),h.cycleH=h.cycleH||n(h).height(),h.cycleW=h.cycleW||n(h).width(),u.multiFx&&(o&&(u.lastFx===t||++u.lastFx>=u.fxs.length)?u.lastFx=0:!o&&(u.lastFx===t||0>--u.lastFx)&&(u.lastFx=u.fxs.length-1),a=u.fxs[u.lastFx]),u.oneTimeFx&&(a=u.oneTimeFx,u.oneTimeFx=null),n.fn.cycle.resetState(u,a),u.before.length&&n.each(u.before,function(n,t){l.cycleStop==u.stopCount&&t.apply(h,[c,h,u,o])}),y=function(){u.busy=0;n.each(u.after,function(n,t){l.cycleStop==u.stopCount&&t.apply(h,[c,h,u,o])});l.cycleStop||p()},r("tx firing("+a+"); currSlide: "+u.currSlide+"; nextSlide: "+u.nextSlide),u.busy=1,u.fxFn?u.fxFn(c,h,u,y,o,e&&u.fastOnEvent):n.isFunction(n.fn.cycle[u.fx])?n.fn.cycle[u.fx](c,h,u,y,o,e&&u.fastOnEvent):n.fn.cycle.custom(c,h,u,y,o,e&&u.fastOnEvent)),(v||u.nextSlide==u.currSlide)&&(u.lastSlide=u.currSlide,u.random?(u.currSlide=u.nextSlide,++u.randomIndex==i.length&&(u.randomIndex=0,u.randomMap.sort(function(){return Math.random()-.5})),u.nextSlide=u.randomMap[u.randomIndex],u.nextSlide==u.currSlide&&(u.nextSlide=u.currSlide==u.slideCount-1?0:u.currSlide+1)):u.backwards?(e=0>u.nextSlide-1)&&u.bounce?(u.backwards=!u.backwards,u.nextSlide=1,u.currSlide=0):(u.nextSlide=e?i.length-1:u.nextSlide-1,u.currSlide=e?0:u.nextSlide+1):(e=u.nextSlide+1==i.length)&&u.bounce?(u.backwards=!u.backwards,u.nextSlide=i.length-2,u.currSlide=i.length-1):(u.nextSlide=e?0:u.nextSlide+1,u.currSlide=e?i.length-1:u.nextSlide-1)),v&&u.pager&&u.updateActivePagerLink(u.pager,u.currSlide,u.activePagerClass)):u.end&&u.end(u))}function s(n,t,i,u){if(i.timeoutFn){for(n=i.timeoutFn.call(n,n,t,i,u);"none"!=i.fx&&250>n-i.speed;)n+=i.speed;if(r("calculated timeout: "+n+"; speed: "+i.speed),!1!==n)return n}return i.timeout}function e(t,i){var e=i?1:-1,r=t.elements,u=t.$cont[0],o=u.cycleTimeout;if(o&&(clearTimeout(o),u.cycleTimeout=0),t.random&&0>e)t.randomIndex--,-2==--t.randomIndex?t.randomIndex=r.length-2:-1==t.randomIndex&&(t.randomIndex=r.length-1),t.nextSlide=t.randomMap[t.randomIndex];else if(t.random)t.nextSlide=t.randomMap[t.randomIndex];else if(t.nextSlide=t.currSlide+e,0>t.nextSlide){if(t.nowrap)return!1;t.nextSlide=r.length-1}else if(t.nextSlide>=r.length){if(t.nowrap)return!1;t.nextSlide=0}return u=t.onPrevNextEvent||t.prevNextClick,n.isFunction(u)&&u(0<e,t.nextSlide,r[t.nextSlide]),f(r,t,1,i),!1}function w(t,i){var r=n(i.pager);n.each(t,function(u,f){n.fn.cycle.createPagerAnchor(u,f,r,t,i)});i.updateActivePagerLink(i.pager,i.startingSlide,i.activePagerClass)}function h(){r("applying clearType background-color hack")}n.expr[":"].paused=function(n){return n.cyclePause};n.fn.cycle=function(t,u){var e={s:this.selector,c:this.context};return 0===this.length&&"stop"!=t?!n.isReady&&e.s?(i("DOM not ready, queuing slideshow"),n(function(){n(e.s,e.c).cycle(t,u)}),this):(i("terminating; zero elements found by selector"+(n.isReady?"":" (DOM not ready)")),this):this.each(function(){var h=c(this,t,u),i;if(!1!==h){h.updateActivePagerLink=h.updateActivePagerLink||n.fn.cycle.updateActivePagerLink;this.cycleTimeout&&clearTimeout(this.cycleTimeout);this.cycleStop=this.cycleTimeout=this.cyclePause=0;var o=n(this),v=h.slideExpr?n(h.slideExpr,this):o.children(),l=v.get();l.length>1&&(i=a(o,v,l,h,e),!1!==i&&(o=i.continuous?10:s(l[i.currSlide],l[i.nextSlide],i,!i.backwards))&&(o+=i.delay||0,10>o&&(o=10),r("first timeout: "+o),this.cycleTimeout=setTimeout(function(){f(l,i,0,!h.backwards)},o)))}})};n.fn.cycle.resetState=function(t,i){i=i||t.fx;t.before=[];t.after=[];t.cssBefore=n.extend({},t.original.cssBefore);t.cssAfter=n.extend({},t.original.cssAfter);t.animIn=n.extend({},t.original.animIn);t.animOut=n.extend({},t.original.animOut);t.fxFn=null;n.each(t.original.before,function(){t.before.push(this)});n.each(t.original.after,function(){t.after.push(this)});var r=n.fn.cycle.transitions[i];n.isFunction(r)&&r(t.$cont,n(t.elements),t)};n.fn.cycle.updateActivePagerLink=function(t,i,r){n(t).each(function(){n(this).children().removeClass(r).eq(i).addClass(r)})};n.fn.cycle.next=function(n){e(n,1)};n.fn.cycle.prev=function(n){e(n,0)};n.fn.cycle.createPagerAnchor=function(t,i,e,o,s){var h,l,c,a;n.isFunction(s.pagerAnchorBuilder)?(i=s.pagerAnchorBuilder(t,i),r("pagerAnchorBuilder("+t+", el) returned: "+i)):i='<a href="#">'+(t+1)+"<\/a>";i&&(h=n(i),0===h.parents("body").length&&(l=[],1<e.length?(e.each(function(){var t=h.clone(!0);n(this).append(t);l.push(t[0])}),h=n(l)):h.appendTo(e)),s.pagerAnchors=s.pagerAnchors||[],s.pagerAnchors.push(h),e=function(i){i.preventDefault();s.nextSlide=t;i=s.$cont[0];var r=i.cycleTimeout;r&&(clearTimeout(r),i.cycleTimeout=0);i=s.onPagerEvent||s.pagerClick;n.isFunction(i)&&i(s.nextSlide,o[s.nextSlide]);f(o,s,1,s.currSlide<t)},/mouseenter|mouseover/i.test(s.pagerEvent)?h.hover(e,function(){}):h.bind(s.pagerEvent,e),/^click/.test(s.pagerEvent)||s.allowPagerClickBubble||h.bind("click.cycle",function(){return!1}),c=s.$cont[0],a=!1,s.pauseOnPagerHover&&h.hover(function(){a=!0;c.cyclePause++;u(c,!0,!0)},function(){a&&c.cyclePause--;u(c,!0,!0)}))};n.fn.cycle.hopsFromLast=function(n,t){var i=n.lastSlide,r=n.currSlide;return t?r>i?r-i:n.slideCount-i:r<i?i-r:i+n.slideCount-r};n.fn.cycle.commonReset=function(t,i,r,u,f,e){n(r.elements).not(t).hide();"undefined"==typeof r.cssBefore.opacity&&(r.cssBefore.opacity=1);r.cssBefore.display="block";r.slideResize&&!1!==u&&0<i.cycleW&&(r.cssBefore.width=i.cycleW);r.slideResize&&!1!==f&&0<i.cycleH&&(r.cssBefore.height=i.cycleH);r.cssAfter=r.cssAfter||{};r.cssAfter.display="none";n(t).css("zIndex",r.slideCount+(!0===e?1:0));n(i).css("zIndex",r.slideCount+(!0===e?0:1))};n.fn.cycle.custom=function(t,i,r,u,f,e){var h=n(t),c=n(i),l=r.speedIn,o,a,s;t=r.speedOut;o=r.easeIn;i=r.easeOut;a=r.animInDelay;f=r.animOutDelay;c.css(r.cssBefore);e&&(l=t="number"==typeof e?e:1,o=i=null);s=function(){c.delay(a).animate(r.animIn,l,o,function(){u()})};h.delay(f).animate(r.animOut,t,i,function(){h.css(r.cssAfter);r.sync||s()});r.sync&&s()};n.fn.cycle.transitions={fade:function(t,i,r){i.not(":eq("+r.currSlide+")").css("opacity",0);r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.cssBefore.opacity=0});r.animIn={opacity:1};r.animOut={opacity:0};r.cssBefore={top:0,left:0}}};n.fn.cycle.ver=function(){return"3.0.3"};n.fn.cycle.defaults={activePagerClass:"activeSlide",after:null,allowPagerClickBubble:!1,animIn:null,animInDelay:0,animOut:null,animOutDelay:0,aspect:!1,autostop:0,autostopCount:0,backwards:!1,before:null,center:null,cleartype:!n.support.opacity,cleartypeNoBg:!1,containerResize:1,containerResizeHeight:0,continuous:0,cssAfter:null,cssBefore:null,delay:0,easeIn:null,easeOut:null,easing:null,end:null,fastOnEvent:0,fit:0,fx:"fade",fxFn:null,height:"auto",manualTrump:!0,metaAttr:"cycle",next:null,nowrap:0,onPagerEvent:null,onPrevNextEvent:null,pager:null,pagerAnchorBuilder:null,pagerEvent:"click.cycle",pause:0,pauseOnPagerHover:0,prev:null,prevNextEvent:"click.cycle",random:0,randomizeEffects:1,requeueOnImageNotLoaded:!0,requeueTimeout:250,rev:0,shuffle:null,skipInitializationCallbacks:!1,slideExpr:null,slideResize:1,speed:1e3,speedIn:null,speedOut:null,startingSlide:t,sync:1,timeout:4e3,timeoutFn:null,updateActivePagerLink:null,width:null}}(jQuery),function(n){n.fn.cycle.transitions.none=function(t,i,r){r.fxFn=function(t,i,r,u){n(i).show();n(t).hide();u()}};n.fn.cycle.transitions.fadeout=function(t,i,r){i.not(":eq("+r.currSlide+")").css({display:"block",opacity:1});r.before.push(function(t,i,r,u,f,e){n(t).css("zIndex",r.slideCount+(!0!==e?1:0));n(i).css("zIndex",r.slideCount+(!0!==e?0:1))});r.animIn.opacity=1;r.animOut.opacity=0;r.cssBefore.opacity=1;r.cssBefore.display="block";r.cssAfter.zIndex=0};n.fn.cycle.transitions.scrollUp=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);t=t.height();r.cssBefore.top=t;r.cssBefore.left=0;r.cssFirst.top=0;r.animIn.top=0;r.animOut.top=-t};n.fn.cycle.transitions.scrollDown=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);t=t.height();r.cssFirst.top=0;r.cssBefore.top=-t;r.cssBefore.left=0;r.animIn.top=0;r.animOut.top=t};n.fn.cycle.transitions.scrollLeft=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);t=t.width();r.cssFirst.left=0;r.cssBefore.left=t;r.cssBefore.top=0;r.animIn.left=0;r.animOut.left=0-t};n.fn.cycle.transitions.scrollRight=function(t,i,r){t.css("overflow","hidden");r.before.push(n.fn.cycle.commonReset);t=t.width();r.cssFirst.left=0;r.cssBefore.left=-t;r.cssBefore.top=0;r.animIn.left=0;r.animOut.left=t};n.fn.cycle.transitions.scrollHorz=function(t,i,r){t.css("overflow","hidden").width();r.before.push(function(t,i,r,u){r.rev&&(u=!u);n.fn.cycle.commonReset(t,i,r);r.cssBefore.left=u?i.cycleW-1:1-i.cycleW;r.animOut.left=u?-t.cycleW:t.cycleW});r.cssFirst.left=0;r.cssBefore.top=0;r.animIn.left=0;r.animOut.top=0};n.fn.cycle.transitions.scrollVert=function(t,i,r){t.css("overflow","hidden");r.before.push(function(t,i,r,u){r.rev&&(u=!u);n.fn.cycle.commonReset(t,i,r);r.cssBefore.top=u?1-i.cycleH:i.cycleH-1;r.animOut.top=u?t.cycleH:-t.cycleH});r.cssFirst.top=0;r.cssBefore.left=0;r.animIn.top=0;r.animOut.left=0};n.fn.cycle.transitions.slideX=function(t,i,r){r.before.push(function(t,i,r){n(r.elements).not(t).hide();n.fn.cycle.commonReset(t,i,r,!1,!0);r.animIn.width=i.cycleW});r.cssBefore.left=0;r.cssBefore.top=0;r.cssBefore.width=0;r.animIn.width="show";r.animOut.width=0};n.fn.cycle.transitions.slideY=function(t,i,r){r.before.push(function(t,i,r){n(r.elements).not(t).hide();n.fn.cycle.commonReset(t,i,r,!0,!1);r.animIn.height=i.cycleH});r.cssBefore.left=0;r.cssBefore.top=0;r.cssBefore.height=0;r.animIn.height="show";r.animOut.height=0};n.fn.cycle.transitions.shuffle=function(t,i,r){for(t=t.css("overflow","visible").width(),i.css({left:0,top:0}),r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0)}),r.speedAdjusted||(r.speed/=2,r.speedAdjusted=!0),r.random=0,r.shuffle=r.shuffle||{left:-t,top:15},r.els=[],t=0;t<i.length;t++)r.els.push(i[t]);for(t=0;t<r.currSlide;t++)r.els.push(r.els.shift());r.fxFn=function(t,i,r,u,f){var e,o;r.rev&&(f=!f);e=f?n(t):n(i);n(i).css(r.cssBefore);o=r.slideCount;e.animate(r.shuffle,r.speedIn,r.easeIn,function(){for(var i=n.fn.cycle.hopsFromLast(r,f),s=0;s<i;s++)f?r.els.push(r.els.shift()):r.els.unshift(r.els.pop());if(f)for(i=0,s=r.els.length;i<s;i++)n(r.els[i]).css("z-index",s-i+o);else i=n(t).css("z-index"),e.css("z-index",parseInt(i,10)+1+o);e.animate({left:0,top:0},r.speedOut,r.easeOut,function(){n(f?this:t).hide();u&&u()})})};n.extend(r.cssBefore,{display:"block",opacity:1,top:0,left:0})};n.fn.cycle.transitions.turnUp=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.cssBefore.top=i.cycleH;r.animIn.height=i.cycleH;r.animOut.width=i.cycleW});r.cssFirst.top=0;r.cssBefore.left=0;r.cssBefore.height=0;r.animIn.top=0;r.animOut.height=0};n.fn.cycle.transitions.turnDown=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssFirst.top=0;r.cssBefore.left=0;r.cssBefore.top=0;r.cssBefore.height=0;r.animOut.height=0};n.fn.cycle.transitions.turnLeft=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.cssBefore.left=i.cycleW;r.animIn.width=i.cycleW});r.cssBefore.top=0;r.cssBefore.width=0;r.animIn.left=0;r.animOut.width=0};n.fn.cycle.transitions.turnRight=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.animIn.width=i.cycleW;r.animOut.left=t.cycleW});n.extend(r.cssBefore,{top:0,left:0,width:0});r.animIn.left=0;r.animOut.width=0};n.fn.cycle.transitions.zoom=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!1,!0);r.cssBefore.top=i.cycleH/2;r.cssBefore.left=i.cycleW/2;n.extend(r.animIn,{top:0,left:0,width:i.cycleW,height:i.cycleH});n.extend(r.animOut,{width:0,height:0,top:t.cycleH/2,left:t.cycleW/2})});r.cssFirst.top=0;r.cssFirst.left=0;r.cssBefore.width=0;r.cssBefore.height=0};n.fn.cycle.transitions.fadeZoom=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!1);r.cssBefore.left=i.cycleW/2;r.cssBefore.top=i.cycleH/2;n.extend(r.animIn,{top:0,left:0,width:i.cycleW,height:i.cycleH})});r.cssBefore.width=0;r.cssBefore.height=0;r.animOut.opacity=0};n.fn.cycle.transitions.blindX=function(t,i,r){t=t.css("overflow","hidden").width();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.width=i.cycleW;r.animOut.left=t.cycleW});r.cssBefore.left=t;r.cssBefore.top=0;r.animIn.left=0;r.animOut.left=t};n.fn.cycle.transitions.blindY=function(t,i,r){t=t.css("overflow","hidden").height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssBefore.top=t;r.cssBefore.left=0;r.animIn.top=0;r.animOut.top=t};n.fn.cycle.transitions.blindZ=function(t,i,r){i=t.css("overflow","hidden").height();t=t.width();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.animIn.height=i.cycleH;r.animOut.top=t.cycleH});r.cssBefore.top=i;r.cssBefore.left=t;r.animIn.top=0;r.animIn.left=0;r.animOut.top=i;r.animOut.left=t};n.fn.cycle.transitions.growX=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0);r.cssBefore.left=this.cycleW/2;r.animIn.left=0;r.animIn.width=this.cycleW;r.animOut.left=0});r.cssBefore.top=0;r.cssBefore.width=0};n.fn.cycle.transitions.growY=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1);r.cssBefore.top=this.cycleH/2;r.animIn.top=0;r.animIn.height=this.cycleH;r.animOut.top=0});r.cssBefore.height=0;r.cssBefore.left=0};n.fn.cycle.transitions.curtainX=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!1,!0,!0);r.cssBefore.left=i.cycleW/2;r.animIn.left=0;r.animIn.width=this.cycleW;r.animOut.left=t.cycleW/2;r.animOut.width=0});r.cssBefore.top=0;r.cssBefore.width=0};n.fn.cycle.transitions.curtainY=function(t,i,r){r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!1,!0);r.cssBefore.top=i.cycleH/2;r.animIn.top=0;r.animIn.height=i.cycleH;r.animOut.top=t.cycleH/2;r.animOut.height=0});r.cssBefore.height=0;r.cssBefore.left=0};n.fn.cycle.transitions.cover=function(t,i,r){var u=r.direction||"left",f=t.css("overflow","hidden").width(),e=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r);r.cssAfter.display="";"right"==u?r.cssBefore.left=-f:"up"==u?r.cssBefore.top=e:"down"==u?r.cssBefore.top=-e:r.cssBefore.left=f});r.animIn.left=0;r.animIn.top=0;r.cssBefore.top=0;r.cssBefore.left=0};n.fn.cycle.transitions.uncover=function(t,i,r){var u=r.direction||"left",f=t.css("overflow","hidden").width(),e=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0);"right"==u?r.animOut.left=f:"up"==u?r.animOut.top=-e:"down"==u?r.animOut.top=e:r.animOut.left=-f});r.animIn.left=0;r.animIn.top=0;r.cssBefore.top=0;r.cssBefore.left=0};n.fn.cycle.transitions.toss=function(t,i,r){var u=t.css("overflow","visible").width(),f=t.height();r.before.push(function(t,i,r){n.fn.cycle.commonReset(t,i,r,!0,!0,!0);r.animOut.left||r.animOut.top?r.animOut.opacity=0:n.extend(r.animOut,{left:2*u,top:-f/2,opacity:0})});r.cssBefore.left=0;r.cssBefore.top=0;r.animIn.left=0};n.fn.cycle.transitions.wipe=function(t,i,r){var u=t.css("overflow","hidden").width(),f=t.height(),e;r.cssBefore=r.cssBefore||{};r.clip&&(/l2r/.test(r.clip)?e="rect(0px 0px "+f+"px 0px)":/r2l/.test(r.clip)?e="rect(0px "+u+"px "+f+"px "+u+"px)":/t2b/.test(r.clip)?e="rect(0px "+u+"px 0px 0px)":/b2t/.test(r.clip)?e="rect("+f+"px "+u+"px "+f+"px 0px)":/zoom/.test(r.clip)&&(t=parseInt(f/2,10),i=parseInt(u/2,10),e="rect("+t+"px "+i+"px "+t+"px "+i+"px)"));r.cssBefore.clip=r.cssBefore.clip||e||"rect(0px 0px 0px 0px)";t=r.cssBefore.clip.match(/(\d+)/g);var o=parseInt(t[0],10),s=parseInt(t[1],10),h=parseInt(t[2],10),c=parseInt(t[3],10);r.before.push(function(t,i,r){var a,v,e,l;t!=i&&(a=n(t),v=n(i),n.fn.cycle.commonReset(t,i,r,!0,!0,!1),r.cssAfter.display="block",e=1,l=parseInt(r.speedIn/13,10)-1,function y(){var n=o?o-parseInt(o/l*e,10):0,t=c?c-parseInt(c/l*e,10):0,i=h<f?h+parseInt(e*((f-h)/l||1),10):f,r=s<u?s+parseInt(e*((u-s)/l||1),10):u;v.css({clip:"rect("+n+"px "+r+"px "+i+"px "+t+"px)"});e++<=l?setTimeout(y,13):a.css("display","none")}())});n.extend(r.cssBefore,{display:"block",opacity:1,top:0,left:0});r.animIn={left:0};r.animOut={left:0}}}(jQuery),function(n,t,i){function u(i,u){this.wrapper="string"==typeof i?t.querySelector(i):i;this.scroller=this.wrapper.children[0];this.scrollerStyle=this.scroller.style;this.options={resizeScrollbars:!0,mouseWheelSpeed:20,snapThreshold:.334,disablePointer:!r.hasPointer,disableTouch:r.hasPointer||!r.hasTouch,disableMouse:r.hasPointer||r.hasTouch,startX:0,startY:0,scrollY:!0,directionLockThreshold:5,momentum:!0,bounce:!0,bounceTime:600,bounceEasing:"",preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:"undefined"==typeof n.onmousedown};for(var f in u)this.options[f]=u[f];this.translateZ=this.options.HWCompositing&&r.hasPerspective?" translateZ(0)":"";this.options.useTransition=r.hasTransition&&this.options.useTransition;this.options.useTransform=r.hasTransform&&this.options.useTransform;this.options.eventPassthrough=!0===this.options.eventPassthrough?"vertical":this.options.eventPassthrough;this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault;this.options.scrollY="vertical"==this.options.eventPassthrough?!1:this.options.scrollY;this.options.scrollX="horizontal"==this.options.eventPassthrough?!1:this.options.scrollX;this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough;this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold;this.options.bounceEasing="string"==typeof this.options.bounceEasing?r.ease[this.options.bounceEasing]||r.ease.circular:this.options.bounceEasing;this.options.resizePolling=void 0===this.options.resizePolling?60:this.options.resizePolling;!0===this.options.tap&&(this.options.tap="tap");this.options.useTransition||this.options.useTransform||/relative|absolute/i.test(this.scrollerStyle.position)||(this.scrollerStyle.position="relative");"scale"==this.options.shrinkScrollbars&&(this.options.useTransition=!1);this.options.invertWheelDirection=this.options.invertWheelDirection?-1:1;this.directionY=this.directionX=this.y=this.x=0;this._events={};this._init();this.refresh();this.scrollTo(this.options.startX,this.options.startY);this.enable()}function e(n,i,r){var u=t.createElement("div"),f=t.createElement("div");return!0===r&&(u.style.cssText="position:absolute;z-index:9999",f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px"),f.className="iScrollIndicator","h"==n?(!0===r&&(u.style.cssText+=";height:7px;left:2px;right:2px;bottom:0",f.style.height="100%"),u.className="iScrollHorizontalScrollbar"):(!0===r&&(u.style.cssText+=";width:7px;bottom:2px;top:2px;right:1px",f.style.width="100%"),u.className="iScrollVerticalScrollbar"),u.style.cssText+=";overflow:hidden",i||(u.style.pointerEvents="none"),u.appendChild(f),u}function o(i,u){var o,e,s;this.wrapper="string"==typeof u.el?t.querySelector(u.el):u.el;this.wrapperStyle=this.wrapper.style;this.indicator=this.wrapper.children[0];this.indicatorStyle=this.indicator.style;this.scroller=i;this.options={listenX:!0,listenY:!0,interactive:!1,resize:!0,defaultScrollbars:!1,shrink:!1,fade:!1,speedRatioX:0,speedRatioY:0};for(o in u)this.options[o]=u[o];this.sizeRatioY=this.sizeRatioX=1;this.maxPosY=this.maxPosX=0;this.options.interactive&&(this.options.disableTouch||(r.addEvent(this.indicator,"touchstart",this),r.addEvent(n,"touchend",this)),this.options.disablePointer||(r.addEvent(this.indicator,r.prefixPointerEvent("pointerdown"),this),r.addEvent(n,r.prefixPointerEvent("pointerup"),this)),this.options.disableMouse||(r.addEvent(this.indicator,"mousedown",this),r.addEvent(n,"mouseup",this)));this.options.fade&&(this.wrapperStyle[r.style.transform]=this.scroller.translateZ,e=r.style.transitionDuration,e&&(this.wrapperStyle[e]=r.isBadAndroid?"0.0001ms":"0ms",s=this,r.isBadAndroid&&f(function(){"0.0001ms"===s.wrapperStyle[e]&&(s.wrapperStyle[e]="0s")}),this.wrapperStyle.opacity="0"))}var f=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||n.oRequestAnimationFrame||n.msRequestAnimationFrame||function(t){n.setTimeout(t,1e3/60)},r=function(){function u(n){return!1===e?!1:""===e?n:e+n.charAt(0).toUpperCase()+n.substr(1)}var r={},f=t.createElement("div").style,e=function(){for(var t=["t","webkitT","MozT","msT","OT"],i,n=0,r=t.length;n<r;n++)if(i=t[n]+"ransform",i in f)return t[n].substr(0,t[n].length-1);return!1}(),o;return r.getTime=Date.now||function(){return(new Date).getTime()},r.extend=function(n,t){for(var i in t)n[i]=t[i]},r.addEvent=function(n,t,i,r){n.addEventListener(t,i,!!r)},r.removeEvent=function(n,t,i,r){n.removeEventListener(t,i,!!r)},r.prefixPointerEvent=function(t){return n.MSPointerEvent?"MSPointer"+t.charAt(7).toUpperCase()+t.substr(8):t},r.momentum=function(n,t,r,u,f,e){t=n-t;r=i.abs(t)/r;e=void 0===e?.0006:e;var o=n+r*r/(2*e)*(0>t?-1:1);return e=r/e,o<u?(o=f?u-f/2.5*(r/8):u,t=i.abs(o-n),e=t/r):0<o&&(o=f?f/2.5*(r/8):0,t=i.abs(n)+o,e=t/r),{destination:i.round(o),duration:e}},o=u("transform"),r.extend(r,{hasTransform:!1!==o,hasPerspective:u("perspective")in f,hasTouch:"ontouchstart"in n,hasPointer:!(!n.PointerEvent&&!n.MSPointerEvent),hasTransition:u("transition")in f}),r.isBadAndroid=function(){var t=n.navigator.appVersion;return/Android/.test(t)&&!/Chrome\/\d/.test(t)?(t=t.match(/Safari\/(\d+.\d)/))&&"object"==typeof t&&2<=t.length?535.19>parseFloat(t[1]):!0:!1}(),r.extend(r.style={},{transform:o,transitionTimingFunction:u("transitionTimingFunction"),transitionDuration:u("transitionDuration"),transitionDelay:u("transitionDelay"),transformOrigin:u("transformOrigin")}),r.hasClass=function(n,t){return new RegExp("(^|\\s)"+t+"(\\s|$)").test(n.className)},r.addClass=function(n,t){if(!r.hasClass(n,t)){var i=n.className.split(" ");i.push(t);n.className=i.join(" ")}},r.removeClass=function(n,t){r.hasClass(n,t)&&(n.className=n.className.replace(new RegExp("(^|\\s)"+t+"(\\s|$)","g")," "))},r.offset=function(n){for(var t=-n.offsetLeft,i=-n.offsetTop;n=n.offsetParent;)t-=n.offsetLeft,i-=n.offsetTop;return{left:t,top:i}},r.preventDefaultException=function(n,t){for(var i in t)if(t[i].test(n[i]))return!0;return!1},r.extend(r.eventType={},{touchstart:1,touchmove:1,touchend:1,mousedown:2,mousemove:2,mouseup:2,pointerdown:3,pointermove:3,pointerup:3,MSPointerDown:3,MSPointerMove:3,MSPointerUp:3}),r.extend(r.ease={},{quadratic:{style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)",fn:function(n){return n*(2-n)}},circular:{style:"cubic-bezier(0.1, 0.57, 0.1, 1)",fn:function(n){return i.sqrt(1- --n*n)}},back:{style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fn:function(n){return--n*n*(5*n+4)+1}},bounce:{style:"",fn:function(n){return(n/=1)<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}},elastic:{style:"",fn:function(n){return 0===n?0:1==n?1:.4*i.pow(2,-10*n)*i.sin(2*(n-.055)*i.PI/.22)+1}}}),r.tap=function(n,i){var r=t.createEvent("Event");r.initEvent(i,!0,!0);r.pageX=n.pageX;r.pageY=n.pageY;n.target.dispatchEvent(r)},r.click=function(i){var u=i.target,r;/(SELECT|INPUT|TEXTAREA)/i.test(u.tagName)||(r=t.createEvent(n.MouseEvent?"MouseEvents":"Event"),r.initEvent("click",!0,!0),r.view=i.view||n,r.detail=1,r.screenX=u.screenX||0,r.screenY=u.screenY||0,r.clientX=u.clientX||0,r.clientY=u.clientY||0,r.ctrlKey=!!i.ctrlKey,r.altKey=!!i.altKey,r.shiftKey=!!i.shiftKey,r.metaKey=!!i.metaKey,r.button=0,r.relatedTarget=null,r._constructed=!0,u.dispatchEvent(r))},r}();u.prototype={version:"5.2.0",_init:function(){this._initEvents();(this.options.scrollbars||this.options.indicators)&&this._initIndicators();this.options.mouseWheel&&this._initWheel();this.options.snap&&this._initSnap();this.options.keyBindings&&this._initKeys()},destroy:function(){this._initEvents(!0);clearTimeout(this.resizeTimeout);this.resizeTimeout=null;this._execEvent("destroy")},_transitionEnd:function(n){n.target==this.scroller&&this.isInTransition&&(this._transitionTime(),this.resetPosition(this.options.bounceTime)||(this.isInTransition=!1,this._execEvent("scrollEnd")))},_start:function(n){if(!(1!=r.eventType[n.type]&&0!==(n.which?n.button:2>n.button?0:4==n.button?1:2)||!this.enabled||this.initiated&&r.eventType[n.type]!==this.initiated)){!this.options.preventDefault||r.isBadAndroid||r.preventDefaultException(n.target,this.options.preventDefaultException)||n.preventDefault();var t=n.touches?n.touches[0]:n;this.initiated=r.eventType[n.type];this.moved=!1;this.directionLocked=this.directionY=this.directionX=this.distY=this.distX=0;this.startTime=r.getTime();this.options.useTransition&&this.isInTransition?(this._transitionTime(),this.isInTransition=!1,n=this.getComputedPosition(),this._translate(i.round(n.x),i.round(n.y)),this._execEvent("scrollEnd")):!this.options.useTransition&&this.isAnimating&&(this.isAnimating=!1,this._execEvent("scrollEnd"));this.startX=this.x;this.startY=this.y;this.absStartX=this.x;this.absStartY=this.y;this.pointX=t.pageX;this.pointY=t.pageY;this._execEvent("beforeScrollStart")}},_move:function(n){var e;if(this.enabled&&r.eventType[n.type]===this.initiated){this.options.preventDefault&&n.preventDefault();var t=n.touches?n.touches[0]:n,u=t.pageX-this.pointX,f=t.pageY-this.pointY,o=r.getTime();if(this.pointX=t.pageX,this.pointY=t.pageY,this.distX+=u,this.distY+=f,t=i.abs(this.distX),e=i.abs(this.distY),!(300<o-this.endTime&&10>t&&10>e)){if(this.directionLocked||this.options.freeScroll||(this.directionLocked=t>e+this.options.directionLockThreshold?"h":e>=t+this.options.directionLockThreshold?"v":"n"),"h"==this.directionLocked){if("vertical"==this.options.eventPassthrough)n.preventDefault();else if("horizontal"==this.options.eventPassthrough){this.initiated=!1;return}f=0}else if("v"==this.directionLocked){if("horizontal"==this.options.eventPassthrough)n.preventDefault();else if("vertical"==this.options.eventPassthrough){this.initiated=!1;return}u=0}u=this.hasHorizontalScroll?u:0;f=this.hasVerticalScroll?f:0;n=this.x+u;t=this.y+f;(0<n||n<this.maxScrollX)&&(n=this.options.bounce?this.x+u/3:0<n?0:this.maxScrollX);(0<t||t<this.maxScrollY)&&(t=this.options.bounce?this.y+f/3:0<t?0:this.maxScrollY);this.directionX=0<u?-1:0>u?1:0;this.directionY=0<f?-1:0>f?1:0;this.moved||this._execEvent("scrollStart");this.moved=!0;this._translate(n,t);300<o-this.startTime&&(this.startTime=o,this.startX=this.x,this.startY=this.y)}}},_end:function(n){if(this.enabled&&r.eventType[n.type]===this.initiated){this.options.preventDefault&&!r.preventDefaultException(n.target,this.options.preventDefaultException)&&n.preventDefault();var e=r.getTime()-this.startTime,t=i.round(this.x),u=i.round(this.y),s=i.abs(t-this.startX),h=i.abs(u-this.startY),o=0,f="";this.initiated=this.isInTransition=0;this.endTime=r.getTime();this.resetPosition(this.options.bounceTime)||((this.scrollTo(t,u),this.moved)?this._events.flick&&200>e&&100>s&&100>h?this._execEvent("flick"):(this.options.momentum&&300>e&&(o=this.hasHorizontalScroll?r.momentum(this.x,this.startX,e,this.maxScrollX,this.options.bounce?this.wrapperWidth:0,this.options.deceleration):{destination:t,duration:0},e=this.hasVerticalScroll?r.momentum(this.y,this.startY,e,this.maxScrollY,this.options.bounce?this.wrapperHeight:0,this.options.deceleration):{destination:u,duration:0},t=o.destination,u=e.destination,o=i.max(o.duration,e.duration),this.isInTransition=1),this.options.snap&&(this.currentPage=f=this._nearestSnap(t,u),o=this.options.snapSpeed||i.max(i.max(i.min(i.abs(t-f.x),1e3),i.min(i.abs(u-f.y),1e3)),300),t=f.x,u=f.y,this.directionY=this.directionX=0,f=this.options.bounceEasing),t!=this.x||u!=this.y)?((0<t||t<this.maxScrollX||0<u||u<this.maxScrollY)&&(f=r.ease.quadratic),this.scrollTo(t,u,o,f)):this._execEvent("scrollEnd"):(this.options.tap&&r.tap(n,this.options.tap),this.options.click&&r.click(n),this._execEvent("scrollCancel")))}},_resize:function(){var n=this;clearTimeout(this.resizeTimeout);this.resizeTimeout=setTimeout(function(){n.refresh()},this.options.resizePolling)},resetPosition:function(n){var t=this.x,i=this.y;return(!this.hasHorizontalScroll||0<this.x?t=0:this.x<this.maxScrollX&&(t=this.maxScrollX),!this.hasVerticalScroll||0<this.y?i=0:this.y<this.maxScrollY&&(i=this.maxScrollY),t==this.x&&i==this.y)?!1:(this.scrollTo(t,i,n||0,this.options.bounceEasing),!0)},disable:function(){this.enabled=!1},enable:function(){this.enabled=!0},refresh:function(){this.wrapperWidth=this.wrapper.clientWidth;this.wrapperHeight=this.wrapper.clientHeight;this.scrollerWidth=this.scroller.offsetWidth+60;this.scrollerHeight=this.scroller.offsetHeight;this.maxScrollX=this.wrapperWidth-this.scrollerWidth;this.maxScrollY=this.wrapperHeight-this.scrollerHeight;this.hasHorizontalScroll=this.options.scrollX&&0>this.maxScrollX;this.hasVerticalScroll=this.options.scrollY&&0>this.maxScrollY;this.hasHorizontalScroll||(this.maxScrollX=0,this.scrollerWidth=this.wrapperWidth);this.hasVerticalScroll||(this.maxScrollY=0,this.scrollerHeight=this.wrapperHeight);this.directionY=this.directionX=this.endTime=0;this.wrapperOffset=r.offset(this.wrapper);this._execEvent("refresh");this.resetPosition()},on:function(n,t){this._events[n]||(this._events[n]=[]);this._events[n].push(t)},off:function(n,t){if(this._events[n]){var i=this._events[n].indexOf(t);-1<i&&this._events[n].splice(i,1)}},_execEvent:function(n){if(this._events[n]){var t=0,i=this._events[n].length;if(i)for(;t<i;t++)this._events[n][t].apply(this,[].slice.call(arguments,1))}},scrollBy:function(n,t,i,r){n=this.x+n;t=this.y+t;this.scrollTo(n,t,i||0,r)},scrollTo:function(n,t,i,u){u=u||r.ease.circular;this.isInTransition=this.options.useTransition&&0<i;var f=this.options.useTransition&&u.style;!i||f?(f&&(this._transitionTimingFunction(u.style),this._transitionTime(i)),this._translate(n,t)):this._animate(n,t,i,u.fn)},scrollToElement:function(n,t,u,f,e){if(n=n.nodeType?n:this.scroller.querySelector(n)){var o=r.offset(n);o.left-=this.wrapperOffset.left;o.top-=this.wrapperOffset.top;!0===u&&(u=i.round(n.offsetWidth/2-this.wrapper.offsetWidth/2));!0===f&&(f=i.round(n.offsetHeight/2-this.wrapper.offsetHeight/2));o.left-=u||0;o.top-=f||0;o.left=0<o.left?0:o.left<this.maxScrollX?this.maxScrollX:o.left;o.top=0<o.top?0:o.top<this.maxScrollY?this.maxScrollY:o.top;t=void 0===t||null===t||"auto"===t?i.max(i.abs(this.x-o.left),i.abs(this.y-o.top)):t;this.scrollTo(o.left,o.top,t,e)}},_transitionTime:function(n){var t,i,u;if(this.options.useTransition&&(n=n||0,t=r.style.transitionDuration,t&&(this.scrollerStyle[t]=n+"ms",!n&&r.isBadAndroid&&(this.scrollerStyle[t]="0.0001ms",i=this,f(function(){"0.0001ms"===i.scrollerStyle[t]&&(i.scrollerStyle[t]="0s")})),this.indicators)))for(u=this.indicators.length;u--;)this.indicators[u].transitionTime(n)},_transitionTimingFunction:function(n){if(this.scrollerStyle[r.style.transitionTimingFunction]=n,this.indicators)for(var t=this.indicators.length;t--;)this.indicators[t].transitionTimingFunction(n)},_translate:function(n,t){if(this.options.useTransform?this.scrollerStyle[r.style.transform]="translate("+n+"px,"+t+"px)"+this.translateZ:(n=i.round(n),t=i.round(t),this.scrollerStyle.left=n+"px",this.scrollerStyle.top=t+"px"),this.x=n,this.y=t,this.indicators)for(var u=this.indicators.length;u--;)this.indicators[u].updatePosition()},_initEvents:function(t){t=t?r.removeEvent:r.addEvent;var i=this.options.bindToWrapper?this.wrapper:n;t(n,"orientationchange",this);t(n,"resize",this);this.options.click&&t(this.wrapper,"click",this,!0);this.options.disableMouse||(t(this.wrapper,"mousedown",this),t(i,"mousemove",this),t(i,"mousecancel",this),t(i,"mouseup",this));r.hasPointer&&!this.options.disablePointer&&(t(this.wrapper,r.prefixPointerEvent("pointerdown"),this),t(i,r.prefixPointerEvent("pointermove"),this),t(i,r.prefixPointerEvent("pointercancel"),this),t(i,r.prefixPointerEvent("pointerup"),this));r.hasTouch&&!this.options.disableTouch&&(t(this.wrapper,"touchstart",this),t(i,"touchmove",this),t(i,"touchcancel",this),t(i,"touchend",this));t(this.scroller,"transitionend",this);t(this.scroller,"webkitTransitionEnd",this);t(this.scroller,"oTransitionEnd",this);t(this.scroller,"MSTransitionEnd",this)},getComputedPosition:function(){var t=n.getComputedStyle(this.scroller,null),i;return this.options.useTransform?(t=t[r.style.transform].split(")")[0].split(", "),i=+(t[12]||t[4]),t=+(t[13]||t[5])):(i=+t.left.replace(/[^-\d.]/g,""),t=+t.top.replace(/[^-\d.]/g,"")),{x:i,y:t}},_initIndicators:function(){function t(n){if(u.indicators)for(var t=u.indicators.length;t--;)n.call(u.indicators[t])}var n=this.options.interactiveScrollbars,f="string"!=typeof this.options.scrollbars,i=[],u=this,r;for(this.indicators=[],this.options.scrollbars&&(this.options.scrollY&&(r={el:e("v",n,this.options.scrollbars),interactive:n,defaultScrollbars:!0,customStyle:f,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenX:!1},this.wrapper.appendChild(r.el),i.push(r)),this.options.scrollX&&(r={el:e("h",n,this.options.scrollbars),interactive:n,defaultScrollbars:!0,customStyle:f,resize:this.options.resizeScrollbars,shrink:this.options.shrinkScrollbars,fade:this.options.fadeScrollbars,listenY:!1},this.wrapper.appendChild(r.el),i.push(r))),this.options.indicators&&(i=i.concat(this.options.indicators)),n=i.length;n--;)this.indicators.push(new o(this,i[n]));this.options.fadeScrollbars&&(this.on("scrollEnd",function(){t(function(){this.fade()})}),this.on("scrollCancel",function(){t(function(){this.fade()})}),this.on("scrollStart",function(){t(function(){this.fade(1)})}),this.on("beforeScrollStart",function(){t(function(){this.fade(1,!0)})}));this.on("refresh",function(){t(function(){this.refresh()})});this.on("destroy",function(){t(function(){this.destroy()});delete this.indicators})},_initWheel:function(){r.addEvent(this.wrapper,"wheel",this);r.addEvent(this.wrapper,"mousewheel",this);r.addEvent(this.wrapper,"DOMMouseScroll",this);this.on("destroy",function(){clearTimeout(this.wheelTimeout);this.wheelTimeout=null;r.removeEvent(this.wrapper,"wheel",this);r.removeEvent(this.wrapper,"mousewheel",this);r.removeEvent(this.wrapper,"DOMMouseScroll",this)})},_wheel:function(n){var f,t,r,u;if(this.enabled){if(n.preventDefault(),f=this,void 0===this.wheelTimeout&&f._execEvent("scrollStart"),clearTimeout(this.wheelTimeout),this.wheelTimeout=setTimeout(function(){f.options.snap||f._execEvent("scrollEnd");f.wheelTimeout=void 0},400),"deltaX"in n)1===n.deltaMode?(t=-n.deltaX*this.options.mouseWheelSpeed,n=-n.deltaY*this.options.mouseWheelSpeed):(t=-n.deltaX,n=-n.deltaY);else if("wheelDeltaX"in n)t=n.wheelDeltaX/120*this.options.mouseWheelSpeed,n=n.wheelDeltaY/120*this.options.mouseWheelSpeed;else if("wheelDelta"in n)t=n=n.wheelDelta/120*this.options.mouseWheelSpeed;else if("detail"in n)t=n=-n.detail/3*this.options.mouseWheelSpeed;else return;t*=this.options.invertWheelDirection;n*=this.options.invertWheelDirection;this.hasVerticalScroll||(t=n,n=0);this.options.snap?(r=this.currentPage.pageX,u=this.currentPage.pageY,0<t?r--:0>t&&r++,0<n?u--:0>n&&u++,this.goToPage(r,u)):(r=this.x+i.round(this.hasHorizontalScroll?t:0),u=this.y+i.round(this.hasVerticalScroll?n:0),this.directionX=0<t?-1:0>t?1:0,this.directionY=0<n?-1:0>n?1:0,0<r?r=0:r<this.maxScrollX&&(r=this.maxScrollX),0<u?u=0:u<this.maxScrollY&&(u=this.maxScrollY),this.scrollTo(r,u,0))}},_initSnap:function(){this.currentPage={};"string"==typeof this.options.snap&&(this.options.snap=this.scroller.querySelectorAll(this.options.snap));this.on("refresh",function(){var n=0,e,o=0,s,r=0,u,f=this.options.snapStepX||this.wrapperWidth,t=this.options.snapStepY||this.wrapperHeight,h;if(this.pages=[],this.wrapperWidth&&this.wrapperHeight&&this.scrollerWidth&&this.scrollerHeight){if(!0===this.options.snap)for(h=i.round(f/2),s=i.round(t/2);r>-this.scrollerWidth;){for(this.pages[n]=[],u=e=0;u>-this.scrollerHeight;)this.pages[n][e]={x:i.max(r,this.maxScrollX),y:i.max(u,this.maxScrollY),width:f,height:t,cx:r-h,cy:u-s},u-=t,e++;r-=f;n++}else for(t=this.options.snap,e=t.length,f=-1;n<e;n++)(0===n||t[n].offsetLeft<=t[n-1].offsetLeft)&&(o=0,f++),this.pages[o]||(this.pages[o]=[]),r=i.max(-t[n].offsetLeft,this.maxScrollX),u=i.max(-t[n].offsetTop,this.maxScrollY),h=r-i.round(t[n].offsetWidth/2),s=u-i.round(t[n].offsetHeight/2),this.pages[o][f]={x:r,y:u,width:t[n].offsetWidth,height:t[n].offsetHeight,cx:h,cy:s},r>this.maxScrollX&&o++;this.goToPage(this.currentPage.pageX||0,this.currentPage.pageY||0,0);0==this.options.snapThreshold%1?this.snapThresholdY=this.snapThresholdX=this.options.snapThreshold:(this.snapThresholdX=i.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width*this.options.snapThreshold),this.snapThresholdY=i.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height*this.options.snapThreshold))}});this.on("flick",function(){var n=this.options.snapSpeed||i.max(i.max(i.min(i.abs(this.x-this.startX),1e3),i.min(i.abs(this.y-this.startY),1e3)),300);this.goToPage(this.currentPage.pageX+this.directionX,this.currentPage.pageY+this.directionY,n)})},_nearestSnap:function(n,t){if(!this.pages.length)return{x:0,y:0,pageX:0,pageY:0};var r=0,f=this.pages.length,u=0;if(i.abs(n-this.absStartX)<this.snapThresholdX&&i.abs(t-this.absStartY)<this.snapThresholdY)return this.currentPage;for(0<n?n=0:n<this.maxScrollX&&(n=this.maxScrollX),0<t?t=0:t<this.maxScrollY&&(t=this.maxScrollY);r<f;r++)if(n>=this.pages[r][0].cx){n=this.pages[r][0].x;break}for(f=this.pages[r].length;u<f;u++)if(t>=this.pages[0][u].cy){t=this.pages[0][u].y;break}return r==this.currentPage.pageX&&(r+=this.directionX,0>r?r=0:r>=this.pages.length&&(r=this.pages.length-1),n=this.pages[r][0].x),u==this.currentPage.pageY&&(u+=this.directionY,0>u?u=0:u>=this.pages[0].length&&(u=this.pages[0].length-1),t=this.pages[0][u].y),{x:n,y:t,pageX:r,pageY:u}},goToPage:function(n,t,r,u){u=u||this.options.bounceEasing;n>=this.pages.length?n=this.pages.length-1:0>n&&(n=0);t>=this.pages[n].length?t=this.pages[n].length-1:0>t&&(t=0);var f=this.pages[n][t].x,e=this.pages[n][t].y;r=void 0===r?this.options.snapSpeed||i.max(i.max(i.min(i.abs(f-this.x),1e3),i.min(i.abs(e-this.y),1e3)),300):r;this.currentPage={x:f,y:e,pageX:n,pageY:t};this.scrollTo(f,e,r,u)},next:function(n,t){var i=this.currentPage.pageX,r=this.currentPage.pageY;i++;i>=this.pages.length&&this.hasVerticalScroll&&(i=0,r++);this.goToPage(i,r,n,t)},prev:function(n,t){var i=this.currentPage.pageX,r=this.currentPage.pageY;i--;0>i&&this.hasVerticalScroll&&(i=0,r--);this.goToPage(i,r,n,t)},_initKeys:function(t){t={pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40};var i;if("object"==typeof this.options.keyBindings)for(i in this.options.keyBindings)"string"==typeof this.options.keyBindings[i]&&(this.options.keyBindings[i]=this.options.keyBindings[i].toUpperCase().charCodeAt(0));else this.options.keyBindings={};for(i in t)this.options.keyBindings[i]=this.options.keyBindings[i]||t[i];r.addEvent(n,"keydown",this);this.on("destroy",function(){r.removeEvent(n,"keydown",this)})},_key:function(n){var e;if(this.enabled){var t=this.options.snap,u=t?this.currentPage.pageX:this.x,f=t?this.currentPage.pageY:this.y,o=r.getTime(),s=this.keyTime||0;this.options.useTransition&&this.isInTransition&&(e=this.getComputedPosition(),this._translate(i.round(e.x),i.round(e.y)),this.isInTransition=!1);this.keyAcceleration=200>o-s?i.min(this.keyAcceleration+.25,50):0;switch(n.keyCode){case this.options.keyBindings.pageUp:this.hasHorizontalScroll&&!this.hasVerticalScroll?u+=t?1:this.wrapperWidth:f+=t?1:this.wrapperHeight;break;case this.options.keyBindings.pageDown:this.hasHorizontalScroll&&!this.hasVerticalScroll?u-=t?1:this.wrapperWidth:f-=t?1:this.wrapperHeight;break;case this.options.keyBindings.end:u=t?this.pages.length-1:this.maxScrollX;f=t?this.pages[0].length-1:this.maxScrollY;break;case this.options.keyBindings.home:f=u=0;break;case this.options.keyBindings.left:u+=t?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.up:f+=t?1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.right:u-=t?-1:5+this.keyAcceleration>>0;break;case this.options.keyBindings.down:f-=t?1:5+this.keyAcceleration>>0;break;default:return}t?this.goToPage(u,f):(0<u?this.keyAcceleration=u=0:u<this.maxScrollX&&(u=this.maxScrollX,this.keyAcceleration=0),0<f?this.keyAcceleration=f=0:f<this.maxScrollY&&(f=this.maxScrollY,this.keyAcceleration=0),this.scrollTo(u,f,0),this.keyTime=o)}},_animate:function(n,t,i,u){function o(){var a=r.getTime(),v;a>=l?(e.isAnimating=!1,e._translate(n,t),e.resetPosition(e.options.bounceTime)||e._execEvent("scrollEnd")):(a=(a-c)/i,v=u(a),a=(n-s)*v+s,e._translate(a,(t-h)*v+h),e.isAnimating&&f(o))}var e=this,s=this.x,h=this.y,c=r.getTime(),l=c+i;this.isAnimating=!0;o()},handleEvent:function(n){switch(n.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(n);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(n);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(n);break;case"orientationchange":case"resize":this._resize();break;case"transitionend":case"webkitTransitionEnd":case"oTransitionEnd":case"MSTransitionEnd":this._transitionEnd(n);break;case"wheel":case"DOMMouseScroll":case"mousewheel":this._wheel(n);break;case"keydown":this._key(n);break;case"click":this.enabled&&!n._constructed&&(n.preventDefault(),n.stopPropagation())}}};o.prototype={handleEvent:function(n){switch(n.type){case"touchstart":case"pointerdown":case"MSPointerDown":case"mousedown":this._start(n);break;case"touchmove":case"pointermove":case"MSPointerMove":case"mousemove":this._move(n);break;case"touchend":case"pointerup":case"MSPointerUp":case"mouseup":case"touchcancel":case"pointercancel":case"MSPointerCancel":case"mousecancel":this._end(n)}},destroy:function(){this.options.fadeScrollbars&&(clearTimeout(this.fadeTimeout),this.fadeTimeout=null);this.options.interactive&&(r.removeEvent(this.indicator,"touchstart",this),r.removeEvent(this.indicator,r.prefixPointerEvent("pointerdown"),this),r.removeEvent(this.indicator,"mousedown",this),r.removeEvent(n,"touchmove",this),r.removeEvent(n,r.prefixPointerEvent("pointermove"),this),r.removeEvent(n,"mousemove",this),r.removeEvent(n,"touchend",this),r.removeEvent(n,r.prefixPointerEvent("pointerup"),this),r.removeEvent(n,"mouseup",this));this.options.defaultScrollbars&&this.wrapper.parentNode.removeChild(this.wrapper)},_start:function(t){var i=t.touches?t.touches[0]:t;t.preventDefault();t.stopPropagation();this.transitionTime();this.initiated=!0;this.moved=!1;this.lastPointX=i.pageX;this.lastPointY=i.pageY;this.startTime=r.getTime();this.options.disableTouch||r.addEvent(n,"touchmove",this);this.options.disablePointer||r.addEvent(n,r.prefixPointerEvent("pointermove"),this);this.options.disableMouse||r.addEvent(n,"mousemove",this);this.scroller._execEvent("beforeScrollStart")},_move:function(n){var t=n.touches?n.touches[0]:n,i,u;r.getTime();this.moved||this.scroller._execEvent("scrollStart");this.moved=!0;i=t.pageX-this.lastPointX;this.lastPointX=t.pageX;u=t.pageY-this.lastPointY;this.lastPointY=t.pageY;this._pos(this.x+i,this.y+u);n.preventDefault();n.stopPropagation()},_end:function(t){if(this.initiated){if(this.initiated=!1,t.preventDefault(),t.stopPropagation(),r.removeEvent(n,"touchmove",this),r.removeEvent(n,r.prefixPointerEvent("pointermove"),this),r.removeEvent(n,"mousemove",this),this.scroller.options.snap){t=this.scroller._nearestSnap(this.scroller.x,this.scroller.y);var u=this.options.snapSpeed||i.max(i.max(i.min(i.abs(this.scroller.x-t.x),1e3),i.min(i.abs(this.scroller.y-t.y),1e3)),300);(this.scroller.x!=t.x||this.scroller.y!=t.y)&&(this.scroller.directionX=0,this.scroller.directionY=0,this.scroller.currentPage=t,this.scroller.scrollTo(t.x,t.y,u,this.scroller.options.bounceEasing))}this.moved&&this.scroller._execEvent("scrollEnd")}},transitionTime:function(n){var t,i;n=n||0;t=r.style.transitionDuration;t&&(this.indicatorStyle[t]=n+"ms",!n&&r.isBadAndroid)&&(this.indicatorStyle[t]="0.0001ms",i=this,f(function(){"0.0001ms"===i.indicatorStyle[t]&&(i.indicatorStyle[t]="0s")}))},transitionTimingFunction:function(n){this.indicatorStyle[r.style.transitionTimingFunction]=n},refresh:function(){this.transitionTime();this.indicatorStyle.display=this.options.listenX&&!this.options.listenY?this.scroller.hasHorizontalScroll?"block":"none":this.options.listenY&&!this.options.listenX?this.scroller.hasVerticalScroll?"block":"none":this.scroller.hasHorizontalScroll||this.scroller.hasVerticalScroll?"block":"none";this.scroller.hasHorizontalScroll&&this.scroller.hasVerticalScroll?(r.addClass(this.wrapper,"iScrollBothScrollbars"),r.removeClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="8px":this.wrapper.style.bottom="8px")):(r.removeClass(this.wrapper,"iScrollBothScrollbars"),r.addClass(this.wrapper,"iScrollLoneScrollbar"),this.options.defaultScrollbars&&this.options.customStyle&&(this.options.listenX?this.wrapper.style.right="2px":this.wrapper.style.bottom="2px"));this.options.listenX&&(this.wrapperWidth=this.wrapper.clientWidth,this.options.resize?(this.indicatorWidth=i.max(i.round(this.wrapperWidth*this.wrapperWidth/(this.scroller.scrollerWidth||this.wrapperWidth||1)),8),this.indicatorStyle.width=this.indicatorWidth+"px"):this.indicatorWidth=this.indicator.clientWidth,this.maxPosX=this.wrapperWidth-this.indicatorWidth,"clip"==this.options.shrink?(this.minBoundaryX=-this.indicatorWidth+8,this.maxBoundaryX=this.wrapperWidth-8):(this.minBoundaryX=0,this.maxBoundaryX=this.maxPosX),this.sizeRatioX=this.options.speedRatioX||this.scroller.maxScrollX&&this.maxPosX/this.scroller.maxScrollX);this.options.listenY&&(this.wrapperHeight=this.wrapper.clientHeight,this.options.resize?(this.indicatorHeight=i.max(i.round(this.wrapperHeight*this.wrapperHeight/(this.scroller.scrollerHeight||this.wrapperHeight||1)),8),this.indicatorStyle.height=this.indicatorHeight+"px"):this.indicatorHeight=this.indicator.clientHeight,this.maxPosY=this.wrapperHeight-this.indicatorHeight,"clip"==this.options.shrink?(this.minBoundaryY=-this.indicatorHeight+8,this.maxBoundaryY=this.wrapperHeight-8):(this.minBoundaryY=0,this.maxBoundaryY=this.maxPosY),this.maxPosY=this.wrapperHeight-this.indicatorHeight,this.sizeRatioY=this.options.speedRatioY||this.scroller.maxScrollY&&this.maxPosY/this.scroller.maxScrollY);this.updatePosition()},updatePosition:function(){var n=this.options.listenX&&i.round(this.sizeRatioX*this.scroller.x)||0,t=this.options.listenY&&i.round(this.sizeRatioY*this.scroller.y)||0;this.options.ignoreBoundaries||(n<this.minBoundaryX?("scale"==this.options.shrink&&(this.width=i.max(this.indicatorWidth+n,8),this.indicatorStyle.width=this.width+"px"),n=this.minBoundaryX):n>this.maxBoundaryX?"scale"==this.options.shrink?(this.width=i.max(this.indicatorWidth-(n-this.maxPosX),8),this.indicatorStyle.width=this.width+"px",n=this.maxPosX+this.indicatorWidth-this.width):n=this.maxBoundaryX:"scale"==this.options.shrink&&this.width!=this.indicatorWidth&&(this.width=this.indicatorWidth,this.indicatorStyle.width=this.width+"px"),t<this.minBoundaryY?("scale"==this.options.shrink&&(this.height=i.max(this.indicatorHeight+3*t,8),this.indicatorStyle.height=this.height+"px"),t=this.minBoundaryY):t>this.maxBoundaryY?"scale"==this.options.shrink?(this.height=i.max(this.indicatorHeight-3*(t-this.maxPosY),8),this.indicatorStyle.height=this.height+"px",t=this.maxPosY+this.indicatorHeight-this.height):t=this.maxBoundaryY:"scale"==this.options.shrink&&this.height!=this.indicatorHeight&&(this.height=this.indicatorHeight,this.indicatorStyle.height=this.height+"px"));this.x=n;this.y=t;this.scroller.options.useTransform?this.indicatorStyle[r.style.transform]="translate("+n+"px,"+t+"px)"+this.scroller.translateZ:(this.indicatorStyle.left=n+"px",this.indicatorStyle.top=t+"px")},_pos:function(n,t){0>n?n=0:n>this.maxPosX&&(n=this.maxPosX);0>t?t=0:t>this.maxPosY&&(t=this.maxPosY);n=this.options.listenX?i.round(n/this.sizeRatioX):this.scroller.x;t=this.options.listenY?i.round(t/this.sizeRatioY):this.scroller.y;this.scroller.scrollTo(n,t)},fade:function(n,t){if(!t||this.visible){clearTimeout(this.fadeTimeout);this.fadeTimeout=null;var i=n?0:300;this.wrapperStyle[r.style.transitionDuration]=(n?250:500)+"ms";this.fadeTimeout=setTimeout(function(n){this.wrapperStyle.opacity=n;this.visible=+n}.bind(this,n?"1":"0"),i)}}};u.utils=r;"undefined"!=typeof module&&module.exports?module.exports=u:"function"==typeof define&&define.amd?define(function(){return u}):n.IScroll=u}(window,document,Math);$(document).ready(function(){window.fbAsyncInit=function(){FB.init({appId:"117546701661897",cookie:!0,xfbml:!0,version:"v8.0"})};$("body").append('<div id="fb-root"><\/div>').ready(function(n,t,i){var r,u=n.getElementsByTagName(t)[0];n.getElementById(i)||(r=n.createElement(t),r.id=i,r.defer=!0,r.crossorigin="anonymous",r.src="https://connect.facebook.net/zh_TW/sdk.js",u.parentNode.insertBefore(r,u))}(document,"script","facebook-jssdk"))});$playerIframe=[];$players={};$(document).ready(function(){var n=document.createElement("script"),t;n.defer=!0;n.src="https://www.youtube.com/iframe_api";t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t)});$(document).ready(function(){var n="PermissionGranted";firebase.initializeApp({apiKey:"AIzaSyDk2t7rPVnDqo0-wcPM9np2AVsHhRHKXaQ",authDomain:"newsfirebase-it.firebaseapp.com",databaseURL:"https://newsfirebase-it.firebaseio.com",projectId:"newsfirebase-it",storageBucket:"newsfirebase-it.appspot.com",messagingSenderId:"556337606524",appId:"1:556337606524:web:e870b91dd77d29c86c3ef9"});const t=firebase.messaging();"Notification"in window&&(Notification.permission!=="denied"?t.requestPermission().then(function(){return t.getToken()}).then(function(t){t&&(localStorage.getItem(n)===null||localStorage.getItem(n)!==t)&&($.post("/User/SaveToken",{code:t}),localStorage.setItem(n,t))}).catch(function(){}):localStorage.getItem(n)!==null&&localStorage.removeItem(n));t.onMessage(function(n){var u="東森新聞",f="給您最新的即時新聞",e="https://news.ebc.net.tw/images/ebc_news.ico",r="https://news.ebc.net.tw",t,o,i;typeof n.notification!="undefined"&&n.notification!==null&&(t=n.notification,u=typeof t.title=="undefined"?u:t.title,f=typeof t.body=="undefined"?f:t.body,e=typeof t.icon=="undefined"?e:t.icon,r=typeof t.click_action=="undefined"?r:t.click_action);o={body:f,icon:e,data:r,click_action:r,tag:"東森新聞",silent:!0};i=new Notification(u,o);setTimeout(i.close.bind(i),1e4);i.onclick=function(n){n.preventDefault();i.close();window.open(i.data)}})});VisibleMenu="";sticky_navigation_offset_top=$("#sticky_navigation").offset().top;sticky_navigation=function(){var n=$(window).scrollTop();n>sticky_navigation_offset_top?$("#sticky_navigation").css({position:"fixed",top:0,left:0,"z-index":50,right:0}):$("#sticky_navigation").css({position:"relative"})};sticky_navigation();$(window).scroll(function(){$("#sticky_navigation").css("position")=="relative"&&$("#sticky_navigation").offset().top!=sticky_navigation_offset_top&&(sticky_navigation_offset_top=$("#sticky_navigation").offset().top);sticky_navigation()});$('a[href="#"]').click(function(n){n.preventDefault()});document.onkeyup=function(n){var i,t;n=n||window.event;i=n.which||n.keyCode;i==27&&$("div.overlay-scale.open").length>0&&(t=$("div.overlay-scale.open").attr("id"),t!="adult-alert"&&toggleOverlay(t))};Sticky_Init();$(window).on("load",function(){Sticky_PageShare()});$(window).resize(function(){$winHeight=$(window).height();$winWidth=$(window).width();$("#main-right").length>0&&($rightLeft=$("#main-right").offset().left,$rightWidth=$("#main-right").width(),$leftLeft=$("#main-left").offset().left,$leftWidth=$("#main-left").width());navigator.userAgent.toLowerCase().indexOf("ipad")<0&&($("#scroll-left").css("position")=="fixed"&&($("#scroll-left").css("width",$leftWidth),$setLeft=$rightLeft-20-$leftWidth,$("#scroll-left").css("left",$setLeft)),$("#scroll-right").css("position")=="fixed"&&($rightLeft=$leftWidth-Math.abs($leftLeft)+20,$("#scroll-right").css("left",$rightLeft)))});$(window).scroll(function(){if($scrollTop=$(this).scrollTop(),navigator.userAgent.toLowerCase().indexOf("ipad")<0&&$("#main-right").length>0){$docHeight!=document.body.scrollHeight&&($docHeight=document.body.scrollHeight,$rightTop=$("#main-right").offset().top,$leftTop=$("#main-left").offset().top,$("#main-right").length>0&&($rightHeight=$("#scroll-right").prop("scrollHeight"),$rightBottom=$rightHeight!=$scroll_RH?$rightTop+$rightHeight:$rightTop+$scroll_RH),$("#main-left").length>0&&($leftHeight=$("#scroll-left").prop("scrollHeight"),$leftBottom=$leftHeight!=$scroll_LH?$leftTop+$leftHeight:$leftTop+$scroll_LH));var t=$scrollTop+$menuHeight,i=t+$winHeight,n;$leftHeight>$rightHeight?($("#scroll-left").css("position","relative").css("top",0),$rightHeight>=$winHeight?i>=$rightBottom?i>=$leftBottom?(n=$leftHeight-$rightHeight,$("#scroll-right").css("position","relative").css("top",n).css("left",0)):(n=$winHeight-$rightHeight,$setLeft=$leftWidth-Math.abs($leftLeft)+20,$("#scroll-right").css("position","fixed").css("top",n).css("left",$rightLeft)):$("#scroll-right").css("position","relative").css("top",0).css("left",0):t>$rightTop?t+$rightHeight>=$leftBottom?(n=$leftHeight-$rightHeight,$("#scroll-right").css("position","relative").css("top",n).css("left",0)):(n=$menuHeight-12,$setLeft=$leftWidth-Math.abs($leftLeft)+20,$("#scroll-right").css("position","fixed").css("top",n).css("left",$rightLeft)):$("#scroll-right").css("position","relative").css("top",0).css("left",0)):($("#scroll-left").css("width",$leftWidth),$("#scroll-right").css("position","relative").css("top",0),$leftHeight>=$winHeight?i>=$leftBottom?i>=$rightBottom?(n=$rightHeight-$leftHeight,$("#scroll-left").css("position","relative").css("top",n).css("left",0)):(n=$winHeight-$leftHeight,$setLeft=$rightLeft-20-$leftWidth,$("#scroll-left").css("position","fixed").css("top",n).css("left",$setLeft)):$("#scroll-left").css("position","relative").css("top",0).css("left",0):t>=$leftTop?t+$leftHeight>=$rightBottom?(n=$rightHeight-$leftHeight,$("#scroll-left").css("position","relative").css("top",n).css("left",0)):(n=$menuHeight-12,$setLeft=$rightLeft-20-$leftWidth,$("#scroll-left").css("position","fixed").css("top",n).css("left",$setLeft)):$("#scroll-left").css("position","relative").css("top",0).css("left",0))}Sticky_PageShare()})