/* Minification failed. Returning unminified contents.
(1517,7): run-time error JS1004: Expected ';'
(1522,8): run-time error JS1004: Expected ';'
 */
var setupNavigationAndToolsDrawerToggle = function () {

    function openNavigationAndToolsDrawer() {
        var mainNavigation = $('#mainnav');
        var mobileTools = $('.js-mobile-nav-tools');
        if (mainNavigation.hasClass('nav-collapse')) {
            mainNavigation.removeClass('nav-collapse');
            mainNavigation.removeClass('nav-collapse-0');
            mobileTools.removeClass('closed');
            mobileTools.addClass('opened');
            $('#ToggleNav').addClass('active');
        } else {
            mainNavigation.addClass('nav-collapse');
            mainNavigation.addClass('nav-collapse-0');
            mainNavigation.addClass('closed');
            mobileTools.addClass('closed');
            mobileTools.removeClass('opened');
            $('#ToggleNav').removeClass('active');
        }
    }

    $('#ToggleNav').on('click', openNavigationAndToolsDrawer); // Hamburger menu button
    $('.skip-links__link[href="#aMainNav"]').on('click', openNavigationAndToolsDrawer); // Skip to main menu link

};

if ($('#mainnav').length && $('#ToggleNav').length) {
    setupNavigationAndToolsDrawerToggle();
}
else if ($('#nav').length) {
    var nav = responsiveNav("#nav",
        {
            // Selector - NOTE: use #ID - using .class borks this script and all following scripts in IE7 (querySelect
            animate: true, // Boolean: Use CSS3 transitions, true or false
            transition: 400, // Integer: Speed of the transition, in milliseconds
            label: "Menu", // String: Label for the navigation toggle
            insert: "after", // String: Insert the toggle before or after the navigation
            customToggle: "ToggleNav", // Selector: Specify the ID of a custom toggle
            openPos: "relative", // String: Position of the opened nav, relative or static
            jsClass: "js", //String: 'JS enabled' class which is added to <html> el
            //init: function () { }, // Function: Init callback
            open: function () {
                if ($('html').hasClass('js-search-active')) {
                    $('#main-navigation .header-search--mobile').slideUp('fast');
                    bcu.searchToggleClose();
                }
                if ($('html').hasClass('js-basket-active')) {
                    $('#main-navigation .header-basket--mobile').slideUp('fast');
                    bcu.basketToggleClose();
                }
                $('#ToggleNav').prop('title', 'Close main menu');
                $('.js-mobile-nav-tools').removeClass('closed').addClass('opened');
            },
            close: function () {
                $('#ToggleNav').removeClass('active');
                $('#ToggleNav').prop('title', 'Open main menu');
                $('.js-mobile-nav-tools').removeClass('opened').addClass('closed');
            }

        });
}



//DW: This is here because Windows Phone does not navigate to clicked URL on first click, so we force it to
if (navigator.userAgent.match(/iemobile/i)) {
    $('body')
        .on('click',
        '.main-nav_link',
        function (e) {
            try {
                var myLink = $(this).attr('href');
                window.location.href(myLink);
            } catch (err) {
                alert($(this).attr('href') + " is not a valid link");
            }

        });
};
(function(n){n.fn.anystretch=function(t,i,r){var u=this.selector.length?!1:!0;return this.each(function(){function w(){var s,i;if(t||e.length>=1){if(u||e.css({position:f.elPosition,background:"none"}),o.length==0?o=n("<div />").attr("class","anystretch").css({left:0,top:0,position:u?"fixed":"absolute",overflow:"hidden",zIndex:u?-999999:-999998,margin:0,padding:0,height:"100%",width:"100%"}):o.find("img").addClass("deleteable"),s=n("<img />").css({position:"absolute",display:"none",margin:0,padding:0,border:"none",zIndex:-999999}).bind("load",function(t){var i=n(this),u,e;i.css({width:"auto",height:"auto"});u=this.width||n(t.target).width();e=this.height||n(t.target).height();a=u/e;y(function(){i.fadeIn(f.speed,function(){o.find(".deleteable").remove();typeof r=="function"&&r()})})}).appendTo(o),e.children(".anystretch").length==0&&(u?n("body").append(o):e.append(o)),o.data("settings",f),i="",t)i=t;else if(e.data(f.dataName))i=e.data(f.dataName);else return;s.attr("src",i);s.attr("alt",e.data(f.altText));n(window).resize(y)}}function y(t){try{h={left:0,top:0};c=p();s=c/a;s>=v()?(l=(s-v())/2,f.positionY=="center"||f.centeredY?n.extend(h,{top:"-"+l+"px"}):f.positionY=="bottom"&&n.extend(h,{top:"auto",bottom:"0px"})):(s=v(),c=s*a,l=(c-p())/2,f.positionX=="center"||f.centeredX?n.extend(h,{left:"-"+l+"px"}):f.positionX=="right"&&n.extend(h,{left:"auto",right:"0px"}));o.children("img:not(.deleteable)").width(c).height(s).filter("img").css(h)}catch(i){}typeof t=="function"&&t()}function p(){return u?e.width():e.innerWidth()}function v(){return u?e.height():e.innerHeight()}var e=n(this),o=u?n(".anystretch"):e.children(".anystretch"),f=o.data("settings")||{positionX:"center",positionY:"center",speed:0,elPosition:"relative",dataName:"stretch",altText:"alttext"},b=o.data("settings"),a,c,s,l,h;return i&&typeof i=="object"&&n.extend(f,i),i&&typeof i=="function"&&(r=i),n(document).ready(w),this})};n.anystretch=function(t,i,r){var u="onorientationchange"in window?n(document):n(window);u.anystretch(t,i,r)}})(jQuery);;
// ==================================================
// fancyBox v3.5.2
//
// Licensed GPLv3 for open source use
// or fancyBox Commercial License for commercial use
//
// http://fancyapps.com/fancybox/
// Copyright 2018 fancyApps
//
// ==================================================
!function(t,e,n,o){"use strict";function a(t,e){var o,a,i,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),i=n.fancybox.getInstance(),i&&i.$trigger&&i.$trigger.is(o)||(e.selector?s=n(e.selector):(a=o.attr("data-fancybox")||"",a?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+a+'"]'):n('[data-fancybox="'+a+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),i=n.fancybox.open(s,e,r),i.$trigger=o))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var i={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span>&nbsp;/&nbsp;<span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schliessen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Maßstab"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),a={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in a)if(n.style[t]!==o)return a[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,a;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},a=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),a)},b=function(t,e,o){var a=this;a.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(a.opts=h(a.opts,e)),n.fancybox.isMobile&&(a.opts=h(a.opts,a.opts.mobile)),a.id=a.opts.id||++c,a.currIndex=parseInt(a.opts.index,10)||0,a.prevIndex=null,a.prevPos=null,a.currPos=0,a.firstRun=!0,a.group=[],a.slides={},a.addContent(t),a.group.length&&a.init()};n.extend(b.prototype,{init:function(){var o,a,i=this,s=i.group[i.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&r.hideScrollbar!==!1&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),a="",n.each(r.buttons,function(t,e){a+=r.btnTpl[e]||""}),o=n(i.translate(i,r.baseTpl.replace("{{buttons}}",a).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+i.id).addClass(r.baseClass).data("FancyBox",i).appendTo(r.parentEl),i.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){i.$refs[t]=o.find(".fancybox-"+t)}),i.trigger("onInit"),i.activate(),i.jumpTo(i.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){var a=n[e];return a===o?t:a})},addContent:function(t){var e,a=this,i=n.makeArray(t);n.each(i,function(t,e){var i,s,r,c,l,d={},u={};n.isPlainObject(e)?(d=e,u=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),u=i.data()||{},u=n.extend(!0,{},u,u.options),u.$orig=i,d.src=a.opts.src||u.src||i.attr("href"),d.type||d.src||(d.type="inline",d.src=e)):d={type:"html",src:e+""},d.opts=n.extend(!0,{},a.opts,u),n.isArray(u.buttons)&&(d.opts.buttons=u.buttons),n.fancybox.isMobile&&d.opts.mobile&&(d.opts=h(d.opts,d.opts.mobile)),s=d.type||d.opts.type,c=d.src||"",!s&&c&&((r=c.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(s="video",d.opts.video.format||(d.opts.video.format="video/"+("ogv"===r[1]?"ogg":r[1]))):c.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?s="image":c.match(/\.(pdf)((\?|#).*)?$/i)?(s="iframe",d=n.extend(!0,d,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===c.charAt(0)&&(s="inline")),s?d.type=s:a.trigger("objectNeedsType",d),d.contentType||(d.contentType=n.inArray(d.type,["html","inline","ajax"])>-1?"html":d.type),d.index=a.group.length,"auto"==d.opts.smallBtn&&(d.opts.smallBtn=n.inArray(d.type,["html","inline","ajax"])>-1),"auto"===d.opts.toolbar&&(d.opts.toolbar=!d.opts.smallBtn),d.$thumb=d.opts.$thumb||null,d.opts.$trigger&&d.index===a.opts.index&&(d.$thumb=d.opts.$trigger.find("img:first"),d.$thumb.length&&(d.opts.$orig=d.opts.$trigger)),d.$thumb&&d.$thumb.length||!d.opts.$orig||(d.$thumb=d.opts.$orig.find("img:first")),d.$thumb&&!d.$thumb.length&&(d.$thumb=null),d.thumb=d.opts.thumb||(d.$thumb?d.$thumb[0].src:null),"function"===n.type(d.opts.caption)&&(d.opts.caption=d.opts.caption.apply(e,[a,d])),"function"===n.type(a.opts.caption)&&(d.opts.caption=a.opts.caption.apply(e,[a,d])),d.opts.caption instanceof n||(d.opts.caption=d.opts.caption===o?"":d.opts.caption+""),"ajax"===d.type&&(l=c.split(/\s+/,2),l.length>1&&(d.src=l.shift(),d.opts.filter=l.shift())),d.opts.modal&&(d.opts=n.extend(!0,d.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),a.group.push(d)}),Object.keys(a.slides).length&&(a.updateControls(),e=a.Thumbs,e&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,a=o.current,i=t.keyCode||t.which;if(9==i)return void(a.opts.trapFocus&&e.focus(t));if(!(!a.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input")||n(t.target).is("textarea")))return 8===i||27===i?(t.preventDefault(),void e.close(t)):37===i||38===i?(t.preventDefault(),void e.previous()):39===i||40===i?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,i)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){e.idleSecondsCounter++,e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var a,i,s,r,c,l,d,u,f,h=this,g=h.group.length;if(!(h.isDragging||h.isClosing||h.isAnimating&&h.firstRun)){if(t=parseInt(t,10),s=h.current?h.current.opts.loop:h.opts.loop,!s&&(t<0||t>=g))return!1;if(a=h.firstRun=!Object.keys(h.slides).length,c=h.current,h.prevIndex=h.currIndex,h.prevPos=h.currPos,r=h.createSlide(t),g>1&&((s||r.index<g-1)&&h.createSlide(t+1),(s||r.index>0)&&h.createSlide(t-1)),h.current=r,h.currIndex=r.index,h.currPos=r.pos,h.trigger("beforeShow",a),h.updateControls(),r.forcedDuration=o,n.isNumeric(e)?r.forcedDuration=e:e=r.opts[a?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=h.isMoved(r),r.$slide.addClass("fancybox-slide--current"),a)return r.opts.animationEffect&&e&&h.$refs.container.css("transition-duration",e+"ms"),h.$refs.container.addClass("fancybox-is-open").trigger("focus"),h.loadSlide(r),void h.preload("image");l=n.fancybox.getTranslate(c.$slide),d=n.fancybox.getTranslate(h.$refs.stage),n.each(h.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),c.pos!==r.pos&&(c.isComplete=!1),c.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(f=l.left-(c.pos*l.width+c.pos*c.opts.gutter),n.each(h.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var a=o.pos*l.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:a-d.left+f}),o.pos!==r.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>r.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-r.pos)*l.width+(o.pos-r.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===h.currPos&&h.complete()})})):e&&r.opts.transitionEffect&&(u="fancybox-animated fancybox-fx-"+r.opts.transitionEffect,c.$slide.addClass("fancybox-slide--"+(c.pos>r.pos?"next":"previous")),n.fancybox.animate(c.$slide,u,e,function(){c.$slide.removeClass(u).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),r.isLoaded?h.revealContent(r):h.loadSlide(r),h.preload("image")}},createSlide:function(t){var e,o,a=this;return o=t%a.group.length,o=o<0?a.group.length+o:o,!a.slides[t]&&a.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(a.$refs.stage),a.slides[t]=n.extend(!0,{},a.group[o],{pos:t,$slide:e,isLoaded:!1}),a.updateSlide(a.slides[t])),a.slides[t]},scaleToActual:function(t,e,a){var i,s,r,c,l,d=this,u=d.current,f=u.$content,p=n.fancybox.getTranslate(u.$slide).width,h=n.fancybox.getTranslate(u.$slide).height,g=u.width,b=u.height;d.isAnimating||d.isMoved()||!f||"image"!=u.type||!u.isLoaded||u.hasError||(d.isAnimating=!0,n.fancybox.stop(f),t=t===o?.5*p:t,e=e===o?.5*h:e,i=n.fancybox.getTranslate(f),i.top-=n.fancybox.getTranslate(u.$slide).top,i.left-=n.fancybox.getTranslate(u.$slide).left,c=g/i.width,l=b/i.height,s=.5*p-.5*g,r=.5*h-.5*b,g>p&&(s=i.left*c-(t*c-t),s>0&&(s=0),s<p-g&&(s=p-g)),b>h&&(r=i.top*l-(e*l-e),r>0&&(r=0),r<h-b&&(r=h-b)),d.updateCursor(g,b),n.fancybox.animate(f,{top:r,left:s,scaleX:c,scaleY:l},a||330,function(){d.isAnimating=!1}),d.SlideShow&&d.SlideShow.isActive&&d.SlideShow.stop())},scaleToFit:function(t){var e,o=this,a=o.current,i=a.$content;o.isAnimating||o.isMoved()||!i||"image"!=a.type||!a.isLoaded||a.hasError||(o.isAnimating=!0,n.fancybox.stop(i),e=o.getFitPos(a),o.updateCursor(e.width,e.height),n.fancybox.animate(i,{top:e.top,left:e.left,scaleX:e.width/i.width(),scaleY:e.height/i.height()},t||330,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,a,i,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),a=Math.min(1,e/l,o/d),l=a*l,d=a*d,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(i=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/i?d=l/i:l>d*i&&(l=d*i)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,a=t&&t.$content,i=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),a&&(i||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(a),n.fancybox.setTranslate(a,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,a=e.current,i=a.$slide;!e.isClosing&&a&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},t===o?0:t,function(){i.css({transform:"",opacity:""}),a.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,a=t||this.current;return!!a&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(a.$slide),!a.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,a,i=this,s=i.current,r=i.$refs.container;s&&!i.isClosing&&i.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=i.canPan(t,e),a=!!o||i.isZoomable(),r.toggleClass("fancybox-is-zoomable",a),n("[data-fancybox-zoom]").prop("disabled",!a),o?r.addClass("fancybox-can-pan"):a&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||i.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if(t=e.getFitPos(n),t&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var a=this,i=!1,s=a.current,r=s.$content;return t!==o&&e!==o?i=t<s.width&&e<s.height:r&&(i=n.fancybox.getTranslate(r),i=i.width<s.width&&i.height<s.height),i},canPan:function(t,e){var a=this,i=a.current,s=null,r=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(r=a.getFitPos(i),t!==o&&e!==o?s={width:t,height:e}:i.isComplete&&(s=n.fancybox.getTranslate(i.$content)),s&&r&&(r=Math.abs(s.width-r.width)>1.5||Math.abs(s.height-r.height)>1.5)),r},loadSlide:function(t){var e,o,a,i=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,i.trigger("beforeLoad",t)===!1)return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":i.setImage(t);break;case"iframe":i.setIframe(t);break;case"html":i.setContent(t,t.src||t.content);break;case"video":i.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?i.setContent(t,n(t.src)):i.setError(t);break;case"ajax":i.showLoading(t),a=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&i.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&i.setError(t)}})),o.one("onReset",function(){a.abort()});break;default:i.setError(t)}return!0}},setImage:function(t){var o,a=this;setTimeout(function(){var e=t.$image;a.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||a.showLoading(t)},50),a.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),t.opts.preload!==!1&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){a.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),a.setBigImage(t)},checkSrcset:function(e){var n,o,a,i,s=e.opts.srcset||e.opts.image.srcset;if(s){a=t.devicePixelRatio||1,i=t.innerWidth*a,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);return 0===n?e.url=t:void(o&&(e.value=o,e.postfix=t[t.length-1]))}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=i||"x"===c.postfix&&c.value>=a){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,a=e.createElement("img"),i=n(a);t.$image=i.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),i.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(a.complete||"complete"==a.readyState)&&i.naturalWidth&&i.naturalHeight?i.trigger("load"):a.error&&i.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),a=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),a>0&&(t.width=Math.floor(a*e/n),t.height=a)},setIframe:function(t){var e,a=this,i=t.opts.iframe,s=t.$slide;n.fancybox.isMobile&&(i.css.overflow="scroll"),t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(s),s.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(a.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),a.afterLoad(t)}),s.on("refresh.fb",function(){var n,a,r=t.$content,c=i.css.width,l=i.css.height;if(1===e[0].isReady){try{n=e.contents(),a=n.find("body")}catch(t){}a&&a.length&&a.children().length&&(s.css("overflow","visible"),r.css({width:"100%","max-width":"100%",height:"9999px"}),c===o&&(c=Math.ceil(Math.max(a[0].clientWidth,a.outerWidth(!0)))),r.css("width",c?c:"").css("max-width",""),l===o&&(l=Math.ceil(Math.max(a[0].clientHeight,a.outerHeight(!0)))),r.css("height",l?l:""),s.css("overflow","auto")),r.removeClass("fancybox-is-hidden")}})):a.afterLoad(t),e.attr("src",t.src),s.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;t=t||e.current,t&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;t=t||e.current,t&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e=this,n=t||e.current,o=n.opts.caption,a=e.$refs.caption,i=!1;n.opts.preventCaptionOverlap&&o&&o.length&&(n.pos!==e.currPos?(a=a.clone().empty().appendTo(a.parent()),a.html(o),i=a.outerHeight(!0),a.empty().remove()):e.$caption&&(i=e.$caption.outerHeight(!0)),n.$slide.css("padding-bottom",i||""))},adjustLayout:function(t){var e,n,o,a,i=this,s=t||i.current;s.isLoaded&&s.opts.disableLayoutFix!==!0&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],a=s.$slide.css("padding-bottom"),parseFloat(a)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=a),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,a,i,s,r=this,c=t.$slide,l=!1,d=!1,u=r.isMoved(t),f=t.isRevealed;return t.isRevealed=!0,e=t.opts[r.firstRun?"animationEffect":"transitionEffect"],i=t.opts[r.firstRun?"animationDuration":"transitionDuration"],i=parseInt(t.forcedDuration===o?i:t.forcedDuration,10),!u&&t.pos===r.currPos&&i||(e=!1),"zoom"===e&&(t.pos===r.currPos&&i&&"image"===t.type&&!t.hasError&&(d=r.getThumbPos(t))?l=r.getFitPos(t):e="fade"),"zoom"===e?(r.isAnimating=!0,l.scaleX=l.width/d.width,l.scaleY=l.height/d.height,s=t.opts.zoomOpacity,"auto"==s&&(s=Math.abs(t.width/t.height-d.width/d.height)>.1),s&&(d.opacity=.1,l.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),d),p(t.$content),void n.fancybox.animate(t.$content,l,i,function(){r.isAnimating=!1,r.complete()})):(r.updateSlide(t),e?(n.fancybox.stop(c),a="fancybox-slide--"+(t.pos>=r.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,c.addClass(a).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(c),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(c,"fancybox-slide--current",i,function(){c.removeClass(a).css({transform:"",opacity:""}),t.pos===r.currPos&&r.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),f||!u||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===r.currPos&&r.complete())))},getThumbPos:function(t){var e,o,a,i,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),a=parseFloat(c.css("border-right-width")||0),i=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-a-s,height:e.height-o-i,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,a={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?a[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=a),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var a,i,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(a=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),a=a.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),a.length?(i=a.index(e.activeElement),t&&t.shiftKey?(i<0||0==i)&&(t.preventDefault(),a.eq(a.length-1).trigger("focus")):(i<0||i==a.length-1)&&(t&&t.preventDefault(),a.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,a,i,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,u.trigger("beforeClose",t)===!1?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),i=f.$content,o=f.opts.animationEffect,a=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),t!==!0?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),a&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",a+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||i&&a&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(i),s=n.fancybox.getTranslate(i),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(i,c),p(i),n.fancybox.animate(i,l,a,h),!0):(o&&a?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,a,h):t===!0?setTimeout(h,a):h(),
!0)))},cleanUp:function(e){var o,a,i,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(a=t.scrollX,i=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(i).scrollLeft(a))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,a=Array.prototype.slice.call(arguments,1),i=this,s=e&&e.opts?e:i.current;return s?a.unshift(s):s=i,a.unshift(i),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,a)),o===!1?o:void("afterClose"!==t&&i.$refs?i.$refs.container.trigger(t+".fb",a):r.trigger(t+".fb",a))},updateControls:function(){var t=this,o=t.current,a=o.index,i=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),t.$caption=r&&r.length?s.html(r):null,t.hasHiddenControls||t.isIdle||t.showControls(),i.find("[data-fancybox-count]").html(t.group.length),i.find("[data-fancybox-index]").html(a+1),i.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&a<=0),i.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&a>=t.group.length-1),"image"===o.type?i.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&i.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.2",defaults:i,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),t===!0&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",a={};if(t&&e)return e.left===o&&e.top===o||(n=(e.left===o?t.position().left:e.left)+"px, "+(e.top===o?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),e.scaleX!==o&&e.scaleY!==o?n+=" scale("+e.scaleX+", "+e.scaleY+")":e.scaleX!==o&&(n+=" scaleX("+e.scaleX+")"),n.length&&(a.transform=n),e.opacity!==o&&(a.opacity=e.opacity),e.width!==o&&(a.width=e.width),e.height!==o&&(a.height=e.height),t.css(a)},animate:function(t,e,a,i,s){var r,c=this;n.isFunction(a)&&(i=a,a=null),c.stop(t),r=c.getTranslate(t),t.on(f,function(l){(!l||!l.originalEvent||t.is(l.originalEvent.target)&&"z-index"!=l.originalEvent.propertyName)&&(c.stop(t),n.isNumeric(a)&&t.css("transition-duration",""),n.isPlainObject(e)?e.scaleX!==o&&e.scaleY!==o&&c.setTranslate(t,{top:e.top,left:e.left,width:r.width*e.scaleX,height:r.height*e.scaleY,scaleX:1,scaleY:1}):s!==!0&&t.removeClass(e),n.isFunction(i)&&i(l))}),n.isNumeric(a)&&t.css("transition-duration",a+"ms"),n.isPlainObject(e)?(e.scaleX!==o&&e.scaleY!==o&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},a+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},a):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},a),this},r.on("click.fb-start","[data-fancybox]",a),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=".fancybox-button",e="fancybox-focus",o=null;r.on("mousedown mouseup focus blur",t,function(a){switch(a.type){case"mousedown":o=n(this);break;case"mouseup":o=null;break;case"focusin":n(t).removeClass(e),n(this).is(o)||n(this).is("[disabled]")||n(this).addClass(e);break;case"focusout":n(t).removeClass(e)}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"//www.youtube-nocookie.com/embed/$4",thumb:"//img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,a,i){var s,r,c,l,d,u,f,p=i.src||"",h=!1;s=t.extend(!0,{},e,i.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var a=0;a<d.length;++a){var s=d[a].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,i.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,i):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,i):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(i.opts.thumb||i.opts.$thumb&&i.opts.$thumb.length||(i.opts.thumb=r),"iframe"===h&&(i.opts=t.extend(!0,i.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(i,{type:h,src:p,origSrc:i.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(i.type=i.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;return this[t].loaded?void setTimeout(function(){n.done(t)}):void(this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e)))},done:function(e){var n,o,a;"youtube"===e&&delete window.onYouTubeIframeAPIReady,n=t.fancybox.getInstance(),n&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?a=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(a=new Vimeo.Player(o),a.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),a=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),i=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,a=o.length;e<a;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],a=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,i=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return a||i},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(a(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var a=this,c=n(o.target),d=a.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&a.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();a.realPoints=a.startPoints=i(o),a.startPoints.length&&(u.touch&&o.stopPropagation(),a.startEvent=o,a.canTap=!0,a.$target=c,a.$content=p,a.opts=u.opts.touch,a.isPanning=!1,a.isSwiping=!1,a.isZooming=!1,a.isScrolling=!1,a.canPan=d.canPan(),a.startTime=(new Date).getTime(),a.distanceX=a.distanceY=a.distance=0,a.canvasWidth=Math.round(f[0].clientWidth),a.canvasHeight=Math.round(f[0].clientHeight),a.contentLastPos=null,a.contentStartPos=n.fancybox.getTranslate(a.$content)||{top:0,left:0},a.sliderStartPos=n.fancybox.getTranslate(f),a.stagePos=n.fancybox.getTranslate(d.$refs.stage),a.sliderStartPos.top-=a.stagePos.top,a.sliderStartPos.left-=a.stagePos.left,a.contentStartPos.top-=a.stagePos.top,a.contentStartPos.left-=a.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(a,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(a,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",a.onscroll,!0),((a.opts||a.canPan)&&(c.is(a.$stage)||a.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.hasClass("fancybox-caption")))&&(a.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&a.isScrollable||o.preventDefault(),(1===a.startPoints.length||u.hasError)&&(a.canPan?(n.fancybox.stop(a.$content),a.isPanning=!0):a.isSwiping=!0,a.$container.addClass("fancybox-is-grabbing")),2===a.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(a.canTap=!1,a.isSwiping=!1,a.isPanning=!1,a.isZooming=!0,n.fancybox.stop(a.$content),a.centerPointStartX=.5*(a.startPoints[0].x+a.startPoints[1].x)-n(t).scrollLeft(),a.centerPointStartY=.5*(a.startPoints[0].y+a.startPoints[1].y)-n(t).scrollTop(),a.percentageOfImageAtPinchPointX=(a.centerPointStartX-a.contentStartPos.left)/a.contentStartPos.width,a.percentageOfImageAtPinchPointY=(a.centerPointStartY-a.contentStartPos.top)/a.contentStartPos.height,a.startDistanceBetweenFingers=s(a.startPoints[0],a.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=i(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&e.isSwiping===!0||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var i,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(c!==!0)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(a(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||s.opts.vertical===!1||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(i=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=i>45&&i<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,a;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),a=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-a.top,s.sliderStartPos.left=o.left-a.left),n.fancybox.setTranslate(e.$slide,{top:o.top-a.top,left:o.left-a.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;return s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5)?void(t.startPoints=t.newPoints):(t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&a(t.requestId),void(t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})))},d.prototype.limitMovement=function(){var t,e,n,o,a,i,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return a=h>r?f+l:f,i=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&a>t&&(a=t-1+Math.pow(-t+f+l,.8)||0),l<0&&a<n&&(a=n+1-Math.pow(n-f-l,.8)||0),d>0&&i>e&&(i=e-1+Math.pow(-e+p+d,.8)||0),d<0&&i<o&&(i=o+1-Math.pow(o-p-d,.8)||0),{top:i,left:a}},d.prototype.limitPosition=function(t,e,n,o){var a=this,i=a.canvasWidth,s=a.canvasHeight;return n>i?(t=t>0?0:t,t=t<i-n?i-n:t):t=Math.max(0,i/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,i=e.contentStartPos,r=i.width,c=i.height,l=i.left,d=i.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&a(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;return o.endPoints=i(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(a(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap?o.onTap(t):(o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,void(r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)))},d.prototype.endSwiping=function(t,e){var o=this,a=!1,i=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&i>1&&(o.dMs>130&&s>10||s>50),c=300;o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),a=o.instance.close(!0,250)):r&&o.distanceX>0?a=o.instance.previous(c):r&&o.distanceX<0&&(a=o.instance.next(c)),a!==!1||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,a=this;a.contentLastPos&&(a.opts.momentum===!1||a.dMs>350?(t=a.contentLastPos.left,e=a.contentLastPos.top):(t=a.contentLastPos.left+500*a.velocityX,e=a.contentLastPos.top+500*a.velocityY),o=a.limitPosition(t,e,a.contentStartPos.width,a.contentStartPos.height),o.width=a.contentStartPos.width,o.height=a.contentStartPos.height,n.fancybox.animate(a.$content,o,330))},d.prototype.endZooming=function(){var t,e,o,a,i=this,s=i.instance.current,r=i.newWidth,c=i.newHeight;i.contentLastPos&&(t=i.contentLastPos.left,e=i.contentLastPos.top,a={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(i.$content,a),r<i.canvasWidth&&c<i.canvasHeight?i.instance.scaleToFit(150):r>s.width||c>s.height?i.instance.scaleToActual(i.centerPointStartX,i.centerPointStartY,150):(o=i.limitPosition(t,e,r,c),n.fancybox.animate(i.$content,o,150)))},d.prototype.onTap=function(e){var o,a=this,s=n(e.target),r=a.instance,c=r.current,l=e&&i(e)||a.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-a.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-a.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(a.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(a.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(a.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(a.tapped){if(clearTimeout(a.tapped),a.tapped=null,Math.abs(d-a.tapX)>50||Math.abs(u-a.tapY)>50)return this;f("dblclick"+o)}else a.tapX=d,a.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?a.tapped=setTimeout(function(){a.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,a=o.current;a&&(t===!0||a.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==a.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},a.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},a.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var a=e&&e.SlideShow;o?a&&n.opts.slideShow.autoStart&&a.start():a&&a.isActive&&a.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,a,i,s){var r=o&&o.SlideShow;!r||!a.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(i.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var a=e[o];if(a&&a[1]in t){for(var i=0;i<a.length;i++)n[e[0][i]]=a[i];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.current.$content.css("transition","none"),n.isAnimating=!1,n.update(!0,!0,0)),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var a;return n?void(e&&e.group[e.currIndex].opts.fullScreen?(a=e.$refs.container,a.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&e.opts.fullScreen.autoStart===!0&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()):void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove()},"afterKeydown.fb":function(t,e,n,o,a){e&&e.FullScreen&&70===a&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs",o=n+"-active";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var a=function(t){this.init(t)};e.extend(a.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var a=0,i=n.length;a<i&&(n[a].thumb&&o++,!(o>1));a++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,a=o.instance,i=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(a.$refs.container.find(i).addBack().filter(i)),o.$grid.on("click","a",function(){a.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(a.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+a.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,a=this,i=a.$list,s=a.$grid;a.instance.current&&(e=i.children().removeClass(o).filter('[data-index="'+a.instance.current.index+'"]').addClass(o),n=e.position(),"y"===a.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===a.opts.axis&&(n.left<s.scrollLeft()||n.left>s.scrollLeft()+(s.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new a(e),n.isActive&&n.opts.autoStart===!0&&n.show())},"beforeShow.fb":function(t,e,n,o){var a=e&&e.Thumbs;a&&a.isVisible&&a.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,a){var i=e&&e.Thumbs;i&&i.isActive&&71===a&&(o.preventDefault(),i.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&n.opts.hideOnClose!==!1&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'
}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,a=e.fancybox.getInstance(),i=a.current||null;i&&("function"===e.type(i.opts.share.url)&&(t=i.opts.share.url.apply(i,[a,i])),o=i.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===i.type?encodeURIComponent(i.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,a.$caption?encodeURIComponent(a.$caption.text()):""),e.fancybox.open({src:a.translate(a,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){a.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,a=n.join("-");return{hash:e,index:o<1?1:o,gallery:a}}function a(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function i(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""),""!==n&&n)}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)}),n(function(){n.fancybox.defaults.hash!==!1&&(n(e).on({"onInit.fb":function(t,e){var n,a;e.group[e.currIndex].opts.hash!==!1&&(n=o(),a=i(e),a&&n.gallery&&a==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,a,s){var r;a&&a.opts.hash!==!1&&(r=i(o),r&&(o.currentHash=r+(o.group.length>1?"-"+(a.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300))))},"beforeClose.fb":function(n,o,a){a.opts.hash!==!1&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var a=n(o).data("FancyBox");if(a&&a.currentHash)return e=a,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&a(t)}),setTimeout(function(){n.fancybox.getInstance()||a(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,a=(new Date).getTime();e.group.length<2||o.opts.wheel===!1||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,a-n<250||(n=a,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);;
/*! ISSUU Embed - v0.1.0 - 2015-11-05
Property of ISSUU: issuu.com  */

!function (a, b, c) {
	function d() { function a(a) { return a = a.match(/[\d]+/g), a.length = 3, a.join(".") } var b = !1, c = ""; if (navigator.plugins && navigator.plugins.length) { var d = navigator.plugins["Shockwave Flash"]; d && (b = !0, d.description && (c = a(d.description))), navigator.plugins["Shockwave Flash 2.0"] && (b = !0, c = "2.0.0.11") } else if (navigator.mimeTypes && navigator.mimeTypes.length) { var e = navigator.mimeTypes["application/x-shockwave-flash"]; (b = e && e.enabledPlugin) && (c = a(e.enabledPlugin.description)) } else try { var f = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"), b = !0, c = a(f.GetVariable("$version")) } catch (g) { try { f = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"), b = !0, c = "6.0.21" } catch (h) { try { f = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"), b = !0, c = a(f.GetVariable("$version")) } catch (i) { } } } return { hasFlash: function () { return b }, getVersion: function () { return c }, isGoodForIssuu: function () { var a = c.split("."); return parseInt(a[0], 10) >= 10 } } } function e(a) { return a ? { pingbackProto: "https://", pingbackHost: "pingback.issuu.com/", staticProto: "https://", staticHost: "static.issuu.com/", configProto: "https://", configHost: "e.issuu.com/", configPath: "embed/", imgProto: "https://", imgHost: "image.issuu.com/", apiHost: "api.issuu.com/", apiPath: "query", exelate: { publisher: "536", website: "001", segment: "2372960" } } : { pingbackProto: "http://", pingbackHost: "pingback.issuu.com/", staticProto: "http://", staticHost: "static.issuu.com/", configProto: "http://", configHost: "e.issuu.com/", configPath: "embed/", imgProto: "http://", imgHost: "image.issuu.com/", apiHost: "api.issuu.com/", apiPath: "query", exelate: { publisher: "536", website: "001", segment: "2372960", enabled: !0 } } } function f() { return z } function g(a) { var b = /^([0-9]{1,8})\/([0-9]{1,8}).*$/, c = b.exec(a); return c && c.length > 2 ? c[1] + "/" + c[2] : v } function h(a) { var b = function (a) { "use strict"; return f().hasOwnProperty(a) && f()[a].template ? f()[a].template.getReader(f()[a].elements[0]) : null }, c = function (a) { "use strict"; var b; try { b = y(a) } catch (c) { } if (b && b.length > 0) { var d = b.attr(t); if (f().hasOwnProperty(d) && f()[d].template) return f()[d].template.getReader(b) } return null }, d = b(a); return null !== d ? d : c(a) } function i(b) { "use strict"; var d = 0, e = 1, h = 2, i = 3, j = function () { a.IssuuReaders.loaded || (a.IssuuReaders.loaded = !0, "function" == typeof a.onIssuuReadersLoaded && a.onIssuuReadersLoaded.call({}, a.IssuuReaders)) }, k = function () { var a = 0; return y.each(f(), function (b) { a += f()[b].elements.length }), a }, l = function (a) { var b; try { b = y(a) } catch (c) { return } b.each(function (a, b) { var c = "embedid", e = g(y(b).attr(t)); e === v && (e = y(b).attr(u), c = "docurl"), f()[e] ? y.inArray(b, f()[e].elements) > -1 || f()[e].elements.push(b) : f()[e] = { state: d, elements: [b], embedSource: c, errorResponseText: null, template: null } }) }, m = function (a) { var b = g(a); l(b === v ? a : "[" + t + "=" + b + " ]") }, o = function (a, b, d) { var e = a.config, f = 0; y.each(a.elements, function (g, h) { if (!y(h).hasClass(x)) { y(h).addClass(x); var i = "embedid" === a.embedSource || d ? b : 1, l = n.get(h.offsetWidth, h.offsetHeight, d ? n.type.ERROR : c); null === a.template && (a.template = l), l.render(h, e, i, function () { ++f >= k() && j() }, { responseText: a.errorResponseText }) } }) }, p = function (a) { if (f().hasOwnProperty(a)) { var b = f()[a]; switch (b.state) { case h: o(b, a, !1); break; case i: o(b, a, !0); break; case e: break; case d: b.state = e, A.load(a, b.embedSource, function (c) { b.config = c, b.state = h, o(b, a, !1) }, function (c) { b.state = i, b.errorResponseText = c.responseText, o(b, a, !0) }) } } }, q = function () { y.each(f(), function (a) { p(a) }) }; b === c ? l(w) : m(b), q() } var j = {}; j.amd = !1; var k = "0.1.0-20151105"; !function (a, b) {
		function c(a) { var b = pa[a] = {}; return _.each(a.split(ca), function (a, c) { b[c] = !0 }), b } function d(a, c, d) { if (d === b && 1 === a.nodeType) { var e = "data-" + c.replace(ra, "-$1").toLowerCase(); if (d = a.getAttribute(e), "string" == typeof d) { try { d = "true" === d ? !0 : "false" === d ? !1 : "null" === d ? null : +d + "" === d ? +d : qa.test(d) ? _.parseJSON(d) : d } catch (f) { } _.data(a, c, d) } else d = b } return d } function e(a) { var b; for (b in a) if (("data" !== b || !_.isEmptyObject(a[b])) && "toJSON" !== b) return !1; return !0 } function f() { return !1 } function g() { return !0 } function h(a) { return !a || !a.parentNode || 11 === a.parentNode.nodeType } function i(a, b) { do a = a[b]; while (a && 1 !== a.nodeType); return a } function k(a, b, c) { if (b = b || 0, _.isFunction(b)) return _.grep(a, function (a, d) { var e = !!b.call(a, d, a); return e === c }); if (b.nodeType) return _.grep(a, function (a, d) { return a === b === c }); if ("string" == typeof b) { var d = _.grep(a, function (a) { return 1 === a.nodeType }); if (La.test(b)) return _.filter(b, d, !c); b = _.filter(b, d) } return _.grep(a, function (a, d) { return _.inArray(a, b) >= 0 === c }) } function l(a) { var b = Oa.split("|"), c = a.createDocumentFragment(); if (c.createElement) for (; b.length;) c.createElement(b.pop()); return c } function m(a, b) { return a.getElementsByTagName(b)[0] || a.appendChild(a.ownerDocument.createElement(b)) } function n(a, b) { if (1 === b.nodeType && _.hasData(a)) { var c, d, e, f = _._data(a), g = _._data(b, f), h = f.events; if (h) { delete g.handle, g.events = {}; for (c in h) for (d = 0, e = h[c].length; e > d; d++) _.event.add(b, c, h[c][d]) } g.data && (g.data = _.extend({}, g.data)) } } function o(a, b) { var c; 1 === b.nodeType && (b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), _.support.html5Clone && a.innerHTML && !_.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && Ya.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.selected = a.defaultSelected : "input" === c || "textarea" === c ? b.defaultValue = a.defaultValue : "script" === c && b.text !== a.text && (b.text = a.text), b.removeAttribute(_.expando)) } function p(a) { return "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName("*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll("*") : [] } function q(a) { Ya.test(a.type) && (a.defaultChecked = a.checked) } function r(a, b) { if (b in a) return b; for (var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = sb.length; e--;) if (b = sb[e] + c, b in a) return b; return d } function s(a, b) { return a = b || a, "none" === _.css(a, "display") || !_.contains(a.ownerDocument, a) } function t(a, b) { for (var c, d, e = [], f = 0, g = a.length; g > f; f++) c = a[f], c.style && (e[f] = _._data(c, "olddisplay"), b ? (e[f] || "none" !== c.style.display || (c.style.display = ""), "" === c.style.display && s(c) && (e[f] = _._data(c, "olddisplay", x(c.nodeName)))) : (d = db(c, "display"), e[f] || "none" === d || _._data(c, "olddisplay", d))); for (f = 0; g > f; f++) c = a[f], c.style && (b && "none" !== c.style.display && "" !== c.style.display || (c.style.display = b ? e[f] || "" : "none")); return a } function u(a, b, c) { var d = lb.exec(b); return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b } function v(a, b, c, d) { for (var e = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, f = 0; 4 > e; e += 2) "margin" === c && (f += _.css(a, c + rb[e], !0)), d ? ("content" === c && (f -= parseFloat(db(a, "padding" + rb[e])) || 0), "margin" !== c && (f -= parseFloat(db(a, "border" + rb[e] + "Width")) || 0)) : (f += parseFloat(db(a, "padding" + rb[e])) || 0, "padding" !== c && (f += parseFloat(db(a, "border" + rb[e] + "Width")) || 0)); return f } function w(a, b, c) { var d = "width" === b ? a.offsetWidth : a.offsetHeight, e = !0, f = _.support.boxSizing && "border-box" === _.css(a, "boxSizing"); if (0 >= d || null == d) { if (d = db(a, b), (0 > d || null == d) && (d = a.style[b]), mb.test(d)) return d; e = f && (_.support.boxSizingReliable || d === a.style[b]), d = parseFloat(d) || 0 } return d + v(a, b, c || (f ? "border" : "content"), e) + "px" } function x(a) { if (ob[a]) return ob[a]; var b = _("<" + a + ">").appendTo(Q.body), c = b.css("display"); return b.remove(), ("none" === c || "" === c) && (eb = Q.body.appendChild(eb || _.extend(Q.createElement("iframe"), { frameBorder: 0, width: 0, height: 0 })), fb && eb.createElement || (fb = (eb.contentWindow || eb.contentDocument).document, fb.write("<!doctype html><html><body>"), fb.close()), b = fb.body.appendChild(fb.createElement(a)), c = db(b, "display"), Q.body.removeChild(eb)), ob[a] = c, c } function y(a, b, c, d) { var e; if (_.isArray(b)) _.each(b, function (b, e) { c || vb.test(a) ? d(a, e) : y(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d) }); else if (c || "object" !== _.type(b)) d(a, b); else for (e in b) y(a + "[" + e + "]", b[e], c, d) } function z(a) { return function (b, c) { "string" != typeof b && (c = b, b = "*"); var d, e, f, g = b.toLowerCase().split(ca), h = 0, i = g.length; if (_.isFunction(c)) for (; i > h; h++) d = g[h], f = /^\+/.test(d), f && (d = d.substr(1) || "*"), e = a[d] = a[d] || [], e[f ? "unshift" : "push"](c) } } function A(a, c, d, e, f, g) { f = f || c.dataTypes[0], g = g || {}, g[f] = !0; for (var h, i = a[f], j = 0, k = i ? i.length : 0, l = a === Lb; k > j && (l || !h) ; j++) h = i[j](c, d, e), "string" == typeof h && (!l || g[h] ? h = b : (c.dataTypes.unshift(h), h = A(a, c, d, e, h, g))); return !l && h || g["*"] || (h = A(a, c, d, e, "*", g)), h } function B(a, c) { var d, e, f = _.ajaxSettings.flatOptions || {}; for (d in c) c[d] !== b && ((f[d] ? a : e || (e = {}))[d] = c[d]); e && _.extend(!0, a, e) } function C(a, c, d) { var e, f, g, h, i = a.contents, j = a.dataTypes, k = a.responseFields; for (f in k) f in d && (c[k[f]] = d[f]); for (; "*" === j[0];) j.shift(), e === b && (e = a.mimeType || c.getResponseHeader("content-type")); if (e) for (f in i) if (i[f] && i[f].test(e)) { j.unshift(f); break } if (j[0] in d) g = j[0]; else { for (f in d) { if (!j[0] || a.converters[f + " " + j[0]]) { g = f; break } h || (h = f) } g = g || h } return g ? (g !== j[0] && j.unshift(g), d[g]) : void 0 } function D(a, b) { var c, d, e, f, g = a.dataTypes.slice(), h = g[0], i = {}, j = 0; if (a.dataFilter && (b = a.dataFilter(b, a.dataType)), g[1]) for (c in a.converters) i[c.toLowerCase()] = a.converters[c]; for (; e = g[++j];) if ("*" !== e) { if ("*" !== h && h !== e) { if (c = i[h + " " + e] || i["* " + e], !c) for (d in i) if (f = d.split(" "), f[1] === e && (c = i[h + " " + f[0]] || i["* " + f[0]])) { c === !0 ? c = i[d] : i[d] !== !0 && (e = f[0], g.splice(j--, 0, e)); break } if (c !== !0) if (c && a["throws"]) b = c(b); else try { b = c(b) } catch (k) { return { state: "parsererror", error: c ? k : "No conversion from " + h + " to " + e } } } h = e } return { state: "success", data: b } } function E() { try { return new a.XMLHttpRequest } catch (b) { } } function F() { try { return new a.ActiveXObject("Microsoft.XMLHTTP") } catch (b) { } } function G() { return setTimeout(function () { Wb = b }, 0), Wb = _.now() } function H(a, b) { _.each(b, function (b, c) { for (var d = (ac[b] || []).concat(ac["*"]), e = 0, f = d.length; f > e; e++) if (d[e].call(a, b, c)) return }) } function I(a, b, c) { var d, e = 0, f = _b.length, g = _.Deferred().always(function () { delete h.elem }), h = function () { for (var b = Wb || G(), c = Math.max(0, i.startTime + i.duration - b), d = 1 - (c / i.duration || 0), e = 0, f = i.tweens.length; f > e; e++) i.tweens[e].run(d); return g.notifyWith(a, [i, d, c]), 1 > d && f ? c : (g.resolveWith(a, [i]), !1) }, i = g.promise({ elem: a, props: _.extend({}, b), opts: _.extend(!0, { specialEasing: {} }, c), originalProperties: b, originalOptions: c, startTime: Wb || G(), duration: c.duration, tweens: [], createTween: function (b, c, d) { var e = _.Tween(a, i.opts, b, c, i.opts.specialEasing[b] || i.opts.easing); return i.tweens.push(e), e }, stop: function (b) { for (var c = 0, d = b ? i.tweens.length : 0; d > c; c++) i.tweens[c].run(1); return b ? g.resolveWith(a, [i, b]) : g.rejectWith(a, [i, b]), this } }), j = i.props; for (J(j, i.opts.specialEasing) ; f > e; e++) if (d = _b[e].call(i, a, j, i.opts)) return d; return H(i, j), _.isFunction(i.opts.start) && i.opts.start.call(a, i), _.fx.timer(_.extend(h, { anim: i, queue: i.opts.queue, elem: a })), i.progress(i.opts.progress).done(i.opts.done, i.opts.complete).fail(i.opts.fail).always(i.opts.always) } function J(a, b) { var c, d, e, f, g; for (c in a) if (d = _.camelCase(c), e = b[d], f = a[c], _.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = _.cssHooks[d], g && "expand" in g) { f = g.expand(f), delete a[d]; for (c in f) c in a || (a[c] = f[c], b[c] = e) } else b[d] = e } function K(a, b, c) { var d, e, f, g, h, i, j, k, l = this, m = a.style, n = {}, o = [], p = a.nodeType && s(a); c.queue || (j = _._queueHooks(a, "fx"), null == j.unqueued && (j.unqueued = 0, k = j.empty.fire, j.empty.fire = function () { j.unqueued || k() }), j.unqueued++, l.always(function () { l.always(function () { j.unqueued--, _.queue(a, "fx").length || j.empty.fire() }) })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [m.overflow, m.overflowX, m.overflowY], "inline" === _.css(a, "display") && "none" === _.css(a, "float") && (_.support.inlineBlockNeedsLayout && "inline" !== x(a.nodeName) ? m.zoom = 1 : m.display = "inline-block")), c.overflow && (m.overflow = "hidden", _.support.shrinkWrapBlocks || l.done(function () { m.overflow = c.overflow[0], m.overflowX = c.overflow[1], m.overflowY = c.overflow[2] })); for (d in b) if (f = b[d], Yb.exec(f)) { if (delete b[d], f === (p ? "hide" : "show")) continue; o.push(d) } if (g = o.length) for (h = _._data(a, "fxshow") || _._data(a, "fxshow", {}), p ? _(a).show() : l.done(function () { _(a).hide() }), l.done(function () { var b; _.removeData(a, "fxshow", !0); for (b in n) _.style(a, b, n[b]) }), d = 0; g > d; d++) e = o[d], i = l.createTween(e, p ? h[e] : 0), n[e] = h[e] || _.style(a, e), e in h || (h[e] = i.start, p && (i.end = i.start, i.start = "width" === e || "height" === e ? 1 : 0)) } function L(a, b, c, d, e) { return new L.prototype.init(a, b, c, d, e) } function M(a, b) { var c, d = { height: a }, e = 0; for (b = b ? 1 : 0; 4 > e; e += 2 - b) c = rb[e], d["margin" + c] = d["padding" + c] = a; return b && (d.opacity = d.width = a), d } function N(a) { return _.isWindow(a) ? a : 9 === a.nodeType ? a.defaultView || a.parentWindow : !1 } var O, P, Q = a.document, R = a.location, S = a.navigator, T = a.jQuery, U = a.$, V = Array.prototype.push, W = Array.prototype.slice, X = Array.prototype.indexOf, Y = Object.prototype.toString, Z = Object.prototype.hasOwnProperty, $ = String.prototype.trim, _ = function (a, b) { return new _.fn.init(a, b, O) }, aa = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source, ba = /\S/, ca = /\s+/, da = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ea = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, fa = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, ga = /^[\],:{}\s]*$/, ha = /(?:^|:|,)(?:\s*\[)+/g, ia = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g, ja = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g, ka = /^-ms-/, la = /-([\da-z])/gi, ma = function (a, b) { return (b + "").toUpperCase() }, na = function () { Q.addEventListener ? (Q.removeEventListener("DOMContentLoaded", na, !1), _.ready()) : "complete" === Q.readyState && (Q.detachEvent("onreadystatechange", na), _.ready()) }, oa = {}; _.fn = _.prototype = { constructor: _, init: function (a, c, d) { var e, f, g; if (!a) return this; if (a.nodeType) return this.context = this[0] = a, this.length = 1, this; if ("string" == typeof a) { if (e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : ea.exec(a), !e || !e[1] && c) return !c || c.jquery ? (c || d).find(a) : this.constructor(c).find(a); if (e[1]) return c = c instanceof _ ? c[0] : c, g = c && c.nodeType ? c.ownerDocument || c : Q, a = _.parseHTML(e[1], g, !0), fa.test(e[1]) && _.isPlainObject(c) && this.attr.call(a, c, !0), _.merge(this, a); if (f = Q.getElementById(e[2]), f && f.parentNode) { if (f.id !== e[2]) return d.find(a); this.length = 1, this[0] = f } return this.context = Q, this.selector = a, this } return _.isFunction(a) ? d.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), _.makeArray(a, this)) }, selector: "", jquery: "1.8.2", length: 0, size: function () { return this.length }, toArray: function () { return W.call(this) }, get: function (a) { return null == a ? this.toArray() : 0 > a ? this[this.length + a] : this[a] }, pushStack: function (a, b, c) { var d = _.merge(this.constructor(), a); return d.prevObject = this, d.context = this.context, "find" === b ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"), d }, each: function (a, b) { return _.each(this, a, b) }, ready: function (a) { return _.ready.promise().done(a), this }, eq: function (a) { return a = +a, -1 === a ? this.slice(a) : this.slice(a, a + 1) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, slice: function () { return this.pushStack(W.apply(this, arguments), "slice", W.call(arguments).join(",")) }, map: function (a) { return this.pushStack(_.map(this, function (b, c) { return a.call(b, c, b) })) }, end: function () { return this.prevObject || this.constructor(null) }, push: V, sort: [].sort, splice: [].splice }, _.fn.init.prototype = _.fn, _.extend = _.fn.extend = function () { var a, c, d, e, f, g, h = arguments[0] || {}, i = 1, j = arguments.length, k = !1; for ("boolean" == typeof h && (k = h, h = arguments[1] || {}, i = 2), "object" == typeof h || _.isFunction(h) || (h = {}), j === i && (h = this, --i) ; j > i; i++) if (null != (a = arguments[i])) for (c in a) d = h[c], e = a[c], h !== e && (k && e && (_.isPlainObject(e) || (f = _.isArray(e))) ? (f ? (f = !1, g = d && _.isArray(d) ? d : []) : g = d && _.isPlainObject(d) ? d : {}, h[c] = _.extend(k, g, e)) : e !== b && (h[c] = e)); return h }, _.extend({ noConflict: function (b) { return a.$ === _ && (a.$ = U), b && a.jQuery === _ && (a.jQuery = T), _ }, isReady: !1, readyWait: 1, holdReady: function (a) { a ? _.readyWait++ : _.ready(!0) }, ready: function (a) { if (a === !0 ? !--_.readyWait : !_.isReady) { if (!Q.body) return setTimeout(_.ready, 1); _.isReady = !0, a !== !0 && --_.readyWait > 0 || (P.resolveWith(Q, [_]), _.fn.trigger && _(Q).trigger("ready").off("ready")) } }, isFunction: function (a) { return "function" === _.type(a) }, isArray: Array.isArray || function (a) { return "array" === _.type(a) }, isWindow: function (a) { return null != a && a == a.window }, isNumeric: function (a) { return !isNaN(parseFloat(a)) && isFinite(a) }, type: function (a) { return null == a ? String(a) : oa[Y.call(a)] || "object" }, isPlainObject: function (a) { if (!a || "object" !== _.type(a) || a.nodeType || _.isWindow(a)) return !1; try { if (a.constructor && !Z.call(a, "constructor") && !Z.call(a.constructor.prototype, "isPrototypeOf")) return !1 } catch (c) { return !1 } var d; for (d in a); return d === b || Z.call(a, d) }, isEmptyObject: function (a) { var b; for (b in a) return !1; return !0 }, error: function (a) { throw new Error(a) }, parseHTML: function (a, b, c) { var d; return a && "string" == typeof a ? ("boolean" == typeof b && (c = b, b = 0), b = b || Q, (d = fa.exec(a)) ? [b.createElement(d[1])] : (d = _.buildFragment([a], b, c ? null : []), _.merge([], (d.cacheable ? _.clone(d.fragment) : d.fragment).childNodes))) : null }, parseJSON: function (b) { return b && "string" == typeof b ? (b = _.trim(b), a.JSON && a.JSON.parse ? a.JSON.parse(b) : ga.test(b.replace(ia, "@").replace(ja, "]").replace(ha, "")) ? new Function("return " + b)() : void _.error("Invalid JSON: " + b)) : null }, parseXML: function (c) { var d, e; if (!c || "string" != typeof c) return null; try { a.DOMParser ? (e = new DOMParser, d = e.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c)) } catch (f) { d = b } return d && d.documentElement && !d.getElementsByTagName("parsererror").length || _.error("Invalid XML: " + c), d }, noop: function () { }, globalEval: function (b) { b && ba.test(b) && (a.execScript || function (b) { a.eval.call(a, b) })(b) }, camelCase: function (a) { return a.replace(ka, "ms-").replace(la, ma) }, nodeName: function (a, b) { return a.nodeName && a.nodeName.toLowerCase() === b.toLowerCase() }, each: function (a, c, d) { var e, f = 0, g = a.length, h = g === b || _.isFunction(a); if (d) if (h) { for (e in a) if (c.apply(a[e], d) === !1) break } else for (; g > f && c.apply(a[f++], d) !== !1;); else if (h) { for (e in a) if (c.call(a[e], e, a[e]) === !1) break } else for (; g > f && c.call(a[f], f, a[f++]) !== !1;); return a }, trim: $ && !$.call("\ufeffÂ ") ? function (a) { return null == a ? "" : $.call(a) } : function (a) { return null == a ? "" : (a + "").replace(da, "") }, makeArray: function (a, b) { var c, d = b || []; return null != a && (c = _.type(a), null == a.length || "string" === c || "function" === c || "regexp" === c || _.isWindow(a) ? V.call(d, a) : _.merge(d, a)), d }, inArray: function (a, b, c) { var d; if (b) { if (X) return X.call(b, a, c); for (d = b.length, c = c ? 0 > c ? Math.max(0, d + c) : c : 0; d > c; c++) if (c in b && b[c] === a) return c } return -1 }, merge: function (a, c) { var d = c.length, e = a.length, f = 0; if ("number" == typeof d) for (; d > f; f++) a[e++] = c[f]; else for (; c[f] !== b;) a[e++] = c[f++]; return a.length = e, a }, grep: function (a, b, c) { var d, e = [], f = 0, g = a.length; for (c = !!c; g > f; f++) d = !!b(a[f], f), c !== d && e.push(a[f]); return e }, map: function (a, c, d) { var e, f, g = [], h = 0, i = a.length, j = a instanceof _ || i !== b && "number" == typeof i && (i > 0 && a[0] && a[i - 1] || 0 === i || _.isArray(a)); if (j) for (; i > h; h++) e = c(a[h], h, d), null != e && (g[g.length] = e); else for (f in a) e = c(a[f], f, d), null != e && (g[g.length] = e); return g.concat.apply([], g) }, guid: 1, proxy: function (a, c) { var d, e, f; return "string" == typeof c && (d = a[c], c = a, a = d), _.isFunction(a) ? (e = W.call(arguments, 2), f = function () { return a.apply(c, e.concat(W.call(arguments))) }, f.guid = a.guid = a.guid || _.guid++, f) : b }, access: function (a, c, d, e, f, g, h) { var i, j = null == d, k = 0, l = a.length; if (d && "object" == typeof d) { for (k in d) _.access(a, c, k, d[k], 1, g, e); f = 1 } else if (e !== b) { if (i = h === b && _.isFunction(e), j && (i ? (i = c, c = function (a, b, c) { return i.call(_(a), c) }) : (c.call(a, e), c = null)), c) for (; l > k; k++) c(a[k], d, i ? e.call(a[k], k, c(a[k], d)) : e, h); f = 1 } return f ? a : j ? c.call(a) : l ? c(a[0], d) : g }, now: function () { return (new Date).getTime() } }), _.ready.promise = function (b) { if (!P) if (P = _.Deferred(), "complete" === Q.readyState) setTimeout(_.ready, 1); else if (Q.addEventListener) Q.addEventListener("DOMContentLoaded", na, !1), a.addEventListener("load", _.ready, !1); else { Q.attachEvent("onreadystatechange", na), a.attachEvent("onload", _.ready); var c = !1; try { c = null == a.frameElement && Q.documentElement } catch (d) { } c && c.doScroll && !function e() { if (!_.isReady) { try { c.doScroll("left") } catch (a) { return setTimeout(e, 50) } _.ready() } }() } return P.promise(b) }, _.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (a, b) { oa["[object " + b + "]"] = b.toLowerCase() }), O = _(Q); var pa = {}; _.Callbacks = function (a) { a = "string" == typeof a ? pa[a] || c(a) : _.extend({}, a); var d, e, f, g, h, i, j = [], k = !a.once && [], l = function (b) { for (d = a.memory && b, e = !0, i = g || 0, g = 0, h = j.length, f = !0; j && h > i; i++) if (j[i].apply(b[0], b[1]) === !1 && a.stopOnFalse) { d = !1; break } f = !1, j && (k ? k.length && l(k.shift()) : d ? j = [] : m.disable()) }, m = { add: function () { if (j) { var b = j.length; !function c(b) { _.each(b, function (b, d) { var e = _.type(d); "function" !== e || a.unique && m.has(d) ? d && d.length && "string" !== e && c(d) : j.push(d) }) }(arguments), f ? h = j.length : d && (g = b, l(d)) } return this }, remove: function () { return j && _.each(arguments, function (a, b) { for (var c; (c = _.inArray(b, j, c)) > -1;) j.splice(c, 1), f && (h >= c && h--, i >= c && i--) }), this }, has: function (a) { return _.inArray(a, j) > -1 }, empty: function () { return j = [], this }, disable: function () { return j = k = d = b, this }, disabled: function () { return !j }, lock: function () { return k = b, d || m.disable(), this }, locked: function () { return !k }, fireWith: function (a, b) { return b = b || [], b = [a, b.slice ? b.slice() : b], !j || e && !k || (f ? k.push(b) : l(b)), this }, fire: function () { return m.fireWith(this, arguments), this }, fired: function () { return !!e } }; return m }, _.extend({ Deferred: function (a) { var b = [["resolve", "done", _.Callbacks("once memory"), "resolved"], ["reject", "fail", _.Callbacks("once memory"), "rejected"], ["notify", "progress", _.Callbacks("memory")]], c = "pending", d = { state: function () { return c }, always: function () { return e.done(arguments).fail(arguments), this }, then: function () { var a = arguments; return _.Deferred(function (c) { _.each(b, function (b, d) { var f = d[0], g = a[b]; e[d[1]](_.isFunction(g) ? function () { var a = g.apply(this, arguments); a && _.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f + "With"](this === e ? c : this, [a]) } : c[f]) }), a = null }).promise() }, promise: function (a) { return null != a ? _.extend(a, d) : d } }, e = {}; return d.pipe = d.then, _.each(b, function (a, f) { var g = f[2], h = f[3]; d[f[1]] = g.add, h && g.add(function () { c = h }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = g.fire, e[f[0] + "With"] = g.fireWith }), d.promise(e), a && a.call(e, e), e }, when: function (a) { var b, c, d, e = 0, f = W.call(arguments), g = f.length, h = 1 !== g || a && _.isFunction(a.promise) ? g : 0, i = 1 === h ? a : _.Deferred(), j = function (a, c, d) { return function (e) { c[a] = this, d[a] = arguments.length > 1 ? W.call(arguments) : e, d === b ? i.notifyWith(c, d) : --h || i.resolveWith(c, d) } }; if (g > 1) for (b = new Array(g), c = new Array(g), d = new Array(g) ; g > e; e++) f[e] && _.isFunction(f[e].promise) ? f[e].promise().done(j(e, d, f)).fail(i.reject).progress(j(e, c, b)) : --h; return h || i.resolveWith(d, f), i.promise() } }), _.support = function () { var b, c, d, e, f, g, h, i, j, k, l, m = Q.createElement("div"); if (m.setAttribute("className", "t"), m.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", c = m.getElementsByTagName("*"), d = m.getElementsByTagName("a")[0], d.style.cssText = "top:1px;float:left;opacity:.5", !c || !c.length) return {}; e = Q.createElement("select"), f = e.appendChild(Q.createElement("option")), g = m.getElementsByTagName("input")[0], b = { leadingWhitespace: 3 === m.firstChild.nodeType, tbody: !m.getElementsByTagName("tbody").length, htmlSerialize: !!m.getElementsByTagName("link").length, style: /top/.test(d.getAttribute("style")), hrefNormalized: "/a" === d.getAttribute("href"), opacity: /^0.5/.test(d.style.opacity), cssFloat: !!d.style.cssFloat, checkOn: "on" === g.value, optSelected: f.selected, getSetAttribute: "t" !== m.className, enctype: !!Q.createElement("form").enctype, html5Clone: "<:nav></:nav>" !== Q.createElement("nav").cloneNode(!0).outerHTML, boxModel: "CSS1Compat" === Q.compatMode, submitBubbles: !0, changeBubbles: !0, focusinBubbles: !1, deleteExpando: !0, noCloneEvent: !0, inlineBlockNeedsLayout: !1, shrinkWrapBlocks: !1, reliableMarginRight: !0, boxSizingReliable: !0, pixelPosition: !1 }, g.checked = !0, b.noCloneChecked = g.cloneNode(!0).checked, e.disabled = !0, b.optDisabled = !f.disabled; try { delete m.test } catch (n) { b.deleteExpando = !1 } if (!m.addEventListener && m.attachEvent && m.fireEvent && (m.attachEvent("onclick", l = function () { b.noCloneEvent = !1 }), m.cloneNode(!0).fireEvent("onclick"), m.detachEvent("onclick", l)), g = Q.createElement("input"), g.value = "t", g.setAttribute("type", "radio"), b.radioValue = "t" === g.value, g.setAttribute("checked", "checked"), g.setAttribute("name", "t"), m.appendChild(g), h = Q.createDocumentFragment(), h.appendChild(m.lastChild), b.checkClone = h.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = g.checked, h.removeChild(g), h.appendChild(m), m.attachEvent) for (j in { submit: !0, change: !0, focusin: !0 }) i = "on" + j, k = i in m, k || (m.setAttribute(i, "return;"), k = "function" == typeof m[i]), b[j + "Bubbles"] = k; return _(function () { var c, d, e, f, g = "padding:0;margin:0;border:0;display:block;overflow:hidden;", h = Q.getElementsByTagName("body")[0]; h && (c = Q.createElement("div"), c.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", h.insertBefore(c, h.firstChild), d = Q.createElement("div"), c.appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", e = d.getElementsByTagName("td"), e[0].style.cssText = "padding:0;margin:0;border:0;display:none", k = 0 === e[0].offsetHeight, e[0].style.display = "", e[1].style.display = "none", b.reliableHiddenOffsets = k && 0 === e[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", b.boxSizing = 4 === d.offsetWidth, b.doesNotIncludeMarginInBodyOffset = 1 !== h.offsetTop, a.getComputedStyle && (b.pixelPosition = "1%" !== (a.getComputedStyle(d, null) || {}).top, b.boxSizingReliable = "4px" === (a.getComputedStyle(d, null) || { width: "4px" }).width, f = Q.createElement("div"), f.style.cssText = d.style.cssText = g, f.style.marginRight = f.style.width = "0", d.style.width = "1px", d.appendChild(f), b.reliableMarginRight = !parseFloat((a.getComputedStyle(f, null) || {}).marginRight)), "undefined" != typeof d.style.zoom && (d.innerHTML = "", d.style.cssText = g + "width:1px;padding:1px;display:inline;zoom:1", b.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", b.shrinkWrapBlocks = 3 !== d.offsetWidth, c.style.zoom = 1), h.removeChild(c), c = d = e = f = null) }), h.removeChild(m), c = d = e = f = g = h = m = null, b }(); var qa = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/, ra = /([A-Z])/g; _.extend({ cache: {}, deletedIds: [], uuid: 0, expando: "jQuery" + (_.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { return a = a.nodeType ? _.cache[a[_.expando]] : a[_.expando], !!a && !e(a) }, data: function (a, c, d, e) { if (_.acceptData(a)) { var f, g, h = _.expando, i = "string" == typeof c, j = a.nodeType, k = j ? _.cache : a, l = j ? a[h] : a[h] && h; if (l && k[l] && (e || k[l].data) || !i || d !== b) return l || (j ? a[h] = l = _.deletedIds.pop() || _.guid++ : l = h), k[l] || (k[l] = {}, j || (k[l].toJSON = _.noop)), ("object" == typeof c || "function" == typeof c) && (e ? k[l] = _.extend(k[l], c) : k[l].data = _.extend(k[l].data, c)), f = k[l], e || (f.data || (f.data = {}), f = f.data), d !== b && (f[_.camelCase(c)] = d), i ? (g = f[c], null == g && (g = f[_.camelCase(c)])) : g = f, g } }, removeData: function (a, b, c) { if (_.acceptData(a)) { var d, f, g, h = a.nodeType, i = h ? _.cache : a, j = h ? a[_.expando] : _.expando; if (i[j]) { if (b && (d = c ? i[j] : i[j].data)) { _.isArray(b) || (b in d ? b = [b] : (b = _.camelCase(b), b = b in d ? [b] : b.split(" "))); for (f = 0, g = b.length; g > f; f++) delete d[b[f]]; if (!(c ? e : _.isEmptyObject)(d)) return } (c || (delete i[j].data, e(i[j]))) && (h ? _.cleanData([a], !0) : _.support.deleteExpando || i != i.window ? delete i[j] : i[j] = null) } } }, _data: function (a, b, c) { return _.data(a, b, c, !0) }, acceptData: function (a) { var b = a.nodeName && _.noData[a.nodeName.toLowerCase()]; return !b || b !== !0 && a.getAttribute("classid") === b } }), _.fn.extend({ data: function (a, c) { var e, f, g, h, i, j = this[0], k = 0, l = null; if (a === b) { if (this.length && (l = _.data(j), 1 === j.nodeType && !_._data(j, "parsedAttrs"))) { for (g = j.attributes, i = g.length; i > k; k++) h = g[k].name, h.indexOf("data-") || (h = _.camelCase(h.substring(5)), d(j, h, l[h])); _._data(j, "parsedAttrs", !0) } return l } return "object" == typeof a ? this.each(function () { _.data(this, a) }) : (e = a.split(".", 2), e[1] = e[1] ? "." + e[1] : "", f = e[1] + "!", _.access(this, function (c) { return c === b ? (l = this.triggerHandler("getData" + f, [e[0]]), l === b && j && (l = _.data(j, a), l = d(j, a, l)), l === b && e[1] ? this.data(e[0]) : l) : (e[1] = c, void this.each(function () { var b = _(this); b.triggerHandler("setData" + f, e), _.data(this, a, c), b.triggerHandler("changeData" + f, e) })) }, null, c, arguments.length > 1, null, !1)) }, removeData: function (a) { return this.each(function () { _.removeData(this, a) }) } }), _.extend({ queue: function (a, b, c) { var d; return a ? (b = (b || "fx") + "queue", d = _._data(a, b), c && (!d || _.isArray(c) ? d = _._data(a, b, _.makeArray(c)) : d.push(c)), d || []) : void 0 }, dequeue: function (a, b) { b = b || "fx"; var c = _.queue(a, b), d = c.length, e = c.shift(), f = _._queueHooks(a, b), g = function () { _.dequeue(a, b) }; "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire() }, _queueHooks: function (a, b) { var c = b + "queueHooks"; return _._data(a, c) || _._data(a, c, { empty: _.Callbacks("once memory").add(function () { _.removeData(a, b + "queue", !0), _.removeData(a, c, !0) }) }) } }), _.fn.extend({ queue: function (a, c) { var d = 2; return "string" != typeof a && (c = a, a = "fx", d--), arguments.length < d ? _.queue(this[0], a) : c === b ? this : this.each(function () { var b = _.queue(this, a, c); _._queueHooks(this, a), "fx" === a && "inprogress" !== b[0] && _.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { _.dequeue(this, a) }) }, delay: function (a, b) { return a = _.fx ? _.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { var d, e = 1, f = _.Deferred(), g = this, h = this.length, i = function () { --e || f.resolveWith(g, [g]) }; for ("string" != typeof a && (c = a, a = b), a = a || "fx"; h--;) d = _._data(g[h], a + "queueHooks"), d && d.empty && (e++, d.empty.add(i)); return i(), f.promise(c) } }); var sa, ta, ua, va = /[\t\r\n]/g, wa = /\r/g, xa = /^(?:button|input)$/i, ya = /^(?:button|input|object|select|textarea)$/i, za = /^a(?:rea|)$/i, Aa = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, Ba = _.support.getSetAttribute; _.fn.extend({
			attr: function (a, b) { return _.access(this, _.attr, a, b, arguments.length > 1) }, removeAttr: function (a) { return this.each(function () { _.removeAttr(this, a) }) }, prop: function (a, b) { return _.access(this, _.prop, a, b, arguments.length > 1) }, removeProp: function (a) { return a = _.propFix[a] || a, this.each(function () { try { this[a] = b, delete this[a] } catch (c) { } }) }, addClass: function (a) { var b, c, d, e, f, g, h; if (_.isFunction(a)) return this.each(function (b) { _(this).addClass(a.call(this, b, this.className)) }); if (a && "string" == typeof a) for (b = a.split(ca), c = 0, d = this.length; d > c; c++) if (e = this[c], 1 === e.nodeType) if (e.className || 1 !== b.length) { for (f = " " + e.className + " ", g = 0, h = b.length; h > g; g++) f.indexOf(" " + b[g] + " ") < 0 && (f += b[g] + " "); e.className = _.trim(f) } else e.className = a; return this }, removeClass: function (a) { var c, d, e, f, g, h, i; if (_.isFunction(a)) return this.each(function (b) { _(this).removeClass(a.call(this, b, this.className)) }); if (a && "string" == typeof a || a === b) for (c = (a || "").split(ca), h = 0, i = this.length; i > h; h++) if (e = this[h], 1 === e.nodeType && e.className) { for (d = (" " + e.className + " ").replace(va, " "), f = 0, g = c.length; g > f; f++) for (; d.indexOf(" " + c[f] + " ") >= 0;) d = d.replace(" " + c[f] + " ", " "); e.className = a ? _.trim(d) : "" } return this }, toggleClass: function (a, b) { var c = typeof a, d = "boolean" == typeof b; return _.isFunction(a) ? this.each(function (c) { _(this).toggleClass(a.call(this, c, this.className, b), b) }) : this.each(function () { if ("string" === c) for (var e, f = 0, g = _(this), h = b, i = a.split(ca) ; e = i[f++];) h = d ? h : !g.hasClass(e), g[h ? "addClass" : "removeClass"](e); else ("undefined" === c || "boolean" === c) && (this.className && _._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : _._data(this, "__className__") || "") }) }, hasClass: function (a) { for (var b = " " + a + " ", c = 0, d = this.length; d > c; c++) if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(va, " ").indexOf(b) >= 0) return !0; return !1 }, val: function (a) {
				var c, d, e, f = this[0]; {
					if (arguments.length) return e = _.isFunction(a), this.each(function (d) {
						var f, g = _(this); 1 === this.nodeType && (f = e ? a.call(this, d, g.val()) : a, null == f ? f = "" : "number" == typeof f ? f += "" : _.isArray(f) && (f = _.map(f, function (a) {
							return null == a ? "" : a + ""
						})), c = _.valHooks[this.type] || _.valHooks[this.nodeName.toLowerCase()], c && "set" in c && c.set(this, f, "value") !== b || (this.value = f))
					}); if (f) return c = _.valHooks[f.type] || _.valHooks[f.nodeName.toLowerCase()], c && "get" in c && (d = c.get(f, "value")) !== b ? d : (d = f.value, "string" == typeof d ? d.replace(wa, "") : null == d ? "" : d)
				}
			}
		}), _.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: { get: function (a) { var b, c, d, e, f = a.selectedIndex, g = [], h = a.options, i = "select-one" === a.type; if (0 > f) return null; for (c = i ? f : 0, d = i ? f + 1 : h.length; d > c; c++) if (e = h[c], e.selected && (_.support.optDisabled ? !e.disabled : null === e.getAttribute("disabled")) && (!e.parentNode.disabled || !_.nodeName(e.parentNode, "optgroup"))) { if (b = _(e).val(), i) return b; g.push(b) } return i && !g.length && h.length ? _(h[f]).val() : g }, set: function (a, b) { var c = _.makeArray(b); return _(a).find("option").each(function () { this.selected = _.inArray(_(this).val(), c) >= 0 }), c.length || (a.selectedIndex = -1), c } } }, attrFn: {}, attr: function (a, c, d, e) { var f, g, h, i = a.nodeType; if (a && 3 !== i && 8 !== i && 2 !== i) return e && _.isFunction(_.fn[c]) ? _(a)[c](d) : "undefined" == typeof a.getAttribute ? _.prop(a, c, d) : (h = 1 !== i || !_.isXMLDoc(a), h && (c = c.toLowerCase(), g = _.attrHooks[c] || (Aa.test(c) ? ta : sa)), d !== b ? null === d ? void _.removeAttr(a, c) : g && "set" in g && h && (f = g.set(a, d, c)) !== b ? f : (a.setAttribute(c, d + ""), d) : g && "get" in g && h && null !== (f = g.get(a, c)) ? f : (f = a.getAttribute(c), null === f ? b : f)) }, removeAttr: function (a, b) { var c, d, e, f, g = 0; if (b && 1 === a.nodeType) for (d = b.split(ca) ; g < d.length; g++) e = d[g], e && (c = _.propFix[e] || e, f = Aa.test(e), f || _.attr(a, e, ""), a.removeAttribute(Ba ? e : c), f && c in a && (a[c] = !1)) }, attrHooks: { type: { set: function (a, b) { if (xa.test(a.nodeName) && a.parentNode) _.error("type property can't be changed"); else if (!_.support.radioValue && "radio" === b && _.nodeName(a, "input")) { var c = a.value; return a.setAttribute("type", b), c && (a.value = c), b } } }, value: { get: function (a, b) { return sa && _.nodeName(a, "button") ? sa.get(a, b) : b in a ? a.value : null }, set: function (a, b, c) { return sa && _.nodeName(a, "button") ? sa.set(a, b, c) : void (a.value = b) } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, f, g, h = a.nodeType; if (a && 3 !== h && 8 !== h && 2 !== h) return g = 1 !== h || !_.isXMLDoc(a), g && (c = _.propFix[c] || c, f = _.propHooks[c]), d !== b ? f && "set" in f && (e = f.set(a, d, c)) !== b ? e : a[c] = d : f && "get" in f && null !== (e = f.get(a, c)) ? e : a[c] }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : ya.test(a.nodeName) || za.test(a.nodeName) && a.href ? 0 : b } } } }), ta = { get: function (a, c) { var d, e = _.prop(a, c); return e === !0 || "boolean" != typeof e && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b }, set: function (a, b, c) { var d; return b === !1 ? _.removeAttr(a, c) : (d = _.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())), c } }, Ba || (ua = { name: !0, id: !0, coords: !0 }, sa = _.valHooks.button = { get: function (a, c) { var d; return d = a.getAttributeNode(c), d && (ua[c] ? "" !== d.value : d.specified) ? d.value : b }, set: function (a, b, c) { var d = a.getAttributeNode(c); return d || (d = Q.createAttribute(c), a.setAttributeNode(d)), d.value = b + "" } }, _.each(["width", "height"], function (a, b) { _.attrHooks[b] = _.extend(_.attrHooks[b], { set: function (a, c) { return "" === c ? (a.setAttribute(b, "auto"), c) : void 0 } }) }), _.attrHooks.contenteditable = { get: sa.get, set: function (a, b, c) { "" === b && (b = "false"), sa.set(a, b, c) } }), _.support.hrefNormalized || _.each(["href", "src", "width", "height"], function (a, c) { _.attrHooks[c] = _.extend(_.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return null === d ? b : d } }) }), _.support.style || (_.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b }, set: function (a, b) { return a.style.cssText = b + "" } }), _.support.optSelected || (_.propHooks.selected = _.extend(_.propHooks.selected, { get: function (a) { var b = a.parentNode; return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null } })), _.support.enctype || (_.propFix.enctype = "encoding"), _.support.checkOn || _.each(["radio", "checkbox"], function () { _.valHooks[this] = { get: function (a) { return null === a.getAttribute("value") ? "on" : a.value } } }), _.each(["radio", "checkbox"], function () { _.valHooks[this] = _.extend(_.valHooks[this], { set: function (a, b) { return _.isArray(b) ? a.checked = _.inArray(_(a).val(), b) >= 0 : void 0 } }) }); var Ca = /^(?:textarea|input|select)$/i, Da = /^([^\.]*|)(?:\.(.+)|)$/, Ea = /(?:^|\s)hover(\.\S+|)\b/, Fa = /^key/, Ga = /^(?:mouse|contextmenu)|click/, Ha = /^(?:focusinfocus|focusoutblur)$/, Ia = function (a) { return _.event.special.hover ? a : a.replace(Ea, "mouseenter$1 mouseleave$1") }; _.event = { add: function (a, c, d, e, f) { var g, h, i, j, k, l, m, n, o, p, q; if (3 !== a.nodeType && 8 !== a.nodeType && c && d && (g = _._data(a))) { for (d.handler && (o = d, d = o.handler, f = o.selector), d.guid || (d.guid = _.guid++), i = g.events, i || (g.events = i = {}), h = g.handle, h || (g.handle = h = function (a) { return "undefined" == typeof _ || a && _.event.triggered === a.type ? b : _.event.dispatch.apply(h.elem, arguments) }, h.elem = a), c = _.trim(Ia(c)).split(" "), j = 0; j < c.length; j++) k = Da.exec(c[j]) || [], l = k[1], m = (k[2] || "").split(".").sort(), q = _.event.special[l] || {}, l = (f ? q.delegateType : q.bindType) || l, q = _.event.special[l] || {}, n = _.extend({ type: l, origType: k[1], data: e, handler: d, guid: d.guid, selector: f, needsContext: f && _.expr.match.needsContext.test(f), namespace: m.join(".") }, o), p = i[l], p || (p = i[l] = [], p.delegateCount = 0, q.setup && q.setup.call(a, e, m, h) !== !1 || (a.addEventListener ? a.addEventListener(l, h, !1) : a.attachEvent && a.attachEvent("on" + l, h))), q.add && (q.add.call(a, n), n.handler.guid || (n.handler.guid = d.guid)), f ? p.splice(p.delegateCount++, 0, n) : p.push(n), _.event.global[l] = !0; a = null } }, global: {}, remove: function (a, b, c, d, e) { var f, g, h, i, j, k, l, m, n, o, p, q = _.hasData(a) && _._data(a); if (q && (m = q.events)) { for (b = _.trim(Ia(b || "")).split(" "), f = 0; f < b.length; f++) if (g = Da.exec(b[f]) || [], h = i = g[1], j = g[2], h) { for (n = _.event.special[h] || {}, h = (d ? n.delegateType : n.bindType) || h, o = m[h] || [], k = o.length, j = j ? new RegExp("(^|\\.)" + j.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = 0; l < o.length; l++) p = o[l], !e && i !== p.origType || c && c.guid !== p.guid || j && !j.test(p.namespace) || d && d !== p.selector && ("**" !== d || !p.selector) || (o.splice(l--, 1), p.selector && o.delegateCount--, n.remove && n.remove.call(a, p)); 0 === o.length && k !== o.length && (n.teardown && n.teardown.call(a, j, q.handle) !== !1 || _.removeEvent(a, h, q.handle), delete m[h]) } else for (h in m) _.event.remove(a, h + b[f], c, d, !0); _.isEmptyObject(m) && (delete q.handle, _.removeData(a, "events", !0)) } }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, e, f) { if (!e || 3 !== e.nodeType && 8 !== e.nodeType) { var g, h, i, j, k, l, m, n, o, p, q = c.type || c, r = []; if (!Ha.test(q + _.event.triggered) && (q.indexOf("!") >= 0 && (q = q.slice(0, -1), h = !0), q.indexOf(".") >= 0 && (r = q.split("."), q = r.shift(), r.sort()), e && !_.event.customEvent[q] || _.event.global[q])) if (c = "object" == typeof c ? c[_.expando] ? c : new _.Event(q, c) : new _.Event(q), c.type = q, c.isTrigger = !0, c.exclusive = h, c.namespace = r.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = q.indexOf(":") < 0 ? "on" + q : "", e) { if (c.result = b, c.target || (c.target = e), d = null != d ? _.makeArray(d) : [], d.unshift(c), m = _.event.special[q] || {}, !m.trigger || m.trigger.apply(e, d) !== !1) { if (o = [[e, m.bindType || q]], !f && !m.noBubble && !_.isWindow(e)) { for (p = m.delegateType || q, j = Ha.test(p + q) ? e : e.parentNode, k = e; j; j = j.parentNode) o.push([j, p]), k = j; k === (e.ownerDocument || Q) && o.push([k.defaultView || k.parentWindow || a, p]) } for (i = 0; i < o.length && !c.isPropagationStopped() ; i++) j = o[i][0], c.type = o[i][1], n = (_._data(j, "events") || {})[c.type] && _._data(j, "handle"), n && n.apply(j, d), n = l && j[l], n && _.acceptData(j) && n.apply && n.apply(j, d) === !1 && c.preventDefault(); return c.type = q, f || c.isDefaultPrevented() || m._default && m._default.apply(e.ownerDocument, d) !== !1 || "click" === q && _.nodeName(e, "a") || !_.acceptData(e) || l && e[q] && ("focus" !== q && "blur" !== q || 0 !== c.target.offsetWidth) && !_.isWindow(e) && (k = e[l], k && (e[l] = null), _.event.triggered = q, e[q](), _.event.triggered = b, k && (e[l] = k)), c.result } } else { g = _.cache; for (i in g) g[i].events && g[i].events[q] && _.event.trigger(c, d, g[i].handle.elem, !0) } } }, dispatch: function (c) { c = _.event.fix(c || a.event); var d, e, f, g, h, i, j, k, l, m = (_._data(this, "events") || {})[c.type] || [], n = m.delegateCount, o = W.call(arguments), p = !c.exclusive && !c.namespace, q = _.event.special[c.type] || {}, r = []; if (o[0] = c, c.delegateTarget = this, !q.preDispatch || q.preDispatch.call(this, c) !== !1) { if (n && (!c.button || "click" !== c.type)) for (f = c.target; f != this; f = f.parentNode || this) if (f.disabled !== !0 || "click" !== c.type) { for (h = {}, j = [], d = 0; n > d; d++) k = m[d], l = k.selector, h[l] === b && (h[l] = k.needsContext ? _(l, this).index(f) >= 0 : _.find(l, this, null, [f]).length), h[l] && j.push(k); j.length && r.push({ elem: f, matches: j }) } for (m.length > n && r.push({ elem: this, matches: m.slice(n) }), d = 0; d < r.length && !c.isPropagationStopped() ; d++) for (i = r[d], c.currentTarget = i.elem, e = 0; e < i.matches.length && !c.isImmediatePropagationStopped() ; e++) k = i.matches[e], (p || !c.namespace && !k.namespace || c.namespace_re && c.namespace_re.test(k.namespace)) && (c.data = k.data, c.handleObj = k, g = ((_.event.special[k.origType] || {}).handle || k.handler).apply(i.elem, o), g !== b && (c.result = g, g === !1 && (c.preventDefault(), c.stopPropagation()))); return q.postDispatch && q.postDispatch.call(this, c), c.result } }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, c) { var d, e, f, g = c.button, h = c.fromElement; return null == a.pageX && null != c.clientX && (d = a.target.ownerDocument || Q, e = d.documentElement, f = d.body, a.pageX = c.clientX + (e && e.scrollLeft || f && f.scrollLeft || 0) - (e && e.clientLeft || f && f.clientLeft || 0), a.pageY = c.clientY + (e && e.scrollTop || f && f.scrollTop || 0) - (e && e.clientTop || f && f.clientTop || 0)), !a.relatedTarget && h && (a.relatedTarget = h === a.target ? c.toElement : h), a.which || g === b || (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0), a } }, fix: function (a) { if (a[_.expando]) return a; var b, c, d = a, e = _.event.fixHooks[a.type] || {}, f = e.props ? this.props.concat(e.props) : this.props; for (a = _.Event(d), b = f.length; b;) c = f[--b], a[c] = d[c]; return a.target || (a.target = d.srcElement || Q), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, e.filter ? e.filter(a, d) : a }, special: { load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { _.isWindow(this) && (this.onbeforeunload = c) }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null) } } }, simulate: function (a, b, c, d) { var e = _.extend(new _.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? _.event.trigger(e, null, b) : _.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, _.event.handle = _.event.dispatch, _.removeEvent = Q.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { var d = "on" + b; a.detachEvent && ("undefined" == typeof a[d] && (a[d] = null), a.detachEvent(d, c)) }, _.Event = function (a, b) { return this instanceof _.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? g : f) : this.type = a, b && _.extend(this, b), this.timeStamp = a && a.timeStamp || _.now(), void (this[_.expando] = !0)) : new _.Event(a, b) }, _.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = g; var a = this.originalEvent; a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { this.isPropagationStopped = g; var a = this.originalEvent; a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = g, this.stopPropagation() }, isDefaultPrevented: f, isPropagationStopped: f, isImmediatePropagationStopped: f }, _.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { _.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c, d = this, e = a.relatedTarget, f = a.handleObj; f.selector; return (!e || e !== d && !_.contains(d, e)) && (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c } } }), _.support.submitBubbles || (_.event.special.submit = { setup: function () { return _.nodeName(this, "form") ? !1 : void _.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = _.nodeName(c, "input") || _.nodeName(c, "button") ? c.form : b; d && !_._data(d, "_submit_attached") && (_.event.add(d, "submit._submit", function (a) { a._submit_bubble = !0 }), _._data(d, "_submit_attached", !0)) }) }, postDispatch: function (a) { a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && _.event.simulate("submit", this.parentNode, a, !0)) }, teardown: function () { return _.nodeName(this, "form") ? !1 : void _.event.remove(this, "._submit") } }), _.support.changeBubbles || (_.event.special.change = { setup: function () { return Ca.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (_.event.add(this, "propertychange._change", function (a) { "checked" === a.originalEvent.propertyName && (this._just_changed = !0) }), _.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1), _.event.simulate("change", this, a, !0) })), !1) : void _.event.add(this, "beforeactivate._change", function (a) { var b = a.target; Ca.test(b.nodeName) && !_._data(b, "_change_attached") && (_.event.add(b, "change._change", function (a) { !this.parentNode || a.isSimulated || a.isTrigger || _.event.simulate("change", this.parentNode, a, !0) }), _._data(b, "_change_attached", !0)) }) }, handle: function (a) { var b = a.target; return this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type ? a.handleObj.handler.apply(this, arguments) : void 0 }, teardown: function () { return _.event.remove(this, "._change"), !Ca.test(this.nodeName) } }), _.support.focusinBubbles || _.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var c = 0, d = function (a) { _.event.simulate(b, a.target, _.event.fix(a), !0) }; _.event.special[b] = { setup: function () { 0 === c++ && Q.addEventListener(a, d, !0) }, teardown: function () { 0 === --c && Q.removeEventListener(a, d, !0) } } }), _.fn.extend({ on: function (a, c, d, e, g) { var h, i; if ("object" == typeof a) { "string" != typeof c && (d = d || c, c = b); for (i in a) this.on(i, c, d, a[i], g); return this } if (null == d && null == e ? (e = c, d = c = b) : null == e && ("string" == typeof c ? (e = d, d = b) : (e = d, d = c, c = b)), e === !1) e = f; else if (!e) return this; return 1 === g && (h = e, e = function (a) { return _().off(a), h.apply(this, arguments) }, e.guid = h.guid || (h.guid = _.guid++)), this.each(function () { _.event.add(this, a, e, d, c) }) }, one: function (a, b, c, d) { return this.on(a, b, c, d, 1) }, off: function (a, c, d) { var e, g; if (a && a.preventDefault && a.handleObj) return e = a.handleObj, _(a.delegateTarget).off(e.namespace ? e.origType + "." + e.namespace : e.origType, e.selector, e.handler), this; if ("object" == typeof a) { for (g in a) this.off(g, c, a[g]); return this } return (c === !1 || "function" == typeof c) && (d = c, c = b), d === !1 && (d = f), this.each(function () { _.event.remove(this, a, d, c) }) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, live: function (a, b, c) { return _(this.context).on(a, this.selector, b, c), this }, die: function (a, b) { return _(this.context).off(a, this.selector || "**", b), this }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return 1 === arguments.length ? this.off(a, "**") : this.off(b, a || "**", c) }, trigger: function (a, b) { return this.each(function () { _.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { return this[0] ? _.event.trigger(a, b, this[0], !0) : void 0 }, toggle: function (a) { var b = arguments, c = a.guid || _.guid++, d = 0, e = function (c) { var e = (_._data(this, "lastToggle" + a.guid) || 0) % d; return _._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(), b[e].apply(this, arguments) || !1 }; for (e.guid = c; d < b.length;) b[d++].guid = c; return this.click(e) }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) } }), _.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { _.fn[b] = function (a, c) { return null == c && (c = a, a = null), arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) }, Fa.test(b) && (_.event.fixHooks[b] = _.event.keyHooks), Ga.test(b) && (_.event.fixHooks[b] = _.event.mouseHooks) }), function (a, b) {
			function c(a, b, c, d) { c = c || [], b = b || F; var e, f, g, h, i = b.nodeType; if (!a || "string" != typeof a) return c; if (1 !== i && 9 !== i) return []; if (g = v(b), !g && !d && (e = ca.exec(a))) if (h = e[1]) { if (9 === i) { if (f = b.getElementById(h), !f || !f.parentNode) return c; if (f.id === h) return c.push(f), c } else if (b.ownerDocument && (f = b.ownerDocument.getElementById(h)) && w(b, f) && f.id === h) return c.push(f), c } else { if (e[2]) return K.apply(c, L.call(b.getElementsByTagName(a), 0)), c; if ((h = e[3]) && ma && b.getElementsByClassName) return K.apply(c, L.call(b.getElementsByClassName(h), 0)), c } return p(a.replace(Z, "$1"), b, c, d, g) } function d(a) { return function (b) { var c = b.nodeName.toLowerCase(); return "input" === c && b.type === a } } function e(a) { return function (b) { var c = b.nodeName.toLowerCase(); return ("input" === c || "button" === c) && b.type === a } } function f(a) { return N(function (b) { return b = +b, N(function (c, d) { for (var e, f = a([], c.length, b), g = f.length; g--;) c[e = f[g]] && (c[e] = !(d[e] = c[e])) }) }) } function g(a, b, c) { if (a === b) return c; for (var d = a.nextSibling; d;) { if (d === b) return -1; d = d.nextSibling } return 1 } function h(a, b) { var d, e, f, g, h, i, j, k = Q[D][a]; if (k) return b ? 0 : k.slice(0); for (h = a, i = [], j = t.preFilter; h;) { (!d || (e = $.exec(h))) && (e && (h = h.slice(e[0].length)), i.push(f = [])), d = !1, (e = aa.exec(h)) && (f.push(d = new E(e.shift())), h = h.slice(d.length), d.type = e[0].replace(Z, " ")); for (g in t.filter) !(e = ha[g].exec(h)) || j[g] && !(e = j[g](e, F, !0)) || (f.push(d = new E(e.shift())), h = h.slice(d.length), d.type = g, d.matches = e); if (!d) break } return b ? h.length : h ? c.error(a) : Q(a, i).slice(0) } function i(a, b, c) { var d = b.dir, e = c && "parentNode" === b.dir, f = I++; return b.first ? function (b, c, f) { for (; b = b[d];) if (e || 1 === b.nodeType) return a(b, c, f) } : function (b, c, g) { if (g) { for (; b = b[d];) if ((e || 1 === b.nodeType) && a(b, c, g)) return b } else for (var h, i = H + " " + f + " ", j = i + r; b = b[d];) if (e || 1 === b.nodeType) { if ((h = b[D]) === j) return b.sizset; if ("string" == typeof h && 0 === h.indexOf(i)) { if (b.sizset) return b } else { if (b[D] = j, a(b, c, g)) return b.sizset = !0, b; b.sizset = !1 } } } } function j(a) { return a.length > 1 ? function (b, c, d) { for (var e = a.length; e--;) if (!a[e](b, c, d)) return !1; return !0 } : a[0] } function k(a, b, c, d, e) { for (var f, g = [], h = 0, i = a.length, j = null != b; i > h; h++) (f = a[h]) && (!c || c(f, d, e)) && (g.push(f), j && b.push(h)); return g } function l(a, b, c, d, e, f) { return d && !d[D] && (d = l(d)), e && !e[D] && (e = l(e, f)), N(function (f, g, h, i) { if (!f || !e) { var j, l, m, n = [], p = [], q = g.length, r = f || o(b || "*", h.nodeType ? [h] : h, [], f), s = !a || !f && b ? r : k(r, n, a, h, i), t = c ? e || (f ? a : q || d) ? [] : g : s; if (c && c(s, t, h, i), d) for (m = k(t, p), d(m, [], h, i), j = m.length; j--;) (l = m[j]) && (t[p[j]] = !(s[p[j]] = l)); if (f) for (j = a && t.length; j--;) (l = t[j]) && (f[n[j]] = !(g[n[j]] = l)); else t = k(t === g ? t.splice(q, t.length) : t), e ? e(null, g, t, i) : K.apply(g, t) } }) } function m(a) { for (var b, c, d, e = a.length, f = t.relative[a[0].type], g = f || t.relative[" "], h = f ? 1 : 0, k = i(function (a) { return a === b }, g, !0), n = i(function (a) { return M.call(b, a) > -1 }, g, !0), o = [function (a, c, d) { return !f && (d || c !== A) || ((b = c).nodeType ? k(a, c, d) : n(a, c, d)) }]; e > h; h++) if (c = t.relative[a[h].type]) o = [i(j(o), c)]; else { if (c = t.filter[a[h].type].apply(null, a[h].matches), c[D]) { for (d = ++h; e > d && !t.relative[a[d].type]; d++); return l(h > 1 && j(o), h > 1 && a.slice(0, h - 1).join("").replace(Z, "$1"), c, d > h && m(a.slice(h, d)), e > d && m(a = a.slice(d)), e > d && a.join("")) } o.push(c) } return j(o) } function n(a, b) { var d = b.length > 0, e = a.length > 0, f = function (g, h, i, j, l) { var m, n, o, p = [], q = 0, s = "0", u = g && [], v = null != l, w = A, x = g || e && t.find.TAG("*", l && h.parentNode || h), y = H += null == w ? 1 : Math.E; for (v && (A = h !== F && h, r = f.el) ; null != (m = x[s]) ; s++) { if (e && m) { for (n = 0; o = a[n]; n++) if (o(m, h, i)) { j.push(m); break } v && (H = y, r = ++f.el) } d && ((m = !o && m) && q--, g && u.push(m)) } if (q += s, d && s !== q) { for (n = 0; o = b[n]; n++) o(u, p, h, i); if (g) { if (q > 0) for (; s--;) u[s] || p[s] || (p[s] = J.call(j)); p = k(p) } K.apply(j, p), v && !g && p.length > 0 && q + b.length > 1 && c.uniqueSort(j) } return v && (H = y, A = w), u }; return f.el = 0, d ? N(f) : f } function o(a, b, d, e) { for (var f = 0, g = b.length; g > f; f++) c(a, b[f], d, e); return d } function p(a, b, c, d, e) { var f, g, i, j, k, l = h(a); l.length; if (!d && 1 === l.length) { if (g = l[0] = l[0].slice(0), g.length > 2 && "ID" === (i = g[0]).type && 9 === b.nodeType && !e && t.relative[g[1].type]) { if (b = t.find.ID(i.matches[0].replace(ga, ""), b, e)[0], !b) return c; a = a.slice(g.shift().length) } for (f = ha.POS.test(a) ? -1 : g.length - 1; f >= 0 && (i = g[f], !t.relative[j = i.type]) ; f--) if ((k = t.find[j]) && (d = k(i.matches[0].replace(ga, ""), da.test(g[0].type) && b.parentNode || b, e))) { if (g.splice(f, 1), a = d.length && g.join(""), !a) return K.apply(c, L.call(d, 0)), c; break } } return x(a, l)(d, b, e, c, da.test(a)), c } function q() { } var r, s, t, u, v, w, x, y, z, A, B = !0, C = "undefined", D = ("sizcache" + Math.random()).replace(".", ""), E = String, F = a.document, G = F.documentElement, H = 0, I = 0, J = [].pop, K = [].push, L = [].slice, M = [].indexOf || function (a) { for (var b = 0, c = this.length; c > b; b++) if (this[b] === a) return b; return -1 }, N = function (a, b) { return a[D] = null == b || b, a }, O = function () { var a = {}, b = []; return N(function (c, d) { return b.push(c) > t.cacheLength && delete a[b.shift()], a[c] = d }, a) }, P = O(), Q = O(), R = O(), S = "[\\x20\\t\\r\\n\\f]", T = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+", U = T.replace("w", "w#"), V = "([*^$|!~]?=)", W = "\\[" + S + "*(" + T + ")" + S + "*(?:" + V + S + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + U + ")|)|)" + S + "*\\]", X = ":(" + T + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + W + ")|[^:]|\\\\.)*|.*))\\)|)", Y = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + S + "*((?:-\\d)?\\d*)" + S + "*\\)|)(?=[^-]|$)", Z = new RegExp("^" + S + "+|((?:^|[^\\\\])(?:\\\\.)*)" + S + "+$", "g"), $ = new RegExp("^" + S + "*," + S + "*"), aa = new RegExp("^" + S + "*([\\x20\\t\\r\\n\\f>+~])" + S + "*"), ba = new RegExp(X), ca = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, da = /[\x20\t\r\n\f]*[+~]/, ea = /h\d/i, fa = /input|select|textarea|button/i, ga = /\\(?!\\)/g, ha = { ID: new RegExp("^#(" + T + ")"), CLASS: new RegExp("^\\.(" + T + ")"), NAME: new RegExp("^\\[name=['\"]?(" + T + ")['\"]?\\]"), TAG: new RegExp("^(" + T.replace("w", "w*") + ")"), ATTR: new RegExp("^" + W), PSEUDO: new RegExp("^" + X), POS: new RegExp(Y, "i"), CHILD: new RegExp("^:(only|nth|first|last)-child(?:\\(" + S + "*(even|odd|(([+-]|)(\\d*)n|)" + S + "*(?:([+-]|)" + S + "*(\\d+)|))" + S + "*\\)|)", "i"), needsContext: new RegExp("^" + S + "*[>+~]|" + Y, "i") }, ia = function (a) { var b = F.createElement("div"); try { return a(b) } catch (c) { return !1 } finally { b = null } }, ja = ia(function (a) { return a.appendChild(F.createComment("")), !a.getElementsByTagName("*").length }), ka = ia(function (a) { return a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute !== C && "#" === a.firstChild.getAttribute("href") }), la = ia(function (a) { a.innerHTML = "<select></select>"; var b = typeof a.lastChild.getAttribute("multiple"); return "boolean" !== b && "string" !== b }), ma = ia(function (a) { return a.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", a.getElementsByClassName && a.getElementsByClassName("e").length ? (a.lastChild.className = "e", 2 === a.getElementsByClassName("e").length) : !1 }), na = ia(function (a) { a.id = D + 0, a.innerHTML = "<a name='" + D + "'></a><div name='" + D + "'></div>", G.insertBefore(a, G.firstChild); var b = F.getElementsByName && F.getElementsByName(D).length === 2 + F.getElementsByName(D + 0).length; return s = !F.getElementById(D), G.removeChild(a), b }); try { L.call(G.childNodes, 0)[0].nodeType } catch (oa) { L = function (a) { for (var b, c = []; b = this[a]; a++) c.push(b); return c } } c.matches = function (a, b) { return c(a, null, null, b) }, c.matchesSelector = function (a, b) { return c(b, null, null, [a]).length > 0 }, u = c.getText = function (a) { var b, c = "", d = 0, e = a.nodeType; if (e) { if (1 === e || 9 === e || 11 === e) { if ("string" == typeof a.textContent) return a.textContent; for (a = a.firstChild; a; a = a.nextSibling) c += u(a) } else if (3 === e || 4 === e) return a.nodeValue } else for (; b = a[d]; d++) c += u(b); return c }, v = c.isXML = function (a) { var b = a && (a.ownerDocument || a).documentElement; return b ? "HTML" !== b.nodeName : !1 }, w = c.contains = G.contains ? function (a, b) { var c = 9 === a.nodeType ? a.documentElement : a, d = b && b.parentNode; return a === d || !!(d && 1 === d.nodeType && c.contains && c.contains(d)) } : G.compareDocumentPosition ? function (a, b) { return b && !!(16 & a.compareDocumentPosition(b)) } : function (a, b) { for (; b = b.parentNode;) if (b === a) return !0; return !1 }, c.attr = function (a, b) { var c, d = v(a); return d || (b = b.toLowerCase()), (c = t.attrHandle[b]) ? c(a) : d || la ? a.getAttribute(b) : (c = a.getAttributeNode(b), c ? "boolean" == typeof a[b] ? a[b] ? b : null : c.specified ? c.value : null : null) }, t = c.selectors = { cacheLength: 50, createPseudo: N, match: ha, attrHandle: ka ? {} : { href: function (a) { return a.getAttribute("href", 2) }, type: function (a) { return a.getAttribute("type") } }, find: { ID: s ? function (a, b, c) { if (typeof b.getElementById !== C && !c) { var d = b.getElementById(a); return d && d.parentNode ? [d] : [] } } : function (a, c, d) { if (typeof c.getElementById !== C && !d) { var e = c.getElementById(a); return e ? e.id === a || typeof e.getAttributeNode !== C && e.getAttributeNode("id").value === a ? [e] : b : [] } }, TAG: ja ? function (a, b) { return typeof b.getElementsByTagName !== C ? b.getElementsByTagName(a) : void 0 } : function (a, b) { var c = b.getElementsByTagName(a); if ("*" === a) { for (var d, e = [], f = 0; d = c[f]; f++) 1 === d.nodeType && e.push(d); return e } return c }, NAME: na && function (a, b) { return typeof b.getElementsByName !== C ? b.getElementsByName(name) : void 0 }, CLASS: ma && function (a, b, c) { return typeof b.getElementsByClassName === C || c ? void 0 : b.getElementsByClassName(a) } }, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (a) { return a[1] = a[1].replace(ga, ""), a[3] = (a[4] || a[5] || "").replace(ga, ""), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) }, CHILD: function (a) { return a[1] = a[1].toLowerCase(), "nth" === a[1] ? (a[2] || c.error(a[0]), a[3] = +(a[3] ? a[4] + (a[5] || 1) : 2 * ("even" === a[2] || "odd" === a[2])), a[4] = +(a[6] + a[7] || "odd" === a[2])) : a[2] && c.error(a[0]), a }, PSEUDO: function (a) { var b, c; return ha.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[3] : (b = a[4]) && (ba.test(b) && (c = h(b, !0)) && (c = b.indexOf(")", b.length - c) - b.length) && (b = b.slice(0, c), a[0] = a[0].slice(0, c)), a[2] = b), a.slice(0, 3)) } }, filter: { ID: s ? function (a) { return a = a.replace(ga, ""), function (b) { return b.getAttribute("id") === a } } : function (a) { return a = a.replace(ga, ""), function (b) { var c = typeof b.getAttributeNode !== C && b.getAttributeNode("id"); return c && c.value === a } }, TAG: function (a) { return "*" === a ? function () { return !0 } : (a = a.replace(ga, "").toLowerCase(), function (b) { return b.nodeName && b.nodeName.toLowerCase() === a }) }, CLASS: function (a) { var b = P[D][a]; return b || (b = P(a, new RegExp("(^|" + S + ")" + a + "(" + S + "|$)"))), function (a) { return b.test(a.className || typeof a.getAttribute !== C && a.getAttribute("class") || "") } }, ATTR: function (a, b, d) { return function (e, f) { var g = c.attr(e, a); return null == g ? "!=" === b : b ? (g += "", "=" === b ? g === d : "!=" === b ? g !== d : "^=" === b ? d && 0 === g.indexOf(d) : "*=" === b ? d && g.indexOf(d) > -1 : "$=" === b ? d && g.substr(g.length - d.length) === d : "~=" === b ? (" " + g + " ").indexOf(d) > -1 : "|=" === b ? g === d || g.substr(0, d.length + 1) === d + "-" : !1) : !0 } }, CHILD: function (a, b, c, d) { return "nth" === a ? function (a) { var b, e, f = a.parentNode; if (1 === c && 0 === d) return !0; if (f) for (e = 0, b = f.firstChild; b && (1 !== b.nodeType || (e++, a !== b)) ; b = b.nextSibling); return e -= d, e === c || e % c === 0 && e / c >= 0 } : function (b) { var c = b; switch (a) { case "only": case "first": for (; c = c.previousSibling;) if (1 === c.nodeType) return !1; if ("first" === a) return !0; c = b; case "last": for (; c = c.nextSibling;) if (1 === c.nodeType) return !1; return !0 } } }, PSEUDO: function (a, b) { var d, e = t.pseudos[a] || t.setFilters[a.toLowerCase()] || c.error("unsupported pseudo: " + a); return e[D] ? e(b) : e.length > 1 ? (d = [a, a, "", b], t.setFilters.hasOwnProperty(a.toLowerCase()) ? N(function (a, c) { for (var d, f = e(a, b), g = f.length; g--;) d = M.call(a, f[g]), a[d] = !(c[d] = f[g]) }) : function (a) { return e(a, 0, d) }) : e } }, pseudos: { not: N(function (a) { var b = [], c = [], d = x(a.replace(Z, "$1")); return d[D] ? N(function (a, b, c, e) { for (var f, g = d(a, null, e, []), h = a.length; h--;) (f = g[h]) && (a[h] = !(b[h] = f)) }) : function (a, e, f) { return b[0] = a, d(b, null, f, c), !c.pop() } }), has: N(function (a) { return function (b) { return c(a, b).length > 0 } }), contains: N(function (a) { return function (b) { return (b.textContent || b.innerText || u(b)).indexOf(a) > -1 } }), enabled: function (a) { return a.disabled === !1 }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && !!a.checked || "option" === b && !!a.selected }, selected: function (a) { return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 }, parent: function (a) { return !t.pseudos.empty(a) }, empty: function (a) { var b; for (a = a.firstChild; a;) { if (a.nodeName > "@" || 3 === (b = a.nodeType) || 4 === b) return !1; a = a.nextSibling } return !0 }, header: function (a) { return ea.test(a.nodeName) }, text: function (a) { var b, c; return "input" === a.nodeName.toLowerCase() && "text" === (b = a.type) && (null == (c = a.getAttribute("type")) || c.toLowerCase() === b) }, radio: d("radio"), checkbox: d("checkbox"), file: d("file"), password: d("password"), image: d("image"), submit: e("submit"), reset: e("reset"), button: function (a) { var b = a.nodeName.toLowerCase(); return "input" === b && "button" === a.type || "button" === b }, input: function (a) { return fa.test(a.nodeName) }, focus: function (a) { var b = a.ownerDocument; return a === b.activeElement && (!b.hasFocus || b.hasFocus()) && !(!a.type && !a.href) }, active: function (a) { return a === a.ownerDocument.activeElement }, first: f(function (a, b, c) { return [0] }), last: f(function (a, b, c) { return [b - 1] }), eq: f(function (a, b, c) { return [0 > c ? c + b : c] }), even: f(function (a, b, c) { for (var d = 0; b > d; d += 2) a.push(d); return a }), odd: f(function (a, b, c) { for (var d = 1; b > d; d += 2) a.push(d); return a }), lt: f(function (a, b, c) { for (var d = 0 > c ? c + b : c; --d >= 0;) a.push(d); return a }), gt: f(function (a, b, c) { for (var d = 0 > c ? c + b : c; ++d < b;) a.push(d); return a }) } }, y = G.compareDocumentPosition ? function (a, b) { return a === b ? (z = !0, 0) : (a.compareDocumentPosition && b.compareDocumentPosition ? 4 & a.compareDocumentPosition(b) : a.compareDocumentPosition) ? -1 : 1 } : function (a, b) { if (a === b) return z = !0, 0; if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex; var c, d, e = [], f = [], h = a.parentNode, i = b.parentNode, j = h; if (h === i) return g(a, b); if (!h) return -1; if (!i) return 1; for (; j;) e.unshift(j), j = j.parentNode; for (j = i; j;) f.unshift(j), j = j.parentNode; c = e.length, d = f.length; for (var k = 0; c > k && d > k; k++) if (e[k] !== f[k]) return g(e[k], f[k]); return k === c ? g(a, f[k], -1) : g(e[k], b, 1) }, [0, 0].sort(y), B = !z, c.uniqueSort = function (a) { var b, c = 1; if (z = B, a.sort(y), z) for (; b = a[c]; c++) b === a[c - 1] && a.splice(c--, 1); return a }, c.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }, x = c.compile = function (a, b) { var c, d = [], e = [], f = R[D][a]; if (!f) { for (b || (b = h(a)), c = b.length; c--;) f = m(b[c]), f[D] ? d.push(f) : e.push(f); f = R(a, n(e, d)) } return f }, F.querySelectorAll && !function () { var a, b = p, d = /'|\\/g, e = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, f = [":focus"], g = [":active", ":focus"], i = G.matchesSelector || G.mozMatchesSelector || G.webkitMatchesSelector || G.oMatchesSelector || G.msMatchesSelector; ia(function (a) { a.innerHTML = "<select><option selected=''></option></select>", a.querySelectorAll("[selected]").length || f.push("\\[" + S + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), a.querySelectorAll(":checked").length || f.push(":checked") }), ia(function (a) { a.innerHTML = "<p test=''></p>", a.querySelectorAll("[test^='']").length && f.push("[*^$]=" + S + "*(?:\"\"|'')"), a.innerHTML = "<input type='hidden'/>", a.querySelectorAll(":enabled").length || f.push(":enabled", ":disabled") }), f = new RegExp(f.join("|")), p = function (a, c, e, g, i) { if (!(g || i || f && f.test(a))) { var j, k, l = !0, m = D, n = c, o = 9 === c.nodeType && a; if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) { for (j = h(a), (l = c.getAttribute("id")) ? m = l.replace(d, "\\$&") : c.setAttribute("id", m), m = "[id='" + m + "'] ", k = j.length; k--;) j[k] = m + j[k].join(""); n = da.test(a) && c.parentNode || c, o = j.join(",") } if (o) try { return K.apply(e, L.call(n.querySelectorAll(o), 0)), e } catch (p) { } finally { l || c.removeAttribute("id") } } return b(a, c, e, g, i) }, i && (ia(function (b) { a = i.call(b, "div"); try { i.call(b, "[test!='']:sizzle"), g.push("!=", X) } catch (c) { } }), g = new RegExp(g.join("|")), c.matchesSelector = function (b, d) { if (d = d.replace(e, "='$1']"), !(v(b) || g.test(d) || f && f.test(d))) try { var h = i.call(b, d); if (h || a || b.document && 11 !== b.document.nodeType) return h } catch (j) { } return c(d, null, null, [b]).length > 0 }) }(), t.pseudos.nth = t.pseudos.eq, t.filters = q.prototype = t.pseudos, t.setFilters = new q, c.attr = _.attr, _.find = c, _.expr = c.selectors,
			_.expr[":"] = _.expr.pseudos, _.unique = c.uniqueSort, _.text = c.getText, _.isXMLDoc = c.isXML, _.contains = c.contains
		}(a); var Ja = /Until$/, Ka = /^(?:parents|prev(?:Until|All))/, La = /^.[^:#\[\.,]*$/, Ma = _.expr.match.needsContext, Na = { children: !0, contents: !0, next: !0, prev: !0 }; _.fn.extend({ find: function (a) { var b, c, d, e, f, g, h = this; if ("string" != typeof a) return _(a).filter(function () { for (b = 0, c = h.length; c > b; b++) if (_.contains(h[b], this)) return !0 }); for (g = this.pushStack("", "find", a), b = 0, c = this.length; c > b; b++) if (d = g.length, _.find(a, this[b], g), b > 0) for (e = d; e < g.length; e++) for (f = 0; d > f; f++) if (g[f] === g[e]) { g.splice(e--, 1); break } return g }, has: function (a) { var b, c = _(a, this), d = c.length; return this.filter(function () { for (b = 0; d > b; b++) if (_.contains(this, c[b])) return !0 }) }, not: function (a) { return this.pushStack(k(this, a, !1), "not", a) }, filter: function (a) { return this.pushStack(k(this, a, !0), "filter", a) }, is: function (a) { return !!a && ("string" == typeof a ? Ma.test(a) ? _(a, this.context).index(this[0]) >= 0 : _.filter(a, this).length > 0 : this.filter(a).length > 0) }, closest: function (a, b) { for (var c, d = 0, e = this.length, f = [], g = Ma.test(a) || "string" != typeof a ? _(a, b || this.context) : 0; e > d; d++) for (c = this[d]; c && c.ownerDocument && c !== b && 11 !== c.nodeType;) { if (g ? g.index(c) > -1 : _.find.matchesSelector(c, a)) { f.push(c); break } c = c.parentNode } return f = f.length > 1 ? _.unique(f) : f, this.pushStack(f, "closest", a) }, index: function (a) { return a ? "string" == typeof a ? _.inArray(this[0], _(a)) : _.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1 }, add: function (a, b) { var c = "string" == typeof a ? _(a, b) : _.makeArray(a && a.nodeType ? [a] : a), d = _.merge(this.get(), c); return this.pushStack(h(c[0]) || h(d[0]) ? d : _.unique(d)) }, addBack: function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) } }), _.fn.andSelf = _.fn.addBack, _.each({ parent: function (a) { var b = a.parentNode; return b && 11 !== b.nodeType ? b : null }, parents: function (a) { return _.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return _.dir(a, "parentNode", c) }, next: function (a) { return i(a, "nextSibling") }, prev: function (a) { return i(a, "previousSibling") }, nextAll: function (a) { return _.dir(a, "nextSibling") }, prevAll: function (a) { return _.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return _.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return _.dir(a, "previousSibling", c) }, siblings: function (a) { return _.sibling((a.parentNode || {}).firstChild, a) }, children: function (a) { return _.sibling(a.firstChild) }, contents: function (a) { return _.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : _.merge([], a.childNodes) } }, function (a, b) { _.fn[a] = function (c, d) { var e = _.map(this, b, c); return Ja.test(a) || (d = c), d && "string" == typeof d && (e = _.filter(d, e)), e = this.length > 1 && !Na[a] ? _.unique(e) : e, this.length > 1 && Ka.test(a) && (e = e.reverse()), this.pushStack(e, a, W.call(arguments).join(",")) } }), _.extend({ filter: function (a, b, c) { return c && (a = ":not(" + a + ")"), 1 === b.length ? _.find.matchesSelector(b[0], a) ? [b[0]] : [] : _.find.matches(a, b) }, dir: function (a, c, d) { for (var e = [], f = a[c]; f && 9 !== f.nodeType && (d === b || 1 !== f.nodeType || !_(f).is(d)) ;) 1 === f.nodeType && e.push(f), f = f[c]; return e }, sibling: function (a, b) { for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a); return c } }); var Oa = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", Pa = / jQuery\d+="(?:null|\d+)"/g, Qa = /^\s+/, Ra = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Sa = /<([\w:]+)/, Ta = /<tbody/i, Ua = /<|&#?\w+;/, Va = /<(?:script|style|link)/i, Wa = /<(?:script|object|embed|option|style)/i, Xa = new RegExp("<(?:" + Oa + ")[\\s/>]", "i"), Ya = /^(?:checkbox|radio)$/, Za = /checked\s*(?:[^=]|=\s*.checked.)/i, $a = /\/(java|ecma)script/i, _a = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, ab = { option: [1, "<select multiple='multiple'>", "</select>"], legend: [1, "<fieldset>", "</fieldset>"], thead: [1, "<table>", "</table>"], tr: [2, "<table><tbody>", "</tbody></table>"], td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"], area: [1, "<map>", "</map>"], _default: [0, "", ""] }, bb = l(Q), cb = bb.appendChild(Q.createElement("div")); ab.optgroup = ab.option, ab.tbody = ab.tfoot = ab.colgroup = ab.caption = ab.thead, ab.th = ab.td, _.support.htmlSerialize || (ab._default = [1, "X<div>", "</div>"]), _.fn.extend({ text: function (a) { return _.access(this, function (a) { return a === b ? _.text(this) : this.empty().append((this[0] && this[0].ownerDocument || Q).createTextNode(a)) }, null, a, arguments.length) }, wrapAll: function (a) { if (_.isFunction(a)) return this.each(function (b) { _(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = _(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { for (var a = this; a.firstChild && 1 === a.firstChild.nodeType;) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { return _.isFunction(a) ? this.each(function (b) { _(this).wrapInner(a.call(this, b)) }) : this.each(function () { var b = _(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = _.isFunction(a); return this.each(function (c) { _(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { _.nodeName(this, "body") || _(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { (1 === this.nodeType || 11 === this.nodeType) && this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { (1 === this.nodeType || 11 === this.nodeType) && this.insertBefore(a, this.firstChild) }) }, before: function () { if (!h(this[0])) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this) }); if (arguments.length) { var a = _.clean(arguments); return this.pushStack(_.merge(a, this), "before", this.selector) } }, after: function () { if (!h(this[0])) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling) }); if (arguments.length) { var a = _.clean(arguments); return this.pushStack(_.merge(this, a), "after", this.selector) } }, remove: function (a, b) { for (var c, d = 0; null != (c = this[d]) ; d++) (!a || _.filter(a, [c]).length) && (b || 1 !== c.nodeType || (_.cleanData(c.getElementsByTagName("*")), _.cleanData([c])), c.parentNode && c.parentNode.removeChild(c)); return this }, empty: function () { for (var a, b = 0; null != (a = this[b]) ; b++) for (1 === a.nodeType && _.cleanData(a.getElementsByTagName("*")) ; a.firstChild;) a.removeChild(a.firstChild); return this }, clone: function (a, b) { return a = null == a ? !1 : a, b = null == b ? a : b, this.map(function () { return _.clone(this, a, b) }) }, html: function (a) { return _.access(this, function (a) { var c = this[0] || {}, d = 0, e = this.length; if (a === b) return 1 === c.nodeType ? c.innerHTML.replace(Pa, "") : b; if ("string" == typeof a && !Va.test(a) && (_.support.htmlSerialize || !Xa.test(a)) && (_.support.leadingWhitespace || !Qa.test(a)) && !ab[(Sa.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(Ra, "<$1></$2>"); try { for (; e > d; d++) c = this[d] || {}, 1 === c.nodeType && (_.cleanData(c.getElementsByTagName("*")), c.innerHTML = a); c = 0 } catch (f) { } } c && this.empty().append(a) }, null, a, arguments.length) }, replaceWith: function (a) { return h(this[0]) ? this.length ? this.pushStack(_(_.isFunction(a) ? a() : a), "replaceWith", a) : this : _.isFunction(a) ? this.each(function (b) { var c = _(this), d = c.html(); c.replaceWith(a.call(this, b, d)) }) : ("string" != typeof a && (a = _(a).detach()), this.each(function () { var b = this.nextSibling, c = this.parentNode; _(this).remove(), b ? _(b).before(a) : _(c).append(a) })) }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, c, d) { a = [].concat.apply([], a); var e, f, g, h, i = 0, j = a[0], k = [], l = this.length; if (!_.support.checkClone && l > 1 && "string" == typeof j && Za.test(j)) return this.each(function () { _(this).domManip(a, c, d) }); if (_.isFunction(j)) return this.each(function (e) { var f = _(this); a[0] = j.call(this, e, c ? f.html() : b), f.domManip(a, c, d) }); if (this[0]) { if (e = _.buildFragment(a, this, k), g = e.fragment, f = g.firstChild, 1 === g.childNodes.length && (g = f), f) for (c = c && _.nodeName(f, "tr"), h = e.cacheable || l - 1; l > i; i++) d.call(c && _.nodeName(this[i], "table") ? m(this[i], "tbody") : this[i], i === h ? g : _.clone(g, !0, !0)); g = f = null, k.length && _.each(k, function (a, b) { b.src ? _.ajax ? _.ajax({ url: b.src, type: "GET", dataType: "script", async: !1, global: !1, "throws": !0 }) : _.error("no ajax") : _.globalEval((b.text || b.textContent || b.innerHTML || "").replace(_a, "")), b.parentNode && b.parentNode.removeChild(b) }) } return this } }), _.buildFragment = function (a, c, d) { var e, f, g, h = a[0]; return c = c || Q, c = !c.nodeType && c[0] || c, c = c.ownerDocument || c, !(1 === a.length && "string" == typeof h && h.length < 512 && c === Q && "<" === h.charAt(0)) || Wa.test(h) || !_.support.checkClone && Za.test(h) || !_.support.html5Clone && Xa.test(h) || (f = !0, e = _.fragments[h], g = e !== b), e || (e = c.createDocumentFragment(), _.clean(a, c, e, d), f && (_.fragments[h] = g && e)), { fragment: e, cacheable: f } }, _.fragments = {}, _.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { _.fn[a] = function (c) { var d, e = 0, f = [], g = _(c), h = g.length, i = 1 === this.length && this[0].parentNode; if ((null == i || i && 11 === i.nodeType && 1 === i.childNodes.length) && 1 === h) return g[b](this[0]), this; for (; h > e; e++) d = (e > 0 ? this.clone(!0) : this).get(), _(g[e])[b](d), f = f.concat(d); return this.pushStack(f, a, g.selector) } }), _.extend({ clone: function (a, b, c) { var d, e, f, g; if (_.support.html5Clone || _.isXMLDoc(a) || !Xa.test("<" + a.nodeName + ">") ? g = a.cloneNode(!0) : (cb.innerHTML = a.outerHTML, cb.removeChild(g = cb.firstChild)), !(_.support.noCloneEvent && _.support.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || _.isXMLDoc(a))) for (o(a, g), d = p(a), e = p(g), f = 0; d[f]; ++f) e[f] && o(d[f], e[f]); if (b && (n(a, g), c)) for (d = p(a), e = p(g), f = 0; d[f]; ++f) n(d[f], e[f]); return d = e = null, g }, clean: function (a, b, c, d) { var e, f, g, h, i, j, k, m, n, o, p, r = b === Q && bb, s = []; for (b && "undefined" != typeof b.createDocumentFragment || (b = Q), e = 0; null != (g = a[e]) ; e++) if ("number" == typeof g && (g += ""), g) { if ("string" == typeof g) if (Ua.test(g)) { for (r = r || l(b), k = b.createElement("div"), r.appendChild(k), g = g.replace(Ra, "<$1></$2>"), h = (Sa.exec(g) || ["", ""])[1].toLowerCase(), i = ab[h] || ab._default, j = i[0], k.innerHTML = i[1] + g + i[2]; j--;) k = k.lastChild; if (!_.support.tbody) for (m = Ta.test(g), n = "table" !== h || m ? "<table>" !== i[1] || m ? [] : k.childNodes : k.firstChild && k.firstChild.childNodes, f = n.length - 1; f >= 0; --f) _.nodeName(n[f], "tbody") && !n[f].childNodes.length && n[f].parentNode.removeChild(n[f]); !_.support.leadingWhitespace && Qa.test(g) && k.insertBefore(b.createTextNode(Qa.exec(g)[0]), k.firstChild), g = k.childNodes, k.parentNode.removeChild(k) } else g = b.createTextNode(g); g.nodeType ? s.push(g) : _.merge(s, g) } if (k && (g = k = r = null), !_.support.appendChecked) for (e = 0; null != (g = s[e]) ; e++) _.nodeName(g, "input") ? q(g) : "undefined" != typeof g.getElementsByTagName && _.grep(g.getElementsByTagName("input"), q); if (c) for (o = function (a) { return !a.type || $a.test(a.type) ? d ? d.push(a.parentNode ? a.parentNode.removeChild(a) : a) : c.appendChild(a) : void 0 }, e = 0; null != (g = s[e]) ; e++) _.nodeName(g, "script") && o(g) || (c.appendChild(g), "undefined" != typeof g.getElementsByTagName && (p = _.grep(_.merge([], g.getElementsByTagName("script")), o), s.splice.apply(s, [e + 1, 0].concat(p)), e += p.length)); return s }, cleanData: function (a, b) { for (var c, d, e, f, g = 0, h = _.expando, i = _.cache, j = _.support.deleteExpando, k = _.event.special; null != (e = a[g]) ; g++) if ((b || _.acceptData(e)) && (d = e[h], c = d && i[d])) { if (c.events) for (f in c.events) k[f] ? _.event.remove(e, f) : _.removeEvent(e, f, c.handle); i[d] && (delete i[d], j ? delete e[h] : e.removeAttribute ? e.removeAttribute(h) : e[h] = null, _.deletedIds.push(d)) } } }), function () { var a, b; _.uaMatch = function (a) { a = a.toLowerCase(); var b = /(chrome)[ \/]([\w.]+)/.exec(a) || /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || a.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a) || []; return { browser: b[1] || "", version: b[2] || "0" } }, a = _.uaMatch(S.userAgent), b = {}, a.browser && (b[a.browser] = !0, b.version = a.version), b.chrome ? b.webkit = !0 : b.webkit && (b.safari = !0), _.browser = b, _.sub = function () { function a(b, c) { return new a.fn.init(b, c) } _.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function (c, d) { return d && d instanceof _ && !(d instanceof a) && (d = a(d)), _.fn.init.call(this, c, d, b) }, a.fn.init.prototype = a.fn; var b = a(Q); return a } }(); var db, eb, fb, gb = /alpha\([^)]*\)/i, hb = /opacity=([^)]*)/, ib = /^(top|right|bottom|left)$/, jb = /^(none|table(?!-c[ea]).+)/, kb = /^margin/, lb = new RegExp("^(" + aa + ")(.*)$", "i"), mb = new RegExp("^(" + aa + ")(?!px)[a-z%]+$", "i"), nb = new RegExp("^([-+])=(" + aa + ")", "i"), ob = {}, pb = { position: "absolute", visibility: "hidden", display: "block" }, qb = { letterSpacing: 0, fontWeight: 400 }, rb = ["Top", "Right", "Bottom", "Left"], sb = ["Webkit", "O", "Moz", "ms"], tb = _.fn.toggle; _.fn.extend({ css: function (a, c) { return _.access(this, function (a, c, d) { return d !== b ? _.style(a, c, d) : _.css(a, c) }, a, c, arguments.length > 1) }, show: function () { return t(this, !0) }, hide: function () { return t(this) }, toggle: function (a, b) { var c = "boolean" == typeof a; return _.isFunction(a) && _.isFunction(b) ? tb.apply(this, arguments) : this.each(function () { (c ? a : s(this)) ? _(this).show() : _(this).hide() }) } }), _.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = db(a, "opacity"); return "" === c ? "1" : c } } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": _.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) { var f, g, h, i = _.camelCase(c), j = a.style; if (c = _.cssProps[i] || (_.cssProps[i] = r(j, i)), h = _.cssHooks[c] || _.cssHooks[i], d === b) return h && "get" in h && (f = h.get(a, !1, e)) !== b ? f : j[c]; if (g = typeof d, "string" === g && (f = nb.exec(d)) && (d = (f[1] + 1) * f[2] + parseFloat(_.css(a, c)), g = "number"), !(null == d || "number" === g && isNaN(d) || ("number" !== g || _.cssNumber[i] || (d += "px"), h && "set" in h && (d = h.set(a, d, e)) === b))) try { j[c] = d } catch (k) { } } }, css: function (a, c, d, e) { var f, g, h, i = _.camelCase(c); return c = _.cssProps[i] || (_.cssProps[i] = r(a.style, i)), h = _.cssHooks[c] || _.cssHooks[i], h && "get" in h && (f = h.get(a, !0, e)), f === b && (f = db(a, c)), "normal" === f && c in qb && (f = qb[c]), d || e !== b ? (g = parseFloat(f), d || _.isNumeric(g) ? g || 0 : f) : f }, swap: function (a, b, c) { var d, e, f = {}; for (e in b) f[e] = a.style[e], a.style[e] = b[e]; d = c.call(a); for (e in b) a.style[e] = f[e]; return d } }), a.getComputedStyle ? db = function (b, c) { var d, e, f, g, h = a.getComputedStyle(b, null), i = b.style; return h && (d = h[c], "" !== d || _.contains(b.ownerDocument, b) || (d = _.style(b, c)), mb.test(d) && kb.test(c) && (e = i.width, f = i.minWidth, g = i.maxWidth, i.minWidth = i.maxWidth = i.width = d, d = h.width, i.width = e, i.minWidth = f, i.maxWidth = g)), d } : Q.documentElement.currentStyle && (db = function (a, b) { var c, d, e = a.currentStyle && a.currentStyle[b], f = a.style; return null == e && f && f[b] && (e = f[b]), mb.test(e) && !ib.test(b) && (c = f.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), f.left = "fontSize" === b ? "1em" : e, e = f.pixelLeft + "px", f.left = c, d && (a.runtimeStyle.left = d)), "" === e ? "auto" : e }), _.each(["height", "width"], function (a, b) { _.cssHooks[b] = { get: function (a, c, d) { return c ? 0 === a.offsetWidth && jb.test(db(a, "display")) ? _.swap(a, pb, function () { return w(a, b, d) }) : w(a, b, d) : void 0 }, set: function (a, c, d) { return u(a, c, d ? v(a, b, d, _.support.boxSizing && "border-box" === _.css(a, "boxSizing")) : 0) } } }), _.support.opacity || (_.cssHooks.opacity = { get: function (a, b) { return hb.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = _.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", f = d && d.filter || c.filter || ""; c.zoom = 1, b >= 1 && "" === _.trim(f.replace(gb, "")) && c.removeAttribute && (c.removeAttribute("filter"), d && !d.filter) || (c.filter = gb.test(f) ? f.replace(gb, e) : f + " " + e) } }), _(function () { _.support.reliableMarginRight || (_.cssHooks.marginRight = { get: function (a, b) { return _.swap(a, { display: "inline-block" }, function () { return b ? db(a, "marginRight") : void 0 }) } }), !_.support.pixelPosition && _.fn.position && _.each(["top", "left"], function (a, b) { _.cssHooks[b] = { get: function (a, c) { if (c) { var d = db(a, b); return mb.test(d) ? _(a).position()[b] + "px" : d } } } }) }), _.expr && _.expr.filters && (_.expr.filters.hidden = function (a) { return 0 === a.offsetWidth && 0 === a.offsetHeight || !_.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || db(a, "display")) }, _.expr.filters.visible = function (a) { return !_.expr.filters.hidden(a) }), _.each({ margin: "", padding: "", border: "Width" }, function (a, b) { _.cssHooks[a + b] = { expand: function (c) { var d, e = "string" == typeof c ? c.split(" ") : [c], f = {}; for (d = 0; 4 > d; d++) f[a + rb[d] + b] = e[d] || e[d - 2] || e[0]; return f } }, kb.test(a) || (_.cssHooks[a + b].set = u) }); var ub = /%20/g, vb = /\[\]$/, wb = /\r?\n/g, xb = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, yb = /^(?:select|textarea)/i; _.fn.extend({ serialize: function () { return _.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { return this.elements ? _.makeArray(this.elements) : this }).filter(function () { return this.name && !this.disabled && (this.checked || yb.test(this.nodeName) || xb.test(this.type)) }).map(function (a, b) { var c = _(this).val(); return null == c ? null : _.isArray(c) ? _.map(c, function (a, c) { return { name: b.name, value: a.replace(wb, "\r\n") } }) : { name: b.name, value: c.replace(wb, "\r\n") } }).get() } }), _.param = function (a, c) { var d, e = [], f = function (a, b) { b = _.isFunction(b) ? b() : null == b ? "" : b, e[e.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (c === b && (c = _.ajaxSettings && _.ajaxSettings.traditional), _.isArray(a) || a.jquery && !_.isPlainObject(a)) _.each(a, function () { f(this.name, this.value) }); else for (d in a) y(d, a[d], c, f); return e.join("&").replace(ub, "+") }; var zb, Ab, Bb = /#.*$/, Cb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, Db = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, Eb = /^(?:GET|HEAD)$/, Fb = /^\/\//, Gb = /\?/, Hb = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, Ib = /([?&])_=[^&]*/, Jb = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, Kb = _.fn.load, Lb = {}, Mb = {}, Nb = ["*/"] + ["*"]; try { Ab = R.href } catch (Ob) { Ab = Q.createElement("a"), Ab.href = "", Ab = Ab.href } zb = Jb.exec(Ab.toLowerCase()) || [], _.fn.load = function (a, c, d) { if ("string" != typeof a && Kb) return Kb.apply(this, arguments); if (!this.length) return this; var e, f, g, h = this, i = a.indexOf(" "); return i >= 0 && (e = a.slice(i, a.length), a = a.slice(0, i)), _.isFunction(c) ? (d = c, c = b) : c && "object" == typeof c && (f = "POST"), _.ajax({ url: a, type: f, dataType: "html", data: c, complete: function (a, b) { d && h.each(d, g || [a.responseText, b, a]) } }).done(function (a) { g = arguments, h.html(e ? _("<div>").append(a.replace(Hb, "")).find(e) : a) }), this }, _.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (a, b) { _.fn[b] = function (a) { return this.on(b, a) } }), _.each(["get", "post"], function (a, c) { _[c] = function (a, d, e, f) { return _.isFunction(d) && (f = f || e, e = d, d = b), _.ajax({ type: c, url: a, data: d, success: e, dataType: f }) } }), _.extend({ getScript: function (a, c) { return _.get(a, b, c, "script") }, getJSON: function (a, b, c) { return _.get(a, b, c, "json") }, ajaxSetup: function (a, b) { return b ? B(a, _.ajaxSettings) : (b = a, a = _.ajaxSettings), B(a, b), a }, ajaxSettings: { url: Ab, isLocal: Db.test(zb[1]), global: !0, type: "GET", contentType: "application/x-www-form-urlencoded; charset=UTF-8", processData: !0, async: !0, accepts: { xml: "application/xml, text/xml", html: "text/html", text: "text/plain", json: "application/json, text/javascript", "*": Nb }, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": _.parseJSON, "text xml": _.parseXML }, flatOptions: { context: !0, url: !0 } }, ajaxPrefilter: z(Lb), ajaxTransport: z(Mb), ajax: function (a, c) { function d(a, c, d, g) { var j, l, s, t, v, x = c; 2 !== u && (u = 2, i && clearTimeout(i), h = b, f = g || "", w.readyState = a > 0 ? 4 : 0, d && (t = C(m, w, d)), a >= 200 && 300 > a || 304 === a ? (m.ifModified && (v = w.getResponseHeader("Last-Modified"), v && (_.lastModified[e] = v), v = w.getResponseHeader("Etag"), v && (_.etag[e] = v)), 304 === a ? (x = "notmodified", j = !0) : (j = D(m, t), x = j.state, l = j.data, s = j.error, j = !s)) : (s = x, (!x || a) && (x = "error", 0 > a && (a = 0))), w.status = a, w.statusText = (c || x) + "", j ? p.resolveWith(n, [l, x, w]) : p.rejectWith(n, [w, x, s]), w.statusCode(r), r = b, k && o.trigger("ajax" + (j ? "Success" : "Error"), [w, m, j ? l : s]), q.fireWith(n, [w, x]), k && (o.trigger("ajaxComplete", [w, m]), --_.active || _.event.trigger("ajaxStop"))) } "object" == typeof a && (c = a, a = b), c = c || {}; var e, f, g, h, i, j, k, l, m = _.ajaxSetup({}, c), n = m.context || m, o = n !== m && (n.nodeType || n instanceof _) ? _(n) : _.event, p = _.Deferred(), q = _.Callbacks("once memory"), r = m.statusCode || {}, s = {}, t = {}, u = 0, v = "canceled", w = { readyState: 0, setRequestHeader: function (a, b) { if (!u) { var c = a.toLowerCase(); a = t[c] = t[c] || a, s[a] = b } return this }, getAllResponseHeaders: function () { return 2 === u ? f : null }, getResponseHeader: function (a) { var c; if (2 === u) { if (!g) for (g = {}; c = Cb.exec(f) ;) g[c[1].toLowerCase()] = c[2]; c = g[a.toLowerCase()] } return c === b ? null : c }, overrideMimeType: function (a) { return u || (m.mimeType = a), this }, abort: function (a) { return a = a || v, h && h.abort(a), d(0, a), this } }; if (p.promise(w), w.success = w.done, w.error = w.fail, w.complete = q.add, w.statusCode = function (a) { if (a) { var b; if (2 > u) for (b in a) r[b] = [r[b], a[b]]; else b = a[w.status], w.always(b) } return this }, m.url = ((a || m.url) + "").replace(Bb, "").replace(Fb, zb[1] + "//"), m.dataTypes = _.trim(m.dataType || "*").toLowerCase().split(ca), null == m.crossDomain && (j = Jb.exec(m.url.toLowerCase()) || !1, m.crossDomain = j && j.join(":") + (j[3] ? "" : "http:" === j[1] ? 80 : 443) !== zb.join(":") + (zb[3] ? "" : "http:" === zb[1] ? 80 : 443)), m.data && m.processData && "string" != typeof m.data && (m.data = _.param(m.data, m.traditional)), A(Lb, m, c, w), 2 === u) return w; if (k = m.global, m.type = m.type.toUpperCase(), m.hasContent = !Eb.test(m.type), k && 0 === _.active++ && _.event.trigger("ajaxStart"), !m.hasContent && (m.data && (m.url += (Gb.test(m.url) ? "&" : "?") + m.data, delete m.data), e = m.url, m.cache === !1)) { var x = _.now(), y = m.url.replace(Ib, "$1_=" + x); m.url = y + (y === m.url ? (Gb.test(m.url) ? "&" : "?") + "_=" + x : "") } (m.data && m.hasContent && m.contentType !== !1 || c.contentType) && w.setRequestHeader("Content-Type", m.contentType), m.ifModified && (e = e || m.url, _.lastModified[e] && w.setRequestHeader("If-Modified-Since", _.lastModified[e]), _.etag[e] && w.setRequestHeader("If-None-Match", _.etag[e])), w.setRequestHeader("Accept", m.dataTypes[0] && m.accepts[m.dataTypes[0]] ? m.accepts[m.dataTypes[0]] + ("*" !== m.dataTypes[0] ? ", " + Nb + "; q=0.01" : "") : m.accepts["*"]); for (l in m.headers) w.setRequestHeader(l, m.headers[l]); if (m.beforeSend && (m.beforeSend.call(n, w, m) === !1 || 2 === u)) return w.abort(); v = "abort"; for (l in { success: 1, error: 1, complete: 1 }) w[l](m[l]); if (h = A(Mb, m, c, w)) { w.readyState = 1, k && o.trigger("ajaxSend", [w, m]), m.async && m.timeout > 0 && (i = setTimeout(function () { w.abort("timeout") }, m.timeout)); try { u = 1, h.send(s, d) } catch (z) { if (!(2 > u)) throw z; d(-1, z) } } else d(-1, "No Transport"); return w }, active: 0, lastModified: {}, etag: {} }); var Pb = [], Qb = /\?/, Rb = /(=)\?(?=&|$)|\?\?/, Sb = _.now(); _.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = Pb.pop() || _.expando + "_" + Sb++; return this[a] = !0, a } }), _.ajaxPrefilter("json jsonp", function (c, d, e) { var f, g, h, i = c.data, j = c.url, k = c.jsonp !== !1, l = k && Rb.test(j), m = k && !l && "string" == typeof i && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") && Rb.test(i); return "jsonp" === c.dataTypes[0] || l || m ? (f = c.jsonpCallback = _.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, g = a[f], l ? c.url = j.replace(Rb, "$1" + f) : m ? c.data = i.replace(Rb, "$1" + f) : k && (c.url += (Qb.test(j) ? "&" : "?") + c.jsonp + "=" + f), c.converters["script json"] = function () { return h || _.error(f + " was not called"), h[0] }, c.dataTypes[0] = "json", a[f] = function () { h = arguments }, e.always(function () { a[f] = g, c[f] && (c.jsonpCallback = d.jsonpCallback, Pb.push(f)), h && _.isFunction(g) && g(h[0]), h = g = b }), "script") : void 0 }), _.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /javascript|ecmascript/ }, converters: { "text script": function (a) { return _.globalEval(a), a } } }), _.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1) }), _.ajaxTransport("script", function (a) { if (a.crossDomain) { var c, d = Q.head || Q.getElementsByTagName("head")[0] || Q.documentElement; return { send: function (e, f) { c = Q.createElement("script"), c.async = "async", a.scriptCharset && (c.charset = a.scriptCharset), c.src = a.url, c.onload = c.onreadystatechange = function (a, e) { (e || !c.readyState || /loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, d && c.parentNode && d.removeChild(c), c = b, e || f(200, "success")) }, d.insertBefore(c, d.firstChild) }, abort: function () { c && c.onload(0, 1) } } } }); var Tb, Ub = a.ActiveXObject ? function () { for (var a in Tb) Tb[a](0, 1) } : !1, Vb = 0; _.ajaxSettings.xhr = a.ActiveXObject ? function () { return !this.isLocal && E() || F() } : E, function (a) { _.extend(_.support, { ajax: !!a, cors: !!a && "withCredentials" in a }) }(_.ajaxSettings.xhr()), _.support.ajax && _.ajaxTransport(function (c) { if (!c.crossDomain || _.support.cors) { var d; return { send: function (e, f) { var g, h, i = c.xhr(); if (c.username ? i.open(c.type, c.url, c.async, c.username, c.password) : i.open(c.type, c.url, c.async), c.xhrFields) for (h in c.xhrFields) i[h] = c.xhrFields[h]; c.mimeType && i.overrideMimeType && i.overrideMimeType(c.mimeType), c.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"); try { for (h in e) i.setRequestHeader(h, e[h]) } catch (j) { } i.send(c.hasContent && c.data || null), d = function (a, e) { var h, j, k, l, m; try { if (d && (e || 4 === i.readyState)) if (d = b, g && (i.onreadystatechange = _.noop, Ub && delete Tb[g]), e) 4 !== i.readyState && i.abort(); else { h = i.status, k = i.getAllResponseHeaders(), l = {}, m = i.responseXML, m && m.documentElement && (l.xml = m); try { l.text = i.responseText } catch (a) { } try { j = i.statusText } catch (n) { j = "" } h || !c.isLocal || c.crossDomain ? 1223 === h && (h = 204) : h = l.text ? 200 : 404 } } catch (o) { e || f(-1, o) } l && f(h, j, l, k) }, c.async ? 4 === i.readyState ? setTimeout(d, 0) : (g = ++Vb, Ub && (Tb || (Tb = {}, _(a).unload(Ub)), Tb[g] = d), i.onreadystatechange = d) : d() }, abort: function () { d && d(0, 1) } } } }); var Wb, Xb, Yb = /^(?:toggle|show|hide)$/, Zb = new RegExp("^(?:([-+])=|)(" + aa + ")([a-z%]*)$", "i"), $b = /queueHooks$/, _b = [K], ac = { "*": [function (a, b) { var c, d, e = this.createTween(a, b), f = Zb.exec(b), g = e.cur(), h = +g || 0, i = 1, j = 20; if (f) { if (c = +f[2], d = f[3] || (_.cssNumber[a] ? "" : "px"), "px" !== d && h) { h = _.css(e.elem, a, !0) || c || 1; do i = i || ".5", h /= i, _.style(e.elem, a, h + d); while (i !== (i = e.cur() / g) && 1 !== i && --j) } e.unit = d, e.start = h, e.end = f[1] ? h + (f[1] + 1) * c : c } return e }] }; _.Animation = _.extend(I, { tweener: function (a, b) { _.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, d = 0, e = a.length; e > d; d++) c = a[d], ac[c] = ac[c] || [], ac[c].unshift(b) }, prefilter: function (a, b) { b ? _b.unshift(a) : _b.push(a) } }), _.Tween = L, L.prototype = { constructor: L, init: function (a, b, c, d, e, f) { this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || (_.cssNumber[c] ? "" : "px") }, cur: function () { var a = L.propHooks[this.prop]; return a && a.get ? a.get(this) : L.propHooks._default.get(this) }, run: function (a) { var b, c = L.propHooks[this.prop]; return this.options.duration ? this.pos = b = _.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : L.propHooks._default.set(this), this } }, L.prototype.init.prototype = L.prototype, L.propHooks = { _default: { get: function (a) { var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = _.css(a.elem, a.prop, !1, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop] }, set: function (a) { _.fx.step[a.prop] ? _.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[_.cssProps[a.prop]] || _.cssHooks[a.prop]) ? _.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now } } }, L.propHooks.scrollTop = L.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }, _.each(["toggle", "show", "hide"], function (a, b) { var c = _.fn[b]; _.fn[b] = function (d, e, f) { return null == d || "boolean" == typeof d || !a && _.isFunction(d) && _.isFunction(e) ? c.apply(this, arguments) : this.animate(M(b, !0), d, e, f) } }), _.fn.extend({ fadeTo: function (a, b, c, d) { return this.filter(s).css("opacity", 0).show().end().animate({ opacity: b }, a, c, d) }, animate: function (a, b, c, d) { var e = _.isEmptyObject(a), f = _.speed(b, c, d), g = function () { var b = I(this, _.extend({}, a), f); e && b.stop(!0) }; return e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g) }, stop: function (a, c, d) { var e = function (a) { var b = a.stop; delete a.stop, b(d) }; return "string" != typeof a && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []), this.each(function () { var b = !0, c = null != a && a + "queueHooks", f = _.timers, g = _._data(this); if (c) g[c] && g[c].stop && e(g[c]); else for (c in g) g[c] && g[c].stop && $b.test(c) && e(g[c]); for (c = f.length; c--;) f[c].elem !== this || null != a && f[c].queue !== a || (f[c].anim.stop(d), b = !1, f.splice(c, 1)); (b || !d) && _.dequeue(this, a) }) } }), _.each({ slideDown: M("show"), slideUp: M("hide"), slideToggle: M("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { _.fn[a] = function (a, c, d) { return this.animate(b, a, c, d) } }), _.speed = function (a, b, c) { var d = a && "object" == typeof a ? _.extend({}, a) : { complete: c || !c && b || _.isFunction(a) && a, duration: a, easing: c && b || b && !_.isFunction(b) && b }; return d.duration = _.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in _.fx.speeds ? _.fx.speeds[d.duration] : _.fx.speeds._default, (null == d.queue || d.queue === !0) && (d.queue = "fx"), d.old = d.complete, d.complete = function () { _.isFunction(d.old) && d.old.call(this), d.queue && _.dequeue(this, d.queue) }, d }, _.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }, _.timers = [], _.fx = L.prototype.init, _.fx.tick = function () { for (var a, b = _.timers, c = 0; c < b.length; c++) a = b[c], a() || b[c] !== a || b.splice(c--, 1); b.length || _.fx.stop() }, _.fx.timer = function (a) { a() && _.timers.push(a) && !Xb && (Xb = setInterval(_.fx.tick, _.fx.interval)) }, _.fx.interval = 13, _.fx.stop = function () { clearInterval(Xb), Xb = null }, _.fx.speeds = { slow: 600, fast: 200, _default: 400 }, _.fx.step = {}, _.expr && _.expr.filters && (_.expr.filters.animated = function (a) { return _.grep(_.timers, function (b) { return a === b.elem }).length }); var bc = /^(?:body|html)$/i; _.fn.offset = function (a) { if (arguments.length) return a === b ? this : this.each(function (b) { _.offset.setOffset(this, a, b) }); var c, d, e, f, g, h, i, j = { top: 0, left: 0 }, k = this[0], l = k && k.ownerDocument; if (l) return (d = l.body) === k ? _.offset.bodyOffset(k) : (c = l.documentElement, _.contains(c, k) ? ("undefined" != typeof k.getBoundingClientRect && (j = k.getBoundingClientRect()), e = N(l), f = c.clientTop || d.clientTop || 0, g = c.clientLeft || d.clientLeft || 0, h = e.pageYOffset || c.scrollTop, i = e.pageXOffset || c.scrollLeft, { top: j.top + h - f, left: j.left + i - g }) : j) }, _.offset = { bodyOffset: function (a) { var b = a.offsetTop, c = a.offsetLeft; return _.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat(_.css(a, "marginTop")) || 0, c += parseFloat(_.css(a, "marginLeft")) || 0), { top: b, left: c } }, setOffset: function (a, b, c) { var d = _.css(a, "position"); "static" === d && (a.style.position = "relative"); var e, f, g = _(a), h = g.offset(), i = _.css(a, "top"), j = _.css(a, "left"), k = ("absolute" === d || "fixed" === d) && _.inArray("auto", [i, j]) > -1, l = {}, m = {}; k ? (m = g.position(), e = m.top, f = m.left) : (e = parseFloat(i) || 0, f = parseFloat(j) || 0), _.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (l.top = b.top - h.top + e), null != b.left && (l.left = b.left - h.left + f), "using" in b ? b.using.call(a, l) : g.css(l) } }, _.fn.extend({ position: function () { if (this[0]) { var a = this[0], b = this.offsetParent(), c = this.offset(), d = bc.test(b[0].nodeName) ? { top: 0, left: 0 } : b.offset(); return c.top -= parseFloat(_.css(a, "marginTop")) || 0, c.left -= parseFloat(_.css(a, "marginLeft")) || 0, d.top += parseFloat(_.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat(_.css(b[0], "borderLeftWidth")) || 0, { top: c.top - d.top, left: c.left - d.left } } }, offsetParent: function () { return this.map(function () { for (var a = this.offsetParent || Q.body; a && !bc.test(a.nodeName) && "static" === _.css(a, "position") ;) a = a.offsetParent; return a || Q.body }) } }), _.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function (a, c) { var d = /Y/.test(c); _.fn[a] = function (e) { return _.access(this, function (a, e, f) { var g = N(a); return f === b ? g ? c in g ? g[c] : g.document.documentElement[e] : a[e] : void (g ? g.scrollTo(d ? _(g).scrollLeft() : f, d ? f : _(g).scrollTop()) : a[e] = f) }, a, e, arguments.length, null) } }), _.each({ Height: "height", Width: "width" }, function (a, c) {
			_.each({ padding: "inner" + a, content: c, "": "outer" + a }, function (d, e) {
				_.fn[e] = function (e, f) {
					var g = arguments.length && (d || "boolean" != typeof e), h = d || (e === !0 || f === !0 ? "margin" : "border"); return _.access(this, function (c, d, e) {
						var f; return _.isWindow(c) ? c.document.documentElement["client" + a] : 9 === c.nodeType ? (f = c.documentElement, Math.max(c.body["scroll" + a], f["scroll" + a], c.body["offset" + a], f["offset" + a], f["client" + a])) : e === b ? _.css(c, d, e, h) : _.style(c, d, e, h);
					}, c, g ? e : b, g, null)
				}
			})
		}), a.jQuery = a.$ = _, "function" == typeof j && j.amd && j.amd.jQuery && j("jquery", [], function () { return _ })
	}(a), jQuery.base64 = function (a) { function b(a, b) { var c = g.indexOf(a.charAt(b)); if (-1 === c) throw "Cannot decode base64"; return c } function c(a) { var c, d, e = 0, g = a.length, h = []; if (a = String(a), 0 === g) return a; if (g % 4 !== 0) throw "Cannot decode base64"; for (a.charAt(g - 1) === f && (e = 1, a.charAt(g - 2) === f && (e = 2), g -= 4), c = 0; g > c; c += 4) d = b(a, c) << 18 | b(a, c + 1) << 12 | b(a, c + 2) << 6 | b(a, c + 3), h.push(String.fromCharCode(d >> 16, d >> 8 & 255, 255 & d)); switch (e) { case 1: d = b(a, c) << 18 | b(a, c + 1) << 12 | b(a, c + 2) << 6, h.push(String.fromCharCode(d >> 16, d >> 8 & 255)); break; case 2: d = b(a, c) << 18 | b(a, c + 1) << 12, h.push(String.fromCharCode(d >> 16)) } return h.join("") } function d(a, b) { var c = a.charCodeAt(b); if (c > 255) throw "INVALID_CHARACTER_ERR: DOM Exception 5"; return c } function e(a) { if (1 !== arguments.length) throw "SyntaxError: exactly one argument required"; a = String(a); var b, c, e = [], h = a.length - a.length % 3; if (0 === a.length) return a; for (b = 0; h > b; b += 3) c = d(a, b) << 16 | d(a, b + 1) << 8 | d(a, b + 2), e.push(g.charAt(c >> 18)), e.push(g.charAt(c >> 12 & 63)), e.push(g.charAt(c >> 6 & 63)), e.push(g.charAt(63 & c)); switch (a.length - h) { case 1: c = d(a, b) << 16, e.push(g.charAt(c >> 18) + g.charAt(c >> 12 & 63) + f + f); break; case 2: c = d(a, b) << 16 | d(a, b + 1) << 8, e.push(g.charAt(c >> 18) + g.charAt(c >> 12 & 63) + g.charAt(c >> 6 & 63) + f) } return e.join("") } var f = "=", g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h = "1.0"; return { decode: c, encode: e, VERSION: h } }(jQuery), function () { function b(a, c) { function e(a) { if (e[a] !== q) return e[a]; var b; if ("bug-string-char-index" == a) b = "a" != "a"[0]; else if ("json" == a) b = e("json-stringify") && e("json-parse"); else { var d; if ("json-stringify" == a) { b = c.stringify; var f = "function" == typeof b && s; if (f) { (d = function () { return 1 }).toJSON = d; try { f = "0" === b(0) && "0" === b(new g) && '""' == b(new h) && b(r) === q && b(q) === q && b() === q && "1" === b(d) && "[1]" == b([d]) && "[null]" == b([q]) && "null" == b(null) && "[null,null,null]" == b([q, r, null]) && '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}' == b({ a: [d, !0, !1, null, "\x00\b\n\f\r	"] }) && "1" === b(null, d) && "[\n 1,\n 2\n]" == b([1, 2], null, 1) && '"-271821-04-20T00:00:00.000Z"' == b(new j(-864e13)) && '"+275760-09-13T00:00:00.000Z"' == b(new j(864e13)) && '"-000001-01-01T00:00:00.000Z"' == b(new j(-621987552e5)) && '"1969-12-31T23:59:59.999Z"' == b(new j(-1)) } catch (i) { f = !1 } } b = f } if ("json-parse" == a) { if (b = c.parse, "function" == typeof b) try { if (0 === b("0") && !b(!1)) { d = b('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'); var k = 5 == d.a.length && 1 === d.a[0]; if (k) { try { k = !b('"	"') } catch (l) { } if (k) try { k = 1 !== b("01") } catch (m) { } if (k) try { k = 1 !== b("1.") } catch (n) { } } } } catch (o) { k = !1 } b = k } } return e[a] = !!b } a || (a = f.Object()), c || (c = f.Object()); var g = a.Number || f.Number, h = a.String || f.String, i = a.Object || f.Object, j = a.Date || f.Date, k = a.SyntaxError || f.SyntaxError, l = a.TypeError || f.TypeError, m = a.Math || f.Math, n = a.JSON || f.JSON; "object" == typeof n && n && (c.stringify = n.stringify, c.parse = n.parse); var o, p, q, i = i.prototype, r = i.toString, s = new j(-0xc782b5b800cec); try { s = -109252 == s.getUTCFullYear() && 0 === s.getUTCMonth() && 1 === s.getUTCDate() && 10 == s.getUTCHours() && 37 == s.getUTCMinutes() && 6 == s.getUTCSeconds() && 708 == s.getUTCMilliseconds() } catch (t) { } if (!e("json")) { var u = e("bug-string-char-index"); if (!s) var v = m.floor, w = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], x = function (a, b) { return w[b] + 365 * (a - 1970) + v((a - 1969 + (b = +(b > 1))) / 4) - v((a - 1901 + b) / 100) + v((a - 1601 + b) / 400) }; if ((o = i.hasOwnProperty) || (o = function (a) { var b, c = {}; return (c.__proto__ = null, c.__proto__ = { toString: 1 }, c).toString != r ? o = function (a) { var b = this.__proto__; return a = a in (this.__proto__ = null, this), this.__proto__ = b, a } : (b = c.constructor, o = function (a) { var c = (this.constructor || b).prototype; return a in this && !(a in c && this[a] === c[a]) }), c = null, o.call(this, a) }), p = function (a, b) { var c, e, f, g = 0; (c = function () { this.valueOf = 0 }).prototype.valueOf = 0, e = new c; for (f in e) o.call(e, f) && g++; return c = e = null, g ? p = 2 == g ? function (a, b) { var c, d = {}, e = "[object Function]" == r.call(a); for (c in a) e && "prototype" == c || o.call(d, c) || (d[c] = 1, !o.call(a, c)) || b(c) } : function (a, b) { var c, d, e = "[object Function]" == r.call(a); for (c in a) e && "prototype" == c || !o.call(a, c) || (d = "constructor" === c) || b(c); (d || o.call(a, c = "constructor")) && b(c) } : (e = "valueOf toString toLocaleString propertyIsEnumerable isPrototypeOf hasOwnProperty constructor".split(" "), p = function (a, b) { var c, f = "[object Function]" == r.call(a), g = !f && "function" != typeof a.constructor && d[typeof a.hasOwnProperty] && a.hasOwnProperty || o; for (c in a) f && "prototype" == c || !g.call(a, c) || b(c); for (f = e.length; c = e[--f]; g.call(a, c) && b(c)); }), p(a, b) }, !e("json-stringify")) { var y = { 92: "\\\\", 34: '\\"', 8: "\\b", 12: "\\f", 10: "\\n", 13: "\\r", 9: "\\t" }, z = function (a, b) { return ("000000" + (b || 0)).slice(-a) }, A = function (a) { for (var b = '"', c = 0, d = a.length, e = !u || d > 10, f = e && (u ? a.split("") : a) ; d > c; c++) { var g = a.charCodeAt(c); switch (g) { case 8: case 9: case 10: case 12: case 13: case 34: case 92: b += y[g]; break; default: if (32 > g) { b += "\\u00" + z(2, g.toString(16)); break } b += e ? f[c] : a.charAt(c) } } return b + '"' }, B = function (a, b, c, d, e, f, g) { var h, i, j, k, m, n, s, t, u; try { h = b[a] } catch (w) { } if ("object" == typeof h && h) if (i = r.call(h), "[object Date]" != i || o.call(h, "toJSON")) "function" == typeof h.toJSON && ("[object Number]" != i && "[object String]" != i && "[object Array]" != i || o.call(h, "toJSON")) && (h = h.toJSON(a)); else if (h > -1 / 0 && 1 / 0 > h) { if (x) { for (k = v(h / 864e5), i = v(k / 365.2425) + 1970 - 1; x(i + 1, 0) <= k; i++); for (j = v((k - x(i, 0)) / 30.42) ; x(i, j + 1) <= k; j++); k = 1 + k - x(i, j), m = (h % 864e5 + 864e5) % 864e5, n = v(m / 36e5) % 24, s = v(m / 6e4) % 60, t = v(m / 1e3) % 60, m %= 1e3 } else i = h.getUTCFullYear(), j = h.getUTCMonth(), k = h.getUTCDate(), n = h.getUTCHours(), s = h.getUTCMinutes(), t = h.getUTCSeconds(), m = h.getUTCMilliseconds(); h = (0 >= i || i >= 1e4 ? (0 > i ? "-" : "+") + z(6, 0 > i ? -i : i) : z(4, i)) + "-" + z(2, j + 1) + "-" + z(2, k) + "T" + z(2, n) + ":" + z(2, s) + ":" + z(2, t) + "." + z(3, m) + "Z" } else h = null; if (c && (h = c.call(b, a, h)), null === h) return "null"; if (i = r.call(h), "[object Boolean]" == i) return "" + h; if ("[object Number]" == i) return h > -1 / 0 && 1 / 0 > h ? "" + h : "null"; if ("[object String]" == i) return A("" + h); if ("object" == typeof h) { for (a = g.length; a--;) if (g[a] === h) throw l(); if (g.push(h), u = [], b = f, f += e, "[object Array]" == i) { for (j = 0, a = h.length; a > j; j++) i = B(j, h, c, d, e, f, g), u.push(i === q ? "null" : i); a = u.length ? e ? "[\n" + f + u.join(",\n" + f) + "\n" + b + "]" : "[" + u.join(",") + "]" : "[]" } else p(d || h, function (a) { var b = B(a, h, c, d, e, f, g); b !== q && u.push(A(a) + ":" + (e ? " " : "") + b) }), a = u.length ? e ? "{\n" + f + u.join(",\n" + f) + "\n" + b + "}" : "{" + u.join(",") + "}" : "{}"; return g.pop(), a } }; c.stringify = function (a, b, c) { var e, f, g, h; if (d[typeof b] && b) if ("[object Function]" == (h = r.call(b))) f = b; else if ("[object Array]" == h) { g = {}; for (var i, j = 0, k = b.length; k > j; i = b[j++], h = r.call(i), ("[object String]" == h || "[object Number]" == h) && (g[i] = 1)); } if (c) if ("[object Number]" == (h = r.call(c))) { if (0 < (c -= c % 1)) for (e = "", c > 10 && (c = 10) ; e.length < c; e += " "); } else "[object String]" == h && (e = 10 >= c.length ? c : c.slice(0, 10)); return B("", (i = {}, i[""] = a, i), f, g, e, "", []) } } if (!e("json-parse")) { var C, D, E = h.fromCharCode, F = { 92: "\\", 34: '"', 47: "/", 98: "\b", 116: "	", 110: "\n", 102: "\f", 114: "\r" }, G = function () { throw C = D = null, k() }, H = function () { for (var a, b, c, d, e, f = D, g = f.length; g > C;) switch (e = f.charCodeAt(C)) { case 9: case 10: case 13: case 32: C++; break; case 123: case 125: case 91: case 93: case 58: case 44: return a = u ? f.charAt(C) : f[C], C++, a; case 34: for (a = "@", C++; g > C;) if (e = f.charCodeAt(C), 32 > e) G(); else if (92 == e) switch (e = f.charCodeAt(++C)) { case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114: a += F[e], C++; break; case 117: for (b = ++C, c = C + 4; c > C; C++) e = f.charCodeAt(C), e >= 48 && 57 >= e || e >= 97 && 102 >= e || e >= 65 && 70 >= e || G(); a += E("0x" + f.slice(b, C)); break; default: G() } else { if (34 == e) break; for (e = f.charCodeAt(C), b = C; e >= 32 && 92 != e && 34 != e;) e = f.charCodeAt(++C); a += f.slice(b, C) } if (34 == f.charCodeAt(C)) return C++, a; G(); default: if (b = C, 45 == e && (d = !0, e = f.charCodeAt(++C)), e >= 48 && 57 >= e) { for (48 == e && (e = f.charCodeAt(C + 1), e >= 48 && 57 >= e) && G() ; g > C && (e = f.charCodeAt(C), e >= 48 && 57 >= e) ; C++); if (46 == f.charCodeAt(C)) { for (c = ++C; g > c && (e = f.charCodeAt(c), e >= 48 && 57 >= e) ; c++); c == C && G(), C = c } if (e = f.charCodeAt(C), 101 == e || 69 == e) { for (e = f.charCodeAt(++C), 43 != e && 45 != e || C++, c = C; g > c && (e = f.charCodeAt(c), e >= 48 && 57 >= e) ; c++); c == C && G(), C = c } return +f.slice(b, C) } if (d && G(), "true" == f.slice(C, C + 4)) return C += 4, !0; if ("false" == f.slice(C, C + 5)) return C += 5, !1; if ("null" == f.slice(C, C + 4)) return C += 4, null; G() } return "$" }, I = function (a) { var b, c; if ("$" == a && G(), "string" == typeof a) { if ("@" == (u ? a.charAt(0) : a[0])) return a.slice(1); if ("[" == a) { for (b = []; a = H(), "]" != a; c || (c = !0)) c && ("," == a ? (a = H(), "]" == a && G()) : G()), "," == a && G(), b.push(I(a)); return b } if ("{" == a) { for (b = {}; a = H(), "}" != a; c || (c = !0)) c && ("," == a ? (a = H(), "}" == a && G()) : G()), "," != a && "string" == typeof a && "@" == (u ? a.charAt(0) : a[0]) && ":" == H() || G(), b[a.slice(1)] = I(H()); return b } G() } return a }, J = function (a, b, c) { c = K(a, b, c), c === q ? delete a[b] : a[b] = c }, K = function (a, b, c) { var d, e = a[b]; if ("object" == typeof e && e) if ("[object Array]" == r.call(e)) for (d = e.length; d--;) J(e, d, c); else p(e, function (a) { J(e, a, c) }); return c.call(a, b, e) }; c.parse = function (a, b) { var c, d; return C = 0, D = "" + a, c = I(H()), "$" != H() && G(), C = D = null, b && "[object Function]" == r.call(b) ? K((d = {}, d[""] = c, d), "", b) : c } } } return c.runInContext = b, c } var c = "function" == typeof j && j.amd, d = { "function": !0, object: !0 }, e = d[typeof exports] && exports && !exports.nodeType && exports, f = d[typeof a] && a || this, g = e && d[typeof module] && module && !module.nodeType && "object" == typeof global && global; if (!g || g.global !== g && g.window !== g && g.self !== g || (f = g), e && !c) b(f, e); else { var h = f.JSON, i = f.JSON3, k = !1, l = b(f, f.JSON3 = { noConflict: function () { return k || (k = !0, f.JSON = h, f.JSON3 = i, h = i = null), l } }); f.JSON = { parse: l.parse, stringify: l.stringify } } c && j(function () { return l }) }.call(this), function (a) { "function" == typeof j && j.amd ? j(["jquery"], a) : a(jQuery) }(function (b) { if (!b.support.cors && b.ajaxTransport && a.XDomainRequest) { var d = /^https?:\/\//i, e = /^get|post$/i, f = new RegExp("^" + location.protocol, "i"); b.ajaxTransport("* text html xml json", function (a, g, h) { if (a.crossDomain && a.async && e.test(a.type) && d.test(a.url) && f.test(a.url)) { var i = null; return { send: function (d, e) { var f = "", h = (g.dataType || "").toLowerCase(); i = new XDomainRequest, /^\d+$/.test(g.timeout) && (i.timeout = g.timeout), i.ontimeout = function () { e(500, "timeout") }, i.onload = function () { var a = "Content-Length: " + i.responseText.length + "\r\nContent-Type: " + i.contentType, d = { code: 200, message: "success" }, f = { text: i.responseText }; try { if ("html" === h || /text\/html/i.test(i.contentType)) f.html = i.responseText; else if ("json" === h || "text" !== h && /\/json/i.test(i.contentType)) try { f.json = b.parseJSON(i.responseText) } catch (g) { d.code = 500, d.message = "parseerror" } else if ("xml" === h || "text" !== h && /\/xml/i.test(i.contentType)) { var j = new ActiveXObject("Microsoft.XMLDOM"); j.async = !1; try { j.loadXML(i.responseText) } catch (g) { j = c } if (!j || !j.documentElement || j.getElementsByTagName("parsererror").length) throw d.code = 500, d.message = "parseerror", "Invalid XML: " + i.responseText; f.xml = j } } catch (k) { throw k } finally { e(d.code, d.message, f, a) } }, i.onprogress = function () { }, i.onerror = function () { e(500, "error", { text: i.responseText }) }, g.data && (f = "string" === b.type(g.data) ? g.data : b.param(g.data)), i.open(a.type, a.url), i.send(f) }, abort: function () { i && i.abort() } } } }) } }); var l = e(-1 !== location.protocol.indexOf("https")); if (l.retries = 3, l.host = "issuu.com", l.configVersion = "1.0.0", m === c) var m = {}; if (m.compile = function (a) { var b = new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + a.replace(/[\r\t\n]/g, " ").split("<%").join("	").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(/\t=(.*?)%>/g, "',$1,'").split("	").join("');").split("%>").join("p.push('").split("\r").join("\\'") + "');}return p.join('');"); return b }, m.render = function (a, b) { var c = m.strings[a], d = m.compile(c); return d(b) }, m === c) var m = {}; if (m.strings = { "error.templ": '<p style="display:block; font:normal 16px Helvetica Neue, HelveticaNeue, Helvetica, Trebuchet, Trebuchet MS, Arial, sans-serif; text-align:center; background-color:rgb(0,0,0); padding:20px; color:white; text-decoration:none;">    <%=msg%><br><br>    <span style="font-size: 11px;">    	<%=id%> | <%=err%> | <%=browser%> | <%=date%>    </span></p>', "factory-fluid.templ": '<div style="width:100%; height:100%;">    <div style="height:-moz-calc(100% - 18px); height:-webkit-calc(100% - 18px); height:-o-calc(100% - 18px); height:calc(100% - 18px);"><%=embedCode%></div>    <div style="height:18px; text-align:left;">        <span style="width:100%; text-align:left; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:12px; font-style:normal; font-weight:normal; height:auto; line-height:18px; margin:0; padding:0;" >            <a href="http://<%=host%>/<%=username%>/docs/<%=name%>" target="_blank">Open publication</a> - Free <a href="http://<%=host%>" target="_blank">publishing</a>        </span>	</div></div>', "factory.templ": '    <div style="height:<%=topRatio%>%;"><%=embedCode%></div>    <div style="height:<%=bottomRatio%>%; text-align:left;">        <span style="width:100%; text-align:left; font-family:Helvetica Neue, Helvetica, Arial, sans-serif; font-size:12px; font-style:normal; font-weight:normal; height:auto; line-height:18px; margin:0; padding:0;" >            <a href="http://<%=host%>/<%=username%>/docs/<%=name%>" target="_blank">Open publication</a> - Free <a href="http://<%=host%>" target="_blank">publishing</a>        </span>    </div>', "htmlembed.templ": '<div class="pcover" href="<%=issuuPath+username%>/docs/<%=name%>?e=<%=embedId%>" style="width:100%; height:100%; display:block;    background-color:<%=embedBackgroundColor%>; position:relative; text-align:center; font:bold 18px Helvetica Neue, HelveticaNeue, Helvetica, Trebuchet, Trebuchet MS, Arial, sans-serif;">    <a href="<%=issuuPath+username%>/docs/<%=name%>?e=<%=embedId%>" class="read-link" style="display: initial;" target="_blank">        <img style="width:auto; height:auto; max-width:90%; max-height:90%; margin:0; position:absolute; top:50%; left:50%; margin-right:-50%; transform: translate(-50%, -50%); -webkit-box-shadow:0px 2px 8px rgba(50, 50, 50, 0.7); -moz-box-shadow:0px 2px 8px rgba(50, 50, 50, 0.7); box-shadow:0px 2px 8px rgba(50, 50, 50, 0.7);"            src="<%=imgPath+documentId%>/jpg/page_<%=pageNumber%>_thumb_large.jpg" alt="<%=imgAlt%>" >        <span style="position:absolute; top:50%; left:50%; z-index:2; display:block;            width:150px; height:50px; margin-top:-25px; margin-left:-75px;            line-height:48px; vertical-align:middle; text-align:center; background-color: rgb(0,0,0);            -moz-border-radius: 15px;            -webkit-border-radius: 15px;            -ms-border-radius: 15px;            -o-border-radius: 15px;            border-radius: 15px;            background-color: rgba(0,0,0, 0.7); border: 2px solid white; color: white; text-decoration: none;            text-indent: initial;">Read now        </span>    </a>    <a href="<%=issuuPath%>" target="_blank">        <img href="<%=issuuPath%>" alt="issuu is the world&#39;s largest collection of free-to-read publications including magazines, newspapers, portfolios, and catalogs. You can publish too." style="width:58px; display:block; position:absolute; bottom:10px; right:10px; opacity:0.3; border-width:0px;"src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAAAaCAYAAAAOl/o1AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo2NTlGNEFEMTBBMTcxMUUyQUI1N0I0NkQ0RkNFMjg5MiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo2NTlGNEFEMjBBMTcxMUUyQUI1N0I0NkQ0RkNFMjg5MiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjY1OUY0QUNGMEExNzExRTJBQjU3QjQ2RDRGQ0UyODkyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjY1OUY0QUQwMEExNzExRTJBQjU3QjQ2RDRGQ0UyODkyIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+dJYXrgAABBRJREFUeNrsWF9IU2EU36YIU5YZ9hA+RCr5r5UwwZc096LUg+ReoubDXhQShPlkOF/1zVB8yD8PvWwW/dnCytoeWihEDYWVoQYpDlwFM8sNG2m5zm/cTz5u310aEub1wOH77vnOPfc7v3u+c8692kQioRFQNnGhZn9TmPiTXJjOzdOIrxHbVAAGIwDylNhOvAqBVoqQDGIf8TmNOgnRUolRJwkcKgYDlEd8k0UIouMj8RG5ViwW+xoMBt+Vl5cXGQyGwyoA5jQi5IQIDJDZbH5cXV0dwaiSSDHppPwhpFAolM6PKiB9Skf9fn/Z6Ojo+/r6+jK1JBPkECONbzQHBGrRpVqdmJh4VVFR4fJ4PH752vDw8JO6ujoX1hl3d3c/CIfDIVFyxhqvq6TP7IrsJOsjybEOPbkM9pR8wRqzC7/eEmH8TRERklAgk8nkJJWHGEVyJR4fH3/JdJeWlhZzc3Nvp9J3u93PmD6TdXV1eUR7gpzppJLJibc7LZHgGVd3nCzxZqamptDaa8jgj6qqqmOYLy8vfxsYGPjg8/my5+bmVkie1G9vb39Bawa9Xr/e19enLy4uTlY06AwODq7A1uzs7GpDQ8M/OxeniPhRqXXfFkUike/svo6Ojov8msgpcnwTY2lpabypqcnC5ACMrvdcEtHt9IaSkpJsNlfKLzxZLJYsjIiEtra2uzi7ezmr7hgQigKz1WqNMSfJ4TWtVvtInugYtba21uTn50cx7+3t1RuNxsXMzEx3Y2Pjrb0Iju5vbnI6nZcpcR6tra1dZTLkjubm5p8FBQUjvKNo+efn568MDQ2lMWDi8XiGy+UyABwA898DIuWASq/Xa41Go2fhLFWeJDgLCwuHbDbba7k+5YvzAIaqjhHJmCrPGuQARlQuKVdtKOSwjVT7QonfjmzXAeEjAM5OTk5a+aOk+FmZl3ccyZgcu8RAobK7xtZZ1FEUbsodwTXkvB6IOumt/zf9/f3P5c/kZbzurgCCPIGcgVCXN0/kZHKzzFEQcgtyBqKAd5CfUyne2kdnZ2ehVMaz6Ct7DEkbDRSeS0fOCznWe3p6zvBllAHkcDjSsTfcA8YcMgaiqNRuu3VHFcHbxnFABECGDVIkfEEewDXyQk5OTgIfgGyzOEKIGtYhsg0lPyelozUzM6OHDfQngUDgJL9ROI98pLRp3j4PMADEkRXdg30Gg8ELf/iN0YJOtUipu6MHj4m6RnSfdrv9Dj3ExTpAcuw+vQEn36UygoxAHOE7Vswhgy3Rs9FJwh7sMvvQhzyRgrBXfl+YK3W9ArIhQvR042d8+h5822kqcXbjxDcOsNAEiQP8T+ZJYqNKwVghriGeZtl9XfrrfF1aVAvB73v4lwowWJURKSr+Z91nYEzLhb8EGABnI1kQq06oHQAAAABJRU5ErkJggg==" >    </a></div>' }, n === c) var n = {}; if (n.embederror = function () { return { render: function (a, b, c, d, e) { var f; if (e.responseText) f = e.responseText; else switch (e.status) { case 0: case 408: f = "Server not responding"; break; case 404: f = "Data not found"; break; default: f = "Error loading data" } y(a).html(m.render("error.templ", { msg: f, id: c.substr(c.indexOf("/") + 1), err: y.map(e, function (a, b) { return "responseText" !== b ? a : "" }).filter(function (a) { return "" !== a }).join(" | "), browser: y.map(y.browser, function (a, b) { return "webkit" === b ? "" : a === !0 ? b : a }).filter(function (a) { return "" !== a }).join(" "), date: parseInt((new Date).getTime() / 1e3, 10) })), d && d() }, getReader: function (a) { return c } } }(), n === c) var n = {}; if (n.type = { READER2: "reader2", HTML5: "html5", ERROR: "error" }, n.browserPrefixes = ["-webkit-", "-o-", "-ms-", "-moz-"], n.testAllPrefixesForCalcCss = function () { var a, c = !1; for (a = 0; a < n.browserPrefixes.length; a++) { var d = b.createElement("div"); d.style.cssText = "width:" + n.browserPrefixes[a] + "calc(10px);", d.style.length && (c = !0) } return c }, n.addLinks = function (a, b, c, d) { var e, f = 18, g = { embedCode: a, username: b, name: c, host: l.host, bottomRatio: f / d * 100, topRatio: (d - f) / d * 100 }; e = n.testAllPrefixesForCalcCss() ? "factory-fluid.templ" : "factory.templ"; var h = m.render(e, g); return h }, n.get = function () { var a = n.type, b = d(), e = /(ipad|iphone|ipod|android).*?applewebkit/i, f = /Chrome/, g = !e.test(navigator.userAgent) && b.hasFlash() && b.isGoodForIssuu() ? a.READER2 : a.HTML5; return function (b, d, e) { switch (e === c && (e = g), f.test(navigator.userAgent) && 116550 > b * d && (e = a.HTML5), e) { case a.READER2: return n.flashembed; case a.HTML5: return n.embedHtml; case a.ERROR: return n.embederror; default: throw new Error("Don't know the expected type: " + e) } } }(), n === c) var n = {}; if (n.flashembed = function () { function d() { return l.staticProto + l.staticHost + "webembed/viewers/style1/v2/IssuuReader.swf" } function e(a, b) { var c, d = {}; for (c in h) h.hasOwnProperty(c) && (d[c] = h[c]); for (c in a) a.hasOwnProperty(c) && (d[c] = a[c]); return d.embedId = b, d } function f(c, d) { function e(a, b) { c[a] !== h[a] && f.push(b) } var f = ["mode=mini"]; return a.issuuIframe || (f.push("jsAPIClientDomain=" + location.hostname), f.push("jsAPIInitCallback=" + d)), f.push("bl_referrer=" + encodeURIComponent(a.issuuIframe ? b.referrer : location.href)), e("viewMode", "viewMode=" + c.viewMode), e("autoFlip", "autoFlip=" + c.autoFlip), e("embedBackground", "embedBackground=" + encodeURIComponent(c.embedBackground)), e("pageNumber", "pageNumber=" + c.pageNumber), e("titleBarEnabled", "titleBarEnabled=" + c.titleBarEnabled), e("shareMenuEnabled", "shareMenuEnabled=" + c.shareMenuEnabled), e("proSidebarEnabled", "proSidebarEnabled=" + c.proSidebarEnabled), e("printButtonEnabled", "printButtonEnabled=" + c.printButtonEnabled), e("shareButtonEnabled", "shareButtonEnabled=" + c.shareButtonEnabled), e("searchButtonEnabled", "searchButtonEnabled=" + c.searchButtonEnabled), e("clippingEnabled", "clippingEnabled=" + c.clippingEnabled), e("linkTarget", "linkTarget=" + c.linkTarget), e("backgroundColor", "backgroundColor=" + encodeURIComponent(c.backgroundColor)), e("theme", "theme=" + c.theme), e("backgroundImage", "backgroundImage=" + encodeURIComponent(c.backgroundImage)), e("backgroundStretch", "backgroundStretch=" + c.backgroundStretch), e("backgroundTile", "backgroundTile=" + c.backgroundTile), e("layout", "layout=" + encodeURIComponent(c.layout)), c.logo && e("logo", "logo=" + encodeURIComponent(c.logo)), e("documentId", "documentId=" + c.documentId), e("embedId", "embedId=" + c.embedId), f.join("&amp;") } function g(a, b, c, g) { var h = e(a, b), i = f(h, g), j = "issuu_" + (Math.random() + "").substr(2), k = '<object id="' + j + '" style="width:' + h.width + h.unit + ";height:" + h.height + h.unit + '" type="application/x-shockwave-flash" data="' + d() + '">'; return k += '<param name="movie" value="' + d() + '" />', k += '<param name="flashvars" value="' + i + '" />', k += '<param name="allowfullscreen" value="true"/>', k += '<param name="allowscriptaccess" value="always"/>', k += '<param name="menu" value="false"/>', k += '<param name="wmode" value="transparent"/>', k += "</object>", h.showHtmlLink && (k = n.addLinks(k, h.username, h.name, y(c).height())), k } var h = { viewMode: "doublePage", autoFlip: !1, embedBackground: c, pageNumber: 1, titleBarEnabled: !1, shareMenuEnabled: !0, showHtmlLink: !0, proSidebarEnabled: !1, printButtonEnabled: !1, shareButtonEnabled: !0, searchButtonEnabled: !0, clippingEnabled: !0, linkTarget: "_blank", backgroundColor: c, theme: "default", backgroundImage: c, backgroundStretch: !1, backgroundTile: !1, layout: c, logo: c, documentId: c, embedId: c, name: c, username: c, tag: c, width: 100, height: 100, unit: "%" }; return { render: function (b, d, e, f) { var h = "issuuflashEmbedOnInit" + (Math.random() + "").substr(2); if (a[h]) throw new Error("Function " + h + " already defined on window."); a[h] = function () { a[h] = c, f && f() }, y(b).html(g(d, e, b, h)) }, getReader: function (a) { return y(a).length > 0 ? y(a).find("object")[0] : c } } }(), n === c) var n = {}; if (n.embedHtml = function () { function b(a) { return ("" + a).replace(/[&<>'"`]/g, function (a) { return f[a] }) } function c(a, c) { "use strict"; var f = { documentId: a.documentId, name: a.name, pageNumber: a.pageNumber ? a.pageNumber + "" : "1", embedId: c, username: a.username, issuuPath: e, embedBackgroundColor: a.embedBackground ? a.embedBackground : "none", imgPath: d, imgAlt: b((a.title || "") + (a.documentCreator ? " -- " + a.documentCreator : "")) }, g = m.render("htmlembed.templ", f); return g } var d = l.imgProto + l.imgHost, e = "http://" + l.host + "/", f = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;", "`": "&#96;" }; return { render: function (b, d, e, f) { var g = o.create(d, e), h = c(d, e); d.showHtmlLink !== !1 && (h = n.addLinks(h, d.username, d.name, y(b).height())), y(b).html(h), y(".read-link", b).click(function (b) { b.preventDefault(); var c = this; g.docClick(), y(this).unbind("click"), a.setTimeout(function () { c.click() }, 1e3) }), g.docImpression(), f && f() }, getReader: function (a) { var b = function () { return 1 }; return { getPageNumber: b, setPageNumber: b, getPageCount: b, goToPreviousPage: b, goToNextPage: b, goToFirstPage: b, goToLastPage: b, addEventListener: b } } } }(), o === c) var o = {}; if (o.PINGBACK_SEND_MODE = { JQUERY: "SEND_JQUERY", XDR: "SEND_XDR", IFRAME: "SEND_IFRAME", COOKIE: "SEND_COOKIE", LOG: "LOG", CALLBACKFN: "CALLBACKFN", ALL: "SEND_ALL" }, o.PingbackHelper = function () { function b() { return l.pingbackProto + l.pingbackHost + "ping" } function c(a) { console.log(JSON.parse(a), a) } function d(a) { var c = b(); y.ajax({ type: "POST", url: c, data: a, crossDomain: !0 }) } function e(c) { if (a.XDomainRequest) { var d = b(), e = new XDomainRequest; e.open("POST", d), e.send(c) } } function f(c) { var d = b(), e = "pingback", f = y.base64.encode(c), g = .04; r.setCookie(e, f, g); var h = new Image(1, 1); h.src = d + "?" + (new Date).getTime(), a.setTimeout(function () { r.clearCookie(e) }, 100) } function g(c) { function d(a) { var b = "post_frame" + a; y("body").append('<iframe id="' + b + '" style="width: 0; height: 0; border: none;"></iframe>'), g = y("iframe#" + b) } function e() { g.remove() } function f(a) { var c = b(), d = g.contents().find("body"), e = '<form method="post" action="' + c + '">'; e += '<textarea name="data">' + a + "</textarea>", e += "</form>", y(e).appendTo(d); var f = y("form", d); f.length > 0 && f[0].submit() } var g; d(p++), a.setTimeout(function () { f(c), a.setTimeout(function () { e() }, 300) }, 1) } function h(a) { f(a), g(a), e(a), d(a) } function i() { return y.browser.msie ? a.XDomainRequest ? o.PINGBACK_SEND_MODE.XDR : o.PINGBACK_SEND_MODE.COOKIE : o.PINGBACK_SEND_MODE.JQUERY } function j(a) { switch (m || (m = i()), m) { case o.PINGBACK_SEND_MODE.LOG: c(a); break; case o.PINGBACK_SEND_MODE.JQUERY: d(a); break; case o.PINGBACK_SEND_MODE.XDR: e(a); break; case o.PINGBACK_SEND_MODE.IFRAME: g(a); break; case o.PINGBACK_SEND_MODE.COOKIE: f(a); break; case o.PINGBACK_SEND_MODE.ALL: h(a); break; case o.PINGBACK_SEND_MODE.CALLBACKFN: n(b(), a) } } function k(a, b) { m = a, b && (n = b) } var m, n, p = 0; return { setSendMode: k, send: j } }(), o === c) var o = {}; if ("undefined" != typeof JSON3 && "undefined" != typeof JSON3.noConflict) var p = JSON3.noConflict(); var q = p || JSON; o.create = function (d, e) { function f(c) { return { version: "1.2.0", origin: "embed:" + (a.issuuIframe ? "iframe" : "script") + ":build" + k, type: "signal", embed_id: e, username: r.getCookie("site.model.username") || "", location: a.issuuIframe ? b.referrer : location.href, source: "external", disco_contexts: [], contexts: [{ doc_id: d.documentId, doc_creator: d.username, doc_name: d.name, ad_id: null, pages: [d.pageNumber || 1], display_size: y(a).width() + "x" + y(a).height(), events: c }] } } function g(a) { var b = f(a); b.disco_contexts.toJSON = c, b.contexts.toJSON = c, b.contexts[0].pages.toJSON = c, b.contexts[0].events.toJSON = c, "undefined" != typeof q.stringify && o.PingbackHelper.send(q.stringify(b)) } return { docClick: function () { g([{ type: "embed_click" }]) }, docImpression: function () { g([{ type: "document_impression" }, { type: "page_impression", page: d.pageNumber || 1 }]) } } }; var r = function () { function a(a, c, d) { var e; if (d) { var f = new Date; f.setTime(f.getTime() + 24 * d * 60 * 60 * 1e3), e = "; expires=" + f.toGMTString() } else e = ""; b.cookie = a + "=" + c + e + "; path=/; domain=" + l.host } function c(a) { var c, d, e, f; for (c = a + "=", d = b.cookie.split(";"), e = 0; e < d.length; e++) { for (f = d[e]; " " === f.charAt(0) ;) f = f.substring(1, f.length); if (0 === f.indexOf(c)) return f.substring(c.length, f.length) } return null } function d(b) { a(b, "", -1) } return { getCookie: function (a) { return c(a) }, setCookie: function (b, c, d) { a(b, c, d) }, clearCookie: function (a) { d(a) } } }(), s = {}; !function () { function a(a, b, c) { "function" != typeof c && (c = function (a) { return a }), s[a] = function (a) { return { target: b, value: c(a) } } } function b(a) { return !!a } a("id", "documentId"), a("du", "username", function (a) { return a.toLowerCase() }), a("dn", "name"), a("dt", "title"), a("dc", "documentCreator"), a("pg", "pageNumber"), a("st", "titleBarEnabled", b), a("sa", "proSidebarEnabled", b), a("bc", "embedBackground"), a("bi", "backgroundImage"), a("fc", "backgroundColor"), a("ss", "shareMenuEnabled", b), a("pr", "printButtonEnabled", b), a("sh", "shareButtonEnabled", b), a("se", "searchButtonEnabled", b), a("sl", "showHtmlLink", b), a("af", "autoFlip", b), a("sc", "clippingEnabled", b), a("vm", "viewMode", function (a) { return "s" === a ? "singlePage" : "doublePage" }), a("lg", "logo"), a("th", "theme"), a("lo", "layout"), a("lt", "linkTarget", function (a) { return "n" === a ? "_blank" : "_self" }), s.bp = function (a) { switch (a) { case "s": return { target: "backgroundStretch", value: !0 }; case "t": return { target: "backgroundTile", value: !0 }; default: return { target: "backgroundTile", value: !1 } } } }(); var t = "data-configid", u = "data-url", v = "invalid", w = ".issuuembed", x = "issuu-isrendered", y = jQuery.noConflict(!0), z = {}; !function () { "use strict"; "object" != typeof a.IssuuReaders && (a.IssuuReaders = { loaded: !1, get: h, add: i }), y(b).ready(function () { a.IssuuReaders.add() }) }(); var A = function () { function b(a) { var b = /(?:https?:\/\/)?(?:[a-zA-Z0-9_\-\.]+\.)?t?issuu\.com\/([a-zA-Z0-9_\-\.]{4,40})\/docs\/([a-z0-9_.\-]{1,100})(\/\d+)?/, c = b.exec(a), d = c && c.length > 3 && "undefined" != typeof c[3] ? c[3] : ""; return c && c.length > 2 ? c[1] + "/" + c[2] + d : j } function c(a) { var c = b(a).split("/"); return l.configProto + l.apiHost + l.apiPath + "?action=issuu.document.get_anonymous&documentUsername=" + c[0] + "&name=" + c[1] + "&format=json" } function d(a) { return l.configProto + l.configHost + l.configPath + a + ".json?v=" + l.configVersion } function e(a) { var b = {}; return y.each(a, function (a, c) { if ("function" == typeof s[a]) { var d = s[a](c); b[d.target] = d.value } }), b } function f(a, c) { var d = a.rsp._content.document, e = b(c).split("/"), f = { documentId: d.documentId, username: d.username, name: d.name, title: d.title, pageNumber: "undefined" != typeof e[2] ? parseInt(e[2], 10) : 1 }; return f } function g(a, b, c, d, e) { i[a]++, i[a] < l.retries ? h(a, b, c, d) : d && d(e) } function h(b, h, i, j) { "use strict"; var k, l = a.setTimeout(function () { g(b, h, i, j, { status: 0 }) }, 5500), m = function () { a.clearTimeout(l) }, n = { cache: !0, dataType: "json", crossDomain: !0, timeout: 5e3, success: function (a) { m(), i && i(e(a)) }, error: function (a, c, d) { m(), g(b, h, i, j, { status: a.status, "X-Served-By": a.getResponseHeader("X-Served-By") }) } }; "embedid" === h ? (k = d(b, h), y.ajax(k, n)) : (k = c(b, h), y.ajax(k, y.extend(n, { success: function (a) { m(); var c = {}; i && "undefined" != typeof a.rsp && "ok" === a.rsp.stat && a.rsp._content && a.rsp._content.document ? i(f(a, b)) : "undefined" != typeof a.rsp && "fail" === a.rsp.stat ? ("undefined" != typeof a.rsp._content && "undefined" != typeof a.rsp._content.error && (c = { code: a.rsp._content.error.code, responseText: a.rsp._content.error.message }), g(b, h, i, j, c)) : g(b, h, i, j, c) } }))) } var i = {}, j = "invalid"; return { load: function (a, b, c, d) { i[a] = 0, "invalid" === a ? d && d({ responseText: "Invalid embed id" }) : h(a, b, c, d) } } }()
}(window, document);;
/*! iFrame Resizer (iframeSizer.min.js ) - v4.3.2 - 2021-10-18
 *  Desc: Force cross domain iframes to size to content.
 *  Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
 *  Copyright: (c) 2021 David J. Bradshaw - dave@bradshaw.net
 *  License: MIT
 */

!function(u){var f,l,a,x,M,I,k,r,m,F,i,g,z;function h(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function O(e,n,i){e.addEventListener(n,i,!1)}function R(e,n,i){e.removeEventListener(n,i,!1)}function o(e){return M+"["+(e="Host page: "+(n=e),e=window.top!==window.self?window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+n:"Nested host page: "+n:e)+"]";var n}function t(e){return F[e]?F[e].log:l}function T(e,n){s("log",e,n,t(e))}function E(e,n){s("info",e,n,t(e))}function N(e,n){s("warn",e,n,!0)}function s(e,n,i,t){!0===t&&"object"==typeof window.console&&console[e](o(n),i)}function e(n){function i(){t("Height"),t("Width"),L(function(){A(y),H(v),l("onResized",y)},y,"init")}function e(){var e=b.substr(I).split(":"),n=e[1]?parseInt(e[1],10):0,i=F[e[0]]&&F[e[0]].iframe,t=getComputedStyle(i);return{iframe:i,id:e[0],height:n+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.paddingTop?parseInt(e.paddingTop,10):0,e=e.paddingBottom?parseInt(e.paddingBottom,10):0;return n+e}(t)+function(e){if("border-box"!==e.boxSizing)return 0;var n=e.borderTopWidth?parseInt(e.borderTopWidth,10):0,e=e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0;return n+e}(t),width:e[2],type:e[3]}}function t(e){var n=Number(F[v]["max"+e]),i=Number(F[v]["min"+e]),t=e.toLowerCase(),e=Number(y[t]);T(v,"Checking "+t+" is in range "+i+"-"+n),e<i&&(e=i,T(v,"Set "+t+" to min value")),n<e&&(e=n,T(v,"Set "+t+" to max value")),y[t]=""+e}function o(){function e(){return t.constructor===Array?function(){var e=0,n=!1;for(T(v,"Checking connection is from allowed list of origins: "+t);e<t.length;e++)if(t[e]===i){n=!0;break}return n}():(e=F[v]&&F[v].remoteHost,T(v,"Checking connection is from: "+e),i===e);var e}var i=n.origin,t=F[v]&&F[v].checkOrigin;if(t&&""+i!="null"&&!e())throw new Error("Unexpected message received from: "+i+" for "+y.iframe.id+". Message was: "+n.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return 1}function a(e){return b.substr(b.indexOf(":")+x+e)}function s(i,t){var e,n,o;e=function(){var e,n;B("Send Page Info","pageInfo:"+(e=document.body.getBoundingClientRect(),n=y.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-e.top,10),offsetLeft:parseInt(n.left-e.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),i,t)},n=32,z[o=t]||(z[o]=setTimeout(function(){z[o]=null,e()},n))}function r(e){e=e.getBoundingClientRect();return S(v),{x:Math.floor(Number(e.left)+Number(k.x)),y:Math.floor(Number(e.top)+Number(k.y))}}function d(e){var n=e?r(y.iframe):{x:0,y:0},i={x:Number(y.width)+n.x,y:Number(y.height)+n.y};T(v,"Reposition requested from iFrame (offset x:"+n.x+" y:"+n.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](i.x,i.y):N(v,"Unable to scroll to requested position, window.parentIFrame not found"):(k=i,c(),T(v,"--"))}function c(){!1!==l("onScroll",k)?H(v):j()}function u(e){var n,i=e.split("#")[1]||"",e=decodeURIComponent(i),t=document.getElementById(e)||document.getElementsByName(e)[0];t?(n=r(t),T(v,"Moving to in page link (#"+i+") at x: "+n.x+" y: "+n.y),k={x:n.x,y:n.y},c(),T(v,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(i):T(v,"In page link #"+i+" not found and window.parentIFrame not found"):T(v,"In page link #"+i+" not found")}function f(e){var n,i={};i=0===Number(y.width)&&0===Number(y.height)?{x:(n=a(9).split(":"))[1],y:n[0]}:{x:y.width,y:y.height},l(e,{iframe:y.iframe,screenX:Number(i.x),screenY:Number(i.y),type:y.type})}function l(e,n){return W(v,e,n)}function m(){switch(F[v]&&F[v].firstRun&&F[v]&&(F[v].firstRun=!1),y.type){case"close":C(y.iframe);break;case"message":n=a(6),T(v,"onMessage passed: {iframe: "+y.iframe.id+", message: "+n+"}"),l("onMessage",{iframe:y.iframe,message:JSON.parse(n)}),T(v,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":F[v].autoResize=JSON.parse(a(9));break;case"scrollTo":d(!1);break;case"scrollToOffset":d(!0);break;case"pageInfo":s(F[v]&&F[v].iframe,v),r=v,e("Add ",O),F[r]&&(F[r].stopPageInfo=o);break;case"pageInfoStop":F[v]&&F[v].stopPageInfo&&(F[v].stopPageInfo(),delete F[v].stopPageInfo);break;case"inPageLink":u(a(9));break;case"reset":P(y);break;case"init":i(),l("onInit",y.iframe);break;default:0===Number(y.width)&&0===Number(y.height)?N("Unsupported message received ("+y.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):i()}function e(n,i){function t(){F[r]?s(F[r].iframe,r):o()}["scroll","resize"].forEach(function(e){T(r,n+e+" listener for sendPageInfo"),i(window,e,t)})}function o(){e("Remove ",R)}var r,n}var g,h,p,w,b=n.data,y={},v=null;"[iFrameResizerChild]Ready"===b?function(){for(var e in F)B("iFrame requested init",q(e),F[e].iframe,e)}():M===(""+b).substr(0,I)&&b.substr(I).split(":")[0]in F?(y=e(),v=y.id,F[v]&&(F[v].loaded=!0),(w=y.type in{true:1,false:1,undefined:1})&&T(v,"Ignoring init message from meta parent page"),!w&&(p=!0,F[h=v]||(p=!1,N(y.type+" No settings for "+h+". Message was: "+b)),p)&&(T(v,"Received: "+b),g=!0,null===y.iframe&&(N(v,"IFrame ("+y.id+") not found"),g=!1),g&&o()&&m())):E(v,"Ignored: "+b)}function W(e,n,i){var t=null,o=null;if(F[e]){if("function"!=typeof(t=F[e][n]))throw new TypeError(n+" on iFrame["+e+"] is not a function");o=t(i)}return o}function p(e){e=e.id;delete F[e]}function C(e){var n=e.id;if(!1!==W(n,"onClose",n)){T(n,"Removing iFrame: "+n);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){N(e)}W(n,"onClosed",n),T(n,"--"),p(e)}else T(n,"Close iframe cancelled by onClose event")}function S(e){null===k&&T(e,"Get page position: "+(k={x:window.pageXOffset!==u?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==u?window.pageYOffset:document.documentElement.scrollTop}).x+","+k.y)}function H(e){null!==k&&(window.scrollTo(k.x,k.y),T(e,"Set page position: "+k.x+","+k.y),j())}function j(){k=null}function P(e){T(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),S(e.id),L(function(){A(e),B("reset","reset",e.iframe,e.id)},e,"reset")}function A(o){function i(e){function n(){Object.keys(F).forEach(function(e){function n(e){return"0px"===(F[i]&&F[i].iframe.style[e])}var i;F[i=e]&&null!==F[i].iframe.offsetParent&&(n("height")||n("width"))&&B("Visibility change","resize",F[i].iframe,i)})}function i(e){T("window","Mutation observed: "+e[0].target+" "+e[0].type),c(n,16)}var t;a||"0"!==o[e]||(a=!0,T(r,"Hidden iFrame detected, creating visibility listener"),(t=h())&&function(){var e=document.querySelector("body");new t(i).observe(e,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}())}function e(e){var n;n=e,o.id?(o.iframe.style[n]=o[n]+"px",T(o.id,"IFrame ("+r+") "+n+" set to "+o[n]+"px")):T("undefined","messageData id not set"),i(e)}var r=o.iframe.id;F[r]&&(F[r].sizeHeight&&e("height"),F[r].sizeWidth&&e("width"))}function L(e,n,i){i!==n.type&&r&&!window.jasmine?(T(n.id,"Requesting animation frame"),r(e)):e()}function B(n,i,t,o,e){function r(){var e;t&&"contentWindow"in t&&null!==t.contentWindow?(e=F[o]&&F[o].targetOrigin,T(o,"["+n+"] Sending msg to iframe["+o+"] ("+i+") targetOrigin: "+e),t.contentWindow.postMessage(M+i,e)):N(o,"["+n+"] IFrame("+o+") not found")}function a(){e&&F[o]&&F[o].warningTimeout&&(F[o].msgTimeout=setTimeout(function(){!F[o]||F[o].loaded||s||(s=!0,N(o,"IFrame has not responded within "+F[o].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},F[o].warningTimeout))}var s=!1;o=o||t.id,F[o]&&(r(),a())}function q(e){return e+":"+F[e].bodyMarginV1+":"+F[e].sizeWidth+":"+F[e].log+":"+F[e].interval+":"+F[e].enablePublicMethods+":"+F[e].autoResize+":"+F[e].bodyMargin+":"+F[e].heightCalculationMethod+":"+F[e].bodyBackground+":"+F[e].bodyPadding+":"+F[e].tolerance+":"+F[e].inPageLinks+":"+F[e].resizeFrom+":"+F[e].widthCalculationMethod+":"+F[e].mouseEvents}function d(t,e){function n(i){var e,n=h();n&&(e=n,t.parentNode&&new e(function(e){e.forEach(function(e){Array.prototype.slice.call(e.removedNodes).forEach(function(e){e===t&&C(t)})})}).observe(t.parentNode,{childList:!0})),O(t,"load",function(){var e,n;B("iFrame.onload",i,t,u,!0),e=F[s]&&F[s].firstRun,n=F[s]&&F[s].heightCalculationMethod in m,!e&&n&&P({iframe:t,height:0,width:0,type:"init"})}),B("init",i,t,u,!0)}function i(e){var n=e.split("Callback");2===n.length&&(this[n="on"+n[0].charAt(0).toUpperCase()+n[0].slice(1)]=this[e],delete this[e],N(s,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version."))}function o(e){e=e||{},F[s]={firstRun:!0,iframe:t,remoteHost:t.src&&t.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(i,e),function(e){for(var n in g)Object.prototype.hasOwnProperty.call(g,n)&&(F[s][n]=(Object.prototype.hasOwnProperty.call(e,n)?e:g)[n])}(e),F[s]&&(F[s].targetOrigin=!0===F[s].checkOrigin?""===(e=F[s].remoteHost)||null!==e.match(/^(about:blank|javascript:|file:\/\/)/)?"*":e:"*")}var r,a,s=(""===(r=t.id)&&(t.id=(a=e&&e.id||g.id+f++,null!==document.getElementById(a)&&(a+=f++),r=a),l=(e||{}).log,T(r,"Added missing iframe ID: "+r+" ("+t.src+")")),r);function d(e){var n=F[s][e];1/0!==n&&0!==n&&(t.style[e]="number"==typeof n?n+"px":n,T(s,"Set "+e+" = "+t.style[e]))}function c(e){if(F[s]["min"+e]>F[s]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}s in F&&"iFrameResizer"in t?N(s,"Ignored iFrame, already setup."):(o(e),function(){switch(T(s,"IFrame scrolling "+(F[s]&&F[s].scrolling?"enabled":"disabled")+" for "+s),t.style.overflow=!1===(F[s]&&F[s].scrolling)?"hidden":"auto",F[s]&&F[s].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=F[s]?F[s].scrolling:"no"}}(),c("Height"),c("Width"),d("maxHeight"),d("minHeight"),d("maxWidth"),d("minWidth"),"number"!=typeof(F[s]&&F[s].bodyMargin)&&"0"!==(F[s]&&F[s].bodyMargin)||(F[s].bodyMarginV1=F[s].bodyMargin,F[s].bodyMargin=F[s].bodyMargin+"px"),n(q(s)),F[s]&&(F[s].iframe.iFrameResizer={close:C.bind(null,F[s].iframe),removeListeners:p.bind(null,F[s].iframe),resize:B.bind(null,"Window resize","resize",F[s].iframe),moveToAnchor:function(e){B("Move to anchor","moveToAnchor:"+e,F[s].iframe,s)},sendMessage:function(e){B("Send Message","message:"+(e=JSON.stringify(e)),F[s].iframe,s)}}))}function c(e,n){null===i&&(i=setTimeout(function(){i=null,e()},n))}function n(){"hidden"!==document.visibilityState&&(T("document","Trigger event: Visibility change"),c(function(){w("Tab Visible","resize")},16))}function w(i,t){Object.keys(F).forEach(function(e){var n;F[n=e]&&"parent"===F[n].resizeFrom&&F[n].autoResize&&!F[n].firstRun&&B(i,t,F[e].iframe,e)})}function b(){O(window,"message",e),O(window,"resize",function(){var e;T("window","Trigger event: "+(e="resize")),c(function(){w("Window "+e,"resize")},16)}),O(document,"visibilitychange",n),O(document,"-webkit-visibilitychange",n)}function y(){function t(e,n){n&&(function(){if(!n.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+n.tagName+">")}(),d(n,e),o.push(n))}var o;return function(){for(var e=["moz","webkit","o","ms"],n=0;n<e.length&&!r;n+=1)r=window[e[n]+"RequestAnimationFrame"];r?r=r.bind(window):T("setup","RequestAnimationFrame not supported")}(),b(),function(e,n){var i;switch(o=[],(i=e)&&i.enablePublicMethods&&N("enablePublicMethods option has been removed, public methods are now always available in the iFrame"),typeof n){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(n||"iframe"),t.bind(u,e));break;case"object":t(e,n);break;default:throw new TypeError("Unexpected data type ("+typeof n+")")}return o}}function v(e){e.fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(i){return this.filter("iframe").each(function(e,n){d(n,i)}).end()}):E("","Unable to bind to jQuery, it is not fully loaded.")}"undefined"!=typeof window&&(x="message".length,I=(M="[iFrameSizer]").length,r=window.requestAnimationFrame,g={autoResize:!(i=k=null),bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!(a=l=!1),inPageLinks:!(F={}),enablePublicMethods:!(f=0),heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!(m={max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){N("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},z={},window.jQuery&&v(window.jQuery),"function"==typeof define&&define.amd?define([],y):"object"==typeof module&&"object"==typeof module.exports&&(module.exports=y()),window.iFrameResize=window.iFrameResize||y())}();
//# sourceMappingURL=iframeResizer.map;
!function (t, o) { "object" == typeof exports && "undefined" != typeof module ? module.exports = o() : "function" == typeof define && define.amd ? define(o) : t.ColorThief = o() }(this, function () { if (!t) var t = { map: function (t, o) { var n = {}; return o ? t.map(function (t, r) { return n.index = r, o.call(n, t) }) : t.slice() }, naturalOrder: function (t, o) { return t < o ? -1 : t > o ? 1 : 0 }, sum: function (t, o) { var n = {}; return t.reduce(o ? function (t, r, e) { return n.index = e, t + o.call(n, r) } : function (t, o) { return t + o }, 0) }, max: function (o, n) { return Math.max.apply(null, n ? t.map(o, n) : o) } }; var o = function () { function o(t, o, n) { return (t << 10) + (o << 5) + n } function n(t) { var o = [], n = !1; function r() { o.sort(t), n = !0 } return { push: function (t) { o.push(t), n = !1 }, peek: function (t) { return n || r(), void 0 === t && (t = o.length - 1), o[t] }, pop: function () { return n || r(), o.pop() }, size: function () { return o.length }, map: function (t) { return o.map(t) }, debug: function () { return n || r(), o } } } function r(t, o, n, r, e, i, u) { this.r1 = t, this.r2 = o, this.g1 = n, this.g2 = r, this.b1 = e, this.b2 = i, this.histo = u } function e() { this.vboxes = new n(function (o, n) { return t.naturalOrder(o.vbox.count() * o.vbox.volume(), n.vbox.count() * n.vbox.volume()) }) } function i(n, r) { if (r.count()) { var e = r.r2 - r.r1 + 1, i = r.g2 - r.g1 + 1, u = t.max([e, i, r.b2 - r.b1 + 1]); if (1 == r.count()) return [r.copy()]; var s, a, h, c, f = 0, _ = [], v = []; if (u == e) for (s = r.r1; s <= r.r2; s++) { for (c = 0, a = r.g1; a <= r.g2; a++)for (h = r.b1; h <= r.b2; h++)c += n[o(s, a, h)] || 0; _[s] = f += c } else if (u == i) for (s = r.g1; s <= r.g2; s++) { for (c = 0, a = r.r1; a <= r.r2; a++)for (h = r.b1; h <= r.b2; h++)c += n[o(a, s, h)] || 0; _[s] = f += c } else for (s = r.b1; s <= r.b2; s++) { for (c = 0, a = r.r1; a <= r.r2; a++)for (h = r.g1; h <= r.g2; h++)c += n[o(a, h, s)] || 0; _[s] = f += c } return _.forEach(function (t, o) { v[o] = f - t }), function (t) { var o, n, e, i, u, a = t + "1", h = t + "2", c = 0; for (s = r[a]; s <= r[h]; s++)if (_[s] > f / 2) { for (e = r.copy(), i = r.copy(), u = (o = s - r[a]) <= (n = r[h] - s) ? Math.min(r[h] - 1, ~~(s + n / 2)) : Math.max(r[a], ~~(s - 1 - o / 2)); !_[u];)u++; for (c = v[u]; !c && _[u - 1];)c = v[--u]; return e[h] = u, i[a] = e[h] + 1, [e, i] } }(u == e ? "r" : u == i ? "g" : "b") } } return r.prototype = { volume: function (t) { return this._volume && !t || (this._volume = (this.r2 - this.r1 + 1) * (this.g2 - this.g1 + 1) * (this.b2 - this.b1 + 1)), this._volume }, count: function (t) { var n = this.histo; if (!this._count_set || t) { var r, e, i, u = 0; for (r = this.r1; r <= this.r2; r++)for (e = this.g1; e <= this.g2; e++)for (i = this.b1; i <= this.b2; i++)u += n[o(r, e, i)] || 0; this._count = u, this._count_set = !0 } return this._count }, copy: function () { return new r(this.r1, this.r2, this.g1, this.g2, this.b1, this.b2, this.histo) }, avg: function (t) { var n = this.histo; if (!this._avg || t) { var r, e, i, u, s = 0, a = 0, h = 0, c = 0; for (e = this.r1; e <= this.r2; e++)for (i = this.g1; i <= this.g2; i++)for (u = this.b1; u <= this.b2; u++)s += r = n[o(e, i, u)] || 0, a += r * (e + .5) * 8, h += r * (i + .5) * 8, c += r * (u + .5) * 8; this._avg = s ? [~~(a / s), ~~(h / s), ~~(c / s)] : [~~(8 * (this.r1 + this.r2 + 1) / 2), ~~(8 * (this.g1 + this.g2 + 1) / 2), ~~(8 * (this.b1 + this.b2 + 1) / 2)] } return this._avg }, contains: function (t) { var o = t[0] >> 3; return gval = t[1] >> 3, bval = t[2] >> 3, o >= this.r1 && o <= this.r2 && gval >= this.g1 && gval <= this.g2 && bval >= this.b1 && bval <= this.b2 } }, e.prototype = { push: function (t) { this.vboxes.push({ vbox: t, color: t.avg() }) }, palette: function () { return this.vboxes.map(function (t) { return t.color }) }, size: function () { return this.vboxes.size() }, map: function (t) { for (var o = this.vboxes, n = 0; n < o.size(); n++)if (o.peek(n).vbox.contains(t)) return o.peek(n).color; return this.nearest(t) }, nearest: function (t) { for (var o, n, r, e = this.vboxes, i = 0; i < e.size(); i++)((n = Math.sqrt(Math.pow(t[0] - e.peek(i).color[0], 2) + Math.pow(t[1] - e.peek(i).color[1], 2) + Math.pow(t[2] - e.peek(i).color[2], 2))) < o || void 0 === o) && (o = n, r = e.peek(i).color); return r }, forcebw: function () { var o = this.vboxes; o.sort(function (o, n) { return t.naturalOrder(t.sum(o.color), t.sum(n.color)) }); var n = o[0].color; n[0] < 5 && n[1] < 5 && n[2] < 5 && (o[0].color = [0, 0, 0]); var r = o.length - 1, e = o[r].color; e[0] > 251 && e[1] > 251 && e[2] > 251 && (o[r].color = [255, 255, 255]) } }, { quantize: function (u, s) { if (!u.length || s < 2 || s > 256) return !1; var a, h, c, f, _, v, l, $, p, g, d, b, m, x, y = (a = u, c = Array(32768), a.forEach(function (t) { c[h = o(t[0] >> 3, t[1] >> 3, t[2] >> 3)] = (c[h] || 0) + 1 }), c); y.forEach(function () { }); var w = (f = u, _ = y, p = 1e6, g = 0, d = 1e6, b = 0, m = 1e6, x = 0, f.forEach(function (t) { (v = t[0] >> 3) < p ? p = v : v > g && (g = v), (l = t[1] >> 3) < d ? d = l : l > b && (b = l), ($ = t[2] >> 3) < m ? m = $ : $ > x && (x = $) }), new r(p, g, d, b, m, x, _)), C = new n(function (o, n) { return t.naturalOrder(o.count(), n.count()) }); function z(t, o) { for (var n, r = t.size(), e = 0; e < 1e3;) { if (r >= o || e++ > 1e3) return; if ((n = t.pop()).count()) { var u = i(y, n), s = u[0], a = u[1]; if (!s) return; t.push(s), a && (t.push(a), r++) } else t.push(n), e++ } } C.push(w), z(C, .75 * s); for (var E = new n(function (o, n) { return t.naturalOrder(o.count() * o.volume(), n.count() * n.volume()) }); C.size();)E.push(C.pop()); z(E, s); for (var I = new e; E.size();)I.push(E.pop()); return I } } }().quantize, n = function (t) { this.canvas = document.createElement("canvas"), this.context = this.canvas.getContext("2d"), this.width = this.canvas.width = t.width, this.height = this.canvas.height = t.height, this.context.drawImage(t, 0, 0, this.width, this.height) }; n.prototype.getImageData = function () { return this.context.getImageData(0, 0, this.width, this.height) }; var r = function () { }; return r.prototype.getColor = function (t, o) { return void 0 === o && (o = 10), this.getPalette(t, 5, o)[0] }, r.prototype.getPalette = function (t, r, e) { var i = function (t) { var o = t.colorCount, n = t.quality; if (void 0 !== o && Number.isInteger(o)) { if (1 === o) throw Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()"); o = Math.min(o = Math.max(o, 2), 20) } else o = 10; return void 0 === n || Number.isInteger(n) ? n = 10 : n < 1 && (n = 10), { colorCount: o, quality: n } }({ colorCount: r, quality: e }), u = new n(t), s = o(function (t, o, n) { for (var r = t, e = [], i = 0, u = void 0, s = void 0, a = void 0, h = void 0, c = void 0; i < o; i += n)s = r[0 + (u = 4 * i)], a = r[u + 1], h = r[u + 2], (void 0 === (c = r[u + 3]) || c >= 125) && (s > 250 && a > 250 && h > 250 || e.push([s, a, h])); return e }(u.getImageData().data, u.width * u.height, i.quality), i.colorCount); return s ? s.palette() : null }, r.prototype.getColorFromUrl = function (t, o, n) { var r = document.createElement("img"), e = this; r.addEventListener("load", function () { o(e.getPalette(r, 5, n)[0], t) }), r.src = t }, r.prototype.getImageData = function (t, o) { var n = new XMLHttpRequest; n.open("GET", t, !0), n.responseType = "arraybuffer", n.onload = function () { if (200 == this.status) { var t = new Uint8Array(this.response); r = t.length; for (var n = Array(r), r = 0; r < t.length; r++)n[r] = String.fromCharCode(t[r]); var e = n.join(""); o("data:image/png;base64," + window.btoa(e)) } }, n.send() }, r.prototype.getColorAsync = function (t, o, n) { var r = this; this.getImageData(t, function (t) { var e = document.createElement("img"); e.addEventListener("load", function () { o(r.getPalette(e, 5, n)[0], this) }), e.src = t }) }, r });;
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject = function () { var D = "undefined", r = "object", S = "Shockwave Flash", W = "ShockwaveFlash.ShockwaveFlash", q = "application/x-shockwave-flash", R = "SWFObjectExprInst", x = "onreadystatechange", O = window, j = document, t = navigator, T = false, U = [h], o = [], N = [], I = [], l, Q, E, B, J = false, a = false, n, G, m = true, M = function () { var aa = typeof j.getElementById != D && typeof j.getElementsByTagName != D && typeof j.createElement != D, ah = t.userAgent.toLowerCase(), Y = t.platform.toLowerCase(), ae = Y ? /win/.test(Y) : /win/.test(ah), ac = Y ? /mac/.test(Y) : /mac/.test(ah), af = /webkit/.test(ah) ? parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, X = !+"\v1", ag = [0, 0, 0], ab = null; if (typeof t.plugins != D && typeof t.plugins[S] == r) { ab = t.plugins[S].description; if (ab && !(typeof t.mimeTypes != D && t.mimeTypes[q] && !t.mimeTypes[q].enabledPlugin)) { T = true; X = false; ab = ab.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); ag[0] = parseInt(ab.replace(/^(.*)\..*$/, "$1"), 10); ag[1] = parseInt(ab.replace(/^.*\.(.*)\s.*$/, "$1"), 10); ag[2] = /[a-zA-Z]/.test(ab) ? parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0 } } else { if (typeof O.ActiveXObject != D) { try { var ad = new ActiveXObject(W); if (ad) { ab = ad.GetVariable("$version"); if (ab) { X = true; ab = ab.split(" ")[1].split(","); ag = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } } catch (Z) { } } } return { w3: aa, pv: ag, wk: af, ie: X, win: ae, mac: ac } }(), k = function () { if (!M.w3) { return } if ((typeof j.readyState != D && j.readyState == "complete") || (typeof j.readyState == D && (j.getElementsByTagName("body")[0] || j.body))) { f() } if (!J) { if (typeof j.addEventListener != D) { j.addEventListener("DOMContentLoaded", f, false) } if (M.ie && M.win) { j.attachEvent(x, function () { if (j.readyState == "complete") { j.detachEvent(x, arguments.callee); f() } }); if (O == top) { (function () { if (J) { return } try { j.documentElement.doScroll("left") } catch (X) { setTimeout(arguments.callee, 0); return } f() })() } } if (M.wk) { (function () { if (J) { return } if (!/loaded|complete/.test(j.readyState)) { setTimeout(arguments.callee, 0); return } f() })() } s(f) } }(); function f() { if (J) { return } try { var Z = j.getElementsByTagName("body")[0].appendChild(C("span")); Z.parentNode.removeChild(Z) } catch (aa) { return } J = true; var X = U.length; for (var Y = 0; Y < X; Y++) { U[Y]() } } function K(X) { if (J) { X() } else { U[U.length] = X } } function s(Y) { if (typeof O.addEventListener != D) { O.addEventListener("load", Y, false) } else { if (typeof j.addEventListener != D) { j.addEventListener("load", Y, false) } else { if (typeof O.attachEvent != D) { i(O, "onload", Y) } else { if (typeof O.onload == "function") { var X = O.onload; O.onload = function () { X(); Y() } } else { O.onload = Y } } } } } function h() { if (T) { V() } else { H() } } function V() { var X = j.getElementsByTagName("body")[0]; var aa = C(r); aa.setAttribute("type", q); var Z = X.appendChild(aa); if (Z) { var Y = 0; (function () { if (typeof Z.GetVariable != D) { var ab = Z.GetVariable("$version"); if (ab) { ab = ab.split(" ")[1].split(","); M.pv = [parseInt(ab[0], 10), parseInt(ab[1], 10), parseInt(ab[2], 10)] } } else { if (Y < 10) { Y++; setTimeout(arguments.callee, 10); return } } X.removeChild(aa); Z = null; H() })() } else { H() } } function H() { var ag = o.length; if (ag > 0) { for (var af = 0; af < ag; af++) { var Y = o[af].id; var ab = o[af].callbackFn; var aa = { success: false, id: Y }; if (M.pv[0] > 0) { var ae = c(Y); if (ae) { if (F(o[af].swfVersion) && !(M.wk && M.wk < 312)) { w(Y, true); if (ab) { aa.success = true; aa.ref = z(Y); ab(aa) } } else { if (o[af].expressInstall && A()) { var ai = {}; ai.data = o[af].expressInstall; ai.width = ae.getAttribute("width") || "0"; ai.height = ae.getAttribute("height") || "0"; if (ae.getAttribute("class")) { ai.styleclass = ae.getAttribute("class") } if (ae.getAttribute("align")) { ai.align = ae.getAttribute("align") } var ah = {}; var X = ae.getElementsByTagName("param"); var ac = X.length; for (var ad = 0; ad < ac; ad++) { if (X[ad].getAttribute("name").toLowerCase() != "movie") { ah[X[ad].getAttribute("name")] = X[ad].getAttribute("value") } } P(ai, ah, Y, ab) } else { p(ae); if (ab) { ab(aa) } } } } } else { w(Y, true); if (ab) { var Z = z(Y); if (Z && typeof Z.SetVariable != D) { aa.success = true; aa.ref = Z } ab(aa) } } } } } function z(aa) { var X = null; var Y = c(aa); if (Y && Y.nodeName == "OBJECT") { if (typeof Y.SetVariable != D) { X = Y } else { var Z = Y.getElementsByTagName(r)[0]; if (Z) { X = Z } } } return X } function A() { return !a && F("6.0.65") && (M.win || M.mac) && !(M.wk && M.wk < 312) } function P(aa, ab, X, Z) { a = true; E = Z || null; B = { success: false, id: X }; var ae = c(X); if (ae) { if (ae.nodeName == "OBJECT") { l = g(ae); Q = null } else { l = ae; Q = X } aa.id = R; if (typeof aa.width == D || (!/%$/.test(aa.width) && parseInt(aa.width, 10) < 310)) { aa.width = "310" } if (typeof aa.height == D || (!/%$/.test(aa.height) && parseInt(aa.height, 10) < 137)) { aa.height = "137" } j.title = j.title.slice(0, 47) + " - Flash Player Installation"; var ad = M.ie && M.win ? "ActiveX" : "PlugIn", ac = "MMredirectURL=" + O.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + ad + "&MMdoctitle=" + j.title; if (typeof ab.flashvars != D) { ab.flashvars += "&" + ac } else { ab.flashvars = ac } if (M.ie && M.win && ae.readyState != 4) { var Y = C("div"); X += "SWFObjectNew"; Y.setAttribute("id", X); ae.parentNode.insertBefore(Y, ae); ae.style.display = "none"; (function () { if (ae.readyState == 4) { ae.parentNode.removeChild(ae) } else { setTimeout(arguments.callee, 10) } })() } u(aa, ab, X) } } function p(Y) { if (M.ie && M.win && Y.readyState != 4) { var X = C("div"); Y.parentNode.insertBefore(X, Y); X.parentNode.replaceChild(g(Y), X); Y.style.display = "none"; (function () { if (Y.readyState == 4) { Y.parentNode.removeChild(Y) } else { setTimeout(arguments.callee, 10) } })() } else { Y.parentNode.replaceChild(g(Y), Y) } } function g(ab) { var aa = C("div"); if (M.win && M.ie) { aa.innerHTML = ab.innerHTML } else { var Y = ab.getElementsByTagName(r)[0]; if (Y) { var ad = Y.childNodes; if (ad) { var X = ad.length; for (var Z = 0; Z < X; Z++) { if (!(ad[Z].nodeType == 1 && ad[Z].nodeName == "PARAM") && !(ad[Z].nodeType == 8)) { aa.appendChild(ad[Z].cloneNode(true)) } } } } } return aa } function u(ai, ag, Y) { var X, aa = c(Y); if (M.wk && M.wk < 312) { return X } if (aa) { if (typeof ai.id == D) { ai.id = Y } if (M.ie && M.win) { var ah = ""; for (var ae in ai) { if (ai[ae] != Object.prototype[ae]) { if (ae.toLowerCase() == "data") { ag.movie = ai[ae] } else { if (ae.toLowerCase() == "styleclass") { ah += ' class="' + ai[ae] + '"' } else { if (ae.toLowerCase() != "classid") { ah += " " + ae + '="' + ai[ae] + '"' } } } } } var af = ""; for (var ad in ag) { if (ag[ad] != Object.prototype[ad]) { af += '<param name="' + ad + '" value="' + ag[ad] + '" />' } } aa.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + ah + ">" + af + "</object>"; N[N.length] = ai.id; X = c(ai.id) } else { var Z = C(r); Z.setAttribute("type", q); for (var ac in ai) { if (ai[ac] != Object.prototype[ac]) { if (ac.toLowerCase() == "styleclass") { Z.setAttribute("class", ai[ac]) } else { if (ac.toLowerCase() != "classid") { Z.setAttribute(ac, ai[ac]) } } } } for (var ab in ag) { if (ag[ab] != Object.prototype[ab] && ab.toLowerCase() != "movie") { e(Z, ab, ag[ab]) } } aa.parentNode.replaceChild(Z, aa); X = Z } } return X } function e(Z, X, Y) { var aa = C("param"); aa.setAttribute("name", X); aa.setAttribute("value", Y); Z.appendChild(aa) } function y(Y) { var X = c(Y); if (X && X.nodeName == "OBJECT") { if (M.ie && M.win) { X.style.display = "none"; (function () { if (X.readyState == 4) { b(Y) } else { setTimeout(arguments.callee, 10) } })() } else { X.parentNode.removeChild(X) } } } function b(Z) { var Y = c(Z); if (Y) { for (var X in Y) { if (typeof Y[X] == "function") { Y[X] = null } } Y.parentNode.removeChild(Y) } } function c(Z) { var X = null; try { X = j.getElementById(Z) } catch (Y) { } return X } function C(X) { return j.createElement(X) } function i(Z, X, Y) { Z.attachEvent(X, Y); I[I.length] = [Z, X, Y] } function F(Z) { var Y = M.pv, X = Z.split("."); X[0] = parseInt(X[0], 10); X[1] = parseInt(X[1], 10) || 0; X[2] = parseInt(X[2], 10) || 0; return (Y[0] > X[0] || (Y[0] == X[0] && Y[1] > X[1]) || (Y[0] == X[0] && Y[1] == X[1] && Y[2] >= X[2])) ? true : false } function v(ac, Y, ad, ab) { if (M.ie && M.mac) { return } var aa = j.getElementsByTagName("head")[0]; if (!aa) { return } var X = (ad && typeof ad == "string") ? ad : "screen"; if (ab) { n = null; G = null } if (!n || G != X) { var Z = C("style"); Z.setAttribute("type", "text/css"); Z.setAttribute("media", X); n = aa.appendChild(Z); if (M.ie && M.win && typeof j.styleSheets != D && j.styleSheets.length > 0) { n = j.styleSheets[j.styleSheets.length - 1] } G = X } if (M.ie && M.win) { if (n && typeof n.addRule == r) { n.addRule(ac, Y) } } else { if (n && typeof j.createTextNode != D) { n.appendChild(j.createTextNode(ac + " {" + Y + "}")) } } } function w(Z, X) { if (!m) { return } var Y = X ? "visible" : "hidden"; if (J && c(Z)) { c(Z).style.visibility = Y } else { v("#" + Z, "visibility:" + Y) } } function L(Y) { var Z = /[\\\"<>\.;]/; var X = Z.exec(Y) != null; return X && typeof encodeURIComponent != D ? encodeURIComponent(Y) : Y } var d = function () { if (M.ie && M.win) { window.attachEvent("onunload", function () { var ac = I.length; for (var ab = 0; ab < ac; ab++) { I[ab][0].detachEvent(I[ab][1], I[ab][2]) } var Z = N.length; for (var aa = 0; aa < Z; aa++) { y(N[aa]) } for (var Y in M) { M[Y] = null } M = null; for (var X in swfobject) { swfobject[X] = null } swfobject = null }) } }(); return { registerObject: function (ab, X, aa, Z) { if (M.w3 && ab && X) { var Y = {}; Y.id = ab; Y.swfVersion = X; Y.expressInstall = aa; Y.callbackFn = Z; o[o.length] = Y; w(ab, false) } else { if (Z) { Z({ success: false, id: ab }) } } }, getObjectById: function (X) { if (M.w3) { return z(X) } }, embedSWF: function (ab, ah, ae, ag, Y, aa, Z, ad, af, ac) { var X = { success: false, id: ah }; if (M.w3 && !(M.wk && M.wk < 312) && ab && ah && ae && ag && Y) { w(ah, false); K(function () { ae += ""; ag += ""; var aj = {}; if (af && typeof af === r) { for (var al in af) { aj[al] = af[al] } } aj.data = ab; aj.width = ae; aj.height = ag; var am = {}; if (ad && typeof ad === r) { for (var ak in ad) { am[ak] = ad[ak] } } if (Z && typeof Z === r) { for (var ai in Z) { if (typeof am.flashvars != D) { am.flashvars += "&" + ai + "=" + Z[ai] } else { am.flashvars = ai + "=" + Z[ai] } } } if (F(Y)) { var an = u(aj, am, ah); if (aj.id == ah) { w(ah, true) } X.success = true; X.ref = an } else { if (aa && A()) { aj.data = aa; P(aj, am, ah, ac); return } else { w(ah, true) } } if (ac) { ac(X) } }) } else { if (ac) { ac(X) } } }, switchOffAutoHideShow: function () { m = false }, ua: M, getFlashPlayerVersion: function () { return { major: M.pv[0], minor: M.pv[1], release: M.pv[2] } }, hasFlashPlayerVersion: F, createSWF: function (Z, Y, X) { if (M.w3) { return u(Z, Y, X) } else { return undefined } }, showExpressInstall: function (Z, aa, X, Y) { if (M.w3 && A()) { P(Z, aa, X, Y) } }, removeSWF: function (X) { if (M.w3) { y(X) } }, createCSS: function (aa, Z, Y, X) { if (M.w3) { v(aa, Z, Y, X) } }, addDomLoadEvent: K, addLoadEvent: s, getQueryParamValue: function (aa) { var Z = j.location.search || j.location.hash; if (Z) { if (/\?/.test(Z)) { Z = Z.split("?")[1] } if (aa == null) { return L(Z) } var Y = Z.split("&"); for (var X = 0; X < Y.length; X++) { if (Y[X].substring(0, Y[X].indexOf("=")) == aa) { return L(Y[X].substring((Y[X].indexOf("=") + 1))) } } } return "" }, expressInstallCallback: function () { if (a) { var X = c(R); if (X && l) { X.parentNode.replaceChild(l, X); if (Q) { w(Q, true); if (M.ie && M.win) { l.style.display = "block" } } if (E) { E(B) } } a = false } } } }();;
// ---------------------------------------------------------------------------
// TOUCH DEVICE SCRIPTS
// ---------------------------------------------------------------------------
if (Modernizr.touch) {

	// - Ipad / Mobile browser reset zoom device-width  
	if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {

		var viewportmeta = document.querySelector('meta[name="viewport"]');

		if (viewportmeta) {

			viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';

			document.body.addEventListener('gesturestart', function () {

				viewportmeta.content = 'width=device-width, minimum-scale=0.25, maximum-scale=1.6';

			}, false);
		}
	}

	// ---------------------------------------------------------------------------
	// NON-TOUCH DEVICE SCRIPTS
	// ---------------------------------------------------------------------------

} else {

	//update virtual buffer in JAWS Screenreader, call on DOM-insert complete
	bcu.updateBuffer = function () {
		if ($('#virtualbufferupdate').val() == '1') $('#virtualbufferupdate').val('0');
		else $('#virtualbufferupdate').val('1');
	};

	bcu.overrideValidateDate = function () {

		///<summary>Enable UK date format in jQuery.Validate</summary>

		$.validator.methods["date"] = function (value, element) {
			var shortDateFormat = "dd/mm/yy";
			var res = true;
			try {
				$.datepicker.parseDate(shortDateFormat, value);
			} catch (error) {
				res = false;
			}
			return res;
		};
	};


	bcu.keyActivatedMenu = function () {
		$('.hover-reveal').keyup(function (e) {
			if ([37, 38, 39, 40].indexOf(e.keyCode) == -1) {
				return;
			}
			// Store the reference to our top level link
			var link = $(this);

			switch (e.keyCode) {
				case 37: // left arrow
					// Make sure to stop event bubbling
					e.preventDefault();
					e.stopPropagation();

					if (link.prevAll('li').filter(':visible').first().length == 0) {
						// Focus on the last item in the top level
						link.nextAll('li').filter(':visible').last().find('a').first().focus();
					} else {
						// Focus on the previous item in the top level
						link.prevAll('li').filter(':visible').first().find('a').first().focus();
					}
					break;

				case 38: /// up arrow
					$(this).removeClass('active').children('.hover-reveal-content').addClass('hidden');
					$(this).find('.hover-reveal-content').attr('aria-expanded', function (i, attr) {
						return attr === 'true' ? 'false' : 'true';
					});
					$(this).find('.hover-reveal-content').attr('aria-hidden', function (i, attr) {
						return attr === 'true' ? 'false' : 'true';
					});
					break;

				case 39: // right arrow
					// Make sure to stop event bubbling
					e.preventDefault();
					e.stopPropagation();
					// This is the last item
					if (link.nextAll('li').filter(':visible').first().length == 0) {
						// Focus on the first item in the top level
						link.prevAll('li').filter(':visible').last().find('a').first().focus();
					} else {
						// Focus on the next item in the top level
						link.nextAll('li').filter(':visible').first().find('a').first().focus();
					}
					break;

				case 40: // down arrow
					$(this).addClass('active').children('.hover-reveal-content').removeClass('hidden');
					$(this).find('.hover-reveal-content').attr('aria-expanded', function (i, attr) {
						return attr === 'true' ? 'false' : 'true';
					});
					$(this).find('.hover-reveal-content').attr('aria-hidden', function (i, attr) {
						return attr === 'true' ? 'false' : 'true';
					});
					break;
			}

		});
    };

    bcu.createFancybox = function () {
        if (jQuery().fancybox) {
            $("a[rel^='lightbox']").addClass('fancybox');

            $('.fancybox').each(
                function () {
                    var imageGroup = $(this).attr('rel');
                    imageGroup = imageGroup.slice(9, -1);
                    if ($(this).attr('title')) {
                        var caption = $(this).attr('title');
                        $(this).attr('data-caption', caption);
                    }
                    
                    $(this).attr('rel', imageGroup).attr('data-fancybox', imageGroup);
                }
            );

            $(".fancybox").fancybox(); // fancybox
        }       
    };


	$(window).resize(function () {
		//Added so JAWS knows that Javascript has updated the page
		if (bcu.updateBuffer) {
			//check needed for IE8
			bcu.updateBuffer();
		}
	});


	$(document).ready(function () {

		// dynamic sreen sizing
		$('body').append('<div class="off-screen"><input type="hidden" value="1" id="virtualbufferupdate" name="virtualbufferupdate" /></div>');

        bcu.createFancybox();
		bcu.keyActivatedMenu();


		// bottom border on editable content
		$('.edit').hover(function () {
			$(this).prev('.editable').toggleClass('dotted');
		}, function () {
			$(this).prev('.editable').toggleClass('dotted');
		});

		$("#perPage").change(function () {
			$('#PerPageForm').submit();
		});


		$('#refine-search').submit(function () {
			if ($(".radio-scope:checked").val() === "4") {
				$('.radio-scope').attr('disabled', true);
			}
		});

		var counter = $(".j-compare input[type=checkbox]").length;

		if (counter > 2) {

			$(".j-compare input[type=checkbox]").click(function () {
				var countchecked = $(".j-compare input[type=checkbox]:checked").length;

				if (countchecked >= 2) {
					$('.j-compare input[type=checkbox]').not(':checked').attr("disabled", true);

					if (countchecked > 2) {
						$("#CompareLimitWarning").removeClass("hidden");
					}
				} else {
					$('.j-compare input[type=checkbox]').not(':checked').attr("disabled", false);
				}
			});

		}

		if ($('#userSignup:checked').length > 0) {
			$('#moreinfo').removeClass('hidden');
		}
		$('#userSignup').change(function () {
			var moreInfoBlock = $('#moreinfo');
			if ($('#userSignup:checked').length > 0) {
				moreInfoBlock.removeClass("hidden");
			} else {
				moreInfoBlock.addClass("hidden");
			}
		});

		//$('#basketbtn').hover(function () {
		//    $('#coursebasket').toggleClass('hidden');
		//});


		$('.fees-tooltip').hover(function () {
			var toolTopText = $('#course-fees-tooltip');

			$(toolTopText).toggleClass('hidden');

			var p = $(this).position();

			$(toolTopText).css(
                {
                	'position': 'absolute',
                	//'width': '300px',
                	'background-color': '#fff',
                	'top': p.top + 30,
                	'left': p.left - 398
                });
		});

		if ($(".pnl-cms-message") != null) {
			$(".pnl-cms-message").delay(4000).fadeOut("slow");
		}


		$(".toggle").click(function () {
			$('.toggled-area').slideToggle('slow', function () {
				// Animation complete.
			});
			var text = $('.toggle').text();
			$('.toggle').text(
                text == "Hide options" ? "Show options" : "Hide options");
		});


		bcu.StopBrowser = function () {
			/// <summary>Used to stop all requests to the server i.e. stops requests for large amounts of media items even after clicking cancel</summary>

			if (window.stop !== undefined) {
				window.stop();
			} else if (document.execCommand !== undefined) {
				document.execCommand("Stop", false);
			}
		};
	});
}

// ---------------------------------------------------------------------------
// SHARED SCRIPTS
// ---------------------------------------------------------------------------

bcu.setCardsHeight = function () {

    $('.js-modules-fixed-height .card, .js-modules-fixed-height .pull-out-primary').css('height', '');
    $('.js-modules-fixed-height').each(function () {       
        var $columns = $('.card, .pull-out-primary', this);
        var maxHeight = Math.max.apply(Math, $columns.map(function () {
            return $(this).height();
        }).get());
        $columns.height(maxHeight);
    });
};

bcu.setModulesHeight = function () {

    if ($(".grid").hasClass("j-fix-item-height")) {

        var maxHeight = 0;

        $('.j-fix-item-height .j-fix-height').each(function () {
            maxHeight = $(this).height() > maxHeight ? $(this).height() : maxHeight;
        });

        $('.j-fix-item-height .j-fix-height').height(maxHeight);
    }

    $('.j-fix-child-height').each(function () {

        var childHeight = 0;

        var $parent = $(this);

        $parent.find('.j-fix-height').each(function () {
            childHeight = $(this).height() > childHeight ? $(this).height() : childHeight;
        });

        $parent.find('.j-fix-height').height(childHeight);

    });
};

$(document).ready(function() {

	// remove link styling from a tags with images in +  a tags with class .button
	$('.content-block a:has(> img)').addClass('no-link');
	$('.content-block a.bcu-button').addClass('no-link prm');
	$('.content-block a.button').addClass('no-link prm');
	$('.article a.bcu-button').addClass('no-link prm');
	$('.article a.button').addClass('no-link prm');


	$('body').on('click',
		'.j-dialog',
		function(e) {
			var inputId;

			if ($(this).parent().prevAll('.mediaItemRef').length > 0) {
				inputId = $(this).parent().prevAll('.mediaItemRef').attr('id');
			} else {
				inputId = $(this).prevAll('.mediaItemRef').attr('id');
			}

			if (typeof inputId != 'undefined') {
				$('#selectedmediaitem').val(inputId);
			}

			mediaManager.mediaManagerDialog(this);

			return false;
		});

	// Auto submit form
	$(function() {
		$('.j-auto-submit').change(function() {
			this.form.submit();
		});
	});

	// set width and height for fluid videos
	var $fluidVideos = $('.fluid-video iframe');

	// Figure out and save aspect ratio for each video
	$fluidVideos.each(function() {
		var fluidVid = $(this);
		fluidVid.attr('data-aspectRatio', 0.5625);
		fluidVid.attr('data-width', fluidVid.parent('.fluid-video').width());
		fluidVid.attr('data-init-width', this.width); //make initial height and width available later
		fluidVid.attr('data-init-height', this.height);

	});

	if ($('#basketGrowl') != null) {
		$("#basketGrowl").fadeIn('slow').delay(3000).fadeOut('slow');
		//$(".js-pop").addClass('badge--update');
		//setTimeout(function () {
		//    $(".js-pop").removeClass('badge--update');
		//}, 500);         
	}

	// When the window is resized
	$(window).resize(function() {
		// Resize all videos according to their own aspect ratio
		$fluidVideos.each(function() {
			var fluidVid = $(this);
			// and remove the hard coded width/height
			fluidVid.attr('data-width', fluidVid.parent('.fluid-video').width());
			fluidVid.width(fluidVid.attr('data-width') - 1);
			fluidVid.height(fluidVid.width() * fluidVid.attr('data-aspectRatio'));
		});
		// Kick off one resize to fix all videos on page load
	}).resize();


	// manual tab change on internal links
	$('.j-switch-tab').on('click',
		function() {

			// get id of target tab
			var hash = $(this).prop("hash");

			// get the index of the target tab
			var tabIndex = $('.bcu-tabs-panel ' + hash).index();

			// switch the tabs to the target
			$('.bcu-tabs-panel ' + hash).closest('.ui-tabs').tabs("option", "active", tabIndex);
		});

	$("#main-navigation .hover-reveal-content .selector a").on("click",
		function(e) {

			var position = $(this).position().top;
			var linkSelected = $(this).attr("data-attr");
			var blockSelect = linkSelected + "-" + "block";
			var titleSelected = $(this).attr("data-course-title");
			var typeSelected = $(this).attr("data-course-type");
			var modeSelected = $(this).attr("data-course-mode");
			var jfSelected = $(this).attr("data-course-jf");

			e.preventDefault();


			$("#main-navigation .hover-reveal-content .selector a span").addClass("icon-radio-unchecked")
				.removeClass("icon-radio-checked");
			$(this).find("span").addClass("icon-radio-checked").removeClass("icon-radio-unchecked");

			// Hide all content navigation blocks
			$(".info-blocks div").each(function() {
				$(this).hide();
			});

			// Show selected block & change pointer colour
			var selected = $("." + blockSelect).show();
			var pointerColor = selected.css("background-color");

			// Update course search values
			$("#course-type-title").text(titleSelected);

			if (typeSelected != "0") {
				$("#course-type-input").val(typeSelected);
			} else {
				$("#course-type-input").val("");
			}

			if (modeSelected != "0") {
				$("#course-mode-input").val(modeSelected);
			} else {
				$("#course-mode-input").val("");
			}

			if (jfSelected != "0") {
				$("#course-jf-input").val(jfSelected);
			} else {
				$("#course-jf-input").val("");
			}

			// kill hover reveal bubbling
			e.stopPropagation();

		});

	$("#main-navigation .hover-reveal-content input, #main-navigation .hover-reveal-content input").on("click",
		function(e) {
			e.stopPropagation();
		});

	bcu.basketToggleAction = function(e) {
		$('html').toggleClass('js-basket-active');
		$('.js-toggle-basket').toggleClass('active');
		if ($('.js-toggle-basket').hasClass('active')) {
			$('.js-toggle-basket').prop('title', 'Close saved courses');
		} else {
			$('.js-toggle-basket').prop('title', 'Open saved courses');
		}
		$('.js-toggle-basket').find('.js-toggle-icon').toggleClass('icon-graduation-cap icon-cancel');
		$('#main-navigation .header-basket--mobile').slideToggle('fast');
	};

	bcu.basketToggleClose = function(e) {
		$('html').removeClass('js-basket-active');
		$('.js-toggle-basket').removeClass('active');
		$('.js-toggle-basket').find('.js-toggle-icon').removeClass('icon-cancel').addClass('icon-graduation-cap')
			.prop('title', 'Open saved courses');;
	};

	bcu.basketToggleInit = function(e) {
		$('.js-toggle-basket').on('click',
			function(e) {
				if ($('html').hasClass('js-nav-active')) {
					nav.close();
					setTimeout(function() { bcu.basketToggleAction(); }, 350);
				} else {
					bcu.basketToggleAction();
				}
			});
	};


	bcu.fullScreenSearchModal = function() {
		var lastFocus;
		var searchModalWindowOpen = false;
		var bodyContainer = $('body');
		var searchModal = $('#search-modal-window');
		var closeButton = $('.close-icon');
		var inputField = $('.modal-window__search-bar input[type=text]');
		var modal = document.querySelector('#search-modal-window');

		function launchSearchModal(e) {
			e.preventDefault(); // prevent default action on the search bar
			lastFocus = document.activeElement;
			searchModal.addClass('active'); // open the search modal
			inputField.focus(); // set focus to search bar
			setTimeout(function() {
					bodyContainer.addClass('noscroll');
				},
				200); // prevent scrolling on body and remove searchbars, timeout corresponds to modal animation
			searchModalWindowOpen = true;
			searchModal.attr('aria-hidden', 'false');

			// Allow Esc key to close dialog
			document.addEventListener("keydown",
				function(event) {
					if (searchModalWindowOpen && event.keyCode === 27) {
						closeSearchModal();
					}
				},
				true);

			document.addEventListener("focus",
				function(event) {
					var dialog = document.getElementById(searchModal);
					if (searchModalWindowOpen && !dialog.contains(event.target)) {
						event.stopPropagation();
						dialog.focus();
					}
				},
				true);

			// Listen for and trap the keyboard
			modal.addEventListener('keydown', trapTabKey);

			// Find all focusable children
			var focusableElementsString =
				'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable]';
			var focusableElements = modal.querySelectorAll(focusableElementsString);
			// Convert NodeList to Array
			focusableElements = Array.prototype.slice.call(focusableElements);

			var firstTabStop = focusableElements[0];
			var lastTabStop = focusableElements[focusableElements.length - 1];

			// Focus first child
			firstTabStop.focus();

			function trapTabKey(e) {
				// Check for TAB key press
				if (e.keyCode === 9) {

					// SHIFT + TAB
					if (e.shiftKey) {
						if (document.activeElement === firstTabStop) {
							e.preventDefault();
							lastTabStop.focus();
						}

						// TAB
					} else {
						if (document.activeElement === lastTabStop) {
							e.preventDefault();
							firstTabStop.focus();
						}
					}
				}
			}
		};

		function closeSearchModal() {
			searchModal.removeClass('active'); // close search modal box
			inputField.blur(); // remove focus from search bar
			bodyContainer.removeClass('noscroll'); // re-enable scroll on body element and show scrollbars
			searchModalWindowOpen = false;
			lastFocus.focus();
			searchModal.attr('aria-hidden', 'true');
		}

		// Launch search modal
		$('#site-search-term, .js-toggle-search').on('click', launchSearchModal);
		$('.header-search_button').on('click', launchSearchModal);

		// Close search modal
		closeButton.on('click', closeSearchModal);
		$('.close-button').on('click', closeSearchModal);

		// Sequential animation for 'animate--fadein' class
		for (let i = 0; i < $('.animate--fadein').length; i++) {
			$('.animate--fadein').eq(i).addClass(`fade-in--${i}`);
		}

		// Esc key to close search modal
		$(document).on('keyup',
			function(e) {
				var key = e.key;
				if (key === 'Escape') // the enter key code
				{
					//console.log('Esc key');
					closeSearchModal();
				}
			});

		//check if modal is active
		if ($("#search-modal-window").hasClass("active")) {
			alert('active');
			//console.log("active class");
		}
	};

	// For SubSites
	bcu.searchOptionsRevealer = function(e) {
		$('.j-search-reveal').on('click',
			function(e) {
				$(this).find('.search-options').slideDown('fast');
				e.stopPropagation();
			});

		$(document).click(function(e) {
			$('.j-search-reveal').find('.search-options').slideUp('fast');
		});
	};

	bcu.updateSearchSubsiteOptions = function() {
		var searchLevelRadioGroup = $('.j-searchOption');
		searchLevelRadioGroup.on('click',
			function() {
				$("#searchPref").val($(this).data("link"));
			});
	};

	bcu.svgLogoCheck = function() {
		if ($('.bcu-logo-subsite img').length > 0) {
			var imgs = document.getElementsByTagName('img');
			var svgExtension = /.*\.svg$/;
			var l = imgs.length;
			for (var i = 0; i < l; i++) {
				if (imgs[i].src.match(svgExtension)) {
					imgs[i].src = imgs[i].src.slice(0, -3) + 'png';
				}
			}
		}

	};

	bcu.browserScroller = function(scrollerSettings) {
		if (typeof scrollerSettings.offSet !== 'undefined') {
			if (typeof scrollerSettings.speed === 'undefined') {
				scrollerSettings.speed = 400;
			}

			scrollerSettings.posAdj =
			(typeof scrollerSettings.posAdj != 'undefined' && scrollerSettings.offSet.top > scrollerSettings.posAdj
				? scrollerSettings.posAdj
				: 0);

			var scrollPosition =
			(typeof scrollerSettings.offSet.top != 'undefined' || scrollerSettings.offSet.top != null
				? scrollerSettings.offSet.top - scrollerSettings.posAdj
				: scrollerSettings.posAdj);
			$('html, body').animate({
					scrollTop: scrollPosition
				},
				scrollerSettings.speed);
		}
	}

	$(document).ready(function() {

		var screenSize = document.body.clientWidth;

		bcu.createDeepTabs = function() {

			if (screenSize > 900) {
				var maxH = 0;
				$('.bcu-tabgroup .bcu-tabs--deep > li').each(function() {
					maxH = $(this).height() > maxH ? $(this).height() : maxH;
				});
				$('.bcu-tabgroup .bcu-tabs--deep > li').height(maxH);
			} else {
				$('.bcu-tabgroup .bcu-tabs--deep > li').height("auto");
			}
		};

		$(window).bind('resize orientationchange',
			function() {
				screenSize = document.body.clientWidth;
				bcu.createDeepTabs();

			});

		bcu.createDeepTabs();

	});

	bcu.setBgAlpha = function() {

		$('.j-bg-alpha').each(function() {

			// get the alpha value from data attribute
			var alpha = $(this).data("bg-alpha");

			if ($.isNumeric(alpha)) {

				var rgba;

				// reset the elements opacity
				$(this).css('opacity', '1');

				// get the bg color - jquery always returns an rgb or rgba value
				var bg = $(this).css('background-color');

				// if it's an rgb colour
				if (bg.indexOf('a') == -1) {
					rgba = bg.replace(')', ', ' + alpha + ')').replace('rgb', 'rgba');
				}
				// else it's an rgba colour
				else {
					rgba = bg.slice(0, bg.lastIndexOf(',') + 1) + alpha + ")";
				}

				// reset the elements bg color
				//$(this).css("background-color", rgba);
				$(this).attr('style', $(this).attr('style') + ' background-color:' + rgba + ' !important;');
			}

		});
	};

	//bcu.fauxCourseListingHighlight = function() {

	//	$(".crs-listing_faux-link").hover(
	//		function() {
	//			$(this).parent(".j-crs-listing_item").addClass("crs-listing_item--hover");
	//		},
	//		function() {
	//			$(this).parent(".j-crs-listing_item").removeClass("crs-listing_item--hover");
	//		}
	//	);
	//};

	bcu.initJqueryUiTabs = function() {

		$(".j-tabgroup").tabs({
			activate: function(event, ui) {
				bcu.setCardsHeight();
			}
		});
	};

	bcu.overideInlineLinksForUiTabs = function() {

		// If url includes a hash and jquery ui tabs on page
		if (location.hash && $('.j-tabgroup').length > 0) {

			// Override browser inline link behaviour and go to top of page
			window.scrollTo(0, 0);

			// Run again for browser compatibility
			setTimeout(function() { window.scrollTo(0, 0); }, 1);
		};

	};

	bcu.openTab = function() {

		$(".open-tab").click(function() {

			var myTab = $(this).attr("href");

			$(".j-tabgroup").tabs("option", "active", $(myTab).index());

			bcu.overideInlineLinksForUiTabs();
		});
	};


	bcu.stretchImages = function() {
		if (jQuery().anystretch) {
			$(".stretchMe").anystretch();
		}
	};


	bcu.userSignUpContentToggles = function() {

		var userSignedUp;
		var formSubmitted;

		var signUpCookie = Cookies.get('bcu-signup');

		if (signUpCookie) {

			var keypairs = signUpCookie.split("&");

			for (var i = 0; i < keypairs.length; i++) {

				var key = keypairs[i].split("=")[0];
				var val = keypairs[i].split("=")[1];

				if (key === "signed-up") userSignedUp = val;
				if (key === "form-submitted") formSubmitted = val;
			}
		}

		if (userSignedUp === "true") {

			$(".j-signedup-show").removeClass("hidden");
			$(".j-signedup-hide").addClass("hidden");

		} else {

			$(".j-signedup-show").addClass("hidden");
			$(".j-signedup-hide").removeClass("hidden");

		}
	};

	bcu.OpenDayPicker = function() {

		$(".open-day-picker").each(function() {

			var picker = $(this);
			var level = (typeof picker.data("level") !== "undefined") ? picker.data("level") : "";

			$.ajax({
				async: true,
				type: "GET",
				url: "/opendaypicker/display",
				data: "level=" + level,
				beforeSend: function() {
					picker.html(
						"<div class='pal secondary-bg-grey-light-2'><p class='mtl text-center'><img src='/content/imgs/sprites/loader.gif' alt='Loading...' width='30' /></p><h4 class='mbl text-center mid-grey'>Loading...</h4></div>");
				},
				success: function(data) {
					picker.html(data);
				}
			});
		});

		bcu.GetOpenDayPicker = function(e) {

			var picker = $(e.target).closest(".open-day-picker");

			if (!picker || picker.length === 0) {
				picker = $(e.target).closest(".open-day-picker-embedded");
			}

			return picker;
		}

		$(document).on("click",
			".j-toggle-levels",
			function(e) {

				var picker = bcu.GetOpenDayPicker(e);

				picker.find(".open-day-picker__level").removeClass("off-screen");
			});

		$(document).on("click",
			".j-toggle-dates-ug",
			function(e) {

				var picker = bcu.GetOpenDayPicker(e);

				picker.find(".j-toggle-dates-ug").addClass("selected");
				picker.find(".j-toggle-dates-pg").removeClass("selected");
				picker.find(".open-day-picker__dates--ug").removeClass("off-screen");
				picker.find(".open-day-picker__dates--pg").addClass("off-screen");
			});

		$(document).on("click",
			".j-toggle-dates-pg",
			function(e) {

				var picker = bcu.GetOpenDayPicker(e);

				picker.find(".j-toggle-dates-ug").removeClass("selected");
				picker.find(".j-toggle-dates-pg").addClass("selected");
				picker.find(".open-day-picker__dates--ug").addClass("off-screen");
				picker.find(".open-day-picker__dates--pg").removeClass("off-screen");
			});
	}

	bcu.CookieAlertToggle = function() {

		$(".j-cookie-alert-hide").click(function(e) {

			e.preventDefault();

			$(".cookie-alert").slideUp();
		});
	};

	bcu.SiteMessage = function() {

		var message = $(".js-site-message");

		if (message.length > 0) {

			var sticky = message.clone().addClass("panel-sticky").appendTo($("body"));

			toggleSiteMessage();

			function toggleSiteMessage() {

				if (isInView(message) || isInView(copyright)) {

					sticky.hide();

				} else {

					sticky.show();
				}
			};

			function isInView(elem) {

				var docViewTop = $(window).scrollTop();
				var docViewBottom = docViewTop + $(window).height();

				var elemTop = $(elem).offset().top;
				var elemBottom = elemTop + $(elem).height();

				return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
			};

			$(document).scroll(function() {
				toggleSiteMessage();
			});
		}
	};

	// For easy reference
	var keys = {
		end: 35,
		home: 36,
		left: 37,
		up: 38,
		right: 39,
		down: 40,
		delete: 46
	};

	// Add or substract depending on key pressed
	var direction = {
		37: -1,
		38: -1,
		39: 1,
		40: 1
	};

	bcu.FlexiblePanelTabbedItemsTabSetup = function() {
		var tabbedItemContainer = $(".fp-list-tabbed");
		var tabbedItemNavigationLink = $(".fp-list-tabbed__tab");
		if (!tabbedItemContainer.length || !tabbedItemNavigationLink.length) {
			return;
		}

		$(tabbedItemNavigationLink).each(function() {
			// Click events
			$(this).on('click',
				function(e) {
					showFlexiblePanelTabbedItemsTab($(this));
				});
			// key events for first(home), last(end), and up/down arrows
			$(this).on('keydown',
				function(e) {
					var key = event.keyCode;
					switch (key) {
					case keys.end:
						e.preventDefault();
						// Activate last tab
						moveToFlexiblePanelTabbedItemsLastTab($(this));
						break;
					case keys.home:
						e.preventDefault();
						// Activate first tab
						moveToFlexiblePanelTabbedItemsFirstTab($(this));
						break;

					// Up and down are in keydown
					// because we need to prevent page scroll >:)
					case keys.up:
					case keys.down:
						e.preventDefault();
						determineTabListOrientation(event);
						break;
					};
				});
			$(this).on('keyup',
				function(e) {
					var key = event.keyCode;
					switch (key) {
					case keys.left:
					case keys.right:
						e.preventDefault();
						determineTabListOrientation($(this), e);
						break;
					};
				});
		});
	};

	function showFlexiblePanelTabbedItemsTab(tab) {
		var panel = "#" + $(tab).attr('aria-controls');
		tab.addClass('active');
		tab.removeAttr('tabindex');
		tab.attr('aria-selected', 'true');
		var activeTab = $(tab);
		activeTab.siblings('.fp-list-tabbed__tab').attr('aria-expanded', 'false');
		activeTab.siblings('.fp-list-tabbed__tab').attr('tabindex', '-1');
		activeTab.siblings('.fp-list-tabbed__tab').removeClass('active');
		activeTab.focus();
		var activePanel = $(panel);
		activePanel.addClass('active');
		activePanel.removeAttr('hidden');
		activePanel.siblings('.fp-list-tabbed__panel').attr('hidden');
		activePanel.siblings('.fp-list-tabbed__panel').removeClass('active');
	}

	function moveToFlexiblePanelTabbedItemsFirstTab(tab) {
		var firstTab = tab.siblings('.fp-list-tabbed__tab:first');
		showFlexiblePanelTabbedItemsTab($(firstTab));
	}

	function moveToFlexiblePanelTabbedItemsLastTab(tab) {
		var lastTab = tab.siblings('.fp-list-tabbed__tab:last');
		showFlexiblePanelTabbedItemsTab($(lastTab));
	}

	// When a tablist's aria-orientation is set to vertical,
	// only up and down arrow should function.
	// In all other cases only left and right arrow function.
	function determineTabListOrientation(tab, e) {
		var tablist = $(tab.attr('data-tablist'));
		var key = e.keyCode;
		var vertical = tablist.attr('aria-orientation') === 'vertical';
		var proceed = false;

		if (vertical) {
			if (key === keys.up || key === keys.down) {
				proceed = true;
			};
		} else {
			if (key === keys.left || key === keys.right) {
				proceed = true;
			};
		};

		if (proceed) {
			switchFlexiblePanelTabbedItemsTab(tab, e);
		};
	};

	function switchFlexiblePanelTabbedItemsTab(tab, e) {
		var pressed = e.keyCode;

		if (pressed === keys.left || pressed === keys.up) {
			var previousTab = tab.prev();
			if (previousTab !== undefined) {
				$(previousTab).focus();
				showFlexiblePanelTabbedItemsTab($(previousTab));
			} else {
				moveToFlexiblePanelTabbedItemsLastTab(tab);
			}
		}

		if (pressed === keys.right || pressed === keys.down) {
			var nextTab = tab.next();
			if (nextTab !== undefined) {
				$(nextTab).focus();
				showFlexiblePanelTabbedItemsTab($(nextTab));
			} else {
				moveToFlexiblePanelTabbedItemsFirstTab(tab);
			}
		}
	}

	bcu.EventMonthFilter = function() {
		if (!$('.j-filterEventsByMonth').length) {
			return;
		}
		var monthFilters = $('.j-filterEventsByMonth');
		monthFilters.change(function(e) {
			e.preventDefault();
			this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);
			window.location = $('.j-filterEventsByMonth').options[this.selectedIndex].value;
		});
	}

	bcu.AccessibleMegaMenu = function() {
		if (jQuery) {
			(function($) {
				"use strict";
				$(document).ready(function() {
					// initialize the megamenu
					$('.megamenu').accessibleMegaMenu();

					// hack so that the megamenu doesn't show flash of css animation after the page loads.
					setTimeout(function() {
							$('body').removeClass('init');
						},
						500);
				});
			}(jQuery));
		}
	}
	bcu.doSlideReveal = function() {
		$('body').on('click',
			'.j-slide-reveal',
			function(e) {
				$(this).find('button').attr('aria-expanded',
					($(this).find('button').attr('aria-expanded') == "true" ? false : true));
			});
	}

	bcu.removeSubNavSkipLinks = function() {
		// remove skip to side nav skip link if side nav not on page
		if ($(".side-nav").length === 0 && $(".js-skip-link-section-nav").length !== 0) {
			$(".js-skip-link-section-nav").addClass('visually-hidden');
		}
	}

	bcu.setupHideRevealActions = function() {
		if ($(".js-action-hidereveal").length) {
			$(".js-action-hidereveal").on('click',
				function() {
					var hiddenElementName = $(this).data("controls");
					if ($(this).attr("aria-expanded") === "false") {
						$(this).attr("aria-expanded", "true");
						$(hiddenElementName).attr("data-hidden", "false");
						$(hiddenElementName).focus();

					} else {
						$(this).attr("aria-expanded", "false");
						$(hiddenElementName).attr("data-hidden", "true");
						$(this).focus();
					}
				});

		}
	}

	bcu.setupAccordionHideRevealActions = function() {
		if ($(".js-accordion-hidereveal").length) {
			$(".js-accordion-hidereveal").on('click', function () {
				console.log('click')
				var hiddenElementName = $(this).attr("aria-controls");
				console.log($(this))
				if ($(this).attr("aria-expanded") === "false") {
					$(this).attr("aria-expanded", "true");
					$("#" + hiddenElementName).attr("data-hidden", "false");
					$(this).addClass('access-accordion-button--active')
					$("#" + hiddenElementName).focus();

				} else {
					$(this).attr("aria-expanded", "false");
					$("#" + hiddenElementName).attr("data-hidden", "true");
					$(this).removeClass('access-accordion-button--active')
					$(this).focus();
				}
			});
		}
	}

	// Iframe Resizer (CRM forms)
	bcu.setupIframeResizer = function () {

		const crmForm = document.querySelector("#crm-form");

		// If form found
		if (crmForm) {

			let loadingMessage;
			let crmIframe;

			// Promise
			const promise = new Promise((res, rej) => {
				// Create loading message
				loadingMessage = document.createElement("h3");
				const loadingMessageText = document.createTextNode("Loading form...");
				loadingMessage.append(loadingMessageText);
				loadingMessage.classList.add("loading-message", "text-center", "mvl", "pvl");
				crmForm.append(loadingMessage);

				// Create iframe
				crmIframe = document.createElement("iframe");
				// ID, class, scrolling, src, title
				crmIframe.id = "crm-iframe";
				crmIframe.classList.add("responsive-iframe", "hidden");
				crmIframe.setAttribute("scrolling", "no");
				crmIframe.setAttribute("src", crmForm.getAttribute("data-src"));
				crmForm.append(crmIframe);

				// Iframe loaded counter
				let iframeLoaded = false;

				crmIframe.addEventListener("load", () => {
					iframeLoaded = true;
					res();
				});

				// Check if iframe has loaded
				setTimeout(() => {
					if (!iframeLoaded) {
						rej();
					}
				}, 5000);

			});

			// Promise resolve, reject
			promise.then(() => {

				iFrameResize({
					log: false
				}, crmIframe);

				crmIframe.classList.remove("hidden");
				loadingMessage.classList.add("hidden");
			}, () => {
				loadingMessage.innerText = "Error: Couldn't load form";
			});
		}
	}

    bcu.doSlideReveal();
	bcu.setupHideRevealActions();
	bcu.setupAccordionHideRevealActions();
	bcu.setupIframeResizer();
    bcu.fullScreenSearchModal();
	bcu.stretchImages();
    bcu.searchOptionsRevealer();
	bcu.basketToggleInit();
    bcu.updateSearchSubsiteOptions();
	bcu.setBgAlpha();
/*	bcu.fauxCourseListingHighlight();*/
	bcu.initJqueryUiTabs();
	bcu.overideInlineLinksForUiTabs();
	bcu.openTab();
	bcu.userSignUpContentToggles();
	bcu.OpenDayPicker();
	bcu.CookieAlertToggle();
    bcu.SiteMessage();
	bcu.FlexiblePanelTabbedItemsTabSetup();
    bcu.EventMonthFilter();
	bcu.removeSubNavSkipLinks();
	bcu.expertProfileListFormat();
	bcu.initFootnotes();
    if (typeof window.videoModalScript !== 'undefined') {
        bcu.videoModalsInit();
    }
    if (typeof window.jumpToMenuScript !== 'undefined') {
        bcu.jumpToMenu();
    }
	if (!Modernizr.svg) {
		bcu.svgLogoCheck();
	}
    bcu.AccessibleMegaMenu();
});

$(document).on("DOMContentLoaded", function () {
	var lazyloadImages;
	if ("IntersectionObserver" in window) {
		imageElementsToObserve = document.querySelectorAll(".lazy-image");
		var imageObserver = new IntersectionObserver(function (entries, observer) {
			entries.forEach(function (entry) {
				if (entry.isIntersecting) {
					var element = entry.target;
                    handleImageLazyLoadByImageElementType(entry.target);
					imageObserver.unobserve(entry.target);
				}
			});
		});

		imageElementsToObserve.forEach(function (element) {
			imageObserver.observe(element);
		});
	} else {
		var lazyloadThrottleTimeout;
		lazyloadImages = document.querySelectorAll(".lazy-image");

		function lazyload() {
			if (lazyloadThrottleTimeout) {
				clearTimeout(lazyloadThrottleTimeout);
			}

			lazyloadThrottleTimeout = setTimeout(function () {
				var scrollTop = window.scrollY;
				lazyloadImages.forEach(function (element) {
					if (element.offsetTop < (window.innerHeight + scrollTop)) {
						handleImageLazyLoadByImageElementType(element)
						element.classList.remove(".lazy-image");
					}
				});
				if (lazyloadImages.length == 0) {
					document.removeEventListener("scroll", lazyload);
					window.removeEventListener("resize", lazyload);
					window.removeEventListener("orientationChange", lazyload);
				}
			}, 20);
		}

		document.addEventListener("scroll", lazyload);
		window.addEventListener("resize", lazyload);
		window.addEventListener("orientationChange", lazyload);
	}
});

function handleImageLazyLoadByImageElementType(element) {
	var imageType = element.dataset.imgtype;
	if (!imageType || imageType.toLowerCase() === "normal") {
		element.src = element.dataset.src;
	}
	if (imageType.toLowerCase() === "background") {
		element.classList.add(element.dataset.bgimgclass);
	}
	if (imageType.toLowerCase() === "srcset") {
		element.src = element.dataset.src;
		element.srcset = element.dataset.srcset;
		element.sizes = element.dataset.sizes;
	}
	element.classList.remove("lazy-image");
}

$(window).on('load', function () {
    bcu.setCardsHeight();
    bcu.setModulesHeight();
});

$(window).on('resize orientationchange', function () {
    bcu.setCardsHeight();
    bcu.setModulesHeight();
});


bcu.setupSignUpFormSubmitEventHandlers = function() {
    
    $(".js-bcu-signup-submit").click(function(e) {
        e.preventDefault();
        bcu.checkSignUpFormReCaptcha($(this));
    });
    $(".js-bcu-signup-submit").keypress(function(e) {
        e.preventDefault();
        bcu.checkSignUpFormReCaptcha();
    });
}

bcu.checkSignUpFormReCaptcha = function() {
    var recaptcha = $("#g-recaptcha-response").val();
	if (recaptcha === "") {
        $('#recaptchaFieldError').removeClass("visually-hidden");
    } else {
        $('#signupForm').submit();
    }
}

/**
 * =======================================================================
 * Panels - Expert Profile List
 * =======================================================================
 */
bcu.expertProfileListFormat = function () {
	const expertProfileList = document.querySelectorAll('.panel--expert-profile-list')
	if (expertProfileList.length > 0) {
		expertProfileList.forEach(listing => {
			const profileBlock = listing.querySelectorAll('.expert-list-block')
			profileBlock.forEach(block => {
				const tags = block.querySelector('.expert-list-block__tags')
				let tagsText = tags.textContent
				tagsArr = tagsText.split(',')
				const tagsInSpan = tagsArr.map(tagsToSpan)

				function tagsToSpan(tag) {
					return `<span>${tag}</span>`
				}
				tags.innerHTML = tagsInSpan.toString().split(',').join('')
			})

		})
	}
}


/**
 * =======================================================================
 * Look At Me Now - Case study listing / Related case studies
 * =======================================================================
 */
const lamnCaseStudyListingAll = document.querySelectorAll('.js-case-study-grid--lamn'),
	  lamnCaseStudyRelatedStudiesAll = document.querySelectorAll('.case-study-detail__related-cs-LAMN')

if (lamnCaseStudyListingAll.length > 0 || lamnCaseStudyRelatedStudiesAll.length > 0) {


	let relatedCaseStudyAll = document.querySelectorAll('.related-cs-LAMN__content')
	let caseStudyListingAll = document.querySelectorAll('.js-case-study--lamn')


	async function loadImage(img) {
		const imageLoadPromise = new Promise(resolve => {
			img.onload = resolve;
		});

		await imageLoadPromise;
		return img;
	}

	// Related case studies
	if (relatedCaseStudyAll.length > 0) {
		relatedCaseStudyAll.forEach(caseStudy => {

			let imageContainer = caseStudy.querySelector('.related-cs-LAMN__content__image'),
				img = imageContainer.querySelector('.LAMN-image-bg'),
				imageGradient = imageContainer.querySelector('.related-cs-LAMN__content__image__gradient')

			loadImage(img).then(image => {
				const colorThief = new ColorThief();
				let colorRef = colorThief.getColor(image)
				imageGradient.style.background = `linear-gradient(90deg, rgba(${colorRef},0.8) 0%, rgba(255,255,255,0) 70%)`
			})
		})
	}
	
	// Case study listing
	if (caseStudyListingAll.length > 0) {
		caseStudyListingAll.forEach(caseStudy => {

			let imageContainer = caseStudy.querySelector('.case-study-image'),
				img = imageContainer.querySelector('.case-study-image-bg'),
				imageGradient = imageContainer.querySelector('.case-study-image-gradient')

			loadImage(img).then(image => {
				const colorThief = new ColorThief();
				let colorRef = colorThief.getColor(image)
				imageGradient.style.background = `linear-gradient(90deg, rgba(${colorRef},0.8) 0%, rgba(255,255,255,0) 70%)`
			})
		})
	}
	
	
	
	
}

/**
 * =======================================================================
 * Footnote on course pages
 * =======================================================================
 */
bcu.initFootnotes = function() {

	window.addEventListener('click', e => {
		if (e.target.classList.contains('js-footnoteanchor')) {
			footnoteClickEvt(e)
		}
	})

	function footnoteClickEvt(e) {
        e.preventDefault();

		// get target element from href
        let targetEl = document.querySelector(`${e.target.getAttribute('href')}`);

		if (targetEl) {
			// get title height
            let fixedTitleHeight = document.querySelector('.course__title--pin').offsetHeight;

			// get menu height
            let fixedMenuHeight = window.innerWidth >= 768
                ? document.querySelector('.course__menu__list--NEW').offsetHeight
                : document.querySelector('.course-menu-inner').offsetHeight;

			// calc total height plus 'padding'
            let totalOffsetHeight = fixedTitleHeight + fixedMenuHeight + 30;

			// set scroll offset
            targetEl.style.scrollMarginTop = `${totalOffsetHeight}px`;

			// scroll into view
            targetEl.scrollIntoView({ behavior: 'smooth' });

			// find matching parent to highlight
            let targetElParentToHighlight = targetEl.closest('.anim-highlight');

			// start animation and remove when complete
            targetElParentToHighlight.classList.add('init-anim');
            targetElParentToHighlight.addEventListener('animationend',
                () => { targetElParentToHighlight.classList.remove('init-anim') });
        }

		

	}
};


$(document).ready(function() {

	bcu.geoLookupCountryCodeFromService = function() {

		var code;

		$.ajax({
			async:false,
			url: "/home/geolookupcountrycode",
			dataType: "json",
			success: function(response) { code = response.Code; },
			error: function() { code = "??"; }
		});

		return code;
	}

    bcu.geoLookupCountryCode = function () {

		var privacyCookie = Cookies.get('bcu-privacy');

        var functionalCookieValue = "1";

	    if (privacyCookie.length > 1) { functionalCookieValue = privacyCookie.substring(1, 2); }

        if (functionalCookieValue == null || functionalCookieValue !== "1") return "??";

	    var cookieName = "bcu-country-code";

		var code = Cookies.get(cookieName);

		if (typeof code == "undefined") {

			code = bcu.geoLookupCountryCodeFromService();

			Cookies.set(cookieName, code);
		}

		return code;
    }
});
;


$(document).ready(function() {

	bcu.getYouKuIframe = function (ele) {

		var width = ele.attr("width");
		var height = ele.attr("height");
		var title = ele.attr("title");
		var youKuId = ele.attr("data-youkuid");
		var autoplay = ele.attr("data-autoplay") === "true" ? "&amp;isAutoPlay=true" : "";

		return '<iframe height="' + height + '" width="' + width + '" src="//player.youku.com/embed/' + youKuId + autoplay + '" allowfullscreen title="' + title + '"></iframe>';
	}

	bcu.getYouTubeIframe = function (ele) {

		var width = ele.attr("width");
		var height = ele.attr("height");
		var title = ele.attr("title");
		var youtubeId = ele.attr("data-youtubeid");
		var autoplay = ele.attr("data-autoplay") === "true" ? "&amp;autoplay=1" : "";

		return '<iframe width="' + width + '" height="' + height + '" src="//www.youtube.com/embed/' + youtubeId + '?enablejsapi=1&amp;rel=0&amp;wmode=transparent&amp;controls=1' + autoplay + '" allowfullscreen title="' + title + '"></iframe>';
	}

	bcu.swapYouTubeForYouKu = function () {

		var $iframeTags = $('iframe');

		for (var i = 0; i < $iframeTags.length; i++) {

			var $currentiFrame = $($iframeTags[i]);
			var youKuId = $currentiFrame.attr("data-youkuid");
			if (typeof youKuId != "undefined") {

				var countryCode = bcu.geoLookupCountryCode();

				if (countryCode.toLowerCase() === "cn") {

					$currentiFrame.replaceWith(bcu.getYouKuIframe($currentiFrame));
				}
			}
		}
	}

	bcu.swapYouTubeObjectsWithIframe = function () {
		var $objectTags = $('object');
		for (var i = 0; i < $objectTags.length; i++) {

			var $currentObj = $($objectTags[i]);
			var youtubeId = $currentObj.attr("data-youtubeid");

			if (typeof youtubeId != "undefined") {
				
				var youKuId = $currentObj.attr("data-youkuid");
				if (typeof youKuId != "undefined") {
					
                    var countryCode = bcu.geoLookupCountryCode();

					if (countryCode.toLowerCase() === "cn") {

						$currentObj.replaceWith(bcu.getYouKuIframe($currentObj));

						continue;
					}
				}

				$currentObj.replaceWith(bcu.getYouTubeIframe($currentObj));
			}
		}
    }
    bcu.swapYouTubeForYouKu();
    bcu.swapYouTubeObjectsWithIframe();
});

;


	// ---------------------------------------------------------------------
	// News rss widget
	// ---------------------------------------------------------------------
	var formatDate = function (dateString) {

		var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

		var date = new Date(Date.parse(dateString));

		return date.getDate() + " " + months[date.getMonth()];
	};

	$('.bcu-news-rss-widget').each(function () {

		var $this = $(this);

		var siteId = $this.data('site-id');
		var count = $this.data('item-count');
		var tLength = $this.data('title-length');

		tLength = (!tLength) ? 58 : tLength;
		count = (!count) ? 4 : count;

		var host = document.location.hostname;
		var port = document.location.port;
		var fhost = port != 80 ? host + ":" + port : host;
		var feedUrl = "//" + fhost + "/news/rss/" + siteId;

		$.ajax({

			type: 'GET',
			url: feedUrl,

			beforeSend: function () {
				$this.html('<p class="grey ptm">Loading, please wait...</p>');
			},

			success: function (data) {

				$this.empty();

				var markup = '<ul class="news-listing-item no-bullets man pan">';

				$(data).find('item').slice(0, count).each(function (i) {

					var title = $(this).find('title').text();
					var link = $(this).find('link').text();
					var date = $(this).find('a10\\:updated').text();
					if (date == "") {
						date = $(this).find('updated').text();
					}
					var img = $(this).find('enclosure').attr('url');

					title = title.length > tLength ? title.slice(0, tLength) + '...' : title;

					markup += '<li class="clear-fix dotted-bottom pan man pbm mbs no-bullets">';
					markup += '<a href="' + link + '"><img class="mts mrm left" src="' + img + '" alt="' + title + '" width="80" height="68" style="width:80px;height:68px;" /></a>';
					markup += '<h5 class="man pan line-height"><span class="grey prs">' + formatDate(date) + '</span> <a href="' + link + '">' + title + '</a></h5>';
					markup += '</li>';
				});

				markup += '</ul>';

				$this.html(markup);
			},

			error: function () {
				$this.html('<p>Sorry, the latest news could not be retrieved.</p>');
			}
		});
	});


	// ---------------------------------------------------------------------
	// Twitter widget
	// ---------------------------------------------------------------------
	var replaceUrlWithHtmlLinks = function (text) {
		var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
		return text.replace(exp, "<a href='$1'>$1</a>");
	};

	var tweetDateInfo = function (dateString) {
		var month = ["January", "February", "March", "April", "May", "June",
               "July", "August", "September", "October", "November", "December"];

		var dateToday = new Date();
		var datePosted = new Date(Date.parse(dateString));

		//One day in milliseconds
		var oneDay = 24 * 60 * 60 * 1000;
		var daysAgo = Math.round(Math.abs((dateToday.getTime() - datePosted.getTime()) / (oneDay)));

		var dayMsg = (daysAgo > 1 ? daysAgo + ' days ago' : 'a day ago');

		var tweetDateString = month[datePosted.getMonth()] + " " + datePosted.getDate() + " (" + dayMsg + ")";

		return tweetDateString;
	};

	$('.twitter-widget').each(function () {
		var $this = $(this);
		var username = $(this).data('screen-name');
		var twitterCount = $(this).data('tweet-count');
		var recentTweetsUrl = "/api/twitter/" + username;

		$.ajax({
			type: "GET", url: recentTweetsUrl, dataType: "json", success: function (response) {
				var tdata = '';
				for (var i = 0; i < response.length; i++) {
					if (i < twitterCount) {
						var data = response[i];
						var id = data.id;
						//var text = data.text;
						var text = replaceUrlWithHtmlLinks(data.text);
						var createdTime = data.created_at;
						var createdTimeString = tweetDateInfo(data.created_at);
						var screen_name = data.user.screen_name;
						var image = data.user.profile_image_url;
						var source = data.source;
						tdata += "<div class='status mvm' id='" + id + "'><p class='mbn'><a class='bold simple' href='http://twitter.com/" + screen_name + "'>" + screen_name + ":</a> " + text + "</p><div class='twitter_posted_at mbm sml'><span class='timeago' title='" + createdTime + "'>" + createdTimeString + "</span></div></div>";
						//image not needed, kept in case we change our minds: <img src=" + image + " class='twitter_image'/>
					}
				}
				$this.html(tdata);

			}
		});

	});
;
experiments = (function () {
    var cookieNamePrefix = 'bcu-croexp-';
    var experiment = $('.js-cro-experiment').first();

    var experimentVariants = new Array();
    var selectedVariant;

    var runExperiment = function runExperiment() {
        selectedVariant = selectVariant();
        experiment.attr('data-selectedvariant', selectedVariant.data('variant').toString());
        selectedVariant.addClass('js-cro-experiment__variant--shown');
        //ga('set', 'exp', experiment.data('experiment') + '.' + selectedVariant.data('variant'));
    };

    function selectVariant() {
       
        getExperimentVariants();
        var experimentVariantFromCookie = checkCookieForExperimentRecord(experiment.data('experiment'));
        if (experimentVariantFromCookie !== "") {
            return experimentVariants[experimentVariantFromCookie];
        }
        var randomVariantIndex = getRandomInteger(experimentVariants.length);
        var experimentName = cookieNamePrefix + experiment.data('experiment');
        Cookies.set(experimentName, experimentVariants[randomVariantIndex].data('variant'));
        return experimentVariants[randomVariantIndex];
    }

    function getExperimentVariants() {
        var expVariants = $('.js-cro-experiment__variant');
        if ((!expVariants).length) { return; }
        expVariants.each(function () {
            experimentVariants.push($(this));
        });
    }

    function checkCookieForExperimentRecord(experiment) {
        var experimentsCookie = Cookies.get(cookieNamePrefix + experiment);
        return experimentsCookie;
    }

    function getRandomInteger(max) {
        return Math.floor(Math.random() * Math.floor(max));
    }

    var init = function() {
        if (!experiment.length) { return; }
        runExperiment();
    };

    init();

})();;
privacyReview = (function () {
    var defaultCookieExpiryInDays = 365;
    var consentCookieName = 'bcu-consent';
    var consentShownCookieName = 'bcu-consent-shown';
    var consentAcknowledgedCookieName = 'bcu-consent-ack';
    var privacySettingsCookieName = 'bcu-privacy';
    var consentCookieMessageAcknowledged = Cookies.get(consentAcknowledgedCookieName);
    var defaultPrivacySettings = '111';

    var privacyCookiePolicyAccept = $('.js-cookie-policy-accept');
    var privacyCookiePolicyViewButton = $('.js-cookie-policy-view');

    var togglePrivacyActionBar = function (shouldShow) {
        var el = $('.js-cookie-banner');
        if (!el || el.length === 0) { return; }
        if (shouldShow) {
            el.addClass("cookie-banner--shown");
            if (!Cookies.get(consentShownCookieName).length > 0) {
                Cookies.set(consentShownCookieName, new Date().toISOString(), { expires: defaultCookieExpiryInDays, path:'' });
            }
        } else {
            el.removeClass("cookie-banner--shown");
        }
    }

    var setConsentCookie = function (valueToSet) {
        var cookieValueToSet = valueToSet + "=" + new Date().toISOString();
        Cookies.set(consentCookieName, cookieValueToSet, { expires: defaultCookieExpiryInDays, path: '' });
    }

    var setPrivacySettingsCookie = function (valuesToSet) {
        Cookies.set(privacySettingsCookieName, valuesToSet, { expires: defaultCookieExpiryInDays, path: '' });
    }

    var pushGtmDataLayer = function() {
        (function(w, d, s, l, i) {
            w[l] = w[l] || [];
            w[l].push({
                'gtm.start':
                    new Date().getTime(),
                event: 'gtm.js'
            });
            var f = d.getElementsByTagName(s)[0],
                j = d.createElement(s),
                dl = l != 'dataLayer' ? '&l=' + l : '';
            j.async = true;
            j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
            f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-WTWQ7N');
    }

    var setCookieAndPushGtm = function() {
        var privacyCookieValue = Cookies.get(privacySettingsCookieName);
        if (!privacyCookieValue || !privacyCookieValue.length > 0) {
            setConsentCookie("YES");
            setPrivacySettingsCookie(defaultPrivacySettings);
        }
        Cookies.set(consentAcknowledgedCookieName, new Date().toISOString(), { expires: defaultCookieExpiryInDays, path: '' });
        pushGtmDataLayer();
    }

    var acceptCookiePolicy = function () {
        // Consent explicitly given via consent button (affirmative action)
        privacyCookiePolicyAccept.on("click", function () {
            setCookieAndPushGtm();
            togglePrivacyActionBar(false); // Hide action message
        });
    }

    var viewCookiePolicy = function () {
        // User visiting settings page so apply consent with default settings
        privacyCookiePolicyViewButton.on("click", function () {
            e.preventDefault();
            setCookieAndPushGtm();
            if (privacyCookiePolicyViewButton.data("src").length > 0) {
                parent.window.location = privacyCookiePolicyViewButton.data("src");
            }
        });
    }

    var setupPrivacyReviewActions = function () {
        if (!privacyCookiePolicyAccept || !privacyCookiePolicyAccept.length > 0) {
            return;
        }
        acceptCookiePolicy();
        viewCookiePolicy();
    }

    var init = function () {
        if (!consentCookieMessageAcknowledged || consentCookieMessageAcknowledged.length === 0) {
            setupPrivacyReviewActions();
        }
    };
    init();

})();;
//var $ = require('jquery');

tabDrawerInit = (function() {

  var currentWindowWidth = window.innerWidth ? window.innerWidth : $(window).width();

  var tabDrawer = $(".js-tab-drawer");

  var selectors = {
    closeButton: '.js-close-tab-drawer',
    defaultDrawerLink: 'li[data-linknumber="1"]',
    defaultDrawer: 'div[data-drawernumber="1"]',
    drawers: '.tab-drawer__drawers',
    drawerLink: '.js-tab-drawer-link',
    tabs: '.tab-drawer__tabs',
    tabDrawer: '.js-tab-drawer',
    visibleDrawer: '.tab-drawer__drawer--visible'
  }

  var classes = {
    drawerVisible: 'tab-drawer__drawer--visible',
    drawerLinkVisible: 'tab-drawer__listitem--active',
    visuallyHidden: 'visually-hidden--force',
  }


  function setupTabDrawerLinks() {
    var drawerLinks = $(selectors.drawerLink);
    drawerLinks.click(function( e ) {
      e.preventDefault;
      showTabDrawer( $(this) );
    });
  };

  function setupCloseDrawerButton() {
    $(selectors.closeButton).click(function( e ) {
      closeTabDrawer();      
    });
  }

  function closeTabDrawer() {
    $(selectors.drawers).addClass(classes.visuallyHidden);
    $(selectors.tabDrawer).removeClass(classes.drawerVisible);
    $(selectors.tabs).removeClass(classes.visuallyHidden);
  }

  function showTabDrawer( $drawSelectionLink ) {
    
    var drawerNumber = $drawSelectionLink.data("linknumber");
    //console.log(drawerNumber);
    var drawSelector = '[data-drawernumber="' + drawerNumber + '"]';
    //console.log($(drawSelector).length);
    if (!$(drawSelector).length) return;

    $(selectors.drawerLink).removeClass(classes.drawerLinkVisible);
    $drawSelectionLink.addClass(classes.drawerLinkVisible);
    $(selectors.tabDrawer).removeClass(classes.drawerVisible);
    $(drawSelector).addClass(classes.drawerVisible);

    var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
    if(windowWidth < 900){
      $(selectors.tabs).addClass(classes.visuallyHidden);
      $(selectors.drawers).removeClass(classes.visuallyHidden);
    }
  }

  function highlightFirstTabDrawerLink() {
    $(selectors.defaultDrawerLink).addClass(classes.drawerLinkVisible);
  }

  function setupTabDrawerBasedOnWindowSize() {
    var windowWidth = window.innerWidth ? window.innerWidth : $(window).width();
    if (windowWidth == currentWindowWidth) return;

    if(windowWidth < 900){
      closeTabDrawer();
    }
    else {
      $(selectors.drawers).removeClass(classes.visuallyHidden);
      
      $(selectors.drawerLink).removeClass(classes.drawerLinkVisible);
      if(!$(selectors.visibleDrawer).length) {
        if($(selectors.defaultDrawerLink).length > 0)
        {
          highlightFirstTabDrawerLink();
        }
        if ($(selectors.defaultDrawer).length > 0)
        {
          $(selectors.defaultDrawer).addClass(classes.drawerVisible);
        }
      }
    }
  };

    var init = function () {
    if (!tabDrawer.length) { return; }
    setupTabDrawerLinks();
    highlightFirstTabDrawerLink();
    setupCloseDrawerButton();
    setupTabDrawerBasedOnWindowSize();
    window.addEventListener('resize', function() { setupTabDrawerBasedOnWindowSize(); });
  };

    init();

})();;
function resetFocusOnOptions(){$(".js-course").each(function(){$(this).attr("aria-selected","false")})}function toggleSearchTabs(){$(this).hasClass("active")||($(".search-container__tabs > div").toggleClass("active"),$(".search-container__panel").toggleClass("active"))}function setupSearchResultOptionClickEvents(){var n=$("li.js-course");n.click(function(){var t,i;n.removeClass("js-course--match");t=$(this).data("course-id");let u=$(this).text();$(".js-course-welcome--open").removeClass("js-course-welcome--open");i=$(".js-course-welcome");let r;i.each(function(){let n=$(this).data("courses");n=n.split(";");for(let i=0;i<n.length;i++){let u=n[i].split("|");u[0].replace(" ","")===t&&($(this).addClass("js-course-welcome--open"),r=$(this))}});displayCourseDetails(u,r)})}function displayCourseDetails(n,t){displayCourseTitle(n);showDefaultContent();showMidPageMenu(t)}function displayCourseTitle(n){const t=document.querySelector(".search__course-name-display");t.innerHTML=`<h2 class="search__course-name-display__text">${n}</h2>`;t.classList.add("visible")}function showDefaultContent(){const t=document.querySelector(".js-course-welcome--open"),i=document.querySelector(".welcome-week-default-content"),r=document.querySelectorAll(".welcome-week-default-content__block");i.classList.remove("visible");for(defaultBlock of r)defaultBlock.classList.remove("block-selected"),defaultBlock.setAttribute("id","");let n;for(n in t.dataset){let u;for(u of r){let r;for(r in u.dataset){const f=r,e=t.dataset[n],o=u.dataset[r];r===n&&e===o&&(u.classList.add("block-selected"),u.setAttribute("id",`scrollTo${f.replace("default","")}`),i.classList.add("visible"))}}}addIdsToCustomBlocks()}function addIdsToCustomBlocks(){const n=document.querySelectorAll(".js-course-welcome");n.forEach(n=>{const t=n,i=t.querySelectorAll("section");for(let n of i)if(n.hasAttribute("data-scroll-to"))if(t.classList.contains("js-course-welcome--open")){function t(n){return n.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g).map(n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase()).join("")}const i=t(n.dataset.scrollTo);n.setAttribute("id",`scrollTo${i}`)}else n.setAttribute("id","")})}function showMidPageMenu(n){const t=document.querySelector(".ww-midpage-menu-container");n[0].classList.contains("hide-menu")?t.classList.remove("ww-midpage-menu-container--visible"):t.classList.add("ww-midpage-menu-container--visible")}function initDefaultContent(){const t=document.querySelector(".welcome-week-default-content");let n;if(t)for(n of t.children){const i=n.querySelector(".welcome-week-default-content__title"),t=i.textContent.toLowerCase().split("-"),r=t[0].trim().replaceAll(" ","-"),u=t[1].trim().replaceAll(" ","-");n.setAttribute(`data-default-${r}`,u)}}function toggleMidpageMenu(){const n=document.querySelector(".ww-midpage-menu");n.classList.contains("open")?n.classList.remove("open"):n.classList.add("open")}function URLSearchParams(n){var u,e,t,o,i,f,r=Object.create(null);if(this[secret]=r,n)if(typeof n=="string")for(n.charAt(0)==="?"&&(n=n.slice(1)),o=n.split("&"),i=0,f=o.length;i<f;i++)t=o[i],u=t.indexOf("="),-1<u?appendTo(r,decode(t.slice(0,u)),decode(t.slice(u+1))):t.length&&appendTo(r,decode(t),"");else if(isArray(n))for(i=0,f=n.length;i<f;i++)t=n[i],appendTo(r,t[0],t[1]);else if(n.forEach)n.forEach(addEach,r);else for(e in n)appendTo(r,e,n[e])}function addEach(n,t){appendTo(this,t,n)}function appendTo(n,t,i){var r=isArray(i)?i.join(","):i;t in n?n[t].push(r):n[t]=[r]}function decode(n){return decodeURIComponent(n.replace(plus," "))}function encode(n){return encodeURIComponent(n).replace(find,replacer)}var orgStructureData={faculties:[{facultyId:"d7dad765-00bd-4d94-843e-132623d56528",name:"Faculty of Health, Education and Life Sciences",ugPageUrl:"https://www.bcu.ac.uk/health-education-and-life-sciences/welcome-undergraduate/",pgPageUrl:"https://www.bcu.ac.uk/health-education-and-life-sciences/welcome-postgraduate"},{facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",name:"Faculty of Arts, Design and Media",ugPageUrl:"https://www.bcu.ac.uk/arts-design-and-media/welcome-undergraduate/",pgPageUrl:"https://www.bcu.ac.uk/arts-design-and-media/welcome-postgraduate"},{facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",name:"Faculty of Computing, Engineering and The Built Environment",ugPageUrl:"https://www.bcu.ac.uk/computing-engineering-and-the-built-environment/welcome-undergraduate/",pgPageUrl:"https://www.bcu.ac.uk/computing-engineering-and-the-built-environment/welcome-postgraduate"},{facultyId:"fd2a8df7-f397-40e0-b2e6-a8a2b633e19b",name:"Faculty of Business, Law and Social Sciences",ugPageUrl:"https://www.bcu.ac.uk/business-law-and-social-sciences/welcome-undergraduate/",pgPageUrl:"https://www.bcu.ac.uk/business-law-and-social-sciences/welcome-postgraduate"}],schools:[{schoolId:"be457b61-5b09-4b20-8b5f-3569e6403be5",name:"Birmingham Conservatoire - HIC",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"2f51ded5-97b3-4687-b2a4-36c0d32f8e38",name:"Birmingham School of Acting",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"c2ff5678-429b-4dc7-add8-220bae324a28",name:"Birmingham School of Architecture and Design",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"e95a4146-f78f-460f-b3c4-efd83d81de09",name:"Birmingham School of Art",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"d8b9d963-1bca-493c-a969-d4b189add346",name:"Birmingham School of Media",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"8fb2fde4-fae8-475b-b285-5314bef70f1f",name:"School of Games, Film and Animation",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"4b93d348-af54-49d0-b944-da07fe27f49d",name:"Royal Birmingham Conservatoire",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"49b06c05-b245-4a27-a29a-cb351dab9790",name:"School of English",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"4850747c-d2d1-4bb3-a77a-6dd42163f871",name:"School of Fashion and Textiles",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"5d5ac166-898c-40ca-a20e-bd15374b4b99",name:"School of Jewellery",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"50653243-b3cf-4303-be31-8f7607db8888",name:"School of Visual Communication",facultyId:"118969e0-c54e-4b32-984b-981c10a03e65",courses:[]},{schoolId:"1670c498-50cf-4d95-8abd-552faa91366c",name:"The Centre for Leadership and Management Practice",facultyId:"1605099f-5e1c-460a-beb8-753a7dc5f1c0",courses:[]},{schoolId:"ba3d87f0-b020-45f9-945a-3d5fce7ad7ba",name:"The Centre of Internal Audit, Governance and Risk Management",facultyId:"1605099f-5e1c-460a-beb8-753a7dc5f1c0",courses:[]},{schoolId:"bf42d32e-db97-4267-8028-6b114b575e1d",name:"The Department of Accountancy and Finance",facultyId:"1605099f-5e1c-460a-beb8-753a7dc5f1c0",courses:[]},{schoolId:"f218eedb-d359-4fc1-83ef-34817fbb6351",name:"The Department of Management, Human Resources and Enterprise",facultyId:"1605099f-5e1c-460a-beb8-753a7dc5f1c0",courses:[]},{schoolId:"b6e42e2c-6653-4c5c-a28f-465636c00acb",name:"The Department of Strategy, Marketing and Economics",facultyId:"1605099f-5e1c-460a-beb8-753a7dc5f1c0",courses:[]},{schoolId:"267bafd3-2850-4896-824f-6b5fd4b30c93",name:"School of Computing and Digital Technology",facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",courses:[]},{schoolId:"41c346d8-c50e-4cec-bd0c-b2be510d1e46",name:"School of Computing and Digital Technology",facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",courses:[]},{schoolId:"357da836-3514-4adc-8acd-cba7882238ee",name:"School of Engineering and the Built Environment",facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",courses:[]},{schoolId:"8eca182c-e0e0-461c-a1d1-4ca3b254449d",name:"School of Engineering and the Built Environment",facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",courses:[]},{schoolId:"ca144104-c419-4fd0-adaa-e9c72cba2b37",name:"St Trinian's - edited",facultyId:"73ec7c81-4015-40f3-a5fe-a17d2e7fa0bf",courses:[]},{schoolId:"960299b0-012f-48aa-b6f1-c849fd7c39dc",name:"Centre for Community Mental Health",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"346c5b09-be7d-4bfb-9ee4-f7f7aab51669",name:"Defence School of Healthcare Education",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"c9c81007-7a71-401a-ba3e-6a9eb629157b",name:"School of Education and Social Work",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"98f6def4-63bb-420a-b332-39ea172e9959",name:"School of Health Sciences",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"1f64ad48-ebc2-4397-9e7c-410323563bbd",name:"School of Health Sciences (old)",facultyId:"d7dad765-00bd-4d94-843e-132623d56528}",courses:[]},{schoolId:"4b991dc2-743a-4d6d-8219-73f0045e27d5",name:"School of Nursing and Midwifery",facultyId:" d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"3e002259-3655-473f-829a-92d37cdf9dfa",name:"School of Professional Practice",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"aebb100c-2e1e-4273-ac6f-ab8e263f47ae",name:"The School of Health and Social Care - Research Dept",facultyId:"d7dad765-00bd-4d94-843e-132623d56528",courses:[]},{schoolId:"5c082c5c-732b-4e47-a3a5-a527e0ffa221",name:"Birmingham City Business School",facultyId:"fd2a8df7-f397-40e0-b2e6-a8a2b633e19b",courses:[]},{schoolId:"25528a13-02b9-46f0-a22d-ded0ae525981",name:"School of Law",facultyId:"fd2a8df7-f397-40e0-b2e6-a8a2b633e19b",courses:[]},{schoolId:"5b3e8087-fae0-45ff-aab8-9c88bbe64918",name:"School of Social Sciences",facultyId:"fd2a8df7-f397-40e0-b2e6-a8a2b633e19b",courses:[]},{schoolId:"d02092be-f29c-47af-87f9-7c5a2c5a1e5b",name:"BIAD Research",facultyId:"fff2a992-0c7c-4925-b59f-5240edd993bf",courses:[]}]},courseWelcomeBlocks=$(".js-course-welcome"),facultiesData=this.orgStructureData.faculties,schoolsData=this.orgStructureData.schools,schoolsMenu=[],displaySelectedSchoolCourse;$(document).ready(function(){function t(n){function e(){const n=$(".search-container__panel__input");if($('.js-course--match[aria-selected="true"]').length!==0){const n=$('.js-course--match[aria-selected="true"]');n.nextAll(".js-course--match:first").attr("aria-selected","true");n.nextAll(".js-course--match:first").focus();n.attr("aria-selected","false")}else n.next().children(":first").children(".js-course--match:first").attr("aria-selected","true"),n.next().children(":first").children(".js-course--match:first").focus()}function o(){const n=$(".search-container__panel__input");if($('.js-course--match[aria-selected="true"]').length!==0){const n=$('.js-course--match[aria-selected="true"]');n.prevAll(".js-course--match:first").attr("aria-selected","true");n.prevAll(".js-course--match:first").focus();n.attr("aria-selected","false")}}function s(){n.target.classList.contains("js-course--match")&&n.target.click()}var t;if(n.keyCode!==38&&n.keyCode!==40&&n.keyCode!==13){var r=$(".search-container__panel__input").val().toUpperCase(),i=$(".js-course"),u=$(".search-container__panel__no-results"),f;if(r.length>=2){for(t=0;t<i.length;t++)f=i[t].textContent||i[t].innerText,f.toUpperCase().indexOf(r)>-1&&r.length!=0?i.eq(t).addClass("js-course--match"):i.eq(t).removeClass("js-course--match");$(".js-course--match").length==0?u.addClass("showing"):u.removeClass("showing")}else $(".js-course.js-course--match").removeClass("js-course--match"),u.removeClass("showing")}else n.keyCode===38?o():n.keyCode===40?e():n.keyCode===13&&s(n)}buildMenuFromCourseWelcomeBlocksOnPage();showPreSelectedWelcomeBlock();setupSearchResultOptionClickEvents();const n=document.querySelector("#wwMidpageMenuBtn");n&&n!=null&&n!=undefined&&n.addEventListener("click",toggleMidpageMenu);$(".search-container__tabs > div").on("click",toggleSearchTabs);$(".search-container__tabs > div").on("keypress",function(n){n.keyCode===13&&$(this).click()});$(".search-container__panel").on("keyup",t);setupSchoolCoursesSelectionChangedEvent()});$(".search-container__panel__input").on("focus",resetFocusOnOptions);var setupSchoolCoursesSelectionChangedEvent=function(){$(".school-course-select").change(function(n){n.preventDefault;displaySelectedSchoolCourse(n)})},buildMenuFromCourseWelcomeBlocksOnPage=function(){var t=$(".course-list"),i=$(".school-course-select"),n=document.createElement("ul");n.id="autocomplete-options--destination";n.setAttribute("role","list");t.append(n);$.each(courseWelcomeBlocks,function(n,t){var i=$(t).data("school"),u,r,f;i!=null&&i!=undefined&&i!=""&&(u=schoolsMenu.find(function(n){return n.id===i}),r=orgStructureData.schools.find(function(n){return n.schoolId===i}),u===undefined&&schoolsMenu.push({id:r.schoolId,name:r.name,facultyId:r.facultyId,courses:[]}),f=$(t).data("courses").split(";"),$.each(f,function(n,t){var r=t.split("|")[0],u=t.split("|")[1],f=schoolsMenu.find(function(n){return n.id===i});f.courses.push({id:r,name:u})}))});$.each(schoolsMenu,function(t,r){var u=document.createElement("optgroup");(u.setAttribute("label",r.name),u.text=r.name,i.append(u),r.courses!=undefined)&&$.each(r.courses,function(t,i){var r=document.createElement("li"),s,e,o,f;r.setAttribute("class","js-course");r.setAttribute("role","option");r.setAttribute("tabindex","-1");s=document.createTextNode(i.name);e=document.createAttribute("data-course-id");e.value=i.id;r.setAttributeNode(e);o=document.createAttribute("aria-selected");o.value="false";r.setAttributeNode(o);r.append(s);n.append(r);f=document.createElement("option");f.setAttribute("label",i.name);f.setAttribute("value",i.id);f.setAttribute("data-course-id",i.id);f.text=i.name;u.appendChild(f)})});$("#json-payload").html(JSON.stringify({faculties:orgStructureData.faculties,schools:schoolsMenu}))},showPreSelectedWelcomeBlock=function(){var n=new URLSearchParams(location.search),u=n.get("course"),f=n.get("title"),t,i,r;n.has("course")&&n.has("title")&&($(".js-course-welcome--open").removeClass("js-course-welcome--open"),t=$(".js-course-welcome"),i=f,t.each(function(){let n=$(this).data("courses");n=n.split(";");for(let t=0;t<n.length;t++){let i=n[t].split("|");i[0].replace(" ","")===u&&($(this).addClass("js-course-welcome--open"),r=$(this))}}),displayCourseDetails(i,r))};displaySelectedSchoolCourse=function(n){var t,i;let u=n.target.options[n.target.selectedIndex].text;t=$(".school-course-select").val();$(".js-course-welcome").removeClass("js-course-welcome--open");i=$(".js-course-welcome");let r;i.each(function(){let n=$(this).data("courses");n=n.split(";");for(let i=0;i<n.length;i++){let u=n[i].split("|");u[0].replace(" ","")===t&&($(this).addClass("js-course-welcome--open"),r=$(this))}});displayCourseDetails(u,r)};initDefaultContent();Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(n){var i,u,f,t,r;if(this==null)throw new TypeError('"this" is null or not defined');if(i=Object(this),u=i.length>>>0,typeof n!="function")throw new TypeError("predicate must be a function");for(f=arguments[1],t=0;t<u;){if(r=i[t],n.call(f,r,t,i))return r;t++}return undefined},configurable:!0,writable:!0}),function(n){n.forEach(function(n){n.hasOwnProperty("append")||Object.defineProperty(n,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),n=document.createDocumentFragment();t.forEach(function(t){var i=t instanceof Node;n.appendChild(i?t:document.createTextNode(String(t)))});this.appendChild(n)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);var isArray=Array.isArray,URLSearchParamsProto=URLSearchParams.prototype,find=/[!'\(\)~]|%20|%00/g,plus=/\+/g,replace={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\x00"},replacer=function(n){return replace[n]},secret="__URLSearchParams__:"+Math.random();URLSearchParamsProto.append=function(n,t){appendTo(this[secret],n,t)};URLSearchParamsProto.delete=function(n){delete this[secret][n]};URLSearchParamsProto.get=function(n){var t=this[secret];return n in t?t[n][0]:null};URLSearchParamsProto.getAll=function(n){var t=this[secret];return n in t?t[n].slice(0):[]};URLSearchParamsProto.has=function(n){return n in this[secret]};URLSearchParamsProto.set=function(n,t){this[secret][n]=[""+t]};URLSearchParamsProto.forEach=function(n,t){var i=this[secret];Object.getOwnPropertyNames(i).forEach(function(r){i[r].forEach(function(i){n.call(t,i,r,this)},this)},this)};URLSearchParamsProto.toJSON=function(){return{}};URLSearchParamsProto.toString=function(){var r=this[secret],u=[],n,t,f,i;for(t in r)for(f=encode(t),n=0,i=r[t];n<i.length;n++)u.push(f+"="+encode(i[n]));return u.join("&")};;
function initScholarshipEgibilityChecker(){function v(n){function t(n){if(n!==undefined){let r=n.place_name.split(","),t="";for(i of r)i=i.trim(),t+=`${i}</br>`;a.innerHTML=t;const u=n.geometry.coordinates;h=new mapboxgl.Map({container:"map",style:"mapbox://styles/adamjames-bcu/ck06kt6xd05lb1do5l0tfuts2",center:u,zoom:15});let f=new mapboxgl.Marker;f.setLngLat(n.geometry.coordinates).addTo(h)}else console.log("Mapbox: postcode couldn't be found"),console.log(err),l()}fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${n}.json?access_token=pk.eyJ1IjoiYWRhbWphbWVzLWJjdSIsImEiOiJjandrcXNvM3cxZ2FmNDRvMjk4cjBibTQ1In0.3WgTdZJEiGw-teANjlf4Pw`).then(n=>n.json()).then(n=>t(n.features[0])).catch(n=>t(n))}function y(t){t.toLowerCase()!=t.toUpperCase()?fetch(`/Scripts/postcodes_polar4/JSON_Postcodes_POLAR4_${t}.json`).then(n=>n.json()).then(t=>{match=!1;for(i in t)if(t[i].Postcode===n){match=!0;polar4Quintile=t[i]["POLAR4 quintile"];console.log(`Postcode "${n}" is in POLAR4 quintile ${polar4Quintile}`);switch(polar4Quintile){case"1":u("qualified");break;case"2":document.querySelectorAll(".alt-criteria-checkbox:checked").length>0?u("qualified"):u("unqualified");break;case"3":case"4":case"5":u("unqualified");break;case"R":u("unknown")}r.classList.add("hidden")}match||c()}).catch(()=>{console.log("There was an error fetching the data"),l()}):c()}function u(i){i==="qualified"?t.innerHTML=`<div class="postcode-result-message result-eligible" id="resultMessageEligible">
				<div class="postcode-result-message__inner">
					<h2 class="postcode-result-message__title">You are eligible</h2>
					<p>Based on your postcode (${n}), you do live in one of our target areas and would be eligible for our scholarship.</p>
				</div>
			</div>`:i==="unqualified"?t.innerHTML=`<div class="postcode-result-message result-not-eligible" id="resultMessageNotEligible">
				<div class="postcode-result-message__inner">
					<h2 class="postcode-result-message__title">You are not eligible</h2>
					<p>Based on your postcode (${n}), you don't live in one of our target areas and wouldn't be eligible for our scholarship.</p>
				</div>
			</div>`:i==="unknown"&&(t.innerHTML=`<div class="postcode-result-message">
		         <div class="postcode-result-message__inner">
			         <h2 class="postcode-result-message__title">Sorry, we can't check that postcode</h2>
					 <p>If you would like to check the eligibility for this postcode please contact our <a href="/about-us/contact-details/course-enquiries-form">Enquiries Team</a> and we will respond to you shortly.</p>
		         </div>
	         </div>`);e.classList.add("visible");window.dispatchEvent(new Event("resize"));r.classList.remove("input-error-message");window.scrollTo({top:0,left:0,behavior:"smooth"})}function c(){t.innerHTML='<p class="postcode-not-found-msg">Postcode not found. Please try again.<\/p>';t.classList.add("visible")}function p(){t.innerHTML="";e.classList.remove("visible")}function l(){r.classList.add("input-error-message");r.scrollIntoView(!0)}mapboxgl.accessToken="pk.eyJ1IjoiYWRhbWphbWVzLWJjdSIsImEiOiJjandrcjF5dzUwZno2M3lwankybDJnbTk3In0.Hj9WWVr2dDW0CJ2nunwCVQ";const f=document.querySelector("#userInput"),o=document.querySelector("#submitBtn"),r=document.querySelector("#postcodeChecker"),e=document.querySelector("#postcodeResult"),a=document.querySelector("#postcodeFullAddress"),s=document.querySelector("#editPostcodeBtn"),t=document.querySelector("#postcodeResultMessage");let n,h;o&&o.addEventListener("click",t=>{t.preventDefault(),n=f.value.toUpperCase().split(" ").join(""),v(n),checkboxes=document.querySelectorAll(".alt-criteria-checkbox:checked").length,y(n[0])});s&&s.addEventListener("click",()=>{r.classList.remove("hidden"),p(),f.value="",f.focus()})}const headSection=document.querySelector("head"),newScriptTag=document.createElement("script");newScriptTag.setAttribute("id","mapboxScriptTag");newScriptTag.setAttribute("src","https://api.tiles.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.js");newScriptTag.onload=initScholarshipEgibilityChecker;const newStyleTag=document.createElement("link");newStyleTag.setAttribute("id","mapboxStyleTag");newStyleTag.setAttribute("rel","stylesheet");newStyleTag.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.css");headSection.append(newScriptTag);headSection.append(newStyleTag);;
