function getQueryStringByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.search);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}var MYLAN;Array.prototype.indexOf||(Array.prototype.indexOf=function(n){"use strict";var u,r,t,i;if(this==null)throw new TypeError;if((u=Object(this),r=u.length>>>0,r===0)||(t=0,arguments.length>1&&(t=Number(arguments[1]),t!=t?t=0:t!=0&&t!=Infinity&&t!=-Infinity&&(t=(t>0||-1)*Math.floor(Math.abs(t)))),t>=r))return-1;for(i=t>=0?t:Math.max(r-Math.abs(t),0);i<r;i++)if(i in u&&u[i]===n)return i;return-1}),jQuery.browser.msie||function(n){function u(t,i,u){function o(){e&&(e.apply(n,arguments),s||(delete i[f],e=null))}var f,e=u[0],s=t===r;return u[0]=o,f=t.apply(n,u),i[f]={args:u,created:Date.now(),cb:e,id:f},f}function f(t,i,u,f){function c(){e.cb&&(e.cb.apply(n,arguments),h||(delete u[f],e.cb=null))}var e=u[f],h,o,s;e&&(h=t===r,(i(e.id),h)||(o=e.args[1],s=Date.now()-e.created,0>s&&(s=0),o-=s,0>o&&(o=0),e.args[1]=o),e.args[0]=c,e.created=Date.now(),e.id=t.apply(n,e.args))}var t={},i={},e=n.setTimeout,r=n.setInterval,o=n.clearTimeout,s=n.clearInterval;n.setTimeout=function(){return u(e,t,arguments)},n.setInterval=function(){return u(r,i,arguments)},n.clearTimeout=function(n){var i=t[n];i&&(delete t[n],o(i.id))},n.clearInterval=function(n){var t=i[n];t&&(delete i[n],s(t.id))},n.addEventListener("scroll",function(){var n;for(n in t)f(e,o,t,n);for(n in i)f(r,s,i,n)})}(window),MYLAN=MYLAN||{},function(n,t,i,r){"use strict";var e={LEFT:37,RIGHT:39,ESC:27,ENTER:13},u,f;n(function(){var r=!n.browser.msie||parseInt(n.browser.version,10)>6,t;r&&(n(".carousel").each(function(){n(this).data("carousel",new u(this))}),n(".js-rotator").each(function(){var n=!1,t=new f(this,n)}),i.Select2.init(),i.ModalController.init(),i.ModalTemplate.init()),i.MediaQueryNotifications.init(),i.ExternalLinks.init(),i.AutoReplace.init(),i.ToggleNav.init(),i.ToggleLangSelect.init(),i.StickyHeader.init(),i.AccordionTabs.init(),i.VideoPlayer.init(),i.EventTracking.init(),i.ToggleEvent.init(),i.WindowScroller.init(),i.ShowWarningMessage.init(!r),i.TabBtns.init(),i.CustomRadio.init(),i.ArrowWrapping.init(),i.Popover.init(),i.CatalogSearch.init(),i.Prefilter.init(),i.SearchSuggest.init(),i.LinksCallto.init();n(".input-search").on("focus",function(){n(this).trigger("click")});n(".branded_products .row-headingParent span.row-heading a.row-title-content").click(function(t){t.stopPropagation();var r=n(this);i.EventTracking.addEventTracking(r.data("category"),r.data("action"),r.data("label"))}),n(".select_country").length>0&&n(".select_country").each(function(){n(this).select2("val")!="#"&&(n(this).select2("val","#"),n(this).change())}),t=i.Utils.getQueryStringParam("hash"),setTimeout(function(){t.length>1&&n("html, body").animate({scrollTop:n("#"+t).offset().top-60},1)},800)}),u=function(n){return this.init(n)},u.prototype.init=function(t){this.$carousel=n(t),this.$activeSlide=undefined,this.isTransitioning=!1,this.$slidesContainer=this.$carousel.find(".carousel-slides"),this.$slides=this.$slidesContainer.children(),this.slideWidth=this.$slides.eq(0).outerWidth(),this.numberSlides=this.$slides.length,this.addsAutoPlay=this.$carousel.attr("data-autoplay"),this.rotations=0,this.maxFullRotations=2,this.$slides.each(function(t,i){var r=n(i);r.attr("data-slide-index",t),r.find("a").attr("tabindex","-1")}),this.slideTime=4e3,this.initialClone()._rebuildSlideReference()._setSlideWidth().addChildren().onWindowResize().bind(),this.addsAutoPlay!==undefined&&this.autoPlay(),this.$activeSlide=n(this.$slides.get(1)),this.$activeSlide.find("a").attr("tabindex","0"),i.Utils.isMobile()?this.$slidesContainer.css({left:"-95%"}):this.$slidesContainer.css({left:"-100%"})},u.prototype.initialClone=function(){var t=n(this.$slides.last().clone());return t.addClass("js-clone"),this.$slidesContainer.prepend(t),this},u.prototype._setSlideWidth=function(){return i.Utils.isMobile()?this.$slidesContainer.css("width",this.numberSlides*95+"%"):this.$slidesContainer.css("width",this.numberSlides*100+"%"),this.$slides.css("width",100/this.numberSlides+"%"),this},u.prototype.addChildren=function(){var a=this.$slides.length,o=this,u=this.$carousel.hasClass("js-carousel_main")?this.$carousel:undefined,s,h,e,c,r,l;if(u){var t=n('<div class="carousel-controls hList isDesktop"><\/div>'),f=n('<ol class="carousel-controls-nav js-carousel-index"><\/ol>'),v=n('<span class="carousel-controls-arrow carousel-controls-arrow_prev js-carousel-prev ir">Previous Slide<\/span>'),y=n('<span class="carousel-controls-arrow carousel-controls-arrow_next js-carousel-next ir">Next Slide<\/span>'),i;for(u.hasClass("js-carousel_main_alt")&&t.addClass("carousel-controls_alt"),t.appendTo(u),v.appendTo(t),f.appendTo(t),y.appendTo(t),i=1;i<a;i++)f.append(n('<li><a href="#slide-'+(i+1)+'" class="carousel-controls-nav-item ir">Slide '+(i+1)+"<\/a><\/li>"));f.find("li").eq(0).children("a").addClass("carousel-controls-nav-item_isActive")}return s=this.$carousel.hasClass("js-carousel_main_titlePane")?this.$carousel:undefined,s&&(this.isMainTitlePane=!0,this.$mainTitleContainer=n(".carousel-titlePane-slides"),this.$mainTitles=this.$mainTitleContainer.find("li"),this.$mainTitles.each(function(t,i){n(i).attr("data-slide-index",t)}),this.$mainTitles.eq(0).addClass("carousel-titlePane-slides-item_isActive")),h=this.$carousel.hasClass("js-carousel_alt")?this.$carousel:undefined,h&&this.$carousel.find(".carousel-tabs li").eq(0).children("a").addClass("carousel-tabs-item_isActive"),e=this.$carousel.hasClass("js-carousel_mobile")?this.$carousel:undefined,e&&(c=n('<a href="#" class="carousel-controller js-carousel-next isMobile"><span class="ico ico_arrow_large"><\/span><\/a>'),c.appendTo(e)),r=this.$carousel.find(".js-carousel-slide_overlay"),l={speed:1250,delay:1e3,maxDelay:4e3},r.length&&this.$carousel.is(":visible")&&(Date.now||(Date.now=function(){return+new Date}),r.each(function(n,t){o._initLoadAnimation(t)}),r.each(function(n,t){o.triggerLoadAnimation(t,l)})),this},u.prototype.shuffleMainTitles=function(){var t=this.$mainTitleContainer,i=this.$mainTitles;i.detach(),this.$slides.each(function(r,u){var f;r>0&&(f=n(u).attr("data-slide-index"),i.each(function(i,r){var u=n(r);u.attr("data-slide-index")===f&&t.append(u)}))}),this.$mainTitles=t.find("li"),this.$mainTitles.removeClass("carousel-titlePane-slides-item_isActive").eq(0).addClass("carousel-titlePane-slides-item_isActive"),t.css({left:0})},u.prototype._initLoadAnimation=function(t){if(!n.browser.msie||!(parseInt(n.browser.version,10)<=7))return n('<div class="carousel-overlay"><img width="285" height="285" title="" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAR0AAAEdCAMAAAAGtENJAAAAMFBMVEX///8AvORAzeu/7viA3vIQwObP8vqf5vVg1e4wyekgxOdQ0eyP4vOv6vdw2fAAvOSGkGnkAAAAD3RSTlMA358gYM8QQIGvv49QMHCgI48fAAAFQklEQVR42uzb3Y7qIBhG4e8thQJVuf+7nWTHMQx1fmzVrWWtw5pw8EgBE7RC34cOOuj8Bx3tvpU6yvPogu0858Y560YdpUOwbgqHpD/rSDFYZ4Uo/UlH0bos6ncdJWed5pJ+0dFoHTfqJx15Z13n/Pc6StZ7IanWAaep5jFwrvO0Ot7oX/6KjoItcmMcdt1pdLYoaKGjgzVNs1R2nzQflxt7o6OhtckqnaTc+gytTvu5SkdpuP5u2dUjcvAqXSUfrO6kWsdb3aTSXQ2Pr3R0+jpzSumdJ6rSady6zFtdpTM3C3KX6avCRUdT9fio0mly7dprixcrl25LVnXRSUyd5eRJnzr1jhVLx8Ua4lNnYsNabluHs45cc4buNgW75HTWqZfq0nXHiuKKzli6bkQHHXTQQQcddNBBBx100EHnNXQ07Cd/fx3bTwM66KBz/0K6v47k58nevVOW9KAdXSnYOxelh553/LSDy8gP0ylytq5pzlKOR1ufi1lK0dm68hPOyt7W5LLOutnZusKgy0W2Nc16go7imomjaoDJ1jT5bf/ncHrK7yytw9nIc1RzU+vWYnmOzmg3FtSMEFbdQK/LKwZ4ik4Z7MaGzSPYoI1fUdCL6gRtfjmDtm4OrryoznJQHTYvGnI70ZnLomi3lcqicSc6w/Yh9D46Hp0fEjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466KCDDjrooIMOOuiggw466Hy0a7dLbsIwFIZ1sGXAfOj+77Y/tskEBdpoNOtusd4L0MATO2RiQid0Qid0Qid0Qid0Qid0Quen68yh86iejPDrTD9Vp5ApuHUS3Jszt9KRjSyVM51EljZ5j8nU3kxnJ0urnLS6bw1kam6mM5OlRU5a3LeGkSyhmQ6M1+Uf4QYeG+pky8aCeD/57AcepJmOVNPz3D/C/RklNNTBal46OozuEexdOn4d74Xx943AZFg6LXWw0GcNcI9Yrkckw9ZsoGPdGBnuESPcS3hCYx1BMdyZY0SBXIfZ8L3VUke42HHsIwqLOHlGSHsd4eT+zHikP5dYxMmTIU10dFjdux3Z6SuoxfCd3lBHMNBlqeKjEXMxPPAMwvoq2usIkA03ZvzVkoEPJ9TRsHBcOsbAUyHdNgAW4pMRZWLLiLqS4SocOuZQ9+31ETExnCO2vcI6AcOaDFfh0DEH8PAVgH84otpG2HXuUuiETuiETujcUqfQsw3ScUj0LP3WkXQQ6zioc3fS66lKx1X1HUP6bYYd0m3Y1QkufZHF1tIbi/ihg6L+s+ow/VdKwUNH1lg8euns8tSp6n/YLkN+OwGjk1OzAV3iDO+Hp3T2ltmMDnFmde7+ooOkeDrHSXjR0YuHFnT3uFJL56CDjQ6tjI5sWN39hqOOMKkyoxebTCoWpYOFdOPCwM1lwMt4fQpGfzn2TTfv6uBd6whGio6vbNDxfZGIEuRURzhR940sR53YXGpbXegIduq6CaJ19Os03VZmiNLRIVOnZYiKzn87dlhmyIWO9tmps/aDjdLRAXNO1Ekpz4CotI4OGKa8plu35mk4yGidSEIndEIndELnv+gXNAYPsSMEWJ0AAAAASUVORK5CYII=" /><\/div>').appendTo(n(t).find(".carousel-img"))},u.prototype.triggerLoadAnimation=function(t,i){var r=n(t).find(".carousel-overlay"),e,f,o,s=!1,h=this,u;r.length!==0&&(h.firingLoadAnimation=!0,u=function(){s||(s=!0,r.fadeOut(i.speed,function(){r.remove(),h.firingLoadAnimation=!1}))},e=Date.now(),f=r.siblings(".carousel-img").find("img"),o=f.attr("src"),i.delay?(f.attr("src","").on("load",function(){var n=Date.now()-e,t=Math.max(0,i.delay-n);setTimeout(u,t)}).attr("src",o),i.maxDelay&&setTimeout(u,i.maxDelay)):u())},u.prototype.autoPlay=function(){var n=this;return this.autoplaying=!0,this.timer=r.setInterval(function(){n.isHovering||n.firingLoadAnimation||n.nextSlide()},this.slideTime),this},u.prototype.getActiveSlideIndex=function(){return parseInt(this.$activeSlide.attr("data-slide-index"),10)},u.prototype.stopSlide=function(){var n=this;n.autoplaying=!1,r.clearInterval(n.timer)},u.prototype.goToSlide=function(t,r,u){var f=this,o=n(this.$slides.get(t)),l=o.position(),a=this.getActiveSlideIndex(),e,s,h,c;f.$activeSlide=o,f.rotations+=1,f.autoplaying&&f.rotations>=(f.numberSlides-1)*f.maxFullRotations&&f.stopSlide(),f.$activeSlide.find("a").attr("tabindex","-1"),f.isMainTitlePane&&(e=40,r?(s=f.$mainTitles.first().outerWidth(),f.$mainTitleContainer.animate({left:-s+-e+"px"},400)):(h=f.$mainTitles.last().outerWidth(),f.$mainTitleContainer.animate({left:h+e+"px"},400))),c=function(){var t,e=f.getActiveSlideIndex();r?(f.$slides.first().remove(),t=n(f.$slides[1]).clone(),t.find(".carousel-overlay").remove(),t.appendTo(f.$slidesContainer)):(f.$slides.last().remove(),t=n(f.$slides[f.numberSlides-2]).clone(),t.find(".carousel-overlay").remove(),t.prependTo(f.$slidesContainer)),i.Utils.isMobile()?f.$slidesContainer.css({left:"-95%"}):f.$slidesContainer.css({left:"-100%"}),f._rebuildSlideReference(),f.$carousel.find(".carousel-controls-nav-item_isActive").removeClass("carousel-controls-nav-item_isActive"),f.$carousel.find(".carousel-controls-nav li a").eq(e).addClass("carousel-controls-nav-item_isActive"),f.$carousel.find(".carousel-tabs li .carousel-tabs-item_isActive").removeClass("carousel-tabs-item_isActive"),f.$carousel.find(".carousel-tabs li a").eq(e).addClass("carousel-tabs-item_isActive"),f.isMainTitlePane&&f.shuffleMainTitles(),u?u.resolve():f.isTransitioning=!1,f.$activeSlide.find("a").attr("tabindex","0")},this.$slidesContainer.stop(!0,!1).animate({left:-l.left},400,"linear",c)},u.prototype.nextSlide=function(n){var t=this.$activeSlide.next(),i=this.$slides.index(t);this.goToSlide(i,!0,n)},u.prototype.prevSlide=function(n){var t=this.$activeSlide.prev(),i=this.$slides.index(t);this.goToSlide(i,!1,n)},u.prototype.bind=function(){var i=this,u=this.$carousel,f;n(r).on("resize",n.proxy(this.onWindowResize,this));u.find(".js-carousel-index").on("click","li",n.proxy(this.onIndexClick,this));u.find(".js-carousel-next").on("click",n.proxy(this.onNextClick,this));u.find(".js-carousel-prev").on("click",n.proxy(this.onPrevClick,this));u.on("modalLaunch",function(){u.data("carousel").stopSlide()});t.touch&&n(i.$slidesContainer).swipe({swipe:function(n,t,r){i.isTransitioning===!0||r<40||((t==="left"||t==="right")&&(i.isTransitioning=!0),t==="left"?i.nextSlide():i.prevSlide(),i.stopSlide())},threshold:40,excludedElements:".noSwipe",allowPageScroll:"vertical"}),i.$carousel.hover(function(){i.isHovering=!0},function(){i.isHovering=!1});this.$carousel.on("keydown",function(n){(n.keyCode===e.LEFT||n.keyCode===e.RIGHT)&&(n.keyCode===e.RIGHT?i.nextSlide():i.prevSlide(),i.stopSlide(),i.$activeSlide.find("a").first()[0].focus())});return this},u.prototype.onWindowResize=function(){return this.slideWidth=this.$slides.eq(0).outerWidth(),this},u.prototype.onIndexClick=function(t){t.preventDefault();var u=n(t.currentTarget),f=n(t.delegateTarget).children(),i=f.index(u),r=this.getActiveSlideIndex();if(this.isTransitioning!==!0&&i!==r)return this.isTransitioning=!0,i>r?this.deferNext(i):i<r&&this.deferPrev(i),this.stopSlide(),this},u.prototype.deferNext=function(t){var i=this,r=n.Deferred();r.done(function(){var n=i.getActiveSlideIndex();n!==t?i.deferNext(t):i.isTransitioning=!1}),this.nextSlide(r)},u.prototype.deferPrev=function(t){var i=this,r=n.Deferred();r.done(function(){var n=i.getActiveSlideIndex();n!==t?i.deferPrev(t):i.isTransitioning=!1}),this.prevSlide(r)},u.prototype.onNextClick=function(n){if(n.preventDefault(),this.isTransitioning!==!0)return this.isTransitioning=!0,this.stopSlide(),this.nextSlide()},u.prototype.onPrevClick=function(n){if(n.preventDefault(),this.isTransitioning!==!0)return this.isTransitioning=!0,this.stopSlide(),this.prevSlide()},u.prototype._rebuildSlideReference=function(){return this.$slides=this.$slidesContainer.children(),this.numberSlides=this.$slides.length,this},i.Utils={isMobile:function(){return t.mq("screen and (max-width: 680px)")},isOldIE:n.browser.msie&&parseInt(n.browser.version,10)<9||!1,isExternalLink:function(n){for(var r=MylanInternalLinks.split(","),t,i=0;i<r.length;i++)if(n.indexOf(r[i])!=-1&&r[i]!="")return!1;return(t=n.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/),typeof t[1]=="string"&&t[1].length>0&&t[1].toLowerCase()!==location.protocol)?!0:typeof t[2]=="string"&&t[2].length>0&&t[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host?!0:!1},isExternalTemplate:function(){return n(".js-externalTemplate").length>0},getHash:function(n){var t=r.location.hash;return n?t:t.replace("%","")},prefetch:function(){var i=!1,u=[],t,f;n(r).on("load",function(){i=!0,t(u)});return t=function(t){n.each(t,function(n,t){var i=new Image;i.src=t})},f=function(n){typeof n=="string"&&(n=[n]),i?t(n):Array.prototype.push.apply(u,n)},f}(),getQueryStringParam:function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",u=new RegExp(i),t=u.exec(r.location.href);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}},i.MediaQueryNotifications=function(){var f=[767,800,940],u=function(){};return u.prototype.init=function(){this._lastWidth=undefined,this._currentWidth=undefined,this._currentWidth=n(r).width(),this._checkSize(),this.bind()},u.prototype.bind=function(){var t=this;n(r).resize(function(){t._currentWidth=n(r).width(),t._checkSize()})},u.prototype._checkSize=function(){for(var e=this,o=e._currentWidth,s=n("body"),i,r,t=0,u=f.length;t<u;t++)i=f[t],r=o<i,s.toggleClass("gt"+i,!r).toggleClass("lt"+i,r)},{init:function(){if(!t.mq("only all")){n(".vList_striped-img img").each(function(){var r=n(this),f=this.getAttribute("width"),e=this.getAttribute("height"),u=r.width();u<f&&(r.width(u),r.height(e*(u/f)))});var i=new u;i.init()}}}}(),i.ExternalLinks={init:function(){n(document).on("click","a[rel=external]",function(n){r.open(this.href),n.preventDefault()})}},i.AutoReplace={$fields:undefined,init:function(){"placeholder"in document.createElement("input"),this.$fields=n("[placeholder]"),this.bind()},bind:function(){this.$fields.each(function(){var t=n(this),i=t.attr("placeholder");t.attr("placeholder",""),(t.val()===""||t.val()===i)&&t.addClass("placeholder-text").val(i),t.off(".autoreplace");t.on("focus.autoreplace",function(){t.val()===i&&t.val("").removeClass("placeholder-text")});t.on("blur.autoreplace",function(){(t.val()===""||t.val()===i)&&t.val(i).addClass("placeholder-text")});t.parents("form").off("submit.autoreplace").on("submit.autoreplace",function(){t.val()===i&&t.val("")})})}},i.ToggleNav={init:function(){n(".nav_isParent").addClass("nav_isExpanded");var t=0;n(".js-menu").on("click",function(){n(".pageWrap").toggleClass("nav_isShown");var i=n(".pageWrap").height(),r=r||n(".navPanel").height()-i;return r>0&&!t?(n(".nav_isShown").height(i+r),t=i):t&&(n(".pageWrap").height(t),t=0),!1});n(".nav-toggle").on("click",function(){return n(".nav").toggleClass("nav_isOpen"),!1});n(".nav-section-toggle").on("click",function(){var i=n(this),t=i.parent().parent();if(t.find(".nav-secondary").length)return t.hasClass("nav_isExpanded")?(i.next(".nav-section.content").slideUp(),t.removeClass("nav_isExpanded").attr("aria-expanded","false")):(n(".nav").find(".nav-section.content").slideUp(),n(".nav").find(".nav_isExpanded").filter(":not(.js-forceExpanded)").removeClass("nav_isExpanded").attr("aria-expanded","false"),i.next(".nav-section.content").slideDown(),t.addClass("nav_isExpanded").attr("aria-expanded","true")),!1});this.enableKeyboard()},enableKeyboard:function(){n(".nav-main").on("keydown",function(t){var i=n(this),u=n(document.activeElement),r=i.hasClass("nav_isExpanded");r||t.keyCode!==e.RIGHT?r&&t.keyCode===e.LEFT&&(i.find(".nav-section-toggle").trigger("click"),i.find("ul a").attr("tabindex","-1"),i.find(".nav-section")[0].focus()):(i.find(".nav-section-toggle").trigger("click"),i.find("ul a").attr("tabindex","0"))}).not(".nav_isExpanded").attr("aria-expanded","false").find("ul a").attr("tabindex",-1)}},i.ToggleLangSelect={$langMenuController:undefined,init:function(){var t=this,u=n(".js-lang-menu"),r=n(".js-lang-trigger"),f=n(".js-langDropdown-exit"),e=n(".langDropdown");(this.isOpen=!1,r.length!==0)&&(t.$langMenuTrigger=r,t.$langMenuController=u,t.$langMenuExit=f,t.$dropdown=e,t.bind(),i.Utils.prefetch(["/Mylan.com/assets/images/ico-logo.png","/Mylan.com/assets/images/ico-modal.png","/Mylan.com/assets/images/ico-spritesheet-flags-square.png"]))},bind:function(){var t=this;t.$langMenuTrigger.on("click",function(n){n.preventDefault(),t.prevFocus=this,t.updateCurrent(t.$langMenuController),t.toggleMenu.call(t,t.$langMenuController)});n(document).on("keydown",function(n){t.isOpen&&n.keyCode===e.ESC&&(n.preventDefault(),t.toggleMenu.call(t,t.$langMenuController),t.prevFocus.focus())});n(".js-top").on("click",function(n){n.preventDefault(),r.scrollTo(0,0)});if(t.$langMenuExit.length)t.$langMenuExit.on("click",function(n){n.preventDefault(),t.toggleMenu.call(t,t.$langMenuController),t.prevFocus.focus()})},toggleMenu:function(t){var r=this,e=n(".pageWrap"),u,f;n(t).toggleClass("headerBtn_lang-isActive"),r.$dropdown.toggleClass("langDropdown-isActive"),u=e.height(),f=r.$dropdown.height()+75-u,f>0&&e.height(u+f),r.isOpen?(navigator.userAgent.match(/BlackBerry/i)||i.ModalShade.hide("LangSelect"),i.WindowScroller.enableScroll(),r.isOpen=!1):(navigator.userAgent.match(/BlackBerry/i)||i.ModalShade.show("LangSelect",null,function(){r.toggleMenu.call(r,t),r.prevFocus.focus()}),i.WindowScroller.disableScroll(".langSelectItems"),r.$dropdown.find("a").first()[0].focus(),r.isOpen=!0),r.$dropdown.attr("aria-hidden",!r.isOpen)},updateCurrent:function(t){var i=n(".js-langDropdown-current"),r=t.parent().html();i.html(r)}},i.StickyHeader={init:function(){var u=this,f=n(r),e=!1,s=t.mq("only all"),h=i.Utils.isMobile,o,c;if(this.$header=n(".header"),this.activeClass="header_isSticky",this.threshold=60,o=function(){u.updateHeader.call(u,f.scrollTop())},c=function(){var n=h();if(e&&n)f.off("scroll.stickyHeader"),e=!1;else if(!e&&!n){f.on("scroll.stickyHeader",o);e=!0,u.updateHeader.call(u,f.scrollTop())}},s)f.on("resize",c);if(!s||!h()){f.on("scroll.stickyHeader",o);e=!0,this.updateHeader()}if(t.touch&&r.webkitRequestAnimationFrame)this.$header.find(".input-search").on("focus",function(){var t=this;t.style.webkitTransform="translate3d(0px,-10000px,0)",r.webkitRequestAnimationFrame(function(){t.style.webkitTransform=""})});if("onhashchange"in r)f.on("hashchange",n.proxy(u.fixOffset,u));n(".pageWrap").on("click",".js-anchor",n.proxy(u.fixOffset,u))},updateHeader:function(n){var t=n>this.threshold;this.$header.toggleClass(this.activeClass,t)},fixOffset:function(r){var u=r.type==="click"?r.target.hash:i.Utils.getHash(),f,e;(u==undefined||u==null)&&(u=""),f=this.$header.height(),e=n(u.replace(":","")).length?n(u).offset().top:0,u&&u!=="#"&&!i.Utils.isMobile()&&(t.history&&(r.preventDefault(),history.pushState(null,null,i.Utils.getHash(!0))),setTimeout(function(){n(document).scrollTop(e-f)},0))}},i.ModalController={modalSelector:"#modal",init:function(){this.bind()},bind:function(){var t=this;n(".pageWrap").on("click",".js-modalTrigger",function(r){var u=n(this);i.Utils.isMobile()||(r.preventDefault(),u.trigger("modalLaunch"),t.loadModal.call(t))});n(r).on("resize",function(){t.visible&&t.positionModal(t.visible)});n(document).on("keydown",function(n){t.visible&&n.keyCode===e.ESC&&(n.preventDefault(),t.removeModal.call(t))}).on("focus","a",function(i){var u=i.target,r=t.visible;r&&!n.contains(r[0],u)&&r.find("a")[0].focus()})},loadModal:function(){var t=this,r=n(t.modalSelector);t.prevFocus=document.activeElement,r&&(t.positionModal(r),t.bindModal(r),i.ModalShade.show("Modal","isDesktop",function(){t.removeModal.call(t)}),r.appendTo("body").attr("aria-hidden",!1).show()),t.visible=r},bindModal:function(t){var u=this,r=t.find("a")[0];t.find(".js-modal-exit").on("click",function(n){n.preventDefault(),u.removeModal.call(u)});i.WindowScroller.disableScroll(".tabcordion_sub-section"),r&&n(r).is(":visible")&&r.focus()},positionModal:function(t){n(r).height()<650?t.addClass("modal_sm"):t.removeClass("modal_sm");var i=t.width(),u=t.height();t.css({"margin-left":i/-2,"margin-top":u/-2+10})},removeModal:function(){var r=this.visible,t;if(r){if(r.hide().attr("aria-hidden",!0),i.ModalShade.hide("Modal"),i.WindowScroller.enableScroll(),t=typeof jwplayer!="undefined"?jwplayer():{},t&&t.id)try{t.stop()}catch(u){}n("#modal").html("")}this.visible=null}},i.ModalShade={shades:{},template:'<div class="modalOverlay" />',show:function(t,i,r){var u;if(this.shades[t])throw new Error('ModalShade: multiple shades opened [name="'+t+'"]');if(u=n(this.template),i&&u.addClass(i),typeof r=="function")u.on("click.modalShade",r);this.shades[t]=u.appendTo(".pageWrap")},hide:function(n){var t=this.shades[n];t&&t.off(".modalShade").remove(),this.shades[n]=null}},i.Select2={init:function(){var t=navigator.userAgent,f=4,u;t.indexOf("Android")>=0&&(f=parseFloat(t.slice(t.indexOf("Android")+8))),f>=3?(u=n(".select2"),u.length&&u.each(function(t,i){var r=n(i),u={minimumResultsForSearch:1e3};r.hasClass("select2_std")&&(u.dropdownCssClass="select2-drop_std"),r.select2(u)})):(n("*").css("-webkit-transition","none"),n("*").css("-moz-transition","none"),n("*").css("-ms-transition","none"),n("*").css("-o-transition","none"),n("*").css("transition","none"),n("*").css("-webkit-transform","none"),n("*").css("-moz-transform","none"),n("*").css("-ms-transform","none"),n("*").css("-o-transform","none"),n("*").css("transform","none"),n(".select2").addClass("android2-fix"));n(".nav-dropdown, .js-redirectMenu").find("select").on("change",function(){var t=n(this).find("option:selected");t.hasClass("js-forceWarning")?i.ShowWarningMessage.launchWarning(t.val(),!0):r.location=n(this).find("option:selected").val()});this.initDisabler()},initDisabler:function(){var t=n("select.js-disableTrigger"),u=n(".js-disableTarget").addClass("disableTarget"),r=n(".js-regionModel").get(0),f,e;if(t.length!==0&&r){f=new i.ViewModels.RegionModel(r.id),e=t.attr("data-disable").split("|"),ko.applyBindings(f,r);t.on("change",function(){var t=n(this).find("option:selected").val();e.indexOf(t)!==-1?u.removeClass("disableTarget").find("input").removeAttr("disabled"):u.addClass("disableTarget").find("input").attr("disabled","disabled")})}}},i.AccordionTabs={init:function(){n(".tabcordion").on("click",".tabcordion-tab",function(t){t.preventDefault();var i=n(this),r;(i.toggleClass("tab_isActive").next().toggleClass("tabcordion_isActive"),i.hasClass("tab_isFront"))||(r=n(".tabcordion").find(".tabcordion_isFront").removeClass("tabcordion_isFront"),i.next().addClass("tabcordion_isFront"),n(".tabcordion").find(".tab_isFront").removeClass("tab_isFront"),i.addClass("tab_isFront"))}).find(".tabcordion-tab").first().addClass("tab_isFront").next().addClass("tabcordion_isFront")}},i.TabBtns={subscribers:[],init:function(){var u=this,t=n(".tabBtn-container"),f=i.Utils.getHash();t.on("click",".tabBtn-tab",function(n){n.preventDefault(),u.activateTab.call(this,t)}).on("click",".js-tabLink",function(i){i.preventDefault(),u.linkTab.call(u,n(this),t)}).find(".tabBtn-title").attr("aria-selected","false").first().trigger("click"),f&&(t.find(".tabBtn-title").filter(function(){return this.hash===f}).trigger("click"),setTimeout(function(){r.scrollTo(0,0)},1))},activateTab:function(t){var r="tab_isFront",f="tabBtn-section_isFront",e=n(this),l=e.find(".tabBtn-title").attr("href"),o=i.TabBtns.subscribers,s,h,u,c;if(!e.hasClass(r))for(h=t.find("."+f).removeClass(f),s=n(l).addClass(f).attr("aria-selected","true"),t.find("."+r).removeClass(r).find(".tabBtn-title").attr("aria-selected","false"),e.addClass(r).find(".tabBtn-title").attr("aria-selected","true"),u=0,c=o.length;u<c;u++)o[u](s,h)},linkTab:function(t,i){var s=t.attr("data-tab"),h=t.attr("data-tab-item"),c=n('.tabBtn-title[href="#'+s+'"]').parent(),u,e,o,f;(this.activateTab.call(c,i),u=n("#"+h),u.length!==0)&&(e=u.offset().top,o=n(".header").height(),n(r).scrollTop(e-o),f=u.find(".js-toggle"),f.length&&!u.hasClass("row_isExpanded")&&f.trigger("click"))},subscribe:function(n){this.subscribers.push(n)}},i.VideoPlayer={init:function(){var t=this;n("img.video").each(function(i,r){var f=n("#player"),h=f.data("category"),c=f.data("action"),l=f.data("label"),e=f.attr("data-playTag"),o,u=function(n,i){o!==i&&(t.percentageEventCallback(i,h,c,l),o=i)},s=[{percent:25,callback:u},{percent:50,callback:u},{percent:75,callback:u},{percent:100,callback:u}];e!=undefined&&e=="true"&&s.unshift({percent:0,callback:u}),jwplayer(r).setup({autostart:"true",file:decodeURIComponent(r.getAttribute("file")),type:"mp4",primary:"flash",image:decodeURIComponent(r.getAttribute("src")),width:640,height:360,flashplayer:"/mylan.com/assets/scripts/jwplayer/jwplayer.flash.swf",plugins:{"/mylan.com/assets/scripts/jwplayer.percentageEvents.js":{events:s}}})});n(".js-modal-exit").on("click",function(){var i=typeof jwplayer!="undefined"?jwplayer():{},u;if(i&&i.id)try{i.stop()}catch(f){}n("#modal").html(""),navigator.userAgent.match(/iPad/i)&&(u=n(r).scrollTop(),n(r).scrollTop(u+2),n(r).scrollTop(u-2))});this.readyCallback()},readyCallback:function(){if(!i.Utils.isOldIE){var t=typeof jwplayer!="undefined"?jwplayer():{};if(t.id)t.onReady(function(){n(".fixedAspect > *:first-child").removeAttr("style")})}},percentageEventCallback:function(n,t,r,u){var e=u,f;n!=0&&(u=u.replace("Play",""),f=u.indexOf("_")+1,e=u.substring(0,f)+n+"%"+u.substring(f)),i.EventTracking.addEventTracking(t,r,e)}},i.CatalogSearch={init:function(){n(document).on("keydown",this.handleKeydown);n(".js-staticSearch").on("click",".catalogSearch-btn",this.handleStaticSearch)},handleKeydown:function(t){var i=n(document.activeElement);t.keyCode===e.ENTER&&i.hasClass("js-catalogSearch")&&(t.preventDefault(),i.parents(".catalogSearch-wrapper").find(".catalogSearch-btn").trigger("click"))},handleStaticSearch:function(t){t.preventDefault();var u="/search/product?q=",i=n(this).parents(".catalogSearch-wrapper").find(".catalogSearch").val();if(i=="Product"||i==="")return!1;r.location=u+encodeURIComponent(i)}},i.ModalTemplate={data:null,init:function(){var t=this,i=n("#modal-template");if(i.length)n("body").on("click",".js-modalTrigger",function(){var r=n(this).parents("li[data-carousel]").data("carousel");t.data={carouselGuid:r},n.ajax({type:"POST",url:"/Mylan.com/Services/ApiService.asmx/GetVideoModal",data:JSON.stringify(t.data),contentType:"application/json; charset=utf-8'",cache:!1,dataType:"json"}).done(function(n){t.onLoadSuccess.call(t,n)}).fail(function(n){t.onLoadError.call(t,n)})})},onLoadSuccess:function(t){var r=n("#modal");ko.applyBindings(t,r[0]),i.AccordionTabs.init(),i.ModalController.positionModal(r),i.ModalController.bindModal(r),i.VideoPlayer.init()},onLoadError:function(){var r=n("#modal").html('<div class="modal-error"><div>Something went wrong loading this content.<\/div><a href="#" class="js-modal-exit">Close<\/a><\/div>');i.ModalController.positionModal(r),i.ModalController.bindModal(r)}},i.EventTracking={init:function(){var t=this;if(r._gaq){n("body").on("click","[data-category]",function(){var i=n(this);t.addEventTracking(i.data("category"),i.data("action"),i.data("label"))});n("select").on("change",function(){var r=n(this).children(":selected").first();t.addEventTracking(r.data("category"),r.data("action"),r.data("label"))})}},addEventTracking:function(n,t,i){typeof n!="undefined"&&n!==""&&r._gaq.push(["_trackEvent",n,t,i])}},i.ToggleEvent={init:function(){var i=this,t="row-heading_disabled js-toggle-disabled";this.$toggles=n(".toggle").hide().attr("aria-expanded",!1),this.$rows=n(".row");n(".pageWrap").on("click",".js-toggle",function(t){t.preventDefault();var r=n(this),u=r.data("toggle-id"),i=r.parent().parent(),f=i.hasClass("row_isExpanded");r.hasClass("js-toggle-disabled")||(navigator.userAgent.match(/BlackBerry/i)&&(i.hasClass("row_isExpanded")||(n(".row").removeClass("row_isExpanded"),n(".row .row-details").hide().attr("aria-expanded",!1))),n("#"+u).toggle().attr("aria-expanded",!f),i.toggleClass("row_isExpanded"),navigator.userAgent.match(/BlackBerry/i)&&n("html, body").scrollTop(n(i).offset().top))});n(".pageWrap").on("change",".js-openRow input",function(){var u=n(this).parent().data("toggle-id"),o=n(this).is(":checked"),r=n("#"+u),f=r.prev(),e;o?(r.show().attr("aria-disabled","false").attr("aria-expanded",!0),f.addClass("row_isExpanded").attr("aria-disabled","false").find(".js-toggle").removeClass(t)):(e=n(".js-openRow").filter('[data-toggle-id="'+u+'"]').find("input:checked"),e.length===0&&(r.hide().attr("aria-disabled","true"),f.removeClass("row_isExpanded").attr("aria-disabled","true").find(".js-toggle").addClass(t)))});this.showAll();n(".pageWrap").on("click",".js-rowTrigger",function(n){n.preventDefault(),i.toggleRow.call(this)})},toggleRow:function(){var t=n(this.hash),u=n(".header").height(),f=t.hasClass("row")?t:t.parents(".row"),r;n(".row_isExpanded").find(".js-toggle").trigger("click"),t.trigger("click"),r=t.offset().top,setTimeout(function(){var t=i.Utils.isMobile()?r:r-u;n(document).scrollTop(t)},0)},showAll:function(){var i=this,t=n(".showAll"),r="showAll_isHidden";if(t.length!==0)t.on("click",function(n){var u=!t.hasClass(r),f=u?"Hide all –":"Show all +";n.preventDefault(),i.$toggles.toggle(u),i.$rows.toggleClass("row_isExpanded",u),t.toggleClass(r,u).text(f)})}},i.WindowScroller={init:function(){this.$body=n("html, body"),this.registerClick=!1},disableScroll:function(i){var r=this,f,e,u;if(this.$body.addClass("mix-disableScroll"),t.touch&&t.mq("screen and (min-width: 680px)")){f=n(i),u=function(){var t=n(this),i=t.scrollTop(),r=t[0].offsetHeight,u=t[0].scrollHeight;i===0?t.scrollTop(1):r+i===u&&t.scrollTop(i-1)},f.each(function(){n(this).on("touchend.modalScroll touchStart.modalScroll",u);u.call(this)});n(".pageWrap").on("touchstart.modalScroll touchmove.modalScroll",function(t){if(t.type==="touchstart"&&(r.registerClick=!0,setTimeout(function(){r.registerClick=!1},200)),t.originalEvent.targetTouches.length>=1){var u=t.originalEvent.targetTouches[0],f=n(u.target),e=f.parents(i);e.length===0&&t.preventDefault()}});n(".pageWrap").on("touchend.modalScroll",function(t){var i=n(t.originalEvent.changedTouches[0].target);r.registerClick&&(i.parents(".langSelect").length?i.triggerHandler("click"):i.trigger("click"))})}},enableScroll:function(){this.$body.removeClass("mix-disableScroll"),t.touch&&(n(document).off(".modalScroll"),n(".pageWrap").off(".modalScroll"))}},i.ArrowWrapping={init:function(t){var r=/link_(arrow|popup)\w*/,u=/link_(arrow|popup)\w*/g,i=".link_arrow, .link_popup",f=t!==undefined?t.find(i):n(i);f.each(function(t,i){var f=n.trim(i.innerHTML).split(" "),o=f[f.length-1],e;n(i).hasClass("link_arrow_inline")||o&&(e=i.className.split(" "),n.each(e,function(n,t){r.test(t)||(e[n]="")}),f[f.length-1]='<span class="'+e.join(" ")+' link_arrow_inline">'+o+"<\/span>",i.innerHTML=f.join(" "),i.className=i.className.replace(u,""))})}},i.CustomRadio={init:function(){var i=n(".js-customRadio"),t=this;i.addClass("customRadio").on("click",function(){var i=n(this).find('input[type="radio"]');i[0].checked=!0,t.updateRadio(i)}).find('input[type="radio"]').addClass("visuallyHidden").on("change",function(){t.updateRadio(n(this))}).each(function(i,r){t.updateRadio(n(r))})},updateRadio:function(t){var i=t.attr("name");t.is(":checked")&&(n('input[name="'+i+'"]').parent().removeClass("customRadio_isChecked"),t.parent().addClass("customRadio_isChecked"))}},i.ShowWarningMessage={init:function(t){var u=this,f;if(this.$warning=n("#modal-warning").appendTo("body"),this.warningConfirm=n("#modal-warning-confirm")[0],this.modalOpen=!1,!i.Utils.isExternalTemplate()){if(t){this.loadLegacy("You are leaving Mylan.com");return}f=n.proxy(this.cancelWarning,this);n(".pageWrap").on("click","a",function(t){var r=n(this),f=!0;if(i.Utils.isExternalLink(this.href)||r.data("message")==="True"||r.hasClass("js-forceWarning")){if(r.hasClass("js-ignoreWarning")||r.parents(".js-ignoreWarning").length)return;t.preventDefault(),u.launchWarning.call(u,this.href,f)}});n(".pageWrap, .modal_warning").on("click",".js-cancelWarning",function(n){n.preventDefault(),f()}).on("click",".js-closeWarning",function(){f()});n(document).on("keydown",function(n){u.modalOpen&&n.keyCode===e.ESC&&f()});n(r).on("resize",function(){u.modalOpen&&u.positionWarning.call(u)})}},launchWarning:function(t,u){this.warningConfirm.href=t,i.ModalShade.show("ShowWarningMessage","js-cancelWarning modal_warning-shade"),this.$warning.show().attr("aria-hidden",!1),this.modalOpen=!0,this.positionWarning(),u?this.warningConfirm.setAttribute("target","_blank"):this.warningConfirm.removeAttribute("target"),i.Utils.isMobile()&&(this.returnPosition=n(r).scrollTop(),r.scrollTo(0,0))},positionWarning:function(){var s=this.$warning.outerWidth(),h=Math.min(960,n(r).width()),u=(h-s)/2;if(this.$warning[0].style.left=u+"px",i.Utils.isMobile()){var f=n(r).height(),e=this.$warning.outerHeight(),o=0,c=/iPhone|iPod/i.test(navigator.userAgent);c&&t.mq("screen and (orientation: portrait)")&&(o=40),u=f>e?(f-e)/2+o:0,this.$warning[0].style.top=u+"px"}},cancelWarning:function(){i.ModalShade.hide("ShowWarningMessage"),this.$warning.hide().attr("aria-hidden",!0),this.modalOpen=!1,i.Utils.isMobile()&&this.returnPosition&&(r.scrollTo(0,this.returnPosition),this.returnPosition=null)},loadLegacy:function(t){n(".pageWrap").on("click","a",function(){var f=n(this);if(i.Utils.isExternalLink(this.href)||f.data("message")==="True"||f.hasClass("js-forceWarning"))return f.hasClass("js-ignoreWarning")||f.parents(".js-ignoreWarning").length?void 0:(f.attr("target","_blank"),r.confirm(t))})}},i.Popover={visibleElements:[],init:function(){var t=n(".js-popover"),r=n(".pageWrap");if(t.length!==0){t.each(function(){var t=n(this);t.attr("data-popover",this.title).removeAttr("title")});r.on("click",".js-popover",this.handleOpen).on("click",".js-popover-close",this.handleClose);i.TabBtns.subscribe(function(){r.children(".popover").remove()})}},handleOpen:function(t){t.preventDefault();var i=n(this),r=n(".pageWrap"),u=n('<div class="popover textMain textMain_isLast"><div class="popover-content">'+i.attr("data-popover")+'<\/div><span class="js-popover-close popover-close link_light">close<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAABgklEQVR4AWP4TgGgmeY3X74BEWmaT77+EnPujciu5wxbnwGR4K7n4WfeHH31hYDmr9++l1x5x7QNqAcdMW59lnPp7edvuDXHn3sLVIcHRZ19g13z8kcfgdIE0dz7H9E1A52jtv8lXMXsU/dWnL8PYTcdvb/p4l35HU8hXIV9L77BNcMDCdl4r71PHj9+POvi85wjT+7du9dzFsXyQy8/o2he9ADdzV2nn7579+7xq7cH771Ck5p+9wOK5ol3PmB67/6zl1+/fg05/BJNvPnGexTNSx6i2zzh5P3bj55effX5+psvaFKz731E0Xznw1dGJOnIfY/u3r3bd/5F8KGXX758mXABxfIb77+iR5XL8dcQObntTy/euL3nFlRp37nn79+/TzwCTXB2x15hiedTr79wbn+OP5LZtj+DplPMFLbwwUeWbTh1Mm97NvPeR3wZY9uzz0r7XmDqlN37YuOTT4Rz1cev34FpMPrsG+ujr0wOvwo782bWvY/vvmLJmwNXkgAAPKDAA8ldu5YAAAAASUVORK5CYII=" alt=""><\/span><\/div>');r.children(".popover").remove(),u.appendTo(r).css({left:i.offset().left,top:i.offset().top-u.outerHeight()+20})},handleClose:function(t){t.preventDefault(),n(this).parent().remove()}},f=function(t,i){this.$el=n(t),this.$slides=this.$el.find(".rotator-items").children(),this.size=this.$slides.length,this.baseSpeed=1e3,this.animateSpeed=1e3,this.activeClass="rotator-tab_isActive",this._buildTabs(i),this._buildControls(),this._initContent(),this._bind(),this._updateState(),this._updateSize()},f.prototype.tabStyles={active:{"margin-left":"-307px",opacity:1},entering:{"margin-left":"140px",opacity:0},exiting:{"margin-left":"-600px",opacity:0},idle:{"margin-left":"9px",opacity:1}},f.prototype._buildTabs=function(t){var f=this,i=n('<ol class="rotator-tabs"><\/ol>').attr("aria-hidden","true"),o,e=this.$slides.children().first().outerWidth()+260,u=0;t&&(e*=2),i.width(this.$slides.length*e),this.$slides.each(function(t,r){var u=n(r),e=u.find(".rotator-hd"),s=e.find(".hdg").addClass("visuallyHidden"),o=n('<li class="rotator-tab"><\/li>');o.data("slide",u).css(f.tabStyles.idle).append('<div class="rotator-tab-bg"><\/div>').append(e).appendTo(i)}),t&&(i.children().clone(!0).appendTo(i),this.size*=2),this.$currentTab=i.children().first().css(f.tabStyles.active),this.$currentTab.children(".rotator-tab-bg").css("bottom","-74px"),this.$tabs=i,this.$el.find(".rotator-hdg").after(i),this.$tabs.wrap('<div class="rotator-bar"><\/div>');n(r).on("load",function(){i.children().each(function(t,i){var r=n(i).height();u=Math.max(u,r)}).height(u)})},f.prototype._buildControls=function(){var t=n('<button class="navBtn navBtn_prev rotator-control rotator-prev ir">Previous<\/button><button class="navBtn navBtn_next rotator-control rotator-next ir">Next<\/button>').attr("aria-hidden","true").insertAfter(this.$tabs);this.$slides.length===1&&this.disableControls()},f.prototype._initContent=function(){this.$slides.not(":first").addClass("visuallyHidden")},f.prototype._bind=function(){var i=this,u=i.$el.find(".rotator-prev"),f=i.$el.find(".rotator-next");u.on("click",function(n){n.preventDefault(),i.disabled||i.prev()});f.on("click",function(n){n.preventDefault(),i.disabled||i.next()});i.$tabs.children().on("click",function(){var r=n(this).index();i.disabled||(r>1&&(i.animateSpeed=i.baseSpeed/2),r&&i.advance(!0,r))});i.$el.on("keydown",function(n){i.disabled||(n.keyCode===e.LEFT&&(u[0].focus(),i.prev()),n.keyCode===e.LEFT&&(f[0].focus(),i.next()))});n(r).on("load resize",function(n){i._updateSize(n)});if(t.touch){i.$tabs.swipe({swipe:function(n,t,r,u){i.disabled||u>250||(t==="left"?i.next():t==="right"&&i.prev())},threshold:40,excludedElements:"",allowPageScroll:"vertical"});i.$el.on("touchstart.rotator",".rotator-tab",function(t){var u=Date.now(),i=10,r={x:t.originalEvent.touches[0].pageX,y:t.originalEvent.touches[0].pageY};n(this).on("touchend.rotator",function(){var f=Date.now(),e=Math.abs(t.originalEvent.changedTouches[0].pageX-r.x),o=Math.abs(t.originalEvent.changedTouches[0].pageY-r.y);n(this).off("touchend.rotator"),f-u<250&&e<i&&o<i&&n(this).trigger("click")})})}},f.prototype._updateState=function(){var n=this.$tabs.children().eq(0);this.$currentTab.removeClass(this.activeClass),this.$currentTab=n,this.$currentTab.addClass(this.activeClass)},f.prototype._updateSize=function(n){if(!i.Utils.isOldIE||!n||n.type!=="resize"){var t=this.$slides.parent(),r=t.css("min-height",0).height();t.css("min-height",r)}},f.prototype.advance=function(n,t){var r=this,o=n?1:this.size-1,f=r.$currentTab,u=r.$tabs.children().eq(o),e=r.animateSpeed/2;this.disableControls(),t&&(t-=1),i.Utils.isOldIE&&r.$slides.parent().height(this.$slides.parent().height()),f.removeClass(this.activeClass),r._prepAnimation(f,u,n).done(function(){t||u.data("slide").slideUp(0,function(){u.data("slide").removeClass("visuallyHidden").slideDown(e,function(){i.Utils.isOldIE&&r.$slides.parent().height("auto")})}),n?f.css(r.tabStyles.entering).appendTo(r.$tabs).animate(r.tabStyles.idle,e,function(){}):u.css(r.tabStyles.exiting).prependTo(r.$tabs).animate(r.tabStyles.active,e),r._updateState(),r.enableControls(),n&&t?r.advance(!0,t):r.animateSpeed=r.baseSpeed,r._sendGA(f,u)})},f.prototype._sendGA=function(t){var u="Slider",f=this.$el.attr("data-label"),e=n.trim(t.text());r._gaq.push(["_trackEvent",u,e,f])},f.prototype._prepAnimation=function(t,r,u){var o=this,f=n.Deferred(),h=5,e=o.animateSpeed/2,s=t.children(".rotator-tab-bg"),c=r.children(".rotator-tab-bg"),l=i.Utils.isOldIE;return f.progress(function(){h-=1,h===0&&(l&&s.css("bottom",0),f.resolve())}),t.data("slide").slideUp(e,function(){t.data("slide").addClass("visuallyHidden").slideDown(0,f.notify)}),u?(t.animate(o.tabStyles.exiting,e,f.notify),l?f.notify():s.animate({bottom:0},e,f.notify),r.animate(o.tabStyles.active,e,f.notify),c.animate({bottom:"-74px"},e,f.notify)):(r.animate(o.tabStyles.entering,e,f.notify),c.animate({bottom:"-74px"},e,f.notify),t.animate(o.tabStyles.idle,e,f.notify),s.animate({bottom:"0"},e,f.notify)),f},f.prototype.prev=function(){this.advance(!1)},f.prototype.next=function(){this.advance(!0)},f.prototype.disableControls=function(){this.disabled=!0,this.$el.find(".rotator-control").each(function(t,i){var r=n(i);r.hasClass("navBtn_prev")?r.addClass("navBtn_prev_isDisabled"):r.addClass("navBtn_next_isDisabled"),r.attr("aria-disabled",!0)})},f.prototype.enableControls=function(){this.disabled=!1,this.$el.find(".rotator-control").attr("aria-disabled",!1).removeClass("navBtn_prev_isDisabled").removeClass("navBtn_next_isDisabled")},i.Prefilter={init:function(){var f=this,r=n("select.js-prefilter"),t=i.Utils.getHash(!0),u="#tag-";r.length!==0&&t&&t.indexOf(u)===0&&(t=decodeURIComponent(t.replace(u,"")),this._tag=t,r.each(function(n,i){f.filter(i,t)}))},filter:function(t){var r=n(t).children()},getTag:function(){return this._tag||!1}},i.SearchSuggest={data:null,init:function(){var t=this,r="",u=n("#ProductSearch"),i=0;u.keyup(function(){if(r=u.val(),r.length>=3){if(i==1)return;i=1,t.clearResults(),n.ajax({type:"POST",url:"/Mylan.com/Services/ApiService.asmx/AutoComplete",data:JSON.stringify({query:r}),contentType:"application/json; charset=utf-8",cache:"false",dataType:"json"}).done(function(n){var r=JSON.parse(n.d);t.onLoadSuccess.call(t,r),i=0}).fail(function(){i=0,t.clearResults()})}else t.clearResults()})},onLoadSuccess:function(t){var u=n(".plusSearch-fieldSet"),i=t.Suggestions,f=t.Data,r;n(u).append('<ul class="vList textMain searchSuggestions" id="searchSuggestions">'),r=n("#searchSuggestions"),n(t.Suggestions).each(function(t){n(r).append('<li><a class="suggestion" title="'+i[t]+'"href="'+f[t]+'">'+i[t]+"<\/a><\/li>")})},clearResults:function(){n("#searchSuggestions").length&&n("#searchSuggestions").remove()}}}(jQuery,Modernizr,MYLAN,window),MYLAN.LinksCallto={init:function(){$("a[href^=tel]").click(function(n){MYLAN.Utils.isMobile()||n.preventDefault()})}},MYLAN.FormErrors={ScrollToFirstError:function(n){var f,r,i,t,u;if(Page_ClientValidate(n),!Page_IsValid){for(i=0;i<Page_Validators.length;i++)t=Page_Validators[i],t.isvalid==!1&&(MYLAN.FormErrors.PageOffset(t)<r||r==undefined)&&(f=t,r=t.offsetTop);u=$("#"+$(f).attr("id")).offset().top-100,$(window).scrollTop(u),setTimeout(function(){$(window).scrollTop(u)},1)}return Page_IsValid},PageOffset:function(n){for(var t=0;n!=null;)t+=n.offsetTop,n=n.offsetParent;return t}},MYLAN=MYLAN||{},MYLAN.ViewModels=MYLAN.ViewModels||{},MYLAN.Investors=MYLAN.Investors||{},function(n,t,i,r){function f(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.search);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}var u=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];i.ViewModels.AutoMapper=function(t,i){this.key=function(n){return typeof n[i]=="function"?n[i]():n[i]},this.create=function(){return new t},this.update=function(t){var i=this;return t.data!==null&&n.each(t.data,function(n,i){var u,f;if(r.isObservable(t.target[n])&&r.utils.unwrapObservable(t.target[n])!==null&&typeof r.utils.unwrapObservable(t.target[n])=="object"&&typeof r.utils.unwrapObservable(t.target[n]).constructor.mapping!="undefined")return r.mapping.fromJS(i,r.utils.unwrapObservable(t.target[n]).constructor.mapping,t.target[n]);r.isObservable(t.target[n])&&typeof r.utils.unwrapObservable(t.target[n])=="object"&&r.utils.unwrapObservable(t.target[n])&&String(typeof r.utils.unwrapObservable(t.target[n]).length).toLowerCase()==="number"&&r.utils.unwrapObservable(t.target[n]).length>0&&!0&&typeof r.utils.unwrapObservable(t.target[n])[0].constructor.mapping!="undefined"&&typeof t.target[n].push!="undefined"?(u=r.utils.unwrapObservable(t.target[n])[0],t.target[n].removeAll(),r.utils.arrayForEach(i,function(i){var f=r.mapping.fromJS(i,u.constructor.mapping);t.target[n]().push(f)}),t.target[n].valueHasMutated()):r.isObservable(t.target[n])?(f=t.target[n],f(i)):t.target[n]=i}),t.target}},r.bindingHandlers.select2={update:function(t){n(t).select2("val",t.value)}},i.ViewModels.Tag=function(){var n=this;return this.Id=r.observable(),this.Name=r.observable(),this.FilterUrl=function(t){return typeof t=="undefined"||t===null?"":t.DashboardUrl+"?tag="+n.Name()},this},i.ViewModels.Tag.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Tag,"Id"),i.ViewModels.File=function(){var n=this;return this.Id=r.observable(),this.Url=r.observable(),this.Src=r.observable(),this.Extension=r.observable(),this.MimeType=r.observable(),this.Size=r.observable(),this.LegibleSize=r.observable(),this.CssClass=r.computed(function(){return"ico ico_file ico_file_"+n.Extension()}),this},i.ViewModels.File.mapping=new i.ViewModels.AutoMapper(i.ViewModels.File,"Id"),i.ViewModels.ShareholderModel=function(){var n=this},i.ViewModels.ArticleBase=function(){var n=this;return this.Id=r.observable(),this.AllTags=r.observableArray([new i.ViewModels.Tag]),this.ArticleImage=r.observable(new i.ViewModels.File),this.ArticleTitle=r.observable(),this.PublishDate=r.observable(),this.Summary=r.observable(),this.Url=r.observable(),this.LegibleDate=r.computed(function(){if(n.PublishDate()){var t=i.ViewModels.parseDate(n.PublishDate());return u[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear()}return null}),this},i.ViewModels.PressRelease=function(){return i.ViewModels.ArticleBase.prototype.constructor.call(this),this.Pdf=r.observable(new i.ViewModels.File),this},i.ViewModels.PressRelease.prototype=new i.ViewModels.ArticleBase,i.ViewModels.PressRelease.prototype.constructor=i.ViewModels.PressRelease,i.ViewModels.PressRelease.mapping=new i.ViewModels.AutoMapper(i.ViewModels.PressRelease,"Id"),i.ViewModels.FeatureContent=function(){var n=this;return i.ViewModels.ArticleBase.prototype.constructor.call(this),this.Video=r.observable(new i.ViewModels.File),this.HasVideo=r.observable(),this.ImageCss=r.computed(function(){return typeof n.Video()=="undefined"||n.Video().Src()===null?"feature_img":"feature_vid"}),this},i.ViewModels.FeatureContent.prototype=new i.ViewModels.ArticleBase,i.ViewModels.FeatureContent.prototype.constructor=i.ViewModels.FeatureContent,i.ViewModels.FeatureContent.mapping=new i.ViewModels.AutoMapper(i.ViewModels.FeatureContent,"Id"),i.ViewModels.FinancialReport=function(){var n=this;return i.ViewModels.ArticleBase.prototype.constructor.call(this),this.Type=r.observable(),this.ReportType=r.observable(),this.Attachments=r.observableArray([new i.ViewModels.File]),this},i.ViewModels.FinancialReport.prototype=new i.ViewModels.ArticleBase,i.ViewModels.FinancialReport.prototype.constructor=i.ViewModels.FinancialReport,i.ViewModels.FinancialReport.mapping=new i.ViewModels.AutoMapper(i.ViewModels.FinancialReport,"Id"),i.ViewModels.Event=function(){var n=this;return n.Id=r.observable(),n.Title=r.observable(),n.Thumbnail=r.observable(),n.Location=r.observable(),n.StartDate=r.observable(),n.Sponsor=r.observable(),n.EndDate=r.observable(),n.Summary=r.observable(),n.EventSummary=r.observable(),n.EventAccessLinkURL=r.observable(),n.AllTags=r.observable(),n.Url=r.observable(),n.LegibleDate=r.computed(function(){var t,r,f;return n.StartDate()&&n.EndDate()?(t=i.ViewModels.parseDate(n.StartDate()),r=u[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear(),n.StartDate()==n.EndDate()?r:(t=i.ViewModels.parseDate(n.EndDate()),f=u[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear(),r+" - "+f)):null}),n.ImageSrc=r.computed(function(){return n.Thumbnail()&&n.Thumbnail().Src?n.Thumbnail().Src:null}),n.ImageAlt=r.computed(function(){return n.Thumbnail()&&n.Thumbnail().Alt?n.Thumbnail().Alt:null}),n.ImageTitle=r.computed(function(){return n.Title()+" with "+n.Sponsor()}),this},i.ViewModels.Event.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Event,"Id"),i.ViewModels.ContentViewModel=function(t){var u=this;return u.modelName=t,u.mapping=i.ViewModels[t].mapping,u.content=r.observableArray([new i.ViewModels[t]]),u.page=r.observable(0),u.pageSize=r.observable(10),u.lastPage=r.observable({}),u.sortBy=r.observable(null),u.sortDirection=r.observable("DESC"),u.filter=r.observable({}),u.selectedYear=r.observable("All Years"),u.selectedTag=r.observable("All Categories"),u.selectedType=r.observable("All Types"),u.allYears=r.observable(),u.allTags=r.observable(),u.allTypes=r.observable(),u.subscriptions=[],u.parameters=null,u.updateLock=!1,u.itemSourcePath="",u.discoverQueryParams=function(){var t=f("page"),n;typeof t!="undefined"&&t!==null&&t!==""&&u.page(parseInt(t)-1),n=f("tag"),typeof n!="undefined"&&n!==null&&n!==""&&u.Tags().indexOf(n)>=0&&u.selectedTag(n)},u.pages=r.computed(function(){var t,n;if(u.lastPage()){for(t=[],n=u.page()-2;n<u.page()+3;n++)n>=0&&n<=u.lastPage()&&t.push(n+1);return t}return[1]}),u.paginationClass=function(n){return n===u.page()+1?"tabBtn-pagination-item tabBtn-pagination-item_isCurrent":"tabBtn-pagination-item"},u.prevClass=r.computed(function(){return u.page()===0?"navBtn_prev_isDisabled":""}),u.prevDisabled=r.computed(function(){return u.page()===0}),u.nextClass=r.computed(function(){return u.page()===u.lastPage()?"navBtn_next_isDisabled":""}),u.nextDisabled=r.computed(function(){return u.page()===u.lastPage()}),u.Years=r.computed(function(){if(u.allYears()){var t=["All Years"];return n.each(u.allYears(),function(){var n=this,i=n.split("-");t.push(i[0])}),t=n.grep(t,function(i,r){return n.inArray(i,t)===r})}return[]}),u.Tags=r.computed(function(){var t=[];return u.allTags()&&(n.each(u.allTags(),function(i,r){n.inArray(r.Name(),t)<0&&t.push(r.Name())}),t=t.sort(),t.unshift("All Topics")),t}),u.Types=r.computed(function(){if(u.allTypes()){var t=["All Filings"];return n.each(u.allTypes(),function(i,r){n.inArray(r,t)<0&&t.push(r)}),t}return[]}),u.refreshTop=function(t){var e=n(".header"),r=n(t).parents(".js-contentList"),u=n(window),i,f;r.length&&(i=r.offset().top-e.height(),f=u.scrollTop(),f>i&&u.scrollTop(i))},u.disposeSubscriptions=function(){while(u.subscriptions.length){var n=u.subscriptions.pop();n.dispose()}},u.addSubscriptions=function(){u.subscriptions.push(u.selectedYear.subscribe(function(n){typeof n!="undefined"&&(u.modelName==="Event"?u.applyFilter("StartDate.Year",n,"All Years",!0):(u.modelName==="PressRelease"||u.modelName==="FinancialReport")&&u.applyFilter("PublishDate.Year",n,"All Years",!0))})),u.subscriptions.push(u.selectedTag.subscribe(function(n){typeof n=="undefined"||u.updateLock||u.applyFilter("AllTags",n,"All Topics",!0)})),u.subscriptions.push(u.selectedType.subscribe(function(n){typeof n!="undefined"&&u.applyFilter("Type",n,"All Filings",!0)}))},u.addSubscriptions(),u},i.ViewModels.ContentViewModel.prototype.update=function(t){var i=this;n.ajax({type:"POST",url:"/Mylan.com/Services/ApiService.asmx/GetArticleFeed",data:JSON.stringify({articleType:i.modelName,page:i.page(),pageSize:i.pageSize(),sortBy:i.sortBy(),sortDirection:i.sortDirection(),filterString:JSON.stringify(i.filter()),parameters:i.parameters}),contentType:"application/json; charset=utf-8",cache:"false",dataType:"json",success:function(n){var u=JSON.parse(n.d);i.lastPage(u.LastPage),i.disposeSubscriptions(),r.mapping.fromJS(u.Articles,i.mapping,i.content),r.mapping.fromJS(u.Years,null,i.allYears),r.mapping.fromJS(u.Tags,null,i.allTags),r.mapping.fromJS(u.Types,null,i.allTypes),i.addSubscriptions(),i.page()>i.lastPage()&&i.page(i.lastPage()),typeof t!="undefined"&&t!==null&&t()}})},i.ViewModels.ContentViewModel.prototype.applyFilter=function(n,t,i,r){return t===i?delete this.filter()[n]:this.filter()[n]=t,r&&(this.page(0),this.update()),!0},i.ViewModels.ContentViewModel.prototype.next=function(){this.page()+1<=this.lastPage()&&(this.page(this.page()+1),this.update())},i.ViewModels.ContentViewModel.prototype.previous=function(){this.page()-1>=0&&(this.page(this.page()-1),this.update())},i.ViewModels.ContentViewModel.prototype.setPage=function(n){this.page()!==n-1&&(this.page(n-1),this.update())},i.ViewModels.ContentViewModel.prototype.sort=function(t,i,r){var f,u;this.sortBy()===t?this.sortDirection(this.sortDirection()==="ASC"?"DESC":"ASC"):(this.sortDirection("DESC"),this.sortBy(t)),this.update(),typeof r!="undefined"&&r!==null&&(u=n(r.srcElement||r.target),u.hasClass("listTableSort-item")||(u=u.parents(".listTableSort-item")),u.hasClass("listTableSort-item_isActive")?u.toggleClass("listTableSort-item_isActive_reversed"):(u.parent().siblings().children().removeClass("listTableSort-item_isActive").removeClass("listTableSort-item_isActive_reversed"),u.addClass("listTableSort-item_isActive")))},i.ViewModels.ContentViewModel.prototype.applyBindings=function(t){r.applyBindings(this,n(t).get(0))},i.ViewModels.parseDate=function(n){var t=n.match(/(\d+)/g);return new Date(t[0],t[1]-1,t[2])},i.ViewModels.RegionModel=function(t){var i=this;return i.formName=t,i.selectedCountry=r.observable(""),i.selectedState=r.observable(""),i.states=r.observableArray([]),i.resetForm=function(){var t=n("#"+i.formName);t.find("input:not(:submit), textarea").val(""),t.find("select option").removeAttr("selected"),t.find("select option:first-child").attr("selected",""),t.find("div.select2").select2("val",""),t.find('input[type="checkbox"]').removeAttr("checked")},i},i.ViewModels.SearchResultObject=function(){var n=this;n.Id=r.observable(),n.Title=r.observable(),n.Summary=r.observable(),n.UrlLink=r.observable(),n.Image=r.observable(),n.UrlLinkDisplay=r.observable(),n.IsProduct=r.observable(),n.IsPdf=r.observable()},i.ViewModels.SearchResultObject.mapping=new i.ViewModels.AutoMapper(i.ViewModels.SearchResultObject,"Id"),i.ViewModels.SearchResults=function(){var t=this;return t.Id=r.observable(),t.page=r.observable(),t.pageSize=r.observable(),t.parameters=null,t.SearchResults=r.observableArray([new i.ViewModels.SearchResultObject]),t.lastPage=r.observable(),t.pages=r.computed(function(){var i=[],f=t.page(),n=0,r=10,u=t.lastPage();if(t.SearchResults().length)for(;n<=u;n++){if(!r)break;i.push(n),r-=1}return i}),t.paginationClass=function(n){return n===t.page()?"tabBtn-pagination-item tabBtn-pagination-item_isCurrent":"tabBtn-pagination-item"},t.refreshTop=function(t){var e=n(".header"),r=n(t).parents(".js-contentList"),u=n(window),i,f;r.length&&(i=r.offset().top-e.height(),f=u.scrollTop(),f>i&&u.scrollTop(i))},t.prevClass=r.computed(function(){return t.page()===0?"navBtn_prev_isDisabled":""}),t.prevDisabled=r.computed(function(){return t.page()===0}),t.nextClass=r.computed(function(){return t.page()===t.lastPage()?"navBtn_next_isDisabled":""}),t.nextDisabled=r.computed(function(){return t.page()===t.lastPage()}),t},i.ViewModels.SearchResults.mapping=new i.ViewModels.AutoMapper(i.ViewModels.SearchResults,"Id"),i.ViewModels.SearchResults.prototype.applyBindings=function(t){r.applyBindings(this,n(t).get(0))},i.ViewModels.SearchResults.prototype.update=function(t){var u=this;t!=null?(u.page(parseInt(t.Page)),u.pageSize(parseInt(t.PageSize)),u.parameters=t):(u.parameters.Page=u.page(),u.parameters.PageSize=u.pageSize()),n.ajax({type:"POST",url:"/Mylan.com/Services/ApiService.asmx/Search",data:JSON.stringify({param:u.parameters}),contentType:"application/json; charset=utf-8",cache:"false",dataType:"json",success:function(n){var t=JSON.parse(n.d);r.mapping.fromJS(t.SearchResults,i.ViewModels.SearchResults.mapping,u.SearchResults),u.lastPage(t.LastPage)},error:function(){var n={SearchResults:[],LastPage:0};r.mapping.fromJS(n.SearchResults,i.ViewModels.SearchResults.mapping,u.SearchResults),u.lastPage(n.LastPage)}})},i.ViewModels.SearchResults.prototype.next=function(){this.page()+1<=this.lastPage()&&(this.page(this.page()+1),this.update())},i.ViewModels.SearchResults.prototype.previous=function(){this.page()-1>=0&&(this.page(this.page()-1),this.update())},i.ViewModels.SearchResults.prototype.setPage=function(n){this.page()!==n&&(this.page(n),this.update())},i.Investors.Quote=function(){var n=this;return this.ASK=r.observable(),this.BID=r.observable(),this.CHANGE=r.observable(),this.CLOSE=r.observable(),this.COMPANYNAME=r.observable(),this.CUSIP=r.observable(),this.DATETIME=r.observable(),this.DIVIDEND=r.observable(),this.EPS=r.observable(),this.EXACTDATE=r.observable(),this.EXCHANGE=r.observable(),this.HIGH=r.observable(),this.LASTDATETIME=r.observable(),this.LASTPRICE=r.observable(),this.LONGNAME=r.observable(),this.LOW=r.observable(),this.MINPRICEDATE=r.observable(),this.MINYEAR=r.observable(),this.OPEN=r.observable(),this.PCHANGE=r.observable(),this.PE=r.observable(),this.PREVIOUSCLOSE=r.observable(),this.PRICEDATE=r.observable(),this.SHARES=r.observable(),this.SHORTNAME=r.observable(),this.TICKER=r.observable(),this.TRADES=r.observable(),this.VOLUME=r.observable(),this.YEARHIGH=r.observable(),this.YEARLOW=r.observable(),this.YIELD=r.observable(),this.LegibleHigh=r.computed(function(){var t=n.HIGH();return typeof t=="undefined"||t===null?undefined:Math.round(t*100)/100}),this.LegibleLow=r.computed(function(){var t=n.LOW();return typeof t=="undefined"||t===null?undefined:Math.round(t*100)/100}),this.LegibleChange=r.computed(function(){var t=n.CHANGE();return typeof t=="undefined"||t===null?undefined:(n.CHANGE()>0?"+":"")+Math.round(t*100)/100}),this.LegiblePrice=r.computed(function(){var t=n.LASTPRICE();return typeof t=="undefined"||t===null?undefined:Math.round(t*100)/100}),this.LastTradeDirection=r.computed(function(){var t=n.CHANGE();return typeof t=="undefined"||t===null?undefined:n.CHANGE()>0?"inc":"desc"}),this.FormattedVolume=r.computed(function(){var t=n.VOLUME();return typeof t=="undefined"||t===null?"same":t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}),this.FormattedDate=r.computed(function(){var i=/(\d+-\d+-\d+) (\d+):(\d+):(\d+)/.exec(n.DATETIME()),t,r,u;return i?(t=parseInt(i[2],10),r=t>11?"PM":"AM",t%=12,t=t?t:12,u="ET",i[1].replace(/-/g,".")+", "+t+":"+i[3]+" "+r+" "+u):n.DATETIME()}),this.loading=r.observable(!0),this},i.Investors.NewsIdentifier=function(){return this.ProviderID=r.observable(),this.DateID=r.observable(),this.NewsItemID=r.observable(),this},i.Investors.NewsIdentifier.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsIdentifier),i.Investors.Identification=function(){return this.NewsIdentifier=r.observable(new i.Investors.NewsIdentifier),this},i.Investors.Identification.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Identification),i.Investors.Property=function(){return this["@FormalName"]=r.observable(),this["@Value"]=r.observable(),this},i.Investors.Property.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Property),i.Investors.Language=function(){return this["@FormalName"]=r.observable(),this},i.Investors.Language.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Language),i.Investors.Genre=function(){return this["@FormalName"]=r.observable(),this},i.Investors.Genre.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Genre),i.Investors.DescriptiveMetaData=function(){return this["@Confidence"]=r.observable(),this["@HowPresent"]=r.observable(),this["@Importance"]=r.observable(),this.Genre=r.observable(new i.Investors.Genre),this.Language=r.observable(new i.Investors.Language),this.Properties=r.observableArray([new i.Investors.Property]),this},i.Investors.DescriptiveMetaData.mapping=new i.ViewModels.AutoMapper(i.ViewModels.DescriptiveMetaData),i.Investors.Headline=function(){return this["#cdata-section"]=r.observable(),this},i.Investors.Headline.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Headline),i.Investors.NewsLine=function(){return this.DateLine=r.observable(),this.Headline=r.observable(new i.Investors.Headline),this.SubHeadLine=r.observable(new i.Investors.Headline),this},i.Investors.NewsLine.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsLine),i.Investors.Role=function(){return this["@FormalName"]=r.observable(),this},i.Investors.Role.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Role),i.Investors.NewsComponent=function(){return this["@Duid"]=r.observable(),this["@EquivalentsList"]=r.observable(),this["@Essential"]=r.observable(),this.DescriptiveMetaData=r.observable(new i.Investors.DescriptiveMetaData),this.NewsLines=r.observable(new i.Investors.NewsLine),this.Role=r.observable(new i.Investors.Role),this},i.Investors.NewsComponent.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsComponent),i.Investors.NewsItem=function(){return this.Identification=r.observable(new i.Investors.Identification),this.NewsComponent=r.observable(new i.Investors.NewsComponent),this},i.Investors.NewsItem.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsItem),i.Investors.NewsEnvelope=function(){return this.DateAndTime=r.observable(),this},i.Investors.NewsEnvelope.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsEnvelope),i.Investors.NewsML=function(){return this.NewsEnvelope=r.observable(new i.Investors.NewsEnvelope),this.NewsItem=r.observableArray([new i.Investors.NewsItem]),this},i.Investors.NewsML.mapping=new i.ViewModels.AutoMapper(i.ViewModels.NewsML),i.Investors.ContentViewModel=function(){return this.Quote=r.observable(new i.Investors.Quote),this.NewsML=r.observable(new i.Investors.NewsML),this},i.Investors.ContentViewModel.prototype.loadQuote=function(){var t=this;n.ajax({url:"/Mylan.com/Services/ShareholderService.asmx/GetShareholderInformation",type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify({functionName:"StockQuote"}),success:function(n){r.mapping.fromJS(JSON.parse(n.d).STOCKQUOTE.RESULT.ROW,i.Investors.Quote.mapping,t.Quote),t.Quote().loading(!1)}})},i.Investors.ContentViewModel.prototype.loadNews=function(){var t=this;n.ajax({url:"/Mylan.com/Services/ShareholderService.asmx/GetShareholderInformation",type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify({functionName:"NewsReleases"}),success:function(n){r.mapping.fromJS(JSON.parse(n.d),i.Investors.NewsML.mapping,t)}})},i.Investors.ContentViewModel.prototype.applyBindings=function(t){r.applyBindings(this,n(t).get(0))},i.ViewModels.LiveRssFeed=function(t,i){var u=this,f,e,o;for(u.rssUrl=t,u.data=r.observableArray([]),u.filteredDataCount=r.observable(u.data().length),u.pageSize=i,u.sortBy=r.observable(null),u.sortDirection=r.observable("DESC"),u.selectedTag=r.observable(null),u.selectedYear=r.observable(null),u.nextDisabled=r.observable(!1),f=function(n,t){this.tagName=n,this.tagValue=t},u.AllTags=r.observableArray([new f("All Filings","All"),new f("Annual","Annual"),new f("Quarterly","Quarterly"),new f("Proxy","Proxy"),new f("Other","Other")]),e=[],e.push("All Years"),o=(new Date).getFullYear();o>(new Date).getFullYear()-11;o--)e.push(o);return u.AllYears=r.observableArray(e),u.selectedFilterTag=r.observable(null),u.selectedYear.subscribe(function(){u.page(0),u.update()}),u.selectedTag.subscribe(function(){u.page(0),u.update()}),u.selectedFilterTag.subscribe(function(){u.page(0),u.update()}),u.compareTitle=function(n,t){return n.Title<t.Title?-1:n.Title>t.Title?1:0},u.compareDate=function(n,t){return n.StartDate<t.StartDate?-1:n.StartDate>t.StartDate?1:0},u.compareReportTypes=function(n,t){return n.ReportType<t.ReportType?-1:n.ReportType>t.ReportType?1:0},u.getYear=function(n){return new Date(parseInt(n.replace("/Date(","").replace(")/",""),10)).getFullYear()},u.isQuarterly=function(n){return n&&n=="10-Q"},u.isAnnual=function(n){return n&&n=="10-K"},u.page=r.observable(0),u.itemsOnCurrentPage=r.computed(function(){var t=u.data(),i,r;return u.sortBy()=="Title"&&(t.sort(u.compareTitle),u.sortDirection()=="ASC"&&t.reverse()),u.sortBy()=="PublishDate"&&(t.sort(u.compareDate),u.sortDirection()=="ASC"&&t.reverse()),u.sortBy()=="ReportType"&&(t.sort(u.compareReportTypes),u.sortDirection()=="ASC"&&t.reverse()),i=[],u.selectedTag()&&u.selectedTag()!="All Tags"&&u.selectedTag()!="All Categories"&&u.selectedTag()!="All Topics"&&(n.each(t,function(t,r){var f=!1;n.each(r.Tags,function(n,t){t.DisplayName==u.selectedTag()&&(f=!0)}),f&&i.push(r)}),t=i),u.selectedYear()&&u.selectedYear()!="All Years"&&(i=[],n.each(t,function(n,t){u.getYear(t.StartDate)==u.selectedYear()&&i.push(t)}),t=i),u.selectedFilterTag()&&u.selectedFilterTag()=="Annual"&&(i=[],n.each(t,function(n,t){u.isAnnual(t.ReportType)&&i.push(t)}),t=i),u.selectedFilterTag()&&u.selectedFilterTag()=="Quarterly"&&(i=[],n.each(t,function(n,t){u.isQuarterly(t.ReportType)&&i.push(t)}),t=i),u.filteredDataCount(t.length),r=u.pageSize*u.page(),t.slice(r,r+u.pageSize)},this),u.lastPage=r.computed(function(){return Math.ceil(u.filteredDataCount()/u.pageSize)-1}),u.pages=r.computed(function(){var t=[],r=u.page(),n=Math.max(r-5,0),i=10,f=u.lastPage();if(u.itemsOnCurrentPage().length)for(;n<=f;n++){if(!i)break;t.push(n),i-=1}return t}),u.paginationClass=function(n){return n===u.page()?"tabBtn-pagination-item tabBtn-pagination-item_isCurrent":"tabBtn-pagination-item"},u.refreshTop=function(t){var e=n(".header"),r=n(t).parents(".js-contentList"),u=n(window),i,f;r.length&&(i=r.offset().top-e.height(),f=u.scrollTop(),f>i&&u.scrollTop(i))},u.filterTags=function(n){u.selectedTag(n)},u.prevClass=r.computed(function(){return u.page()===0?"navBtn_prev_isDisabled":""}),u.prevDisabled=r.computed(function(){return u.page()===0}),u.nextClass=r.computed(function(){return u.nextDisabled()?"navBtn_next_isDisabled":""}),u},i.ViewModels.LiveRssFeed.prototype.update=function(){var t=this;t.nextDisabled(!1),n.ajax({type:"POST",url:"/Mylan.com/Services/ApiService.asmx/GetFinancialReports",data:JSON.stringify({url:escape(t.rssUrl),page:t.page(),pageSize:t.pageSize,year:t.selectedYear(),type:t.selectedFilterTag(),order:""}),contentType:"application/json; charset=utf-8",cache:"false",dataType:"json",success:function(n){t.data(JSON.parse(n.d)),t.data().length<10&&t.nextDisabled(!0),t.data().length===0&&t.page()>0&&(t.previous(),t.nextDisabled(!0))}})},i.ViewModels.LiveRssFeed.mapping=new i.ViewModels.AutoMapper(i.ViewModels.LiveRssFeed,"Id"),i.ViewModels.LiveRssFeed.prototype.applyBindings=function(t){r.applyBindings(this,n(t).get(0))},i.ViewModels.LiveRssFeed.prototype.next=function(){this.nextDisabled()||(this.page(this.page()+1),this.update())},i.ViewModels.LiveRssFeed.prototype.previous=function(){this.page()-1>=0&&(this.page(this.page()-1),this.nextDisabled(!1),this.update())},i.ViewModels.LiveRssFeed.prototype.cssClass=function(n){return"ico ico_file ico_file_"+n},i.ViewModels.LiveRssFeed.prototype.setPage=function(n){this.page()!==n&&this.page(n)},i.ViewModels.LiveRssFeed.prototype.sort=function(t,i,r){var f,u;this.sortBy()===t?this.sortDirection(this.sortDirection()==="ASC"?"DESC":"ASC"):(this.sortDirection("DESC"),this.sortBy(t)),typeof r!="undefined"&&r!==null&&(u=n(r.srcElement||r.target),u.hasClass("listTableSort-item")||(u=u.parents(".listTableSort-item")),u.hasClass("listTableSort-item_isActive")?u.toggleClass("listTableSort-item_isActive_reversed"):(u.parent().siblings().children().removeClass("listTableSort-item_isActive").removeClass("listTableSort-item_isActive_reversed"),u.addClass("listTableSort-item_isActive")))},i.ViewModels.RssFeed=function(t,i){var u=this;return u.data=r.observableArray(t.Data),u.filteredDataCount=r.observable(u.data().length),u.pageSize=i,u.sortBy=r.observable(null),u.sortDirection=r.observable("DESC"),u.selectedTag=r.observable(null),u.selectedYear=r.observable(null),u.AllTags=r.observableArray(t.AllTags),u.AllYears=r.observableArray(t.AllYears),u.selectedFilterTag=r.observable(null),u.selectedYear.subscribe(function(){u.page(0)}),u.selectedTag.subscribe(function(){u.page(0)}),u.selectedFilterTag.subscribe(function(){u.page(0)}),u.compareTitle=function(n,t){return n.Title<t.Title?-1:n.Title>t.Title?1:0},u.compareDate=function(n,t){return n.StartDate<t.StartDate?-1:n.StartDate>t.StartDate?1:0},u.compareReportTypes=function(n,t){return n.ReportType<t.ReportType?-1:n.ReportType>t.ReportType?1:0},u.getYear=function(n){return new Date(parseInt(n.replace("/Date(","").replace(")/",""),10)).getFullYear()},u.isQuarterly=function(n){return n&&n=="10-Q"},u.isAnnual=function(n){return n&&n=="10-K"},u.page=r.observable(0),u.itemsOnCurrentPage=r.computed(function(){var t=u.data(),i,r;return u.sortBy()=="Title"&&(t.sort(u.compareTitle),u.sortDirection()=="ASC"&&t.reverse()),u.sortBy()=="PublishDate"&&(t.sort(u.compareDate),u.sortDirection()=="ASC"&&t.reverse()),u.sortBy()=="ReportType"&&(t.sort(u.compareReportTypes),u.sortDirection()=="ASC"&&t.reverse()),i=[],u.selectedTag()&&u.selectedTag()!="All Tags"&&u.selectedTag()!="All Categories"&&u.selectedTag()!="All Topics"&&(n.each(t,function(t,r){var f=!1;n.each(r.Tags,function(n,t){t.DisplayName==u.selectedTag()&&(f=!0)}),f&&i.push(r)}),t=i),u.selectedYear()&&u.selectedYear()!="All Years"&&(i=[],n.each(t,function(n,t){u.getYear(t.StartDate)==u.selectedYear()&&i.push(t)}),t=i),u.selectedFilterTag()&&u.selectedFilterTag()=="Annual"&&(i=[],n.each(t,function(n,t){u.isAnnual(t.ReportType)&&i.push(t)}),t=i),u.selectedFilterTag()&&u.selectedFilterTag()=="Quarterly"&&(i=[],n.each(t,function(n,t){u.isQuarterly(t.ReportType)&&i.push(t)}),t=i),u.filteredDataCount(t.length),r=u.pageSize*u.page(),t.slice(r,r+u.pageSize)},this),u.lastPage=r.computed(function(){return Math.ceil(u.filteredDataCount()/u.pageSize)-1}),u.pages=r.computed(function(){var t=[],r=u.page(),n=Math.max(r-5,0),i=10,f=u.lastPage();if(u.itemsOnCurrentPage().length)for(;n<=f;n++){if(!i)break;t.push(n),i-=1}return t}),u.paginationClass=function(n){return n===u.page()?"tabBtn-pagination-item tabBtn-pagination-item_isCurrent":"tabBtn-pagination-item"},u.refreshTop=function(t){var e=n(".header"),r=n(t).parents(".js-contentList"),u=n(window),i,f;r.length&&(i=r.offset().top-e.height(),f=u.scrollTop(),f>i&&u.scrollTop(i))},u.filterTags=function(n){u.selectedTag(n)},u.prevClass=r.computed(function(){return u.page()===0?"navBtn_prev_isDisabled":""}),u.prevDisabled=r.computed(function(){return u.page()===0}),u.nextClass=r.computed(function(){return u.page()===u.lastPage()||u.lastPage()<=0&&u.filteredDataCount()<=0?"navBtn_next_isDisabled":""}),u.nextDisabled=r.computed(function(){return u.page()===u.lastPage()||u.lastPage()<=0&&u.filteredDataCount()<=0}),u},i.ViewModels.RssFeed.mapping=new i.ViewModels.AutoMapper(i.ViewModels.RssFeed,"Id"),i.ViewModels.RssFeed.prototype.applyBindings=function(t){r.applyBindings(this,n(t).get(0))},i.ViewModels.RssFeed.prototype.next=function(){this.page()+1<=this.lastPage()&&this.page(this.page()+1)},i.ViewModels.RssFeed.prototype.previous=function(){this.page()-1>=0&&this.page(this.page()-1)},i.ViewModels.RssFeed.prototype.cssClass=function(n){return"ico ico_file ico_file_"+n},i.ViewModels.RssFeed.prototype.setPage=function(n){this.page()!==n&&this.page(n)},i.ViewModels.RssFeed.prototype.sort=function(t,i,r){var f,u;this.sortBy()===t?this.sortDirection(this.sortDirection()==="ASC"?"DESC":"ASC"):(this.sortDirection("DESC"),this.sortBy(t)),typeof r!="undefined"&&r!==null&&(u=n(r.srcElement||r.target),u.hasClass("listTableSort-item")||(u=u.parents(".listTableSort-item")),u.hasClass("listTableSort-item_isActive")?u.toggleClass("listTableSort-item_isActive_reversed"):(u.parent().siblings().children().removeClass("listTableSort-item_isActive").removeClass("listTableSort-item_isActive_reversed"),u.addClass("listTableSort-item_isActive")))},i.ViewModels.Material=function(){return i.ViewModels.ArticleBase.prototype.constructor.call(this),this.Pdf=r.observable(new i.ViewModels.File),this},i.ViewModels.Material.prototype=new i.ViewModels.ArticleBase,i.ViewModels.Material.prototype.constructor=i.ViewModels.Material,i.ViewModels.Material.mapping=new i.ViewModels.AutoMapper(i.ViewModels.Material,"Id")}(jQuery,Modernizr,MYLAN,ko),MYLAN=MYLAN||{},MYLAN.Validation=MYLAN.Validation||{init:function(){$.validator.setDefaults({errorPlacement:function(n,t){n.insertBefore(t)}}),$("form").validate({onsubmit:!1})}},function(n,t){n(function(){t.Validation.init(),t.Validation.SignUp.init().validate(),t.Validation.ContactForm.init().validate()}),t.Validation.SignUp={init:function(){return window.requestAccessControls&&(window.requestAccessControls.password.jq.rules("add",{required:!0,minlength:5}),window.requestAccessControls.validatePassword.jq.rules("add",{required:!0,equalTo:"#"+window.requestAccessControls.password.id,messages:{equalTo:"Passwords do not match."}}),window.requestAccessControls.username.jq.rules("add",{required:!0,messages:{remote:"Username is already in use."},remote:{dataType:"json",url:"/Mylan.com/Services/ValidationService.svc/IsUsernameUnique",data:{username:function(){return window.requestAccessControls.username.jq.val()}}}}),window.requestAccessControls.email.jq.rules("add",{required:!0,email:!0,messages:{remote:"Email is already in use."},remote:{dataType:"json",url:"/Mylan.com/Services/ValidationService.svc/IsEmailUnique",data:{email:function(){return window.requestAccessControls.email.jq.val()}}}})),this},validate:function(){return window.requestAccessControls&&window.requestAccessControls.signup.jq.click(function(n){var t=window.requestAccessControls.username.jq.valid();t&=window.requestAccessControls.email.jq.valid(),t&=window.requestAccessControls.password.jq.valid(),t&=window.requestAccessControls.validatePassword.jq.valid(),t||n.preventDefault()}),this}},t.Validation.ContactForm={init:function(){return window.contactFormControls,this},validate:function(){return window.contactFormControls&&window.contactFormControls.submit&&window.contactFormControls.submit.jq.click(function(t){var i=!0;n.each(window.contactFormControls,function(n,t){i&=t.jq.valid()}),i||t.preventDefault()}),this}}}(jQuery,MYLAN),!function(n){"undefined"==typeof n.fn.each2&&n.extend(n.fn,{each2:function(t){for(var i=n([0]),r=-1,u=this.length;++r<u&&(i.context=i[0]=this[r])&&t.call(i[0],r,i)!==!1;);return this}})}(jQuery),function(n,t){"use strict";function h(n){var i,t,u,r;if(!n||n.length<1)return n;for(i="",t=0,u=n.length;u>t;t++)r=n.charAt(t),i+=kt[r]||r;return i}function f(n,t){for(var i=0,r=t.length;r>i;i+=1)if(u(n,t[i]))return i;return-1}function st(){var t=n(bt),i;return t.appendTo("body"),i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight},t.remove(),i}function u(n,i){return n===i?!0:n===t||i===t?!1:null===n||null===i?!1:n.constructor===String?n+""==i+"":i.constructor===String?i+""==n+"":!1}function v(t,i){var r,u,f;if(null===t||t.length<1)return[];for(r=t.split(i),u=0,f=r.length;f>u;u+=1)r[u]=n.trim(r[u]);return r}function d(n){return n.outerWidth(!1)-n.width()}function g(i){var r="keyup-change-value";i.on("keydown",function(){n.data(i,r)===t&&n.data(i,r,i.val())}),i.on("keyup",function(){var u=n.data(i,r);u!==t&&i.val()!==u&&(n.removeData(i,r),i.trigger("keyup-change"))})}function ht(i){i.on("mousemove",function(i){var r=k;(r===t||r.x!==i.pageX||r.y!==i.pageY)&&n(i.target).trigger("mousemove-filtered",i)})}function nt(n,i,r){r=r||t;var u;return function(){var t=arguments;window.clearTimeout(u),u=window.setTimeout(function(){i.apply(r,t)},n)}}function ct(n){var t,i=!1;return function(){return i===!1&&(t=n(),i=!0),t}}function lt(n,t){var i=nt(n,function(n){t.trigger("scroll-debounced",n)});t.on("scroll",function(n){f(n.target,t.get())>=0&&i(n)})}function at(n){n[0]!==document.activeElement&&window.setTimeout(function(){var i,t=n[0],r=n.val().length;n.focus(),n.is(":visible")&&t===document.activeElement&&(t.setSelectionRange?t.setSelectionRange(r,r):t.createTextRange&&(i=t.createTextRange(),i.collapse(!1),i.select()))},0)}function vt(t){var i,r,u;return t=n(t)[0],i=0,r=0,"selectionStart"in t?(i=t.selectionStart,r=t.selectionEnd-i):"selection"in document&&(t.focus(),u=document.selection.createRange(),r=document.selection.createRange().text.length,u.moveStart("character",-t.value.length),i=u.text.length-r),{offset:i,length:r}}function r(n){n.preventDefault(),n.stopPropagation()}function yt(n){n.preventDefault(),n.stopImmediatePropagation()}function pt(t){if(!s){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);s=n(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"}),s.attr("class","select2-sizer"),n("body").append(s)}return s.text(t.val()),s.width()}function c(t,i,r){var u,e,f=[];u=t.attr("class"),u&&(u=""+u,n(u.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),u=i.attr("class"),u&&(u=""+u,n(u.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(e=r(this),e&&f.push(this))})),t.attr("class",f.join(" "))}function tt(n,t,i,r){var u=h(n.toUpperCase()).indexOf(h(t.toUpperCase())),f=t.length;return 0>u?(i.push(r(n)),void 0):(i.push(r(n.substring(0,u))),i.push("<span class='select2-match'>"),i.push(r(n.substring(u,u+f))),i.push("<\/span>"),i.push(r(n.substring(u+f,n.length))),void 0)}function it(n){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(n).replace(/[&<>"'\/\\]/g,function(n){return t[n]})}function rt(i){var f,u=null,e=i.quietMillis||100,o=i.url,r=this;return function(s){window.clearTimeout(f),f=window.setTimeout(function(){var e=i.data,f=o,c=i.transport||n.fn.select2.ajaxDefaults.transport,l={type:i.type||"GET",cache:i.cache||!1,jsonpCallback:i.jsonpCallback||t,dataType:i.dataType||"json"},h=n.extend({},n.fn.select2.ajaxDefaults.params,l);e=e?e.call(r,s.term,s.page,s.context):null,f="function"==typeof f?f.call(r,s.term,s.page,s.context):f,u&&u.abort(),i.params&&(n.isFunction(i.params)?n.extend(h,i.params.call(r)):n.extend(h,i.params)),n.extend(h,{url:f,dataType:i.dataType,data:e,success:function(n){var t=i.results(n,s.page);s.callback(t)}}),u=c.call(r,h)},e)}}function ut(t){var e,u,i=t,r=function(n){return""+n.text},f;return n.isArray(i)&&(u=i,i={results:u}),n.isFunction(i)===!1&&(u=i,i=function(){return u}),f=i(),f.text&&(r=f.text,n.isFunction(r)||(e=f.text,r=function(n){return n[e]})),function(t){var u,f=t.term,e={results:[]};return""===f?(t.callback(i()),void 0):(u=function(i,e){var o,s;if(i=i[0],i.children){o={};for(s in i)i.hasOwnProperty(s)&&(o[s]=i[s]);o.children=[],n(i.children).each2(function(n,t){u(t,o.children)}),(o.children.length||t.matcher(f,r(o),i))&&e.push(o)}else t.matcher(f,r(i),i)&&e.push(i)},n(i().results).each2(function(n,t){u(t,e.results)}),t.callback(e),void 0)}}function ft(i){var r=n.isFunction(i);return function(u){var f=u.term,e={results:[]};n(r?i():i).each(function(){var n=this.text!==t,i=n?this.text:this;(""===f||u.matcher(f,i))&&e.results.push(n?this:{id:this,text:this})}),u.callback(e)}}function o(t,i){if(n.isFunction(t))return!0;if(!t)return!1;throw new Error(i+" must be a function or a falsy value");}function e(t){return n.isFunction(t)?t():t}function et(t){var i=0;return n.each(t,function(n,t){t.children?i+=et(t.children):i++}),i}function wt(n,i,r,f){var e,s,o,h,c,a=n,l=!1;if(!f.createSearchChoice||!f.tokenSeparators||f.tokenSeparators.length<1)return t;for(;;){for(s=-1,o=0,h=f.tokenSeparators.length;h>o&&(c=f.tokenSeparators[o],s=n.indexOf(c),!(s>=0));o++);if(0>s)break;if(e=n.substring(0,s),n=n.substring(s+c.length),e.length>0&&(e=f.createSearchChoice.call(this,e,i),e!==t&&null!==e&&f.id(e)!==t&&null!==f.id(e))){for(l=!1,o=0,h=i.length;h>o;o++)if(u(f.id(e),f.id(i[o]))){l=!0;break}l||r(e)}}if(a!==n)return n}function y(t,i){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=n.extend(r.prototype,i),r}if(window.Select2===t){var l,p,w,a,s,ot,b,k={x:0,y:0},i={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(n){switch(n=n.which?n.which:n){case i.LEFT:case i.RIGHT:case i.UP:case i.DOWN:return!0}return!1},isControl:function(n){var t=n.which;switch(t){case i.SHIFT:case i.CTRL:case i.ALT:return!0}return n.metaKey?!0:!1},isFunctionKey:function(n){return n=n.which?n.which:n,n>=112&&123>=n}},bt="<div class='select2-measure-scrollbar'><\/div>",kt={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"};ot=n(document),a=function(){var n=1;return function(){return n++}}(),ot.on("mousemove",function(n){k.x=n.pageX,k.y=n.pageY}),l=y(Object,{bind:function(n){var t=this;return function(){n.apply(t,arguments)}},init:function(i){var u,f,o=".select2-results",s,h;this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+a()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=ct(function(){return i.element.closest("body")}),c(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(e(i.containerCss)),this.container.addClass(e(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",r),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),c(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(e(i.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",r),this.results=u=this.container.find(o),this.search=f=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",r),ht(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",o,this.bind(this.highlightUnderEvent)),lt(80,this.results),this.dropdown.on("scroll-debounced",o,this.bind(this.loadMoreIfNeeded)),n(this.container).on("change",".select2-input",function(n){n.stopPropagation()}),n(this.dropdown).on("change",".select2-input",function(n){n.stopPropagation()}),n.fn.mousewheel&&u.mousewheel(function(n,t,i,f){var e=u.scrollTop();f>0&&0>=e-f?(u.scrollTop(0),r(n)):0>f&&u.get(0).scrollHeight-u.scrollTop()+f<=u.height()&&(u.scrollTop(u.get(0).scrollHeight-u.height()),r(n))}),g(f),f.on("keyup-change input paste",this.bind(this.updateResults)),f.on("focus",function(){f.addClass("select2-focused")}),f.on("blur",function(){f.removeClass("select2-focused")}),this.dropdown.on("mouseup",o,this.bind(function(t){n(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown",function(n){n.stopPropagation()}),n.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength),s=i.element.prop("disabled"),s===t&&(s=!1),this.enable(!s),h=i.element.prop("readonly"),h===t&&(h=!1),this.readonly(h),b=b||st(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.nextSearchTerm=t},destroy:function(){var n=this.opts.element,i=n.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),i!==t&&(i.container.remove(),i.dropdown.remove(),n.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?n.attr({tabindex:this.elementTabIndex}):n.removeAttr("tabindex"),n.show())},optionToData:function(n){return n.is("option")?{id:n.prop("value"),text:n.text(),element:n.get(),css:n.attr("class"),disabled:n.prop("disabled"),locked:u(n.attr("locked"),"locked")||u(n.data("locked"),!0)}:n.is("optgroup")?{text:n.attr("label"),children:[],element:n.get(),css:n.attr("class")}:void 0},prepareOpts:function(i){var e,o,s,r,f=this;if(e=i.element,"select"===e.get(0).tagName.toLowerCase()&&(this.select=o=i.element),o&&n.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.");}),i=n.extend({},{populateResults:function(r,u,e){var o,s=this.opts.id;o=function(r,u,h){var v,k,l,d,p,w,c,a,y,b;for(r=i.sortResults(r,u,e),v=0,k=r.length;k>v;v+=1)l=r[v],p=l.disabled===!0,d=!p&&s(l)!==t,w=l.children&&l.children.length>0,c=n("<li><\/li>"),c.addClass("select2-results-dept-"+h),c.addClass("select2-result"),c.addClass(d?"select2-result-selectable":"select2-result-unselectable"),p&&c.addClass("select2-disabled"),w&&c.addClass("select2-result-with-children"),c.addClass(f.opts.formatResultCssClass(l)),a=n(document.createElement("div")),a.addClass("select2-result-label"),b=i.formatResult(l,a,e,f.opts.escapeMarkup),b!==t&&a.html(b),c.append(a),w&&(y=n("<ul><\/ul>"),y.addClass("select2-result-sub"),o(l.children,y,h+1),c.append(y)),c.data("select2-data",l),u.append(c)},o(u,r,0)}},n.fn.select2.defaults,i),"function"!=typeof i.id&&(s=i.id,i.id=function(n){return n[s]}),n.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.data("select2Tags")}if(o?(i.query=this.bind(function(n){var i,r,u,o={results:[],more:!1},s=n.term;u=function(t,i){var r;t.is("option")?n.matcher(s,t.text(),t)&&i.push(f.optionToData(t)):t.is("optgroup")&&(r=f.optionToData(t),t.children().each2(function(n,t){u(t,r.children)}),r.children.length>0&&i.push(r))},i=e.children(),this.getPlaceholder()!==t&&i.length>0&&(r=this.getPlaceholderOption(),r&&(i=i.not(r))),i.each2(function(n,t){u(t,o.results)}),n.callback(o)}),i.id=function(n){return n.id},i.formatResultCssClass=function(n){return n.css}):"query"in i||("ajax"in i?(r=i.element.data("ajax-url"),r&&r.length>0&&(i.ajax.url=r),i.query=rt.call(i.element,i.ajax)):"data"in i?i.query=ut(i.data):"tags"in i&&(i.query=ft(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(t){return{id:n.trim(t),text:n.trim(t)}}),i.initSelection===t&&(i.initSelection=function(t,r){var f=[];n(v(t.val(),i.separator)).each(function(){var r={id:this,text:this},t=i.tags;n.isFunction(t)&&(t=t()),n(t).each(function(){if(u(this.id,r.id))return r=this,!1}),f.push(r)}),r(f)}))),"function"!=typeof i.query)throw"query function not defined for Select2 "+i.element.attr("id");return i},monitorSource:function(){var i,n=this.opts.element;n.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),i=this.bind(function(){var r=n.prop("disabled"),i;r===t&&(r=!1),this.enable(!r),i=n.prop("readonly"),i===t&&(i=!1),this.readonly(i),c(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(e(this.opts.containerCssClass)),c(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(e(this.opts.dropdownCssClass))}),n.on("propertychange.select2 DOMAttrModified.select2",i),this.mutationCallback===t&&(this.mutationCallback=function(n){n.forEach(i)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var i=n.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(i),!i.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=n.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var n=this._enabled&&!this._readonly,t=!n;return n===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=n,!0)},enable:function(n){n===t&&(n=!0),this._enabled!==n&&(this._enabled=n,this.opts.element.prop("disabled",!n),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(n){return n===t&&(n=!1),this._readonly===n?!1:(this._readonly=n,this.opts.element.prop("readonly",n),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var h,r,a,c,t=this.dropdown,u=this.container.offset(),k=this.container.outerHeight(!1),f=this.container.outerWidth(!1),l=t.outerHeight(!1),v=n(window).scrollLeft()+n(window).width(),d=n(window).scrollTop()+n(window).height(),s=u.top+k,o=u.left,y=d>=s+l,p=u.top-l>=this.body().scrollTop(),i=t.outerWidth(!1),w=v>=o+i,g=t.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(c=n(".select2-results",t)[0],t.addClass("select2-drop-auto-width"),t.css("width",""),i=t.outerWidth(!1)+(c.scrollHeight===c.clientHeight?0:b.width),i>f?f=i:i=f,w=v>=o+i):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(h=this.body().offset(),s-=h.top,o-=h.left),g?(r=!0,!p&&y&&(r=!1)):(r=!1,!y&&p&&(r=!0)),w||(o=u.left+f-i),r?(s=u.top-l,this.container.addClass("select2-drop-above"),t.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),t.removeClass("select2-drop-above")),a=n.extend({top:s,left:o,width:f},e(this.opts.dropdownCss)),t.css(a)},shouldOpen:function(){var t;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(t=n.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var t,i=this.containerId,u="scroll."+i,f="resize."+i,e="orientationchange."+i,r;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),t=n("#select2-drop-mask"),0==t.length&&(t=n(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body()),t.on("mousedown touchstart click",function(t){var i,r=n("#select2-drop");r.length>0&&(i=r.data("select2"),i.opts.selectOnBlur&&i.selectHighlighted({noFocus:!0}),i.close({focus:!1}),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),n("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active"),r=this,this.container.parents().add(window).each(function(){n(this).on(f+" "+u+" "+e,function(){r.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerId,i="scroll."+t,r="resize."+t,u="orientationchange."+t;this.container.parents().add(window).each(function(){n(this).off(i).off(r).off(u)}),this.clearDropdownAlignmentPreference(),n("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(n.Event("select2-close"))}},externalSearch:function(n){this.open(),this.search.val(n),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return e(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var e,i,r,u,o,s,f,t=this.results;if(i=this.highlight(),!(0>i)){if(0==i)return t.scrollTop(0),void 0;e=this.findHighlightableChoices().find(".select2-result-label"),r=n(e[i]),u=r.offset().top+r.outerHeight(!0),i===e.length-1&&(f=t.find("li.select2-more-results"),f.length>0&&(u=f.offset().top+f.outerHeight(!0))),o=t.offset().top+t.outerHeight(!0),u>o&&t.scrollTop(t.scrollTop()+(u-o)),s=r.offset().top-t.offset().top,0>s&&"none"!=r.css("display")&&t.scrollTop(t.scrollTop()+s)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled)")},moveHighlight:function(t){for(var r,u=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<u.length;)if(i+=t,r=n(u[i]),r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")&&!r.hasClass("select2-selected")){this.highlight(i);break}},highlight:function(t){var u,r,i=this.findHighlightableChoices();return 0===arguments.length?f(i.filter(".select2-highlighted")[0],i.get()):(t>=i.length&&(t=i.length-1),0>t&&(t=0),this.removeHighlight(),u=n(i[t]),u.addClass("select2-highlighted"),this.ensureHighlightVisible(),r=u.data("select2-data"),r&&this.opts.element.trigger({type:"select2-highlight",val:this.id(r),choice:r}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=n(t.target).closest(".select2-result-selectable"),r;i.length>0&&!i.is(".select2-highlighted")?(r=this.findHighlightableChoices(),this.highlight(r.index(i))):0==i.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var u,t=this.results,i=t.find("li.select2-more-results"),r=this.resultsPage+1,n=this,f=this.search.val(),e=this.context;0!==i.length&&(u=i.offset().top-t.offset().top-t.height(),u<=this.opts.loadMorePadding&&(i.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:r,context:e,matcher:this.opts.matcher,callback:this.bind(function(u){n.opened()&&(n.opts.populateResults.call(this,t,u.results,{term:f,page:r,context:e}),n.postprocessResults(u,!1,!1),u.more===!0?(i.detach().appendTo(t).text(n.opts.formatLoadMore(r+1)),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):i.remove(),n.positionDropdown(),n.resultsPage=r,n.context=u.context,this.opts.element.trigger({type:"select2-loaded",items:u}))})})))},tokenize:function(){},updateResults:function(i){function v(){f.removeClass("select2-active"),e.positionDropdown()}function s(n){c.html(n),v()}var a,h,y,f=this.search,c=this.results,r=this.opts,e=this,p=f.val(),w=n.data(this.container,"select2-last-term"),l;if((i===!0||!w||!u(p,w))&&(n.data(this.container,"select2-last-term",p),i===!0||this.showSearchInput!==!1&&this.opened())){if(y=++this.queryCount,l=this.getMaximumSelectionSize(),l>=1&&(a=this.data(),n.isArray(a)&&a.length>=l&&o(r.formatSelectionTooBig,"formatSelectionTooBig")))return s("<li class='select2-selection-limit'>"+r.formatSelectionTooBig(l)+"<\/li>"),void 0;if(f.val().length<r.minimumInputLength)return o(r.formatInputTooShort,"formatInputTooShort")?s("<li class='select2-no-results'>"+r.formatInputTooShort(f.val(),r.minimumInputLength)+"<\/li>"):s(""),i&&this.showSearch&&this.showSearch(!0),void 0;if(r.maximumInputLength&&f.val().length>r.maximumInputLength)return o(r.formatInputTooLong,"formatInputTooLong")?s("<li class='select2-no-results'>"+r.formatInputTooLong(f.val(),r.maximumInputLength)+"<\/li>"):s(""),void 0;r.formatSearching&&0===this.findHighlightableChoices().length&&s("<li class='select2-searching'>"+r.formatSearching()+"<\/li>"),f.addClass("select2-active"),this.removeHighlight(),h=this.tokenize(),h!=t&&null!=h&&f.val(h),this.resultsPage=1,r.query({element:r.element,term:f.val(),page:this.resultsPage,context:null,matcher:r.matcher,callback:this.bind(function(h){var l;if(y==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(this.context=h.context===t?null:h.context,this.opts.createSearchChoice&&""!==f.val()&&(l=this.opts.createSearchChoice.call(e,f.val(),h.results),l!==t&&null!==l&&e.id(l)!==t&&null!==e.id(l)&&0===n(h.results).filter(function(){return u(e.id(this),e.id(l))}).length&&h.results.unshift(l)),0===h.results.length&&o(r.formatNoMatches,"formatNoMatches"))return s("<li class='select2-no-results'>"+r.formatNoMatches(f.val())+"<\/li>"),void 0;c.empty(),e.opts.populateResults.call(this,c,h.results,{term:f.val(),page:this.resultsPage,context:null}),h.more===!0&&o(r.formatLoadMore,"formatLoadMore")&&(c.append("<li class='select2-more-results'>"+e.opts.escapeMarkup(r.formatLoadMore(this.resultsPage))+"<\/li>"),window.setTimeout(function(){e.loadMoreIfNeeded()},10)),this.postprocessResults(h,i),v(),this.opts.element.trigger({type:"select2-loaded",items:h})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){at(this.search)},selectHighlighted:function(n){var i=this.highlight(),r=this.results.find(".select2-highlighted"),t=r.closest(".select2-result").data("select2-data");t?(this.highlight(i),this.onSelect(t,n)):n&&n.noFocus&&this.close()},getPlaceholder:function(){var n;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((n=this.getPlaceholderOption())!==t?n.text():t)},getPlaceholderOption:function(){if(this.select){var n=this.select.children().first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&n||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===n.text()&&""===n.val())return n}},initContainerWidth:function(){function r(){var i,f,r,u,e;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(i=this.opts.element.attr("style"),i!==t)for(f=i.split(";"),u=0,e=f.length;e>u;u+=1)if(r=f[u].replace(/\s/g,"").match(/[^-]width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==r&&r.length>=1)return r[1];return"resolve"===this.opts.width?(i=this.opts.element.css("width"),i.indexOf("%")>0?i:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return n.isFunction(this.opts.width)?this.opts.width():this.opts.width}var i=r.call(this);null!==i&&this.container.css("width",i)}}),p=y(l,{createContainer:function(){return n(document.createElement("div")).attr({"class":"select2-container"}).html("<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>   <span class='select2-chosen'>&nbsp;<\/span><abbr class='select2-search-choice-close'><\/abbr>   <span class='select2-arrow'><b><\/b><\/span><\/a><input class='select2-focusser select2-offscreen' type='text'/><div class='select2-drop select2-display-none'>   <div class='select2-search'>       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>   <\/div>   <ul class='select2-results'>   <\/ul><\/div>")},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,r,u;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),i=this.search.get(0),i.createTextRange?(r=i.createTextRange(),r.collapse(!1),r.select()):i.setSelectionRange&&(u=this.search.val().length,i.setSelectionRange(u,u)),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(n.Event("select2-open"))},close:function(n){this.opened()&&(this.parent.close.apply(this,arguments),n=n||{focus:!0},this.focusser.removeAttr("disabled"),n.focus&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},destroy:function(){n("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var t,u=this.container,f=this.dropdown;this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=u.find(".select2-choice"),this.focusser=u.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+a()),n("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(n){if(this.isInterfaceEnabled()){if(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN)return r(n),void 0;switch(n.which){case i.UP:case i.DOWN:return this.moveHighlight(n.which===i.UP?-1:1),r(n),void 0;case i.ENTER:return this.selectHighlighted(),r(n),void 0;case i.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case i.ESC:return this.cancel(n),r(n),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(n){if(this.isInterfaceEnabled()&&n.which!==i.TAB&&!i.isControl(n)&&!i.isFunctionKey(n)&&n.which!==i.ESC)return this.opts.openOnEnter===!1&&n.which===i.ENTER?(r(n),void 0):n.which==i.DOWN||n.which==i.UP||n.which==i.ENTER&&this.opts.openOnEnter?n.altKey||n.ctrlKey||n.shiftKey||n.metaKey?void 0:(this.open(),r(n),void 0):n.which==i.DELETE||n.which==i.BACKSPACE?(this.opts.allowClear&&this.clear(),r(n),void 0):void 0})),g(this.focusser),this.focusser.on("keyup-change input",this.bind(function(n){if(this.opts.minimumResultsForSearch>=0){if(n.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown","abbr",this.bind(function(n){this.isInterfaceEnabled()&&(this.clear(),yt(n),this.close(),this.selection.focus())})),t.on("mousedown",this.bind(function(t){this.container.hasClass("select2-container-active")||this.opts.element.trigger(n.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),r(t)})),f.on("mousedown",this.bind(function(){this.search.focus()})),t.on("focus",this.bind(function(n){r(n)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(n.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(n.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(n.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data"),r,u;if(i){if(r=n.Event("select2-clearing"),this.opts.element.trigger(r),r.isDefaultPrevented())return;u=this.getPlaceholderOption(),this.opts.element.val(u?u.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),t!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(n.updateSelection(i),n.close(),n.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var n;return this.getPlaceholder()?(n=this.getPlaceholderOption())!==t&&n.is(":selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val():!1},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(n,t){var r=n.find(":selected");t(i.optionToData(r))}:"data"in t&&(t.initSelection=t.initSelection||function(i,r){var e=i.val(),f=null;t.query({matcher:function(n,i,r){var o=u(e,t.id(r));return o&&(f=r),o},callback:n.isFunction(r)?function(){r(f)}:n.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var n=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&n!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(n)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(n,t,i){var r=0,e=this,f;(this.findHighlightableChoices().each2(function(n,t){if(u(e.id(t.data("select2-data")),e.opts.element.val()))return r=n,!1}),i!==!1&&(t===!0&&r>=0?this.highlight(r):this.highlight(0)),t===!0)&&(f=this.opts.minimumResultsForSearch,f>=0&&this.showSearch(et(n.results)>=f))},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),n(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(n,t){if(this.triggerSelect(n)){var i=this.opts.element.val(),r=this.data();this.opts.element.val(this.id(n)),this.updateSelection(n),this.opts.element.trigger({type:"select2-selected",val:this.id(n),choice:n}),this.nextSearchTerm=this.opts.nextSearchTerm(n,this.search.val()),this.close(),t&&t.noFocus||this.focusser.focus(),u(i,this.id(n))||this.triggerChange({added:n,removed:r})}},updateSelection:function(n){var r,u,i=this.selection.find(".select2-chosen");this.selection.data("select2-data",n),i.empty(),null!==n&&(r=this.opts.formatSelection(n,i,this.opts.escapeMarkup)),r!==t&&i.append(r),u=this.opts.formatSelectionCssClass(n,i),u!==t&&i.addClass(u),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var i,r=!1,u=null,n=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(i=arguments[0],arguments.length>1&&(r=arguments[1]),this.select)this.select.val(i).find(":selected").each2(function(t,i){return u=n.optionToData(i),!1}),this.updateSelection(u),this.setPlaceholder(),r&&this.triggerChange({added:u,removed:f});else{if(!i&&0!==i)return this.clear(r),void 0;if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(i),this.opts.initSelection(this.opts.element,function(t){n.opts.element.val(t?n.id(t):""),n.updateSelection(t),n.setPlaceholder(),r&&n.triggerChange({added:t,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(n){var i,r=!1;return 0===arguments.length?(i=this.selection.data("select2-data"),i==t&&(i=null),i):(arguments.length>1&&(r=arguments[1]),n?(i=this.data(),this.opts.element.val(n?this.id(n):""),this.updateSelection(n),r&&this.triggerChange({added:n,removed:i})):this.clear(r),void 0)}}),w=y(l,{createContainer:function(){return n(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html("<ul class='select2-choices'>  <li class='select2-search-field'>    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>  <\/li><\/ul><div class='select2-drop select2-drop-multi select2-display-none'>   <ul class='select2-results'>   <\/ul><\/div>")},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(n,t){var r=[];n.find(":selected").each2(function(n,t){r.push(i.optionToData(t))}),t(r)}:"data"in t&&(t.initSelection=t.initSelection||function(i,r){var e=v(i.val(),t.separator),f=[];t.query({matcher:function(i,r,o){var s=n.grep(e,function(n){return u(n,t.id(o))}).length;return s&&f.push(o),s},callback:n.isFunction(r)?function(){for(var h,n,s,o=[],i=0;i<e.length;i++)for(h=e[i],n=0;n<f.length;n++)if(s=f[n],u(h,t.id(s))){o.push(s),f.splice(n,1);break}r(o)}:n.noop})}),t},selectChoice:function(n){var t=this.container.find(".select2-search-choice-focus");t.length&&n&&n[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),n&&n.length&&(this.close(),n.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",n)))},destroy:function(){n("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var t,u=".select2-choices",f;this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(u),f=this,this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){f.search[0].focus(),f.selectChoice(n(this))}),this.search.attr("id","s2id_autogen"+a()),n("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(n){var u;if(this.isInterfaceEnabled()){++this.keydowns;var f=t.find(".select2-search-choice-focus"),o=f.prev(".select2-search-choice:not(.select2-locked)"),e=f.next(".select2-search-choice:not(.select2-locked)"),s=vt(this.search);if(f.length&&(n.which==i.LEFT||n.which==i.RIGHT||n.which==i.BACKSPACE||n.which==i.DELETE||n.which==i.ENTER))return u=f,n.which==i.LEFT&&o.length?u=o:n.which==i.RIGHT?u=e.length?e:null:n.which===i.BACKSPACE?(this.unselect(f.first()),this.search.width(10),u=o.length?o:e):n.which==i.DELETE?(this.unselect(f.first()),this.search.width(10),u=e.length?e:null):n.which==i.ENTER&&(u=null),this.selectChoice(u),r(n),u&&u.length||this.open(),void 0;if((n.which===i.BACKSPACE&&1==this.keydowns||n.which==i.LEFT)&&0==s.offset&&!s.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),r(n),void 0;if(this.selectChoice(null),this.opened())switch(n.which){case i.UP:case i.DOWN:return this.moveHighlight(n.which===i.UP?-1:1),r(n),void 0;case i.ENTER:return this.selectHighlighted(),r(n),void 0;case i.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case i.ESC:return this.cancel(n),r(n),void 0}if(n.which!==i.TAB&&!i.isControl(n)&&!i.isFunctionKey(n)&&n.which!==i.BACKSPACE&&n.which!==i.ESC){if(n.which===i.ENTER){if(this.opts.openOnEnter===!1)return;if(n.altKey||n.ctrlKey||n.shiftKey||n.metaKey)return}this.open(),(n.which===i.PAGE_UP||n.which===i.PAGE_DOWN)&&r(n),n.which===i.ENTER&&r(n)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(n.Event("select2-blur"))})),this.container.on("click",u,this.bind(function(t){this.isInterfaceEnabled()&&(n(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(n.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",u,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(n.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var n=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(n.updateSelection(i),n.close(),n.clearSearch())})}},clearSearch:function(){var n=this.getPlaceholder(),i=this.getMaxSearchWidth();n!==t&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(n).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(n.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var r=[],u=[],i=this;n(t).each(function(){f(i.id(this),r)<0&&(r.push(i.id(this)),u.push(this))}),t=u,this.selection.find(".select2-search-choice").remove(),n(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var n=this.search.val();n=this.opts.tokenizer.call(this,n,this.data(),this.bind(this.onSelect),this.opts),null!=n&&n!=t&&(this.search.val(n),n.length>0&&this.open())},onSelect:function(n,t){this.triggerSelect(n)&&(this.addSelectedChoice(n),this.opts.element.trigger({type:"selected",val:this.id(n),choice:n}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(n,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:n}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var f,e,o=!i.locked,h=n("<li class='select2-search-choice'>    <div><\/div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'><\/a><\/li>"),c=n("<li class='select2-search-choice select2-locked'><div><\/div><\/li>"),u=o?h:c,l=this.id(i),s=this.getVal();f=this.opts.formatSelection(i,u.find("div"),this.opts.escapeMarkup),f!=t&&u.find("div").replaceWith("<div>"+f+"<\/div>"),e=this.opts.formatSelectionCssClass(i,u.find("div")),e!=t&&u.addClass(e),o&&u.find(".select2-search-choice-close").on("mousedown",r).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(n(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(n(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),r(t))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),u.data("select2-data",i),u.insertBefore(this.searchContainer),s.push(l),this.setVal(s)},unselect:function(n){var t,r,i=this.getVal();if(n=n.closest(".select2-search-choice"),0===n.length)throw"Invalid argument: "+n+". Must be .select2-search-choice";if(t=n.data("select2-data")){for(;(r=f(this.id(t),i))>=0;)i.splice(r,1),this.setVal(i),this.select&&this.postprocessResults();n.remove(),this.opts.element.trigger({type:"removed",val:this.id(t),choice:t}),this.triggerChange({removed:t})}},postprocessResults:function(n,t,i){var e=this.getVal(),u=this.results.find(".select2-result"),s=this.results.find(".select2-result-with-children"),r=this;u.each2(function(n,t){var i=r.id(t.data("select2-data"));f(i,e)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),s.each2(function(n,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&i!==!1&&r.highlight(0),!this.opts.createSearchChoice&&!u.filter(".select2-result:not(.select2-selected)").length>0&&(!n||n&&!n.more&&0===this.results.find(".select2-no-results").length)&&o(r.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+r.opts.formatNoMatches(r.search.val())+"<\/li>")},getMaxSearchWidth:function(){return this.selection.width()-d(this.search)},resizeSearch:function(){var i,u,t,f,n,r=d(this.search);i=pt(this.search)+10,u=this.search.offset().left,t=this.selection.width(),f=this.selection.offset().left,n=t-(u-f)-r,i>n&&(n=t-r),40>n&&(n=t-r),0>=n&&(n=i),this.search.width(Math.floor(n))},getVal:function(){var n;return this.select?(n=this.select.val(),null===n?[]:n):(n=this.opts.element.val(),v(n,this.opts.separator))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],n(t).each(function(){f(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(n,t){for(var i,t=t.slice(0),n=n.slice(0),r=0;r<t.length;r++)for(i=0;i<n.length;i++)u(this.opts.id(t[r]),this.opts.id(n[i]))&&(t.splice(r,1),r--,n.splice(i,1),i--);return{added:t,removed:n}},val:function(i,r){var u,f=this;if(0===arguments.length)return this.getVal();if(u=this.data(),u.length||(u=[]),!i&&0!==i)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange({added:this.data(),removed:u}),void 0;if(this.setVal(i),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange(this.buildChangeDetails(u,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var i=n.map(t,f.id);f.setVal(i),f.updateSelection(t),f.clearSearch(),r&&f.triggerChange(f.buildChangeDetails(u,this.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(n(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,i){var r,u,f=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return n(this).data("select2-data")}).get():(u=this.data(),t||(t=[]),r=n.map(t,function(n){return f.opts.id(n)}),this.setVal(r),this.updateSelection(t),this.clearSearch(),i&&this.triggerChange(this.buildChangeDetails(u,this.data())),void 0)}}),n.fn.select2=function(){var r,u,e,o,s,i=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],l=["opened","isFocused","container","dropdown"],a=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===i.length||"object"==typeof i[0])r=0===i.length?{}:n.extend({},i[0]),r.element=n(this),"select"===r.element.get(0).tagName.toLowerCase()?s=r.element.prop("multiple"):(s=r.multiple||!1,"tags"in r&&(r.multiple=s=!0)),u=s?new w:new p,u.init(r);else{if("string"!=typeof i[0])throw"Invalid arguments to select2 plugin: "+i;if(f(i[0],c)<0)throw"Unknown method: "+i[0];if(o=t,u=n(this).data("select2"),u===t)return;if(e=i[0],"container"===e?o=u.container:"dropdown"===e?o=u.dropdown:(h[e]&&(e=h[e]),o=u[e].apply(u,i.slice(1))),f(i[0],l)>=0||f(i[0],a)&&1==i.length)return!1}}),o===t?this:o},n.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(n,t,i,r){var u=[];return tt(n.text,i.term,u,r),u.join("")},formatSelection:function(n,i,r){return n?r(n.text):t},sortResults:function(n){return n},formatResultCssClass:function(){return t},formatSelectionCssClass:function(){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(n,t){var i=t-n.length;return"Please enter "+i+" more character"+(1==i?"":"s")},formatInputTooLong:function(n,t){var i=n.length-t;return"Please delete "+i+" character"+(1==i?"":"s")},formatSelectionTooBig:function(n){return"You can only select "+n+" item"+(1==n?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(n){return n.id},matcher:function(n,t){return h(""+t).toUpperCase().indexOf(h(""+n).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:wt,escapeMarkup:it,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(n){return n},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return t}},n.fn.select2.ajaxDefaults={transport:n.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:rt,local:ut,tags:ft},util:{debounce:nt,markMatch:tt,escapeMarkup:it,stripDiacritics:h},"class":{abstract:l,single:p,multi:w}}}}(jQuery)