PageSourceSearch

https://www.keyence.com.cn/js/core/scripts.js?var=20261006143014

js keyence.com.cn collected 2026-10-08 03:28:07 UTC 195,918 bytes, 3,482 lines download raw bytes

1/* License --------------------------------------------- */
2
3/* 1.jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
4 *
5 * Uses the built in easing capabilities added In jQuery 1.1
6 * to offer multiple easing options
7 *
8 * TERMS OF USE - jQuery Easing
9 *
10 * Open source under the BSD License.
11 *
12 * Copyright (c) 2008 George McGinley Smith
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without modification,
16 * are permitted provided that the following conditions are met:
17 *
18 * Redistributions of source code must retain the above copyright notice, this list of
19 * conditions and the following disclaimer.
20 * Redistributions in binary form must reproduce the above copyright notice, this list
21 * of conditions and the following disclaimer in the documentation and/or other materials
22 * provided with the distribution.
23 *
24 * Neither the name of the author nor the names of contributors may be used to endorse
25 * or promote products derived from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
28 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
30 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
32 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
33 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
35 * OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 * TERMS OF USE - EASING EQUATIONS
38 *
39 * Open source under the BSD License.
40 *
41 * Copyright (c) 2001 Robert Penner
42 * All rights reserved.
43 *
44 * Redistribution and use in source and binary forms, with or without modification,
45 * are permitted provided that the following conditions are met:
46 *
47 * Redistributions of source code must retain the above copyright notice, this list of
48 * conditions and the following disclaimer.
49 * Redistributions in binary form must reproduce the above copyright notice, this list
50 * of conditions and the following disclaimer in the documentation and/or other materials
51 * provided with the distribution.
52 *
53 * Neither the name of the author nor the names of contributors may be used to endorse
54 * or promote products derived from this software without specific prior written permission.
55 *
56 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
57 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
58 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
59 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
60 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
61 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
62 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
63 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
64 * OF THE POSSIBILITY OF SUCH DAMAGE.
65 -------------------------------------------------------- */
66/* 2.jCarousel - Riding carousels with jQuery
67 *   http://sorgalla.com/jcarousel/
68 *
69 * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
70 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
71 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
72 *
73 * Built on top of the jQuery library
74 *   http://jquery.com
75 *
76 * Inspired by the "Carousel Component" by Bill Scott
77 *   http://billwscott.com/carousel/
78  -------------------------------------------------------- */
79/* 3.ColorBox
80 * ColorBox v1.3.20.1 - jQuery lightbox plugin
81 * (c) 2011 Jack Moore - jacklmoore.com
82 * License: http://www.opensource.org/licenses/mit-license.php
83-------------------------------------------------------- */
84/* 4.jq.ui.checks
85 * @version      0.43
86 * @author       nori ([email protected])
87 * @copyright    5509 (http://5509.hatenablog.com/)
88 * @license      The MIT License
89 * @link         https://github.com/5509/jq.ui.checks
90 *
91 * 2012-04-04 02:43
92 -------------------------------------------------------- */
93/* 5.jQselectable
94 *
95 * @version      3.1
96 * @author       nori ([email protected])
97 * @copyright    5509 (http://5509.hatenablog.com/)
98 * @license      The MIT License
99 * @link         https://github.com/5509/jQselectable
100 *
101 * 2012-04-10 19:50
102 -------------------------------------------------------- */
103/* 6.jQuery Cycle Plugin (with Transition Definitions)
104 * Examples and documentation at: http://jquery.malsup.com/cycle/
105 * Copyright (c) 2007-2010 M. Alsup
106 * Version: 2.9999.8 (26-OCT-2012)
107 * Dual licensed under the MIT and GPL licenses.
108 * http://jquery.malsup.com/license.html
109 * Requires: jQuery v1.3.2 or later
110 ---------------------------------------------------------------- */
111/* 7.jQuery Cycle Plugin Transition Definitions
112 * This script is a plugin for the jQuery Cycle Plugin
113 * Examples and documentation at: http://malsup.com/jquery/cycle/
114 * Copyright (c) 2007-2010 M. Alsup
115 * Version:	 2.73
116 * Dual licensed under the MIT and GPL licenses:
117 * http://www.opensource.org/licenses/mit-license.php
118 * http://www.gnu.org/licenses/gpl.html
119 ---------------------------------------------------------------- */
120/* 8.Color animation 20120928 http://www.bitstorm.org/jquery/color-animation/ Copyright 2011, 2012 Edwin Martin <[email protected]> Released under the MIT and GPL licenses.
121 ---------------------------------------------------------------- */
122/* 9.SWFObject v2.2 <http://code.google.com/p/swfobject/>
123 is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
124 ---------------------------------------------------------------- */
125/* 10.jQuery Cookie Plugin v1.3
126 * https://github.com/carhartl/jquery-cookie
127 *
128 * Copyright 2011, Klaus Hartl
129 * Dual licensed under the MIT or GPL Version 2 licenses.
130 * http://www.opensource.org/licenses/mit-license.php
131 * http://www.opensource.org/licenses/GPL-2.0
132 -------------------------------------------------------- */
133/*
134 * 11.jQuery Show Password Plugin
135 * http://github.com/davist11/jQuery-Show-Password
136 *
137 * Copyright (c) 2010 Trevor Davis (http://trevordavis.net)
138 * Dual licensed under the MIT and GPL licenses.
139 * Uses the same license as jQuery, see:
140 * http://jquery.org/license
141 *
142 * @version 0.3
143 *
144 * 2015/06/16 MLC modified
145 */
146/* Scripts --------------------------------------------- */
147/* Browser Distinction
148-------------------------------------------------------- */
149var kpi_htmlObject=$("html");kpi_htmlObject.addClass("js");
150var kpi_ua=function(){return{ltIE6:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.documentElement.style.maxHeight,ltIE7:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.querySelectorAll,ltIE8:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:!document.uniqueID&&!window.opera&&!window.sidebar&&window.localStorage&&"undefined"==typeof window.orientation,
151	Mobile:"undefined"!=typeof window.orientation}}();kpi_ua.ltIE6?kpi_htmlObject.addClass("ie6"):kpi_ua.ltIE7?kpi_htmlObject.addClass("ie7"):kpi_ua.ltIE8?kpi_htmlObject.addClass("ie8"):kpi_ua.Webkit?kpi_htmlObject.addClass("webkit"):kpi_ua.Firefox?kpi_htmlObject.addClass("firefox"):kpi_ua.Opera?kpi_htmlObject.addClass("opera"):kpi_ua.IE&&!kpi_ua.ltIE8?kpi_htmlObject.addClass("gtie9"):kpi_ua.Mobile&&kpi_htmlObject.addClass("smartphone");
152/* Tab Change
153 ---------------------------------------------------------------- */
154(function(a){a.fn.tabChange=function(c){c=a.extend({selected:0},c);a(this);var b=a(this).children("dl").attr("class");return this.each(function(e){if(!a("ul."+b,this).length){a(this).prepend('<ul class="'+b+'"></ul>');var g=a(this).children("dl").children("dt").length;for(h=0;h<g;h++){var i=a(this).children("dl").children("dt").attr("class");a("ul."+b,this).append('<li class="'+i+'"><a href="javascript:void(0);">'+a(this).children("dl."+b).children("dt").eq(h).html()+"</a></li>")}a(this).children("dl."+ b).children("dd").css("display","none");a(this).attr({id:"tabSwitching"+ ++e});var d=a("#tabSwitching"+e).children("ul."+b).children("li"),f=a("#tabSwitching"+e).children("dl."+b).children("dd");d.eq(c.selected).addClass("Current");f.eq(c.selected).addClass("Current").css("display","block");d.on("click",function(){var b=d.index(this);d.removeClass("Current");a(this).addClass("Current");f.removeClass("Current").css("display","none");f.eq(b).addClass("Current").css("display","block")})}})}})(jQuery);
155/* JQuery Place Holder
156 ---------------------------------------------------------------- */
157(function(c){c.fn.kpiplaceholder=function(d){d=c.extend({pickup:"title"},d);return this.each(function(){var a=c(this),b=a.attr(d.pickup);a.val()||(a.val(b),a.css("color","#999"));a.on('focus',function(){this.value==b&&a.val("").css("color","#333")});a.on('blur',function(){""==this.value&&a.val(b).css("color","#999");this.value!=b&&a.css("color","#333")});a.closest("form").on('submit',function(){if(a.val()==b)return a.val(""),!0})})}})(jQuery);
158/* Flex Grip Wrap
159 ---------------------------------------------------------------- */
160(function(b){b.fn.unifyBoxHeight=function(a){a=b.extend({wrapCol:".Col",target:".AdjustHeightTarget"},a);return this.each(function(){var d=0,e=[],c=[];b(this).find(a.wrapCol).each(function(){d++});for(j=0;20>j;j++)e[j]=[];for(i=0;i<d;i++)b(this).children(a.wrapCol).eq(i).find(a.target).each(function(a){e[a][i]=b(this).height();c[i]=a}),c[i]+=1;for(k=0;k<d;k++)for(l=0;l<c[k];l++){var f=Math.max.apply(null,e[l]);b(this).children(a.wrapCol).eq(k).find(a.target).eq(l).css({"min-height":f+"px"})}})}})(jQuery);
161/* Result Count Animation
162 ---------------------------------------------------------------- */
163(function(f){f.fn.extend({airport:function(a){function g(k,h,c,d){if(c>=a.length){switch(!0){case 10>b.text():b.addClass("Lt10");break;case 20>b.text():b.addClass("Lt20");break;case 50>b.text():b.addClass("Lt50")}clearTimeout(j)}else if(d>=e)var j=setTimeout(function(){g(0,0,c+1,0)},1E3);else f(b).find(".c"+k).html(" "==l[h]?"&nbsp;":l[h]),setTimeout(function(){h>l.length?g(k+1,0,c,d+1):l[h]!=a[c].substring(d,d+1).toLowerCase()?g(k,h+1,c,d):g(k+1,0,c,d+1)},40)}var b=f(this),l="9876543210 -".split(""),
164	e=0,j=items2=a.length;for(f(this).empty();j--;)a[j].length>e&&(e=a[j].length);for(;items2--;)a[items2]+=Array(e-a[items2].length+1).join(" ");for(spans=e;spans--;)f(this).prepend("<span class='c"+spans+"'>9</span>");for(i=0;i<e;i++)g(i,0,0,0)}})})(jQuery);
165/* Highlight Search Words for Certified Models
166 ---------------------------------------------------------------- */
167$.fn.kpi_replaceText=function(e,f,g){return this.each(function(){var a=this.firstChild,c,b,d=[];if(a){do 3==a.nodeType&&(c=a.nodeValue,b=c.replace(e,f),b!==c&&(!g&&/</.test(b)?($(a).before(b),d.push(a)):a.nodeValue=b));while(a=a.nextSibling)}d.length&&$(d).remove()})};$.fn.kpi_removeHighlight=function(){return this.find("span.HighLight").each(function(){with(this.parentNode)replaceChild(this.firstChild,this).normalize(),normalize()})};
168/* 1.JQuery Easing Plugin
169---------------------------------------------------------------- */
170!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,o=1.70158,c=1.525*o,s=2*a/3,f=2*a/4.5;return n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2}
170,easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-t(2,20*n-10)*r((20*n-11.125)*f)/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return 2.70158*n*n*n-o*n*n},easeOutBack:function(n){return 1+2.70158*t(n-1,3)+o*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-c)/2:(t(2*n-2,2)*((c+1)*(2*n-2)+c)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}}),n});
171/* 2. JCarousel
172---------------------------------------------------------------- */
173(function(g){var r={vertical:!1,rtl:!1,imagelist:!1,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,setupCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,animationStepCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click", buttonNextCallback:null,buttonPrevCallback:null,itemFallbackDimension:null},n=!1;g(window).on("load.jcarousel",function(){n=!0});g.jcarousel=function(a,c){this.options=g.extend({},r,c||{});this.autoStopped=this.locked=!1;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||void 0===c.rtl)this.options.rtl="rtl"==(g(a).attr("dir")||g("html").attr("dir")||"").toLowerCase();this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical? this.options.rtl?"right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(-1!=d[f].indexOf("jcarousel-skin")){g(a).removeClass(d[f]);b=d[f];break}"UL"==a.nodeName.toUpperCase()||"OL"==a.nodeName.toUpperCase()?(this.list=g(a),this.clip=this.list.parents(".jcarousel-clip"),this.container=this.list.parents(".jcarousel-container")):(this.container=g(a),this.list=this.container.find("ul,ol").eq(0),this.clip=this.container.find(".jcarousel-clip"));0===this.clip.length&&(this.clip= this.list.wrap("<div></div>").parent());0===this.container.length&&(this.container=this.clip.wrap("<div></div>").parent());""!==b&&-1==this.container.parent()[0].className.indexOf("jcarousel-skin")&&this.container.wrap('<div class=" '+b+'"></div>');this.buttonPrev=g(".jcarousel-prev",this.container);0===this.buttonPrev.length&&null!==this.options.buttonPrevHTML&&(this.buttonPrev=g(this.options.buttonPrevHTML).appendTo(this.container));this.buttonPrev.addClass(this.className("jcarousel-prev"));this.buttonNext= g(".jcarousel-next",this.container);0===this.buttonNext.length&&null!==this.options.buttonNextHTML&&(this.buttonNext=g(this.options.buttonNextHTML).appendTo(this.container));this.buttonNext.addClass(this.className("jcarousel-next"));this.clip.addClass(this.className("jcarousel-clip")).css({position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden",position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"}); !this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=null!==this.options.visible?Math.ceil(this.clipping()/this.options.visible):null,b=this.list.children("li"),e=this;if(0<b.length){var h=0,i=this.options.offset;b.each(function(){e.format(this,i++);h+=e.dimension(this,j)});this.list.css(this.wh,h+100+"px");if(!c||void 0===c.size)this.options.size=b.length}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display", "block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.resizeTimer&&clearTimeout(e.resizeTimer);e.resizeTimer=setTimeout(function(){e.reload()},100)};null!==this.options.initCallback&&this.options.initCallback(this,"init");!n&&(window.navigator.userAgent.toLowerCase().indexOf('safari') !== -1 && window.navigator.userAgent.toLowerCase().indexOf('chrome') === -1 && window.navigator.userAgent.toLowerCase().indexOf('edge') === -1)?(this.buttons(!1,!1),g(window).on("load.jcarou
173sel",function(){e.setup()})):this.setup()};var f=g.jcarousel;f.fn=f.prototype={jcarousel:"0.2.8"};f.fn.extend=f.extend=g.extend;f.fn.extend({setup:function(){this.prevLast= this.prevFirst=this.last=this.first=null;this.animating=!1;this.tail=this.resizeTimer=this.timer=null;this.inTail=!1;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,!0);this.prevFirst=this.prevLast=null;this.animate(a,!1);g(window).off("resize.jcarousel",this.funcResize).on("resize.jcarousel",this.funcResize);null!==this.options.setupCallback&&this.options.setupCallback(this)}},reset:function(){this.list.empty();this.list.css(this.lt, "0px");this.list.css(this.wh,"10px");null!==this.options.initCallback&&this.options.initCallback(this,"reset");this.setup()},reload:function(){null!==this.tail&&this.inTail&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=!1;null!==this.options.reloadCallback&&this.options.reloadCallback(this);if(null!==this.options.visible){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0;this.list.children("li").each(function(f){b+=a.dimension(this, c);f+1<a.first&&(d=b)});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,!1)},lock:function(){this.locked=!0;this.buttons()},unlock:function(){this.locked=!1;this.buttons()},size:function(a){void 0!==a&&(this.options.size=a,this.locked||this.buttons());return this.options.size},has:function(a,c){if(void 0===c||!c)c=a;null!==this.options.size&&c>this.options.size&&(c=this.options.size);for(var b=a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return!1}return!0}, get:function(a){return g(">.jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,q=g(c);if(0===b.length)for(var j,e=f.intval(a),b=this.create(a);;){if(j=this.get(--e),0>=e||j.length){0>=e?this.list.prepend(b):j.after(b);break}}else d=this.dimension(b);"LI"==q.get(0).nodeName.toUpperCase()?(b.replaceWith(q),b=q):b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")),a);q=null!==this.options.visible?Math.ceil(this.clipping()/this.options.visible): null;d=this.dimension(b,q)-d;0<a&&a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,f.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(c.length&&!(a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,f.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,f.intval(this.list.css(this.wh))-b+"px")}},next:function(){null!==this.tail&&!this.inTail?this.scrollTail(!1): this.scroll(("both"==this.options.wrap||"last"==this.options.wrap)&&null!==this.options.size&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){null!==this.tail&&this.inTail?this.scrollTail(!0):this.scroll(("both"==this.options.wrap||"first"==this.options.wrap)&&null!==this.options.size&&1==this.first?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!this.locked&&!this.animating&&this.tail){this.pauseAuto();var c=f.intval(this.list.css(this.lt)), c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){!this.locked&&!this.animating&&(this.pauseAuto(),this.animate(this.pos(a),c))},pos:function(a,c){var b=f.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;"circular"!=this.options.wrap&&(a=1>a?1:this.options.size&&a>this.options.size?this.options.size:a);for(var d=this.first>a,g="circular"!=this.options.wrap&&1>=this.first?1:this.first,j=d?this.get(g): this.get(this.last),e=d?g:g-1,h=null,i=0,k=!1,m=0;d?--e>=a:++e<a;){h=this.get(e);k=!h.length;if(0===h.length&&(h=this.create(e).addClass(this.className("jcarousel-item-placeholder")),j[d?"before":"after"](h),null!==this.first&&"circular"==this.options.wrap&&null!==this.options.size&&(0>=e||e>this.options.size)))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)));j=h;m=this.dimension(h);k&&(i+=m);if(null!==this.first&&("circular"==this.options.wrap||1<=e&&(null===this.options.size||e<= this.options.size)))b=d?b+m:b-m}for(var g=this.clipping(),n=[],p=0,l=0,j=this.get(a-1),e=a;++p;){h=this.get(e);k=!h.length;if(0===h.length){h=this.create(e).addClass(this.className("jcarousel-item-placeholder"));if(0===j.length)this.list.prepend(h);else j[d?"before":"after"](h);if(null!==this.first&&"circular"==this.options.wrap&&null!==this.options.size&&(0>=e||e>this.options.size))j=this.get(this.index(e)),j.length&&(h=this.add(e,j.clone(!0)))}j=h;m=this.dimension(h);if(0===m)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");
173 "circular"!=this.options.wrap&&null!==this.options.size&&e>this.options.size?n.push(h):k&&(i+=m);l+=m;if(l>=g)break;e++}for(h=0;h<n.length;h++)n[h].remove();0<i&&(this.list.css(this.wh,this.dimension(this.list)+i+"px"),d&&(b-=i,this.list.css(this.lt,f.intval(this.list.css(this.lt))-i+"px")));i=a+p-1;"circular"!=this.options.wrap&&(this.options.size&&i>this.options.size)&&(i=this.options.size);if(e>i){p=0;e=i;for(l=0;++p;){h=this.get(e--);if(!h.length)break;l+=this.dimension(h);if(l>=g)break}}e=i- p+1;"circular"!=this.options.wrap&&1>e&&(e=1);this.inTail&&d&&(b+=this.tail,this.inTail=!1);this.tail=null;"circular"!=this.options.wrap&&(i==this.options.size&&1<=i-p+1)&&(d=f.intval(this.get(i).css(!this.options.vertical?"marginRight":"marginBottom")),l-d>g&&(this.tail=l-g-d));c&&(a===this.options.size&&this.tail)&&(b-=this.tail,this.inTail=!0);for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=i;return b},animate:function(a,c){if(!this.locked&& !this.animating){this.animating=!0;var b=this,d=function(){b.animating=!1;0===a&&b.list.css(b.lt,0);!b.autoStopped&&("circular"==b.options.wrap||"both"==b.options.wrap||"last"==b.options.wrap||null===b.options.size||b.last<b.options.size||b.last==b.options.size&&null!==b.tail&&!b.inTail)&&b.startAuto();b.buttons();b.notify("onAfterAnimation");if("circular"==b.options.wrap&&null!==b.options.size)for(var c=b.prevFirst;c<=b.prevLast;c++)null!==c&&(!(c>=b.first&&c<=b.last)&&(1>c||c>b.options.size))&& b.remove(c)};this.notify("onBeforeAnimation");if(!this.options.animation||!1===c)this.list.css(this.lt,a+"px"),d();else{var f=!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},d={duration:this.options.animation,easing:this.options.easing,complete:d};typeof this.options.animationStepCallback==="function"&&(d.step=this.options.animationStepCallback);this.list.animate(f,d)}}},startAuto:function(a){void 0!==a&&(this.options.auto=a);if(0===this.options.auto)return this.stopAuto();if(null=== this.timer){this.autoStopped=!1;var c=this;this.timer=window.setTimeout(function(){c.next()},1E3*this.options.auto)}},stopAuto:function(){this.pauseAuto();this.autoStopped=!0},pauseAuto:function(){null!==this.timer&&(window.clearTimeout(this.timer),this.timer=null)},buttons:function(a,c){if(null==a&&(a=!this.locked&&0!==this.options.size&&(this.options.wrap&&"first"!=this.options.wrap||null===this.options.size||this.last<this.options.size),!this.locked&&(!this.options.wrap||"first"==this.options.wrap)&& null!==this.options.size&&this.last>=this.options.size))a=null!==this.tail&&!this.inTail;if(null==c&&(c=!this.locked&&0!==this.options.size&&(this.options.wrap&&"last"!=this.options.wrap||1<this.first),!this.locked&&(!this.options.wrap||"last"==this.options.wrap)&&null!==this.options.size&&1==this.first))c=null!==this.tail&&this.inTail;var b=this;0<this.buttonNext.length?(this.buttonNext.off(this.options.buttonNextEvent+".jcarousel",this.funcNext),a&&this.buttonNext.on(this.options.buttonNextEvent+ ".jcarousel",this.funcNext),this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?!1:!0),null!==this.options.buttonNextCallback&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)):null!==this.options.buttonNextCallback&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);0<this.buttonPrev.length?(this.buttonPrev.off(this.options.buttonPrevEvent+ ".jcarousel",this.funcPrev),c&&this.buttonPrev.on(this.options.buttonPrevEvent+".jcarousel",this.funcPrev),this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?!1:!0),null!==this.options.buttonPrevCallback&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)):null!==this.options.buttonPrevCallback&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=null===this.prevFirst?"init":this.prevFirst<this.first?"next":"prev";
173this.callback("itemLoadCallback",a,c);this.prevFirst!==this.first&&(this.callback("itemFirstInCallback",a,c,this.first),this.callback("itemFirstOutCallback",a,c,this.prevFirst));this.prevLast!==this.last&&(this.callback("itemLastInCallback",a,c,this.last),this.callback("itemLastOutCallback",a,c,this.prevLast));this.callback("itemVisibleInCallback",a, c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(null==this.options[a]||"object"!=typeof this.options[a]&&"onAfterAnimation"!=c)){var h="object"==typeof this.options[a]?this.options[a][c]:this.options[a];if(typeof h==="function"){var i=this;if(void 0===d)h(i,b,c);else if(void 0===f)this.get(d).each(function(){h(i,this,d,b,c)});else for(var a=function(a){i.get(a).each(function(){h(i, this,a,b,c)})},k=d;k<=f;k++)null!==k&&!(k>=j&&k<=e)&&a(k)}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){for(var a=g(a),b=a.get(0).className.split(" "),d=0;d<b.length;d++)-1!=b[d].indexOf("jcarousel-")&&a.removeClass(b[d]);this.options.imagelist?a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).attr("jcarouselindex",c):a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl? "right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical?"-horizontal":"-vertical")},dimension:function(a,c){var b=g(a);if(null==c)return!this.options.vertical?b.outerWidth(!0)||f.intval(this.options.itemFallbackDimension):b.outerHeight(!0)||f.intval(this.options.itemFallbackDimension);var d=!this.options.vertical?c-f.intval(b.css("marginLeft"))-f.intval(b.css("marginRight")):c-f.intval(b.css("marginTop"))-f.intval(b.css("marginBottom")); g(b).css(this.wh,d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-f.intval(this.clip.css("borderLeftWidth"))-f.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-f.intval(this.clip.css("borderTopWidth"))-f.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){null==c&&(c=this.options.size);return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});f.extend({defaults:function(a){return g.extend(r,a||{})},intval:function(a){a= parseInt(a,10);return isNaN(a)?0:a},windowLoaded:function(){n=!0}});g.fn.jcarousel=function(a){if("string"==typeof a){var c=g(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}return this.each(function(){var b=g(this).data("jcarousel");b?(a&&g.extend(b.options,a),b.reload()):g(this).data("jcarousel",new f(this,a))})}})(jQuery);
174/* 3. ColorBox
175---------------------------------------------------------------- */
176(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return typeof i==="function"?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x[0]&&x[0].focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("
176className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x[0]&&x[0].focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el)[0]&&t(_.el)[0].focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.on('click', function(){J.next()}),P.on('click', function(){J.prev()}),B.on('click', function(){J.close()}),v.on('click', function(){_.get("overlayClose")&&J.close()}),t(e).on("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.trigger('click')):39===e&&(t.preventDefault(),K.trigger('click')))}),t(e).on("click."+Z,"."+te,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").on("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).on("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHe
vendor: 6,088 bytes, line 176
176ight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).off(s).one(s,n),ae.on(ne,e).on(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.off(ne,e).off(ie,t),S.html(_.get("slideshowStart")).off(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.off(ne,e).off(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.off(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},typeof o==="function"&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.off("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.on("resize."+Z,J.position)},1),typeof i==="function"&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.off("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).off("click."+Z).off("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
177/* 4.jq.ui.checks */
178(function(a,b,c){function f(a,b){this.namespace="Checks";return this instanceof f?this.init(a,b):new f(a,b)}function h(a,b){this.namespace="Checkbox";return this instanceof h?this.init(a,b):new h(a,b)}function j(a,b){this.namespace="Radio";return this instanceof j?this.init(a,b):new j(a,b)}var d,e;d=Object.prototype.hasOwnProperty;e=function(a,b){function c(){this.constructor=a}for(var e in b)d.call(b,e)&&(a[e]=b[e]);c.prototype=b.prototype;a.prototype=new c;a.__super__=b.prototype;return a};f.prototype={baseConf:{view:!1,uiClass:"ui_check",labelClass:"ui_check_label",checkedClass:"ui_checked",disabledClass:"ui_check_disabled"},init:function(b,c){var d=this;d.$elems=b;d.conf=a.extend({},d.baseConf,c);d.elemMaps={};a.each(b,function(a,b){var c=d._matching(b),e=c.$check,f=c.$label,g=c.$view;f&&f.addClass(d.conf.labelClass);d.conf.view&&e.hide().after(g)});d._eventify()},_view:function(b){var c=this,d=a("<span></span>").addClass(this.conf.uiClass);b.disabled&&d.addClass(c.conf.disabledClass);b.checked&&d.addClass(c.conf.checkedClass);return d},_matching:function(b){var c=this,d=b.id;c.elemMaps[d]={id:d,$check:a(b),$view:c.conf.view?c._view(b):undefined,$label:a("label[for="+d+"]"),state:b.checked,disabled:b.disabled};return c.elemMaps[d]},_eventify:function(){var b=this;a.each(b.elemMaps,function(c,d){var e=d.id,f=d.$check,g=d.$label,h=d.$view,i=d.disabled;f.on({"click.check":function(a){a.stopPropagation();f.trigger("_check:toggle")},"_check:toggle":function(a){b.elemMaps[e].state?b._checkOff(e):b._checkOn(e)},"_check:on":function(){b._checkOn(e)},"_check:off":function(){b._checkOff(e)},"_check:enable":function(){b._enable(e)},"_check:disable":function(){b._disable(e)}});!a.support.opacity&&g.length&&g.on('click', function(a){a.stopPropagation();f.trigger("click")})})},_checkOn:function(a){var b=this,c=b.elemMaps[a],d=c.$check;if(c.disabled)return;b.conf.view&&c.$view.addClass(b.conf.checkedClass);c.state=!0;d.prop("checked","checked");d.trigger("check:on",c)},_checkOff:function(a){var b=this,c=b.elemMaps[a],d=c.$check;if(c.disabled)return;b.conf.view&&c.$view.removeClass(b.conf.checkedClass);c.state=!1;d.prop("checked","");d.trigger("check:off",c)},_enable:function(a){var b=this,c=b.elemMaps[a],d=c.$view,e=c.$check;b.conf.view&&d.removeClass(b.conf.disabledClass);c.disabled=!1;e.prop("disabled","");e.trigger("check:enable",c)},_disable:function(a){var b=this,c=b.elemMaps[a],d=c.$view,e=c.$check;b.conf.view&&d.addClass(b.conf.disabledClass);c.disabled=!0;e.prop("disabled","disabled");e.trigger("check:disable",c)},_callAPI:function(a,b){var c=this;if(typeof c[a]!="function")throw new Error(a+" does not exist of "+c.namespace+" methods.");if(/^_/.test(a)&&typeof c[a]=="function")throw new Error("Method begins with an underscore are not exposed.");return c[a](b)},checkOn:function(a){var b=this;b._checkOn(a)},checkOff:function(a){var b=this;b._checkOff(a)},enable:function(a){var b=this;b._enable(a)},enableAll:function(){var b=this;a.each(b.elemMaps,function(a,c){b.enable(c.id)})},disable:function(a){var b=this;b._disable(a)},disableAll:function(){var b=this;a.each(b.elemMaps,function(a,c){b.disable(c.id)})},destroy:function(){var b=this,c=b.namespace.toLowerCase();b.$elems.removeData(c);b.$elems.trigger("check:destroy");a.each(b.elemMaps,function(a,c){b.conf.view&&c.$view.remove();c.$check.show().off(["click.check","_check:toggle","_check:on","_check:off","_check:enable","_check:disable"].join(" "))})}};var g;e(h,f);g=h.prototype;g.toggleCheckAll=function(){var a=this;a.$elems.trigger("_check:toggle")};g.checkOnAll=function(){var a=this;a.$elems.trigger("_check:on")};g.checkOffAll=function(){var a=this;a.$elems.trigger("_check:off")};var i;e(j,f);i=j.prototype;i.baseConf={view:!1,uiClass:"ui_radio",labelClass:"ui_radio_label",checkedClass:"ui_checked",disabledClass:"ui_radio_disabled"};i._checkOn=function(b){var c=this,d=c.elemMaps[b];a.each(c.elemMaps,function(a,b){c._checkOff(b.id)});c.conf.view&&d.$view.addClass(c.conf.checkedClass);d.$check.prop("checked","checked")};a.fn.checkbox=function(a,b){var c;c=this.data("checkbox");if(c)return c._callAPI(a,b);
178if(typeof a=="string")return;c=h(this,a);this.data("checkbox",c);return this};a.fn.radio=function(a,b){var c;c=this.data("radio");if(c)return c._callAPI(a,b);if(typeof a=="string")return;c=j(this,a);this.data("radio",c);return this}})(jQuery,this,this.document);
179/* 5.jQselectable */
180(function(f,n,h,j){function m(a,b){for(var c=0,d=a.length;c<d;c+=1)b(c,a[c])}var k={},l=function(a,b){this.namespace="jQselectable";if(!(this instanceof l))return new l(a,b);this.init(a,b)};l.prototype={init:function(a,b){b=this.conf=f.extend({style:"CustomSelect",showDuration:150,hideDuration:150,show:"fadeIn",hide:"fadeOut",height:"auto",top:0,left:0,opacity:0.9},b);this.elem=a;this.$elem=f(a);this.$body=f("body");this.$document=f(h);this.state=!1;this.map={};this.selected_id=this.selected=j;this.has_no_maxheight= "undefined"==typeof n.addEventListener&&"undefined"==typeof h.documentElement.style.maxHeight;this.id=this.elem.id||"kpi_"+parseInt(1E3*Math.random());k[this.id]=this;this.elem.className||(this.elem.className=b.style);this.attr={id:this.id,klass:this.elem.className};this._build();this._eventify();this.$elem.attr("disabled")&&this.disable()},_map:function(){var a=this;a.$option=a.$elem.find("option");m(a.$option,function(b,c){var d=c.value;a.map[d.length?d:"nodata"]={elem:c,text:c.textContent||c.innerText}})}, _build:function(){var a=this.$elem.val(),b=this.id,c=j,c=this.$body,d=this.$elem,a=a&&a.length?a:"nodata";this._map();this.$view=this._view(this._escapeHtml(this.map[a].text)).addClass(this.attr.klass);
180this.$list=this._createList().css({position:"absolute"});d.hide().after(this.$view);c.append(this.$list);this.list_height=this.$list[0].offsetHeight;c=this.selected_id;this.selected=h.getElementById(b+"_"+c);this.$list.hide()},_view:function(a){return f(['<span class="UIElm-select-box"><a id="'+this.id+ '_FormDecoration"','href="javascript:void(0)"class="UIElm-select sctble_display"','data-id="'+this.id+'"',">",'<span data-id="'+this.id+'">',a,"</span></a></span>"].join(""))},_setPosition:function(){var a=this.conf,b=this.$view,c=this.$list,d=j,e=b.offset(),d=(h.documentElement.clientHeight||h.body.clientHeight)/2<e.top-(h.documentElement.scrollTop||h.body.scrollTop)?e.top-this.list_height+a.top:e.top+1*b.height()+a.top;c.css({top:d,left:e.left+a.left})},_addSelected:function(a){this.selected=a; a.className="Current"},_removeSelected:function(){var a=this.selected;a&&(a.className="")},_addItem:function(a,b){var c=this;m(b,function(b,e){var g=e.value||"nodata",f=c._escapeHtml(c.map[g].text),h=e.className,j=e.selected;j&&(c.selected_id=g);a+=e.disabled?"<li><span>":['<li><a href="#'+f+'"','id="'+c.id+"_"+g+'"','data-value="'+g+'"',j?'class="Current"':"",">"].join("");a+=f;a+=e.disabled?"</span></li>":"</a></li>";h&&/br/.test(h)&&(a+="<br>")});c.selected_id||(c.selected_id=b[0].value);return a}, _createList:function(){var a=this,b=a.conf,c=j,d='<div id="'+(a.id+"_mat")+'" class="FormSelectPullDown '+("sctble_mat "+a.attr.klass)+'"><div class="FormSelectPullDownInner">',c="auto"===b.height?"auto":b.height+"px",e=a.$elem,c=a.has_no_maxheight?"height: "+c+"; overflow-y: scroll;":"max-height: "+c+";",d=d+'<ul class="UIElm-select-option" style="'+c+'">';a.has_group=e.find("optgroup").length;if(a.has_group){a.list_klass="sctble optgroup";var b=d,g="<dl>",e=e.find("optgroup");m(e,function(b,c){var d= c.getElementsByTagName("option");g+="<dt>"+c.label+"</dt><dd>";g=a._addItem(g,d);g+="</dd>"});g+="</dl>";d=b+g}else a.list_klass="selectable"===b.style?"sctble nooptgroup":"sBox nooptgroup",e=d,b=a._addItem("",a.$option),d=e+b;return f(d+"</ul></div></div>").addClass(a.list_klass)},_eventify:function(){var a=this,b=a.$elem,c=a.$list;a.$view.on("click",function(){a.disabled||b.trigger("jQselectable.click")});c.on("click","a",function(a){a.preventDefault();b.trigger("jQselectable.change",{value:this.getAttribute("data-value"), anchor:this})});b.on("jQselectable.click",function(){c.is(":visible")?a._hide():a._show()});b.on("jQselectable.change",function(c,b){a._change(b.value);a._removeSelected();a._addSelected(b.anchor);a.$view[0]&&a.$view[0].focus()})},_show:function(){var a=this,b=a.conf,c=a.$list,d=a.$view,e=j,g=j,f=j,e=j;a._setPosition();a.state=!0;"slideDown"===b.show?(e=h.documentElement.scrollTop||h.body.scrollTop,g=h.documentElement.clientHeight||h.body.clientHeight,f=d.offset(),(e=g/2<f.top-e)?(c.css({top:f.top+b.top-5}), c.animate({height:"toggle",top:parseInt(c.css("top"))-a.list_height},{easing:"swing",duration:b.showDuration}).css({opacity:b.opacity})):c.stop(!0,!0).slideDown(b.showDuration).css({opacity:b.opacity})):"fadeIn"===b.show?c.css({display:"block",opacity:0}
180).stop(!0,!0).fadeTo(b.showDuration,b.opacity):c.show().css({opacity:b.opacity});c=setTimeout;isNaN(b.showDuration)?(b=b.showDuration,b=/slow/.test(b)?610:/fast/.test(b)?210:410):b=b.showDuration+10;c(function(){a.selected.focus()},b)},_hide:function(a){var b= this,c=b.conf,d=b.$list;if(b.state){b.state=!1;switch(c.hide){case "slideUp":d.stop(!0,!0).slideUp(c.hideDuration);break;case "fadeOut":d.stop(!0,!0).fadeOut(c.hideDuration);break;default:d.hide()}a&&(a=setTimeout,isNaN(c.showDuration)?(c=c.showDuration,c=/slow/.test(c)?610:/fast/.test(c)?210:410):c=c.hideDuration+10,a(function(){b.$view[0]&&b.$view[0].focus()},c))}},_change:function(a){this.$view.find("span").text(this.map[a].text);"nodata"==a&&(a="");this.$elem.val(a)},_callAPI:function(a,b){if("function"!==typeof this[a])throw Error(a+ " does not exist of "+this.namespace+" methods.");if(/^_/.test(a)&&"function"===typeof this[a])throw Error("Method begins with an underscore are not exposed.");return this[a](b)},_escapeHtml:function(a){return f("<div></div>").text(a).html()},refresh:function(){this.destroy();this._build();this._eventify();this.$elem.trigger("jQselectable.refresh")},disable:function(){this.disabled=!0;this.$view.addClass("disabled");this.$elem.trigger("jQselectable.disable")},enable:function(){this.disabled=!1;this.$view.removeClass("disabled"); this.$elem.trigger("jQselectable.enable")},destroy:function(){this.map={};this.$view.remove();this.$list.remove();this.$elem.show();this.$elem.trigger("jQselectable.destroy")}};f(h).on({"click.jQselectable":function(a){if(a.target){var b=a.target.getAttribute("data-id");a.stopPropagation();b&&b in k?f.each(k,function(a,d){a!==b&&d._hide()}):f.each(k,function(a,b){b._hide()})}},"keyup.jQselectable":function(a){27===a.keyCode&&f.each(k,function(a,c){c._hide(!0)})}});f.fn.jQselectable=function(a,b){if(!this.length)throw Error("There is no element"); if(1===this.length){var c=this.data("jQselectable");if(c)return c._callAPI(a,b);if("string"!==typeof a)return c=l(this,a),this.data("jQselectable",c),this}else f.each(this,function(){l(this,a)})}})(jQuery,this,this.document);
181/* 8.Color animation
182 ---------------------------------------------------------------- */
183(function(e){function h(a,b,c){var d="rgb"+(e.support.rgba?"a":"")+"("+parseInt(a[0]+c*(b[0]-a[0]),10)+","+parseInt(a[1]+c*(b[1]-a[1]),10)+","+parseInt(a[2]+c*(b[2]-a[2]),10);
183e.support.rgba&&(d+=","+(a&&b?parseFloat(a[3]+c*(b[3]-a[3])):1));return d+")"}function f(a){var b,c;if(b=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(a))c=[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),1];else if(b=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(a))c=[17*parseInt(b[1],16),17*parseInt(b[2], 16),17*parseInt(b[3],16),1];else if(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))c=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),1];else if(b=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(a))c=[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseFloat(b[4])];return c}e.extend(!0,e,{support:{rgba:function(){var a=e("script:first"),b=a.css("color"),c=!1;if(/^rgba/.test(b))c=!0;else try{c=b!=a.css("color","rgba(0, 0, 0, 0.5)").css("color"), a.css("color",b)}catch(d){}return c}()}});var i="color backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor outlineColor".split(" ");e.each(i,function(a,b){e.Tween.propHooks[b]={get:function(a){return e(a.elem).css(b)},set:function(a){var d=a.elem.style,g=f(e(a.elem).css(b)),j=f(a.end);a.run=function(a){d[b]=h(g,j,a)}}}});e.Tween.propHooks.borderColor={set:function(a){var b=a.elem.style,c=[],d=i.slice(2,6);e.each(d,function(b,d){c[d]=f(e(a.elem).css(d))});var g=f(a.end); a.run=function(a){e.each(d,function(e,d){b[d]=h(c[d],g,a)})}}}})(jQuery);
184/* Highlight Search Words for Certified Models
185---------------------------------------------------------------- */
186$.fn.kpi_replaceText=function(e,f,g){return this.each(function(){var a=this.firstChild,c,b,d=[];if(a){do 3==a.nodeType&&(c=a.nodeValue,b=c.replace(e,f),b!==c&&(!g&&/</.test(b)?(b=b.replace(/\\/g,""),$(a).before(b),d.push(a)):a.nodeValue=b));while(a=a.nextSibling)}d.length&&$(d).remove()})};$.fn.kpi_removeHighlight=function(){return this.find("span.HighLight").each(function(){with(this.parentNode)replaceChild(this.firstChild,this).normalize(),normalize()})};
187/* 9.SWFObject
188---------------------------------------------------------------- */
189var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y<X;Y++){U[Y]()}}function K(X){if(J){X()}else{U[U.length]=X}}function s(Y){if(typeof O.addEventListener!=D){O.addEventListener("load",Y,false)}else{if(typeof j.addEventListener!=D){j.addEventListener("load",Y,false)}else{if(typeof O.attachEvent!=D){i(O,"onload",Y)}else{if(typeof O.onload=="function"){var X=O.onload;O.onload=function(){X();Y()}}else{O.onload=Y}}}}}function h(){if(T){V()}else{H()}}function V(){var X=j.getElementsByTagName("body")[0];var aa=C(r);aa.setAttribute("type",q);var Z=X.appendChild(aa);if(Z){var Y=0;(function(){if(typeof Z.GetVariable!=D){var ab=Z.GetVariable("$version");if(ab){ab=ab.split(" ")[1].split(",");M.pv=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}else{if(Y<10){Y++;setTimeout(arguments.callee,10);return}}X.removeChild(aa);Z=null;H()})()}else{H()}}function H(){var ag=o.length;if(ag>0){for(var af=0;af<ag;af++){var Y=o[af].id;var ab=o[af].callbackFn;var aa={success:false,id:Y};if(M.pv[0]>0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}
189else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad<ac;ad++){if(X[ad].getAttribute("name").toLowerCase()!="movie"){ah[X[ad].getAttribute("name")]=X[ad].getAttribute("value")}}P(ai,ah,Y,ab)}else{p(ae);if(ab){ab(aa)}}}}}else{w(Y,true);if(ab){var Z=z(Y);if(Z&&typeof Z.SetVariable!=D){aa.success=true;aa.ref=Z}ab(aa)}}}}}function z(aa){var X=null;var Y=c(aa);if(Y&&Y.nodeName=="OBJECT"){if(typeof Y.SetVariable!=D){X=Y}else{var Z=Y.getElementsByTagName(r)[0];if(Z){X=Z}}}return X}function A(){return !a&&F("6.0.65")&&(M.win||M.mac)&&!(M.wk&&M.wk<312)}function P(aa,ab,X,Z){a=true;E=Z||null;B={success:false,id:X};var ae=c(X);if(ae){if(ae.nodeName=="OBJECT"){l=g(ae);Q=null}else{l=ae;Q=X}aa.id=R;if(typeof aa.width==D||(!/%$/.test(aa.width)&&parseInt(aa.width,10)<310)){aa.width="310"}if(typeof aa.height==D||(!/%$/.test(aa.height)&&parseInt(aa.height,10)<137)){aa.height="137"}j.title=j.title.slice(0,47)+" - Flash Player Installation";var ad=M.ie&&M.win?"ActiveX":"PlugIn",ac="MMredirectURL="+O.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ad+"&MMdoctitle="+j.title;if(typeof ab.flashvars!=D){ab.flashvars+="&"+ac}else{ab.flashvars=ac}if(M.ie&&M.win&&ae.readyState!=4){var Y=C("div");X+="SWFObjectNew";Y.setAttribute("id",X);ae.parentNode.insertBefore(Y,ae);ae.style.display="none";(function(){if(ae.readyState==4){ae.parentNode.removeChild(ae)}else{setTimeout(arguments.callee,10)}})()}u(aa,ab,X)}}function p(Y){if(M.ie&&M.win&&Y.readyState!=4){var X=C("div");Y.parentNode.insertBefore(X,Y);X.parentNode.replaceChild(g(Y),X);Y.style.display="none";(function(){if(Y.readyState==4){Y.parentNode.removeChild(Y)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.replaceChild(g(Y),Y)}}function g(ab){var aa=C("div");if(M.win&&M.ie){aa.innerHTML=ab.innerHTML}else{var Y=ab.getElementsByTagName(r)[0];if(Y){var ad=Y.childNodes;if(ad){var X=ad.length;for(var Z=0;Z<X;Z++){if(!(ad[Z].nodeType==1&&ad[Z].nodeName=="PARAM")&&!(ad[Z].nodeType==8)){aa.appendChild(ad[Z].cloneNode(true))}}}}}return aa}function u(ai,ag,Y){var X,aa=c(Y);if(M.wk&&M.wk<312){return X}if(aa){if(typeof ai.id==D){ai.id=Y}if(M.ie&&M.win){var ah="";for(var ae in ai){if(ai[ae]!=Object.prototype[ae]){if(ae.toLowerCase()=="data"){ag.movie=ai[ae]}else{if(ae.toLowerCase()=="styleclass"){ah+=' class="'+ai[ae]+'"'}else{if(ae.toLowerCase()!="classid"){ah+=" "+ae+'="'+ai[ae]+'"'}}}}}var af="";for(var ad in ag){if(ag[ad]!=Object.prototype[ad]){af+='<param name="'+ad+'" value="'+ag[ad]+'" />'}}aa.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ah+">"+af+"</object>";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab<ac;ab++){I[ab][0].detachEvent(I[ab][1],I[ab][2])}var Z=N.length;for(var aa=0;aa<Z;aa++){y(N[aa])}for(var Y in M){M[Y]=null}M=null;for(var X in swfobject){swfobject[X]=null}swfobject=null})}}();return{registerObject:function(ab,X,aa,Z){if(M.w3&&ab&&X){var Y={};Y.id=ab;Y.swfVersion=X;Y.expressInstall=aa;Y.callbackFn=Z;o[o.length]=Y;w(ab,false)}else{if(Z){Z({success:false,id:ab})}}},getObjectById:function(X){if(M.w3){return z(X)}},embedSWF:function(ab,ah,ae,ag,Y,aa,Z,ad,af,ac){var X={success:false,id:ah};if(M.w3&&!(M.wk&&M.wk<312)&&ab&&ah&&ae&&ag&&Y){w(ah,false);K(function(){ae+="";ag+="";var aj={};if(af&&typeof af===r){for(var al in af){aj[al]=af[al]}}aj.data=ab;aj.width=ae;aj.height=ag;var am={};if(ad&&typeof ad===r){for(var ak in ad){am[ak]=ad[ak]}}if(Z&&typeof Z===r){for(var ai in Z){if(typeof am.flashvars!=D){am.flashvars+="&"+ai+"="+Z[ai]}else{am.flashvars=ai+"="+Z[ai]}}}if(F(Y)){var an=u(aj,am,ah);if(aj.id==ah){w(ah,true)}X.success=true;X.ref=an}else{if(aa&&A()){aj.data=aa;P(aj,am,ah,ac);return}else{w(ah,true)}}if(ac){ac(X)}})}else{if(ac){ac(X)}}},switchOffAutoHideShow:function(){m=false},ua:M,getFlashPlayerVersion:function(){return{major:M.pv[0],minor:M.pv[1],release:M.pv[2]}},hasFlashPlayerVersion:F,createSWF:function(Z,Y,X){if(M.w3){return u(Z,Y,X)}else{return undefined}},showExpressInstall:function(Z,aa,X,Y){if(M.w3&&A()){P(Z,aa,X,Y)}},removeSWF:function(X){if(M.w3){y(X)}},createCSS:function(aa,Z,Y,X){if(M.w3){v(aa,Z,Y,X)}},addDomLoadEvent:K,addLoadEvent:s,getQueryParamValue:function(aa){var Z=j.location.search||j.location.hash;if(Z){if(/\?/.test(Z)){Z=Z.split("?")[1]}if(aa==null){return L(Z)}var Y=Z.split("&");for(var X=0;X<Y.length;X++){if(Y[X].substring(0,Y[X].indexOf("="))==aa){return L(Y[X].substring((Y[X].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var X=c(R);if(X&&l){X.parentNode.replaceChild(l,X);if(Q){w(Q,true);if(M.ie&&M.win){l.style.display="block"}}if(E){E(B)}}a=false}}}}();
190/* 10.jQuery Cookie Plugin
191 ---------------------------------------------------------------- */
192(function(e,h,k){function l(b){return b}function m(b){return decodeURIComponent(b.replace(n," "))}var n=/\+/g,d=e.cookie=function(b,c,a){if(c!==k){a=e.extend({},d.defaults,a);null===c&&(a.expires=-1);if("number"===typeof a.expires){var f=a.expires,g=a.expires=new Date;g.setDate(g.getDate()+f)}c=d.json?JSON.stringify(c):String(c);return h.cookie=[encodeURIComponent(b),"=",d.raw?c:encodeURIComponent(c),a.expires?"; expires="+a.expires.toUTCString():"",a.path?"; path="+a.path:"",a.domain?"; domain="+
193	a.domain:"",a.secure?"; secure":""].join("")}c=d.raw?l:m;a=h.cookie.split("; ");f=0;for(g=a.length;f<g;f++){var j=a[f].split("=");if(c(j.shift())===b)return b=c(j.join("=")),d.json?JSON.parse(b):b}return null};d.defaults={};e.removeCookie=function(b,c){return null!==e.cookie(b)?(e.cookie(b,null,c),!0):!1}})(jQuery,document);
194/* 11.jQuery Show Password Plugin
195---------------------------------------------------------------- */
196(function(b){b.fn.showPassword=function(k){var j=b.extend({},b.fn.showPassword.defaults,k);return this.each(function(){var a=b(this),f=a.position(),d=a.outerWidth(),g=a.outerHeight(),e=a.parent(),h=e.height(),c=b.meta?b.extend({},j,a.data()):j;e.height(h);b("<a/>",{href:"#","class":c.linkClass,click:function(l){var i=e.find("."+c.showPasswordInputClass);if(a.css("display")==="none"){b(this).text(c.linkText);a.val(i.val()).show();i.hide()}else{b(this).text(c.showPasswordLinkText);i.val(a.val()).show();
197a.hide()}l.preventDefault()},css:{left:f.left+d,top:f.top+g},text:c.linkText}).appendTo(e);d=e.find("."+c.linkClass);g=d.outerWidth();h=parseInt(d.css("left"),10);var m=d.outerHeight(),n=parseInt(d.css("top"),10);d.css({left:h-g-c.linkRightOffset,top:n-m-c.linkTopOffset});b("<input/>",{"class":c.showPasswordInputClass,css:{display:"none",left:0,top:0},type:"text"}).prependTo(e);a.closest("form").on("submit",function(){a.css("display")==="none"&&a.val(a.siblings("."+c.showPasswordInputClass).val())})})};
198b.fn.showPassword.defaults={linkClass:"show-password-link",linkText:"Show",showPasswordLinkText:"Hide",showPasswordInputClass:"password-showing",linkRightOffset:0,linkTopOffset:0}})(jQuery);
199
200/**
201 * domain setting
202 */
203$(function(){
204
205	var kpi_protocol = location.protocol;
206	var kpi_host = location.host;
207
208    kpi_domainSettings.originalDomain = kpi_protocol + "//" + kpi_host + suz_LanguagePath;
209
210    if(0 <= kpi_host.search(suz_search_Path.searchDomainRegExp)) {
211        kpi_domainSettings.originalDomain = kpi_protocol + kpi_originalDomain.replace(/^http+s?:/,"");
212
213		kpi_domainSettings.isDomain = false;
214		//modal settings For www-search,
215		kpi_cartsettings.downloadLicenseCad = kpi_mf_modalsettings.downloadLicenseCadHtml;
216		kpi_cartsettings.downloadLicenseSoft = kpi_mf_modalsettings.downloadLicenseSoftHtml;
217		kpi_loadingfiles.RegionSelectHtml = kpi_mf_modalsettings.RegionSelectHtml;
218		kpi_loadingfiles.AboutUsHtml = kpi_mf_modalsettings.AboutUsHtml;
219		kpi_loadingfiles.ProductsHtml = kpi_mf_modalsettings.ProductsHtml;
220		kpi_loadingfiles.SolutionHtml = kpi_mf_modalsettings.SolutionHtml;
221		kpi_loadingfiles.DownloadsHtml = kpi_mf_modalsettings.DownloadsHtml;
222		kpi_loadingfiles.SupportHtml = kpi_mf_modalsettings.SupportHtml;
223	}
224
225	//override
226	kpi_cartsettings.cartApiUrl = kpi_domainSettings.originalDomain;
227	kpi_downloadListSettings.listApiUrl = kpi_domainSettings.originalDomain;
228	kpi_currentDomain = kpi_domainSettings.originalDomain;
229});
230
231/*! Native Promise Only
232    v0.8.1 (c) Kyle Simpson
233    MIT License: http://getify.mit-license.org
234*/
235!function(t,n,e){n[t]=n[t]||e(),"undefined"!=typeof module&&module.exports?module.exports=n[t]:"function"==typeof define&&define.amd&&define(function(){return n[t]})}("Promise","undefined"!=typeof global?global:this,function(){"use strict";function t(t,n){l.add(t,n),h||(h=y(l.drain))}function n(t){var n,e=typeof t;return null==t||"object"!=e&&"function"!=e||(n=t.then),"function"==typeof n&&n}function e(){for(var t=0;t<this.chain.length;t++)o(this,1===this.state?this.chain[t].success:this.chain[t].failure,this.chain[t]);this.chain.length=0}function o(t,e,o){var r,i;try{!1===e?o.reject(t.msg):(r=!0===e?t.msg:e.call(void 0,t.msg),r===o.promise?o.reject(TypeError("Promise-chain cycle")):(i=n(r))?i.call(r,o.resolve,o.reject):o.resolve(r))}catch(t){o.reject(t)}}function r(o){var c,u=this;if(!u.triggered){u.triggered=!0,u.def&&(u=u.def);try{(c=n(o))?t(function(){var t=new f(u);try{c.call(o,function(){r.apply(t,arguments)},function(){i.apply(t,arguments)})}catch(n){i.call(t,n)}}):(u.msg=o,u.state=1,u.chain.length>0&&t(e,u))}catch(t){i.call(new f(u),t)}}}function i(n){var o=this;o.triggered||(o.triggered=!0,o.def&&(o=o.def),o.msg=n,o.state=2,o.chain.length>0&&t(e,o))}function c(t,n,e,o){for(var r=0;r<n.length;r++)!function(r){t.resolve(n[r]).then(function(t){e(r,t)},o)}(r)}function f(t){this.def=t,this.triggered=!1}function u(t){this.promise=t,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function a(n){if("function"!=typeof n)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var o=new u(this);this.then=function(n,r){var i={success:"function"!=typeof n||n,failure:"function"==typeof r&&r};return i.promise=new this.constructor(function(t,n){if("function"!=typeof t||"function"!=typeof n)throw TypeError("Not a function");i.resolve=t,i.reject=n}),o.chain.push(i),0!==o.state&&t(e,o),i.promise},this.catch=function(t){return this.then(void 0,t)};try{n.call(void 0,function(t){r.call(o,t)},function(t){i.call(o,t)}
235)}catch(t){i.call(o,t)}}var s,h,l,p=Object.prototype.toString,y="undefined"!=typeof setImmediate?function(t){return setImmediate(t)}:setTimeout;try{Object.defineProperty({},"x",{}),s=function(t,n,e,o){return Object.defineProperty(t,n,{value:e,writable:!0,configurable:!1!==o})}}catch(t){s=function(t,n,e){return t[n]=e,t}}l=function(){function t(t,n){this.fn=t,this.self=n,this.next=void 0}var n,e,o;return{add:function(r,i){o=new t(r,i),e?e.next=o:n=o,e=o,o=void 0},drain:function(){var t=n;for(n=e=h=void 0;t;)t.fn.call(t.self),t=t.next}}}();var d=s({},"constructor",a,!1);return a.prototype=d,s(d,"__NPO__",0,!1),s(a,"resolve",function(t){var n=this;return t&&"object"==typeof t&&1===t.__NPO__?t:new n(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");n(t)})}),s(a,"reject",function(t){return new this(function(n,e){if("function"!=typeof n||"function"!=typeof e)throw TypeError("Not a function");e(t)})}),s(a,"all",function(t){var n=this;return"[object Array]"!=p.call(t)?n.reject(TypeError("Not an array")):0===t.length?n.resolve([]):new n(function(e,o){if("function"!=typeof e||"function"!=typeof o)throw TypeError("Not a function");var r=t.length,i=Array(r),f=0;c(n,t,function(t,n){i[t]=n,++f===r&&e(i)},o)})}),s(a,"race",function(t){var n=this;return"[object Array]"!=p.call(t)?n.reject(TypeError("Not an array")):new n(function(e,o){if("function"!=typeof e||"function"!=typeof o)throw TypeError("Not a function");c(n,t,function(t,n){e(n)},o)})}),a});
236
237/*!
238 * jQuery blockUI plugin
239 * Version 2.66.0-2013.10.09
240 * Requires jQuery v1.7 or later
241 *
242 * Examples at: http://malsup.com/jquery/block/
243 * Copyright (c) 2007-2013 M. Alsup
244 * Dual licensed under the MIT and GPL licenses:
245 * http://www.opensource.org/licenses/mit-license.php
246 * http://www.gnu.org/licenses/gpl.html
247 *
248 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
249 */
250
251;(function() {
252	/*jshint eqeqeq:false curly:false latedef:false */
253	"use strict";
254
255	function setup($) {
256		$.fn._fadeIn = $.fn.fadeIn;
257
258		var noOp = $.noop || function() {};
259
260		// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle
261		// confusing userAgent strings on Vista)
262		var msie = /MSIE/.test(navigator.userAgent);
263		var ie6  = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent);
264		var mode = document.documentMode || 0;
265		var setExpr = typeof document.createElement('div').style.setExpression === 'function';
266
267		// global $ methods for blocking/unblocking the entire page
268		$.blockUI   = function(opts) { install(window, opts); };
269		$.unblockUI = function(opts) { remove(window, opts); };
270
271		// convenience method for quick growl-like notifications  (http://www.google.com/search?q=growl)
272		$.growlUI = function(title, message, timeout, onClose) {
273			var $m = $('<div class="growlUI"></div>');
274			if (title) $m.append('<h1>'+title+'</h1>');
275			if (message) $m.append('<h2>'+message+'</h2>');
276			if (timeout === undefined) timeout = 3000;
277
278			// Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications
279			var callBlock = function(opts) {
280				opts = opts || {};
281
282				$.blockUI({
283					message: $m,
284					fadeIn : typeof opts.fadeIn  !== 'undefined' ? opts.fadeIn  : 700,
285					fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000,
286					timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout,
287					centerY: false,
288					showOverlay: false,
289					onUnblock: onClose,
290					css: $.blockUI.defaults.growlCSS
291				});
292			};
293
294			callBlock();
295			var nonmousedOpacity = $m.css('opacity');
296			$m.mouseover(function() {
297				callBlock({
298					fadeIn: 0,
299					timeout: 30000
300				});
301
302				var displayBlock = $('.blockMsg');
303				displayBlock.stop(); // cancel fadeout if it has started
304				displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency
305			}).mouseout(function() {
306				$('.blockMsg').fadeOut(1000);
307			});
308			// End konapun additions
309		};
310
311		// plugin method for blocking element content
312		$.fn.block = function(opts) {
313			if ( this[0] === window ) {
314				$.blockUI( opts );
315				return this;
316			}
317			var fullOpts = $.extend({}, $.blockUI.defaults, opts || {});
318			this.each(function() {
319				var $el = $(this);
320				if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked'))
321					return;
322				$el.unblock({ fadeOut: 0 });
323			});
324
325			return this.each(function() {
326				if ($.css(this,'position') == 'static') {
327					this.style.position = 'relative';
328					$(this).data('blockUI.static', true);
329				}
330				this.style.zoom = 1; // force 'hasLayout' in ie
331				install(this, opts);
332			});
333		};
334
335		// plugin method for unblocking element content
336		$.fn.unblock = function(opts) {
337			if ( this[0] === window ) {
338				$.unblockUI( opts );
339				return this;
340			}
341			return this.each(function() {
342				remove(this, opts);
343			});
344		};
345
346		$.blockUI.version = 2.66; // 2nd generation blocking at no extra cost!
347
348		// override these in your code to change the default behavior and style
349		$.blockUI.defaults = {
350			// message displayed when blocking (use null for no message)
351			message:  '<h1>Please wait...</h1>',
352
353			title: null,		// title string; only used when theme == true
354			draggable: true,	// only used when theme == true (requires jquery-ui.js to be loaded)
355
356			theme: false, // set to true to use with jQuery UI themes
357
358			// styles for the message when blocking; if you wish to disable
359			// these and use an external stylesheet then do this in your code:
360			// $.blockUI.defaults.css = {};
361			css: {
362				padding:	0,
363				margin:		0,
364				width:		'30%',
365				top:		'40%',
366				left:		'35%',
367				textAlign:	'center',
368				color:		'#000',
369				border:		'3px solid #aaa',
370				backgroundColor:'#fff',
371				cursor:		'wait'
372			},
373
374			// minimal style set used when themes are used
375			themedCSS: {
376				width:	'30%',
377				top:	'40%',
378				left:	'35%'
379			},
380
381			// styles for the overlay
382			overlayCSS:  {
383				backgroundColor:	'#000',
384				opacity:			0.6,
385				cursor:				'wait'
386			},
387
388			// style to replace wait cursor before unblocking to correct issue
389			// of lingering wait cursor
390			cursorReset: 'default',
391
392			// styles applied when using $.growlUI
393			growlCSS: {
394				width:		'350px',
395				top:		'10px',
396				left:		'',
397				right:		'10px',
398				border:		'none',
399				padding:	'5px',
400				opacity:	0.6,
401				cursor:		'default',
402				color:		'#fff',
403				backgroundColor: '#000',
vendor: 10,236 bytes, lines 404-667
404				'-webkit-border-radius':'10px',
405				'-moz-border-radius':	'10px',
406				'border-radius':		'10px'
407			},
408
409			// IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w
410			// (hat tip to Jorge H. N. de Vasconcelos)
411			/*jshint scripturl:true */
412			iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank',
413
414			// force usage of iframe in non-IE browsers (handy for blocking applets)
415			forceIframe: false,
416
417			// z-index for the blocking overlay
418			baseZ: 1000,
419
420			// set these to true to have the message automatically centered
421			centerX: true, // <-- only effects element blocking (page block controlled via css above)
422			centerY: true,
423
424			// allow body element to be stetched in ie6; this makes blocking look better
425			// on "short" pages.  disable if you wish to prevent changes to the body height
426			allowBodyStretch: true,
427
428			// enable if you want key and mouse events to be disabled for content that is blocked
429			bindEvents: true,
430
431			// be default blockUI will supress tab navigation from leaving blocking content
432			// (if bindEvents is true)
433			constrainTabKey: true,
434
435			// fadeIn time in millis; set to 0 to disable fadeIn on block
436			fadeIn:  200,
437
438			// fadeOut time in millis; set to 0 to disable fadeOut on unblock
439			fadeOut:  400,
440
441			// time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock
442			timeout: 0,
443
444			// disable if you don't want to show the overlay
445			showOverlay: true,
446
447			// if true, focus will be placed in the first available input field when
448			// page blocking
449			focusInput: true,
450
451			// elements that can receive focus
452			focusableElements: ':input:enabled:visible',
453
454			// suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
455			// no longer needed in 2012
456			// applyPlatformOpacityRules: true,
457
458			// callback method invoked when fadeIn has completed and blocking message is visible
459			onBlock: null,
460
461			// callback method invoked when unblocking has completed; the callback is
462			// passed the element that has been unblocked (which is the window object for page
463			// blocks) and the options that were passed to the unblock call:
464			//	onUnblock(element, options)
465			onUnblock: null,
466
467			// callback method invoked when the overlay area is clicked.
468			// setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used.
469			onOverlayClick: null,
470
471			// don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493
472			quirksmodeOffsetHack: 4,
473
474			// class name of the message block
475			blockMsgClass: 'blockMsg',
476
477			// if it is already blocked, then ignore it (don't unblock and reblock)
478			ignoreIfBlocked: false
479		};
480
481		// private data and functions follow...
482
483		var pageBlock = null;
484		var pageBlockEls = [];
485
486		function install(el, opts) {
487			var css, themedCSS;
488			var full = (el == window);
489			var msg = (opts && opts.message !== undefined ? opts.message : undefined);
490			opts = $.extend({}, $.blockUI.defaults, opts || {});
491
492			if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked'))
493				return;
494
495			opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
496			css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
497			if (opts.onOverlayClick)
498				opts.overlayCSS.cursor = 'pointer';
499
500			themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {});
501			msg = msg === undefined ? opts.message : msg;
502
503			// remove the current block (if there is one)
504			if (full && pageBlock)
505				remove(window, {fadeOut:0});
506
507			// if an existing element is being used as the blocking content then we capture
508			// its current place in the DOM (and current display style) so we can restore
509			// it when we unblock
510			if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
511				var node = msg.jquery ? msg[0] : msg;
512				var data = {};
513				$(el).data('blockUI.history', data);
514				data.el = node;
515				data.parent = node.parentNode;
516				data.display = node.style.display;
517				data.position = node.style.position;
518				if (data.parent)
519					data.parent.removeChild(node);
520			}
521
522			$(el).data('blockUI.onUnblock', opts.onUnblock);
523			var z = opts.baseZ;
524
525			// blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
526			// layer1 is the iframe layer which is used to supress bleed through of underlying content
527			// layer2 is the overlay layer which has opacity and a wait cursor (by default)
528			// layer3 is the message content that is displayed while blocking
529			var lyr1, lyr2, lyr3, s;
530			if (msie || opts.forceIframe)
531				lyr1 = $('<iframe class="blockUI" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+opts.iframeSrc+'"></iframe>');
532			else
533				lyr1 = $('<div class="blockUI" style="display:none"></div>');
534
535			if (opts.theme)
536				lyr2 = $('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+ (z++) +';display:none"></div>');
537			else
538				lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ (z++) +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
539
540			if (opts.theme && full) {
541				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:fixed">';
542				if ( opts.title ) {
543					s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
544				}
545				s += '<div class="ui-widget-content ui-dialog-content"></div>';
546				s += '</div>';
547			}
548			else if (opts.theme) {
549				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(z+10)+';display:none;position:absolute">';
550				if ( opts.title ) {
551					s += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(opts.title || '&nbsp;')+'</div>';
552				}
553				s += '<div class="ui-widget-content ui-dialog-content"></div>';
554				s += '</div>';
555			}
556			else if (full) {
557				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockPage" style="z-index:'+(z+10)+';display:none;position:fixed"></div>';
558			}
559			else {
560				s = '<div class="blockUI ' + opts.blockMsgClass + ' blockElement" style="z-index:'+(z+10)+';display:none;position:absolute"></div>';
561			}
562			lyr3 = $(s);
563
564			// if we have a message, style it
565			if (msg) {
566				if (opts.theme) {
567					lyr3.css(themedCSS);
568					lyr3.addClass('ui-widget-content');
569				}
570				else
571					lyr3.css(css);
572			}
573
574			// style the overlay
575			if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/)
576				lyr2.css(opts.overlayCSS);
577			lyr2.css('position', full ? 'fixed' : 'absolute');
578
579			// make iframe layer transparent in IE
580			if (msie || opts.forceIframe)
581				lyr1.css('opacity',0.0);
582
583			//$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
584			var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el);
585			$.each(layers, function() {
586				this.appendTo($par);
587			});
588
589			if (opts.theme && opts.draggable && $.fn.draggable) {
590				lyr3.draggable({
591					handle: '.ui-dialog-titlebar',
592					cancel: 'li'
593				});
594			}
595
596			// ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
597			var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0);
598			if (ie6 || expr) {
599				// give body 100% height
600				if (full && opts.allowBodyStretch && $.support.boxModel)
601					$('html,body').css('height','100%');
602
603				// fix ie6 issue when blocked element has a border width
604				if ((ie6 || !$.support.boxModel) && !full) {
605					var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
606					var fixT = t ? '(0 - '+t+')' : 0;
607					var fixL = l ? '(0 - '+l+')' : 0;
608				}
609
610				// simulate fixed position
611				$.each(layers, function(i,o) {
612					var s = o[0].style;
613					s.position = 'absolute';
614					if (i < 2) {
615						if (full)
616							s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"');
617						else
618							s.setExpression('height','this.parentNode.offsetHeight + "px"');
619						if (full)
620							s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"');
621						else
622							s.setExpression('width','this.parentNode.offsetWidth + "px"');
623						if (fixL) s.setExpression('left', fixL);
624						if (fixT) s.setExpression('top', fixT);
625					}
626					else if (opts.centerY) {
627						if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
628						s.marginTop = 0;
629					}
630					else if (!opts.centerY && full) {
631						var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0;
632						var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"';
633						s.setExpression('top',expression);
634					}
635				});
636			}
637
638			// show the message
639			if (msg) {
640				if (opts.theme)
641					lyr3.find('.ui-widget-content').append(msg);
642				else
643					lyr3.append(msg);
644				if (msg.jquery || msg.nodeType)
645					$(msg).show();
646			}
647
648			if ((msie || opts.forceIframe) && opts.showOverlay)
649				lyr1.show(); // opacity is zero
650			if (opts.fadeIn) {
651				var cb = opts.onBlock ? opts.onBlock : noOp;
652				var cb1 = (opts.showOverlay && !msg) ? cb : noOp;
653				var cb2 = msg ? cb : noOp;
654				if (opts.showOverlay)
655					lyr2._fadeIn(opts.fadeIn, cb1);
656				if (msg)
657					lyr3._fadeIn(opts.fadeIn, cb2);
658			}
659			else {
660				if (opts.showOverlay)
661					lyr2.show();
662				if (msg)
663					lyr3.show();
664				if (opts.onBlock)
665					opts.onBlock();
666			}
667
vendor: 5,138 bytes, lines 668-850
668			// bind key and mouse events
669			bind(1, el, opts);
670
671			if (full) {
672				pageBlock = lyr3[0];
673				pageBlockEls = $(opts.focusableElements,pageBlock);
674				if (opts.focusInput)
675					setTimeout(focus, 20);
676			}
677			else
678				center(lyr3[0], opts.centerX, opts.centerY);
679
680			if (opts.timeout) {
681				// auto-unblock
682				var to = setTimeout(function() {
683					if (full)
684						$.unblockUI(opts);
685					else
686						$(el).unblock(opts);
687				}, opts.timeout);
688				$(el).data('blockUI.timeout', to);
689			}
690		}
691
692		// remove the block
693		function remove(el, opts) {
694			var count;
695			var full = (el == window);
696			var $el = $(el);
697			var data = $el.data('blockUI.history');
698			var to = $el.data('blockUI.timeout');
699			if (to) {
700				clearTimeout(to);
701				$el.removeData('blockUI.timeout');
702			}
703			opts = $.extend({}, $.blockUI.defaults, opts || {});
704			bind(0, el, opts); // unbind events
705
706			if (opts.onUnblock === null) {
707				opts.onUnblock = $el.data('blockUI.onUnblock');
708				$el.removeData('blockUI.onUnblock');
709			}
710
711			var els;
712			if (full) // crazy selector to handle odd field errors in ie6/7
713				els = $('body').children().filter('.blockUI').add('body > .blockUI');
714			else
715				els = $el.find('>.blockUI');
716
717			// fix cursor issue
718			if ( opts.cursorReset ) {
719				if ( els.length > 1 )
720					els[1].style.cursor = opts.cursorReset;
721				if ( els.length > 2 )
722					els[2].style.cursor = opts.cursorReset;
723			}
724
725			if (full)
726				pageBlock = pageBlockEls = null;
727
728			if (opts.fadeOut) {
729				count = els.length;
730				els.stop().fadeOut(opts.fadeOut, function() {
731					if ( --count === 0)
732						reset(els,data,opts,el);
733				});
734			}
735			else
736				reset(els, data, opts, el);
737		}
738
739		// move blocking element back into the DOM where it started
740		function reset(els,data,opts,el) {
741			var $el = $(el);
742			if ( $el.data('blockUI.isBlocked') )
743				return;
744
745			els.each(function(i,o) {
746				// remove via DOM calls so we don't lose event handlers
747				if (this.parentNode)
748					this.parentNode.removeChild(this);
749			});
750
751			if (data && data.el) {
752				data.el.style.display = data.display;
753				data.el.style.position = data.position;
754				if (data.parent)
755					data.parent.appendChild(data.el);
756				$el.removeData('blockUI.history');
757			}
758
759			if ($el.data('blockUI.static')) {
760				$el.css('position', 'static'); // #22
761			}
762
763			if (typeof opts.onUnblock == 'function')
764				opts.onUnblock(el,opts);
765
766			// fix issue in Safari 6 where block artifacts remain until reflow
767			var body = $(document.body), w = body.width(), cssW = body[0].style.width;
768			body.width(w-1).width(w);
769			body[0].style.width = cssW;
770		}
771
772		// bind/unbind the handler
773		function bind(b, el, opts) {
774			var full = el == window, $el = $(el);
775
776			// don't bother unbinding if there is nothing to unbind
777			if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked')))
778				return;
779
780			$el.data('blockUI.isBlocked', b);
781
782			// don't bind events when overlay is not in use or if bindEvents is false
783			if (!full || !opts.bindEvents || (b && !opts.showOverlay))
784				return;
785
786			// bind anchors and inputs for mouse and key events
787			var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove';
788			if (b)
789				$(document).on(events, opts, handler);
790			else
791				$(document).off(events, handler);
792
793		// former impl...
794		//		var $e = $('a,:input');
795		//		b ? $e.on(events, opts, handler) : $e.off(events, handler);
796		}
797
798		// event handler to suppress keyboard/mouse events when blocking
799		function handler(e) {
800			// allow tab navigation (conditionally)
801			if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) {
802				if (pageBlock && e.data.constrainTabKey) {
803					var els = pageBlockEls;
804					var fwd = !e.shiftKey && e.target === els[els.length-1];
805					var back = e.shiftKey && e.target === els[0];
806					if (fwd || back) {
807						setTimeout(function(){focus(back);},10);
808						return false;
809					}
810				}
811			}
812			var opts = e.data;
813			var target = $(e.target);
814			if (target.hasClass('blockOverlay') && opts.onOverlayClick)
815				opts.onOverlayClick(e);
816
817			// allow events within the message content
818			if (target.parents('div.' + opts.blockMsgClass).length > 0)
819				return true;
820
821			// allow events for content that is not being blocked
822			return target.parents().children().filter('div.blockUI').length === 0;
823		}
824
825		function focus(back) {
826			if (!pageBlockEls)
827				return;
828			var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
829			if (e)
830				e.focus();
831		}
832
833		function center(el, x, y) {
834			var p = el.parentNode, s = el.style;
835			var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
836			var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
837			if (x) s.left = l > 0 ? (l+'px') : '0';
838			if (y) s.top  = t > 0 ? (t+'px') : '0';
839		}
840
841		function sz(el, p) {
842			return parseInt($.css(el,p),10)||0;
843		}
844
845	}
846
847
848	/*global define:true */
849	if (typeof define === 'function' && define.amd && define.amd.jQuery) {
850		define(['jquery'], setup);
851	} else {
852		setup(jQuery);
853	}
854
855})();
856
857/**
858 * BxSlider v4.1.2 - Fully loaded, responsive content slider
859 * http://bxslider.com
860 *
861 * Copyright 2014, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
862 * Written while drinking Belgian ales and listening to jazz
863 *
864 * Released under the MIT license - http://opensource.org/licenses/MIT
865 */
866
867;(function($){
868
869	var plugin = {};
870
871	var defaults = {
872
873		// GENERAL
874		mode: 'horizontal',
875		slideSelector: '',
876		infiniteLoop: true,
877		hideControlOnEnd: false,
878		speed: 500,
879		easing: null,
880		slideMargin: 0,
881		startSlide: 0,
882		randomStart: false,
883		captions: false,
884		ticker: false,
885		tickerHover: false,
886		adaptiveHeight: false,
887		adaptiveHeightSpeed: 500,
888		video: false,
889		useCSS: true,
890		preloadImages: 'visible',
891		responsive: true,
892		slideZIndex: 50,
893		wrapperClass: 'bx-wrapper',
894
895		// TOUCH
896		touchEnabled: true,
897		swipeThreshold: 50,
898		oneToOneTouch: true,
899		preventDefaultSwipeX: true,
900		preventDefaultSwipeY: false,
901
902		// PAGER
903		pager: true,
904		pagerType: 'full',
905		pagerShortSeparator: ' / ',
906		pagerSelector: null,
907		buildPager: null,
908		pagerCustom: null,
909
910		// CONTROLS
911		controls: true,
912		nextText: 'Next',
913		prevText: 'Prev',
914		nextSelector: null,
915		prevSelector: null,
916		autoControls: false,
917		startText: 'Start',
918		stopText: 'Stop',
919		autoControlsCombine: false,
920		autoControlsSelector: null,
921
922		// AUTO
923		auto: false,
924		pause: 4000,
925		autoStart: true,
926		autoDirection: 'next',
927		autoHover: false,
928		autoDelay: 0,
929		autoSlideForOnePage: false,
930
931		// CAROUSEL
932		minSlides: 1,
933		maxSlides: 1,
934		moveSlides: 0,
935		slideWidth: 0,
936
937		// CALLBACKS
938		onSliderLoad: function() {},
939		onSlideBefore: function() {},
940		onSlideAfter: function() {},
941		onSlideNext: function() {},
942		onSlidePrev: function() {},
943		onSliderResize: function() {}
944	}
945
946	$.fn.bxSlider = function(options){
947
948		if(this.length == 0) return this;
949
950		// support mutltiple elements
951		if(this.length > 1){
952			this.each(function(){$(this).bxSlider(options)});
953			return this;
954		}
955
956		// create a namespace to be used throughout the plugin
957		var slider = {};
958		// set a reference to our slider element
959		var el = this;
960		plugin.el = this;
961
962		/**
963		 * Makes slideshow responsive
964		 */
965		// first get the original window dimens (thanks alot IE)
966		var windowWidth = $(window).width();
967		var windowHeight = $(window).height();
968
969
970
971		/**
972		 * ===================================================================================
973		 * = PRIVATE FUNCTIONS
974		 * ===================================================================================
975		 */
976
977		/**
978		 * Initializes namespace settings to be used throughout plugin
979		 */
980		var init = function(){
981			// merge user-supplied options with the defaults
982			slider.settings = $.extend({}, defaults, options);
983			// parse slideWidth setting
984			slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
985			// store the original children
986			slider.children = el.children(slider.settings.slideSelector);
987			// check if actual number of slides is less than minSlides / maxSlides
988			if(slider.children.length < slider.settings.minSlides) slider.settings.minSlides = slider.children.length;
989			if(slider.children.length < slider.settings.maxSlides) slider.settings.maxSlides = slider.children.length;
990			// if random start, set the startSlide setting to random number
991			if(slider.settings.randomStart) slider.settings.startSlide = Math.floor(Math.random() * slider.children.length);
992			// store active slide information
993			slider.active = { index: slider.settings.startSlide }
994			// store if the slider is in carousel mode (displaying / moving multiple slides)
995			slider.carousel = slider.settings.minSlides > 1 || slider.settings.maxSlides > 1;
996			// if carousel, force preloadImages = 'all'
997			if(slider.carousel) slider.settings.preloadImages = 'all';
998			// calculate the min / max width thresholds based on min / max number of slides
999			// used to setup and update carousel slides dimensions
1000			slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
1001			slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
1002			// store the current state of the slider (if currently animating, working is true)
1003			slider.working = false;
1004			// initialize the controls object
1005			slider.controls = {};
1006			// initialize an auto interval
1007			slider.interval = null;
1008			// determine which property to use for transitions
1009			slider.animProp = slider.settings.mode == 'vertical' ? 'top' : 'left';
1010			// determine if hardware acceleration can be used
1011			slider.usingCSS = slider.settings.useCSS && slider.settings.mode != 'fade' && (function(){
1012				// create our test div element
1013				var div = document.createElement('div');
1014				// css transition properties
1015				var props = ['WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
1016				// test for each property
1017				for(var i in props){
1018					if(div.style[props[i]] !== undefined){
1019						slider.cssPrefix = props[i].replace('Perspective', '').toLowerCase();
1020						slider.animProp = '-' + slider.cssPrefix + '-transform';
1021						return true;
1022					}
1023				}
1024				return false;
1025			}());
1026			// if vertical mode always make maxSlides and minSlides equal
1027			if(slider.settings.mode == 'vertical') slider.settings.maxSlides = slider.settings.minSlides;
1028			// save original style data
1029			el.data("origStyle", el.attr("style"));
1030			el.children(slider.settings.slideSelector).each(function() {
1031			  $(this).data("origStyle", $(this).attr("style"));
1032			});
1033			// perform all DOM / CSS modifications
1034			setup();
1035		}
1036
1037		/**
1038		 * Performs all DOM and CSS modifications
1039		 */
1040		var setup = function(){
1041			// wrap el in a wrapper
1042			el.wrap('<div class="' + slider.settings.wrapperClass + '"><div class="bx-viewport"></div></div>');
1043			// store a namspace reference to .bx-viewport
1044			slider.viewport = el.parent();
1045			// add a loading div to display while images are loading
1046			slider.loader = $('<div class="bx-loading" />');
1047			slider.viewport.prepend(slider.loader);
1048			// set el to a massive width, to hold any needed slides
1049			// also strip any margin and padding from el
1050			el.css({
1051				width: slider.settings.mode == 'horizontal' ? (slider.children.length * 100 + 215) + '%' : 'auto',
1052				position: 'relative'
1053			});
1054			// if using CSS, add the easing property
1055			if(slider.usingCSS && slider.settings.easing){
1056				el.css('-' + slider.cssPrefix + '-transition-timing-function', slider.settings.easing);
1057			// if not using CSS and no easing value was supplied, use the default JS animation easing (swing)
1058			}else if(!slider.settings.easing){
1059				slider.settings.easing = 'swing';
1060			}
1061			var slidesShowing = getNumberSlidesShowing();
1062			// make modifications to the viewport (.bx-viewport)
1063			slider.viewport.css({
1064				width: '100%',
1065				overflow: 'hidden',
1066				position: 'relative'
1067			});
1068			slider.viewport.parent().css({
1069				maxWidth: getViewportMaxWidth()
1070			});
1071			// make modification to the wrapper (.bx-wrapper)
1072			if(!slider.settings.pager) {
1073				slider.viewport.parent().css({
1074				margin: '0 auto 0px'
1075				});
1076			}
1077			// apply css to all slider children
1078			slider.children.css({
1079				'float': slider.settings.mode == 'horizontal' ? 'left' : 'none',
1080				listStyle: 'none',
1081				position: 'relative'
1082			});
1083			// apply the calculated width after the float is applied to prevent scrollbar interference
1084			slider.children.css('width', getSlideWidth());
1085			// if slideMargin is supplied, add the css
1086			if(slider.settings.mode == 'horizontal' && slider.settings.slideMargin > 0) slider.children.css('marginRight', slider.settings.slideMargin);
1087			if(slider.settings.mode == 'vertical' && slider.settings.slideMargin > 0) slider.children.css('marginBottom', slider.settings.slideMargin);
1088			// if "fade" mode, add positioning and z-index CSS
1089			if(slider.settings.mode == 'fade'){
1090				slider.children.css({
1091					position: 'absolute',
1092					zIndex: 0,
1093					display: 'none'
1094				});
1095				// prepare the z-index on the showing element
1096				slider.children.eq(slider.settings.startSlide).css({zIndex: slider.settings.slideZIndex, display: 'block'});
1097			}
1098			// create an element to contain all slider controls (pager, start / stop, etc)
1099			slider.controls.el = $('<div class="bx-controls" />');
1100			// if captions are requested, add them
1101			if(slider.settings.captions) appendCaptions();
1102			// check if startSlide is last slide
1103			slider.active.last = slider.settings.startSlide == getPagerQty() - 1;
1104			// if video is true, set up the fitVids plugin
1105			if(slider.settings.video) el.fitVids();
1106			// set the default preload selector (visible)
1107			var preloadSelector = slider.children.eq(slider.settings.startSlide);
1108			if (slider.settings.preloadImages == "all") preloadSelector = slider.children;
1109			// only check for control addition if not in "ticker" mode
1110			if(!slider.settings.ticker){
1111				// if pager is requested, add it
1112				if(slider.settings.pager) appendPager();
1113				// if controls are requested, add them
1114				if(slider.settings.controls) appendControls();
1115				// if auto is true, and auto controls are requested, add them
1116				if(slider.settings.auto && slider.settings.autoControls) appendControlsAuto();
1117				// if any control option is requested, add the controls wrapper
1118				if(slider.settings.controls || slider.settings.autoControls || slider.settings.pager) slider.viewport.after(slider.controls.el);
1119			// if ticker mode, do not allow a pager
1120			}else{
1121				slider.settings.pager = false;
1122			}
1123			// preload all images, then perform final DOM / CSS modifications that depend on images being loaded
1124			loadElements(preloadSelector, start);
1125		}
1126
1127		var loadElements = function(selector, callback){
1128			var total = selector.find('img, iframe').length;
1129			if (total == 0){
1130				callback();
1131				return;
1132			}
1133			var count = 0;
1134			selector.find('img, iframe').each(function(){
1135				$(this).one('load', function() {
1136				  if(++count == total) callback();
1137				}).each(function() {
1138				  if(this.complete) $(this).trigger('load');
1139				});
1140			});
1141		}
1142
1143		/**
1144		 * Start the slider
1145		 */
1146		var start = function(){
1147			// if infinite loop, prepare additional slides
1148			if(slider.settings.infiniteLoop && slider.settings.mode != 'fade' && !slider.settings.ticker){
1149				var slice = slider.settings.mode == 'vertical' ? slider.settings.minSlides : slider.settings.maxSlides;
1150				var sliceAppend = slider.children.slice(0, slice).clone().addClass('bx-clone');
1151				var slicePrepend = slider.children.slice(-slice).clone().addClass('bx-clone');
1152				el.append(sliceAppend).prepend(slicePrepend);
1153			}
1154			// remove the loading DOM element
1155			slider.loader.remove();
1156			// set the left / top position of "el"
1157			setSlidePosition();
1158			// if "vertical" mode, always use adaptiveHeight to prevent odd behavior
1159			if (slider.settings.mode == 'vertical') slider.settings.adaptiveHeight = true;
1160			// set the viewport height
1161			slider.viewport.height(getViewportHeight());
1162			// make sure everything is positioned just right (same as a window resize)
1163			el.redrawSlider();
1164			// onSliderLoad callback
1165			slider.settings.onSliderLoad(slider.active.index);
1166			// slider has been fully initialized
1167			slider.initialized = true;
1168			// bind the resize call to the window
1169			if (slider.settings.responsive) $(window).on('resize', resizeWindow);
1170			// if auto is true and has more than 1 page, start the show
1171			if (slider.settings.auto && slider.settings.autoStart && (getPagerQty() > 1 || slider.settings.autoSlideForOnePage)) initAuto();
1172			// if ticker is true, start the ticker
1173			if (slider.settings.ticker) initTicker();
1174			// if pager is requested, make the appropriate pager link active
1175			if (slider.settings.pager) updatePagerActive(slider.settings.startSlide);
1176			// check for any updates to the controls (like hideControlOnEnd updates)
1177			if (slider.settings.controls) updateDirectionControls();
1178			// if touchEnabled is true, setup the touch events
1179			if (slider.settings.touchEnabled && !slider.settings.ticker) initTouch();
1180		}
1181
1182		/**
1183		 * Returns the calculated height of the viewport, used to determine either adaptiveHeight or the maxHeight value
1184		 */
1185		var getViewportHeight = function(){
1186			var height = 0;
1187			// first determine which children (slides) should be used in our height calculation
1188			var children = $();
1189			// if mode is not "vertical" and adaptiveHeight is false, include all children
1190			if(slider.settings.mode != 'vertical' && !slider.settings.adaptiveHeight){
1191				children = slider.children;
1192			}else{
1193				// if not carousel, return the single active child
1194				if(!slider.carousel){
1195					children = slider.children.eq(slider.active.index);
1196				// if carousel, return a slice of children
1197				}else{
1198					// get the individual slide index
1199					var currentIndex = slider.settings.moveSlides == 1 ? slider.active.index : slider.active.index * getMoveBy();
1200					// add the current slide to the children
1201					children = slider.children.eq(currentIndex);
1202					// cycle through the remaining "showing" slides
1203					for (i = 1; i <= slider.settings.maxSlides - 1; i++){
1204						// if looped back to the start
1205						if(currentIndex + i >= slider.children.length){
1206							children = children.add(slider.children.eq(i - 1));
1207						}else{
1208							children = children.add(slider.children.eq(currentIndex + i));
1209						}
1210					}
1211				}
1212			}
1213			// if "vertical" mode, calculate the sum of the heights of the children
1214			if(slider.settings.mode == 'vertical'){
1215				children.each(function(index) {
1216				  height += $(this).outerHeight();
1217				});
1218				// add user-supplied margins
1219				if(slider.settings.slideMargin > 0){
1220					height += slider.settings.slideMargin * (slider.settings.minSlides - 1);
1221				}
1222			// if not "vertical" mode, calculate the max height of the children
1223			}else{
1224				height = Math.max.apply(Math, children.map(function(){
1225					return $(this).outerHeight(false);
1226				}).get());
1227			}
1228
1229			if(slider.viewport.css('box-sizing') == 'border-box'){
1230				height +=	parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom')) +
1231							parseFloat(slider.viewport.css('border-top-width')) + parseFloat(slider.viewport.css('border-bottom-width'));
1232			}else if(slider.viewport.css('box-sizing') == 'padding-box'){
1233				height +=	parseFloat(slider.viewport.css('padding-top')) + parseFloat(slider.viewport.css('padding-bottom'));
1234			}
1235
1236			return height;
1237		}
1238
1239		/**
1240		 * Returns the calculated width to be used for the outer wrapper / viewport
1241		 */
1242		var getViewportMaxWidth = function(){
1243			var width = '100%';
1244			if(slider.settings.slideWidth > 0){
1245				if(slider.settings.mode == 'horizontal'){
1246					width = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
1247				}else{
1248					width = slider.settings.slideWidth;
1249				}
1250			}
1251			return width;
1252		}
1253
1254		/**
1255		 * Returns the calculated width to be applied to each slide
1256		 */
1257		var getSlideWidth = function(){
1258			// start with any user-supplied slide width
1259			var newElWidth = slider.settings.slideWidth;
1260			// get the current viewport width
1261			var wrapWidth = slider.viewport.width();
1262			// if slide width was not supplied, or is larger than the viewport use the viewport width
1263			if(slider.settings.slideWidth == 0 ||
1264				(slider.settings.slideWidth > wrapWidth && !slider.carousel) ||
1265				slider.settings.mode == 'vertical'){
1266				newElWidth = wrapWidth;
1267			// if carousel, use the thresholds to determine the width
1268			}else if(slider.settings.maxSlides > 1 && slider.settings.mode == 'horizontal'){
1269				if(wrapWidth > slider.maxThreshold){
1270					// newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.maxSlides - 1))) / slider.settings.maxSlides;
1271				}else if(wrapWidth < slider.minThreshold){
1272					newElWidth = (wrapWidth - (slider.settings.slideMargin * (slider.settings.minSlides - 1))) / slider.settings.minSlides;
1273				}
1274			}
1275			return newElWidth;
1276		}
1277
1278		/**
1279		 * Returns the number of slides currently visible in the viewport (includes partially visible slides)
1280		 */
1281		var getNumberSlidesShowing = function(){
1282			var slidesShowing = 1;
1283			if(slider.settings.mode == 'horizontal' && slider.settings.slideWidth > 0){
1284				// if viewport is smaller than minThreshold, return minSlides
1285				if(slider.viewport.width() < slider.minThreshold){
1286					slidesShowing = slider.settings.minSlides;
1287				// if viewport is larger than minThreshold, return maxSlides
1288				}else if(slider.viewport.width() > slider.maxThreshold){
1289					slidesShowing = slider.settings.maxSlides;
1290				// if viewport is between min / max thresholds, divide viewport width by first child width
1291				}else{
1292					var childWidth = slider.children.first().width() + slider.settings.slideMargin;
1293					slidesShowing = Math.floor((slider.viewport.width() +
1294						slider.settings.slideMargin) / childWidth);
1295				}
1296			// if "vertical" mode, slides showing will always be minSlides
1297			}else if(slider.settings.mode == 'vertical'){
1298				slidesShowing = slider.settings.minSlides;
1299			}
1300			return slidesShowing;
1301		}
1302
1303		/**
1304		 * Returns the number of pages (one full viewport of slides is one "page")
1305		 */
1306		var getPagerQty = function(){
1307			var pagerQty = 0;
1308			// if moveSlides is specified by the user
1309			if(slider.settings.moveSlides > 0){
1310				if(slider.settings.infiniteLoop){
1311					pagerQty = Math.ceil(slider.children.length / getMoveBy());
1312				}else{
1313					// use a while loop to determine pages
1314					var breakPoint = 0;
1315					var counter = 0
1316					// when breakpoint goes above children length, counter is the number of pages
1317					while (breakPoint < slider.children.length){
1318						++pagerQty;
1319						breakPoint = counter + getNumberSlidesShowing();
1320						counter += slider.settings.moveSlides <= getNumberSlidesShowing() ? slider.settings.moveSlides : getNumberSlidesShowing();
1321					}
1322				}
1323			// if moveSlides is 0 (auto) divide children length by sides showing, then round up
1324			}else{
1325				pagerQty = Math.ceil(slider.children.length / getNumberSlidesShowing());
1326			}
1327			return pagerQty;
1328		}
1329
1330		/**
1331		 * Returns the number of indivual slides by which to shift the slider
1332		 */
1333		var getMoveBy = function(){
1334			// if moveSlides was set by the user and moveSlides is less than number of slides showing
1335			if(slider.settings.moveSlides > 0 && slider.settings.moveSlides <= getNumberSlidesShowing()){
1336				return slider.settings.moveSlides;
1337			}
1338			// if moveSlides is 0 (auto)
1339			return getNumberSlidesShowing();
1340		}
1341
1342		/**
1343		 * Sets the slider's (el) left or top position
1344		 */
1345		var setSlidePosition = function(){
1346			// if last slide, not infinite loop, and number of children is larger than specified maxSlides
1347			if(slider.children.length > slider.settings.maxSlides && slider.active.last && !slider.settings.infiniteLoop){
1348				if (slider.settings.mode == 'horizontal'){
1349					// get the last child's position
1350					var lastChild = slider.children.last();
1351					var position = lastChild.position();
1352					// set the left position
1353					setPositionProperty(-(position.left - (slider.viewport.width() - lastChild.outerWidth())), 'reset', 0);
1354				}else if(slider.settings.mode == 'vertical'){
1355					// get the last showing index's position
1356					var lastShowingIndex = slider.children.length - slider.settings.minSlides;
1357					var position = slider.children.eq(lastShowingIndex).position();
1358					// set the top position
1359					setPositionProperty(-position.top, 'reset', 0);
1360				}
1361			// if not last slide
1362			}else{
1363				// get the position of the first showing slide
1364				var position = slider.children.eq(slider.active.index * getMoveBy()).position();
1365				// check for last slide
1366				if (slider.active.index == getPagerQty() - 1) slider.active.last = true;
1367				// set the repective position
1368				if (position != undefined){
1369					if (slider.settings.mode == 'horizontal') setPositionProperty(-position.left, 'reset', 0);
1370					else if (slider.settings.mode == 'vertical') setPositionProperty(-position.top, 'reset', 0);
1371				}
1372			}
1373		}
1374
1375		/**
1376		 * Sets the el's animating property position (which in turn will sometimes animate el).
1377		 * If using CSS, sets the transform property. If not using CSS, sets the top / left property.
1378		 *
1379		 * @param value (int)
1380		 *  - the animating property's value
1381		 *
1382		 * @param type (string) 'slider', 'reset', 'ticker'
1383		 *  - the type of instance for which the function is being
1384		 *
1385		 * @param duration (int)
1386		 *  - the amount of time (in ms) the transition should occupy
1387		 *
1388		 * @param params (array) optional
1389		 *  - an optional parameter containing any variables that need to be passed in
1390		 */
1391		var setPositionProperty = function(value, type, duration, params){
1392			// use CSS transform
1393			if(slider.usingCSS){
1394				// determine the translate3d value
1395				var propValue = slider.settings.mode == 'vertical' ? 'translate3d(0, ' + value + 'px, 0)' : 'translate3d(' + value + 'px, 0, 0)';
1396				// add the CSS transition-duration
1397				el.css('-' + slider.cssPrefix + '-transition-duration', duration / 1000 + 's');
1398				if(type == 'slide'){
1399					// set the property value
1400					el.css(slider.animProp, propValue);
1401					// bind a callback method - executes when CSS transition completes
1402					el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
1403						// unbind the callback
1404						el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1405						updateAfterSlideTransition();
1406					});
1407				}else if(type == 'reset'){
1408					el.css(slider.animProp, propValue);
1409				}else if(type == 'ticker'){
1410					// make the transition use 'linear'
1411					el.css('-' + slider.cssPrefix + '-transition-timing-function', 'linear');
1412					el.css(slider.animProp, propValue);
1413					// bind a callback method - executes when CSS transition completes
1414					el.on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
1415						// unbind the callback
1416						el.off('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
1417						// reset the position
1418						setPositionProperty(params['resetValue'], 'reset', 0);
1419						// start the loop again
1420						tickerLoop();
1421					});
1422				}
1423			// use JS animate
1424			}else{
1425				var animateObj = {};
1426				animateObj[slider.animProp] = value;
1427				if(type == 'slide'){
1428					el.animate(animateObj, duration, slider.settings.easing, function(){
1429						updateAfterSlideTransition();
1430					});
1431				}else if(type == 'reset'){
1432					el.css(slider.animProp, value)
1433				}else if(type == 'ticker'){
1434					el.animate(animateObj, speed, 'linear', function(){
1435						setPositionProperty(params['resetValue'], 'reset', 0);
1436						// run the recursive loop after animation
1437						tickerLoop();
1438					});
1439				}
1440			}
1441		}
1442
1443		/**
1444		 * Populates the pager with proper amount of pages
1445		 */
1446		var populatePager = function(){
1447			var pagerHtml = '';
1448			var pagerQty = getPagerQty();
1449			// loop through each pager item
1450			for(var i=0; i < pagerQty; i++){
1451				var linkContent = '';
1452				// if a buildPager function is supplied, use it to get pager link value, else use index + 1
1453				if(slider.settings.buildPager && typeof slider.settings.buildPager === 'function'){
1454					linkContent = slider.settings.buildPager(i);
1455					slider.pagerEl.addClass('bx-custom-pager');
1456				}else{
1457					linkContent = i + 1;
1458					slider.pagerEl.addClass('bx-default-pager');
1459				}
1460				// var linkContent = slider.settings.buildPager && typeof slider.settings.buildPager === 'function' ? slider.settings.buildPager(i) : i + 1;
1461				// add the markup to the string
1462				pagerHtml += '<div class="bx-pager-item"><a href="" data-slide-index="' + i + '" class="bx-pager-link">' + linkContent + '</a></div>';
1463			};
1464			// populate the pager element with pager links
1465			slider.pagerEl.html(pagerHtml);
1466		}
1467
1468		/**
1469		 * Appends the pager to the controls element
1470		 */
1471		var appendPager = function(){
1472			if(!slider.settings.pagerCustom){
1473				// create the pager DOM element
1474				slider.pagerEl = $('<div class="bx-pager" />');
1475				// if a pager selector was supplied, populate it with the pager
1476				if(slider.settings.pagerSelector){
1477					$(slider.settings.pagerSelector).html(slider.pagerEl);
1478				// if no pager selector was supplied, add it after the wrapper
1479				}else{
1480					slider.controls.el.addClass('bx-has-pager').append(slider.pagerEl);
1481				}
1482				// populate the pager
1483				populatePager();
1484			}else{
1485				slider.pagerEl = $(slider.settings.pagerCustom);
1486			}
1487			// assign the pager click binding
1488			slider.pagerEl.on('click', 'a', clickPagerBind);
1489
1490			slider.pagerEl.on('mouseover', 'a', mouseOverPagerBind);
1491		}
1492
1493		/**
1494		 * Appends prev / next controls to the controls element
1495		 */
1496		var appendControls = function(){
1497			slider.controls.next = $('<a class="bx-next" href="">' + slider.settings.nextText + '</a>');
1498			slider.controls.prev = $('<a class="bx-prev" href="">' + slider.settings.prevText + '</a>');
1499			// bind click actions to the controls
1500			slider.controls.next.on('click', clickNextBind);
1501			slider.controls.prev.on('click', clickPrevBind);
1502			// if nextSlector was supplied, populate it
1503			if(slider.settings.nextSelector){
1504				$(slider.settings.nextSelector).append(slider.controls.next);
1505			}
1506			// if prevSlector was supplied, populate it
1507			if(slider.settings.prevSelector){
1508				$(slider.settings.prevSelector).append(slider.controls.prev);
1509			}
1510			// if no custom selectors were supplied
1511			if(!slider.settings.nextSelector && !slider.settings.prevSelector){
1512				// add the controls to the DOM
vendor: 1,820 bytes, lines 1513-1546
1513				slider.controls.directionEl = $('<div class="bx-controls-direction" />');
1514				// add the control elements to the directionEl
1515				slider.controls.directionEl.append(slider.controls.prev).append(slider.controls.next);
1516				// slider.viewport.append(slider.controls.directionEl);
1517				slider.controls.el.addClass('bx-has-controls-direction').append(slider.controls.directionEl);
1518			}
1519		}
1520
1521		/**
1522		 * Appends start / stop auto controls to the controls element
1523		 */
1524		var appendControlsAuto = function(){
1525			slider.controls.start = $('<div class="bx-controls-auto-item"><a class="bx-start" href="">' + slider.settings.startText + '</a></div>');
1526			slider.controls.stop = $('<div class="bx-controls-auto-item"><a class="bx-stop" href="">' + slider.settings.stopText + '</a></div>');
1527			// add the controls to the DOM
1528			slider.controls.autoEl = $('<div class="bx-controls-auto" />');
1529			// bind click actions to the controls
1530			slider.controls.autoEl.on('click', '.bx-start', clickStartBind);
1531			slider.controls.autoEl.on('click', '.bx-stop', clickStopBind);
1532			// if autoControlsCombine, insert only the "start" control
1533			if(slider.settings.autoControlsCombine){
1534				slider.controls.autoEl.append(slider.controls.start);
1535			// if autoControlsCombine is false, insert both controls
1536			}else{
1537				slider.controls.autoEl.append(slider.controls.start).append(slider.controls.stop);
1538			}
1539			// if auto controls selector was supplied, populate it with the controls
1540			if(slider.settings.autoControlsSelector){
1541				$(slider.settings.autoControlsSelector).html(slider.controls.autoEl);
1542			// if auto controls selector was not supplied, add it after the wrapper
1543			}else{
1544				slider.controls.el.addClass('bx-has-controls-auto').append(slider.controls.autoEl);
1545			}
1546			// update the auto controls
1547			updateAutoControls(slider.settings.autoStart ? 'stop' : 'start');
1548		}
1549
1550		/**
1551		 * Appends image captions to the DOM
1552		 */
1553		var appendCaptions = function(){
1554			// cycle through each child
1555			slider.children.each(function(index){
1556				// get the image title attribute
1557				var title = $(this).find('img:first').attr('title');
1558				// append the caption
1559				if (title != undefined && ('' + title).length) {
1560                    $(this).append('<div class="bx-caption"><span>' + title + '</span></div>');
1561                }
1562			});
1563		}
1564
1565		/**
1566		 * Click next binding
1567		 *
1568		 * @param e (event)
1569		 *  - DOM event object
1570		 */
1571		var clickNextBind = function(e){
1572			// if auto show is running, stop it
1573			if (slider.settings.auto) el.stopAuto();
1574			el.goToNextSlide();
1575			e.preventDefault();
1576		}
1577
1578		/**
1579		 * Click prev binding
1580		 *
1581		 * @param e (event)
1582		 *  - DOM event object
1583		 */
1584		var clickPrevBind = function(e){
1585			// if auto show is running, stop it
1586			if (slider.settings.auto) el.stopAuto();
1587			el.goToPrevSlide();
1588			e.preventDefault();
1589		}
1590
1591		/**
1592		 * Click start binding
1593		 *
1594		 * @param e (event)
1595		 *  - DOM event object
1596		 */
1597		var clickStartBind = function(e){
1598			el.startAuto();
1599			e.preventDefault();
1600		}
1601
1602		/**
1603		 * Click stop binding
1604		 *
1605		 * @param e (event)
1606		 *  - DOM event object
1607		 */
1608		var clickStopBind = function(e){
1609			el.stopAuto();
1610			e.preventDefault();
1611		}
1612
1613		/**
1614		 * Click pager binding
1615		 *
1616		 * @param e (event)
1617		 *  - DOM event object
1618		 */
1619		var clickPagerBind = function(e){
1620			// if auto show is running, stop it
1621			if (slider.settings.auto) el.stopAuto();
1622			var pagerLink = $(e.currentTarget);
1623			if(pagerLink.attr('data-slide-index') !== undefined){
1624				var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
1625				// if clicked pager link is not active, continue with the goToSlide call
1626				//if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
1627				//e.preventDefault();
1628			}
1629		}
1630
1631		/**
1632		 * MouseOver pager binding
1633		 *
1634		 * @param e (event)
1635		 *  - DOM event object
1636		 */
1637		var mouseOverPagerBind = function(e){
1638			// if auto show is running, stop it
1639			if (slider.settings.auto) el.stopAuto();
1640			var pagerLink = $(e.currentTarget);
1641			if(pagerLink.attr('data-slide-index') !== undefined){
1642				var pagerIndex = parseInt(pagerLink.attr('data-slide-index'));
1643				//
1644				if(pagerIndex != slider.active.index) el.goToSlide(pagerIndex);
1645				e.preventDefault();
1646			}
1647		}
1648
1649		/**
1650		 * Updates the pager links with an active class
1651		 *
1652		 * @param slideIndex (int)
1653		 *  - index of slide to make active
1654		 */
1655		var updatePagerActive = function(slideIndex){
1656			// if "short" pager type
1657			var len = slider.children.length; // nb of children
1658			if(slider.settings.pagerType == 'short'){
1659				if(slider.settings.maxSlides > 1) {
1660					len = Math.ceil(slider.children.length/slider.settings.maxSlides);
1661				}
1662				slider.pagerEl.html( (slideIndex + 1) + slider.settings.pagerShortSeparator + len);
1663				return;
1664			}
1665			// remove all pager active classes
1666			slider.pagerEl.find('a').removeClass('active');
1667			// apply the active class for all pagers
1668			slider.pagerEl.each(function(i, el) { $(el).find('a').eq(slideIndex).addClass('active'); });
1669		}
1670
1671		/**
1672		 * Performs needed actions after a slide transition
1673		 */
1674		var updateAfterSlideTransition = function(){
1675			// if infinte loop is true
1676			if(slider.settings.infiniteLoop){
1677				var position = '';
1678				// first slide
1679				if(slider.active.index == 0){
1680					// set the new position
1681					position = slider.children.eq(0).position();
1682				// carousel, last slide
1683				}else if(slider.active.index == getPagerQty() - 1 && slider.carousel){
1684					position = slider.children.eq((getPagerQty() - 1) * getMoveBy()).position();
1685				// last slide
1686				}else if(slider.active.index == slider.children.length - 1){
1687					position = slider.children.eq(slider.children.length - 1).position();
1688				}
1689				if(position){
1690					if (slider.settings.mode == 'horizontal') { setPositionProperty(-position.left, 'reset', 0); }
1691					else if (slider.settings.mode == 'vertical') { setPositionProperty(-position.top, 'reset', 0); }
1692				}
1693			}
1694			// declare that the transition is complete
1695			slider.working = false;
1696			// onSlideAfter callback
1697			slider.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
1698		}
1699
1700		/**
1701		 * Updates the auto controls state (either active, or combined switch)
1702		 *
1703		 * @param state (string) "start", "stop"
1704		 *  - the new state of the auto show
1705		 */
1706		var updateAutoControls = function(state){
1707			// if autoControlsCombine is true, replace the current control with the new state
1708			if(slider.settings.autoControlsCombine){
1709				slider.controls.autoEl.html(slider.controls[state]);
1710			// if autoControlsCombine is false, apply the "active" class to the appropriate control
1711			}else{
1712				slider.controls.autoEl.find('a').removeClass('active');
1713				slider.controls.autoEl.find('a:not(.bx-' + state + ')').addClass('active');
1714			}
1715		}
1716
1717		/**
1718		 * Updates the direction controls (checks if either should be hidden)
1719		 */
1720		var updateDirectionControls = function(){
1721			if(getPagerQty() == 1){
1722				slider.controls.prev.addClass('disabled');
1723				slider.controls.next.addClass('disabled');
1724			}else if(!slider.settings.infiniteLoop && slider.settings.hideControlOnEnd){
1725				// if first slide
1726				if (slider.active.index == 0){
1727					slider.controls.prev.addClass('disabled');
1728					slider.controls.next.removeClass('disabled');
1729				// if last slide
1730				}else if(slider.active.index == getPagerQty() - 1){
1731					slider.controls.next.addClass('disabled');
1732					slider.controls.prev.removeClass('disabled');
1733				// if any slide in the middle
1734				}else{
1735					slider.controls.prev.removeClass('disabled');
1736					slider.controls.next.removeClass('disabled');
1737				}
1738			}
1739		}
1740
1741		/**
1742		 * Initialzes the auto process
1743		 */
1744		var initAuto = function(){
1745			// if autoDelay was supplied, launch the auto show using a setTimeout() call
1746			if(slider.settings.autoDelay > 0){
1747				var timeout = setTimeout(el.startAuto, slider.settings.autoDelay);
1748			// if autoDelay was not supplied, start the auto show normally
1749			}else{
1750				el.startAuto();
1751			}
1752			// if autoHover is requested
1753			if(slider.settings.autoHover){
1754				// on el hover
1755				el.hover(function(){
1756					// if the auto show is currently playing (has an active interval)
1757					if(slider.interval){
1758						// stop the auto show and pass true agument which will prevent control update
1759						el.stopAuto(true);
1760						// create a new autoPaused value which will be used by the relative "mouseout" event
1761						slider.autoPaused = true;
1762					}
1763				}, function(){
1764					// if the autoPaused value was created be the prior "mouseover" event
1765					if(slider.autoPaused){
1766						// start the auto show and pass true agument which will prevent control update
1767						el.startAuto(true);
1768						// reset the autoPaused value
1769						slider.autoPaused = null;
1770					}
1771				});
1772			}
1773		}
1774
1775		/**
1776		 * Initialzes the ticker process
1777		 */
1778		var initTicker = function(){
1779			var startPosition = 0;
1780			// if autoDirection is "next", append a clone of the entire slider
1781			if(slider.settings.autoDirection == 'next'){
1782				el.append(slider.children.clone().addClass('bx-clone'));
1783			// if autoDirection is "prev", prepend a clone of the entire slider, and set the left position
1784			}else{
1785				el.prepend(slider.children.clone().addClass('bx-clone'));
1786				var position = slider.children.first().position();
1787				startPosition = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
1788			}
1789			setPositionProperty(startPosition, 'reset', 0);
1790			// do not allow controls in ticker mode
1791			slider.settings.pager = false;
1792			slider.settings.controls = false;
1793			slider.settings.autoControls = false;
1794			// if autoHover is requested
1795			if(slider.settings.tickerHover && !slider.usingCSS){
1796				// on el hover
1797				slider.viewport.hover(function(){
1798					el.stop();
1799				}, function(){
1800					// calculate the total width of children (used to calculate the speed ratio)
1801					var totalDimens = 0;
1802					slider.children.each(function(index){
1803					  totalDimens += slider.settings.mode == 'horizontal' ? $(this).outerWidth(true) : $(this).outerHeight(true);
1804					});
1805					// calculate the speed ratio (used to determine the new speed to finish the paused animation)
1806					var ratio = slider.settings.speed / totalDimens;
1807					// determine which property to use
1808					var property = slider.settings.mode == 'horizontal' ? 'left' : 'top';
1809					// calculate the new speed
1810					var newSpeed = ratio * (totalDimens - (Math.abs(parseInt(el.css(property)))));
1811					tickerLoop(newSpeed);
1812				});
1813			}
1814			// start the ticker loop
1815			tickerLoop();
1816		}
1817
1818		/**
1819		 * Runs a continuous loop, news ticker-style
1820		 */
1821		var tickerLoop = function(resumeSpeed){
1822			speed = resumeSpeed ? resumeSpeed : slider.settings.speed;
1823			var position = {left: 0, top: 0};
1824			var reset = {left: 0, top: 0};
1825			// if "next" animate left position to last child, then reset left to 0
1826			if(slider.settings.autoDirection == 'next'){
1827				position = el.find('.bx-clone').first().position();
1828			// if "prev" animate left position to 0, then reset left to first non-clone child
1829			}else{
1830				reset = slider.children.first().position();
1831			}
1832			var animateProperty = slider.settings.mode == 'horizontal' ? -position.left : -position.top;
1833			var resetValue = slider.settings.mode == 'horizontal' ? -reset.left : -reset.top;
1834			var params = {resetValue: resetValue};
1835			setPositionProperty(animateProperty, 'ticker', speed, params);
1836		}
1837
1838		/**
1839		 * Initializes touch events
1840		 */
1841		var initTouch = function(){
1842			// initialize object to contain all touch values
1843			slider.touch = {
1844				start: {x: 0, y: 0},
1845				end: {x: 0, y: 0}
1846			}
1847			slider.viewport.on('touchstart', onTouchStart);
1848		}
1849
1850		/**
1851		 * Event handler for "touchstart"
1852		 *
1853		 * @param e (event)
1854		 *  - DOM event object
1855		 */
1856		var onTouchStart = function(e){
1857			if(slider.working){
1858				e.preventDefault();
1859			}else{
1860				// record the original position when touch starts
1861				slider.touch.originalPos = el.position();
1862				var orig = e.originalEvent;
1863				// record the starting touch x, y coordinates
1864				slider.touch.start.x = orig.changedTouches[0].pageX;
1865				slider.touch.start.y = orig.changedTouches[0].pageY;
1866				// bind a "touchmove" event to the viewport
1867				slider.viewport.on('touchmove', onTouchMove);
1868				// bind a "touchend" event to the viewport
1869				slider.viewport.on('touchend', onTouchEnd);
1870			}
1871		}
1872
1873		/**
1874		 * Event handler for "touchmove"
1875		 *
1876		 * @param e (event)
1877		 *  - DOM event object
1878		 */
1879		var onTouchMove = function(e){
1880			var orig = e.originalEvent;
1881			// if scrolling on y axis, do not prevent default
1882			var xMovement = Math.abs(orig.changedTouches[0].pageX - slider.touch.start.x);
1883			var yMovement = Math.abs(orig.changedTouches[0].pageY - slider.touch.start.y);
1884			// x axis swipe
1885			if((xMovement * 3) > yMovement && slider.settings.preventDefaultSwipeX){
1886				e.preventDefault();
1887			// y axis swipe
1888			}else if((yMovement * 3) > xMovement && slider.settings.preventDefaultSwipeY){
1889				e.preventDefault();
1890			}
1891			if(slider.settings.mode != 'fade' && slider.settings.oneToOneTouch){
1892				var value = 0;
1893				// if horizontal, drag along x axis
1894				if(slider.settings.mode == 'horizontal'){
1895					var change = orig.changedTouches[0].pageX - slider.touch.start.x;
1896					value = slider.touch.originalPos.left + change;
1897				// if vertical, drag along y axis
1898				}else{
1899					var change = orig.changedTouches[0].pageY - slider.touch.start.y;
1900					value = slider.touch.originalPos.top + change;
1901				}
1902				setPositionProperty(value, 'reset', 0);
1903			}
1904		}
1905
1906		/**
1907		 * Event handler for "touchend"
1908		 *
1909		 * @param e (event)
1910		 *  - DOM event object
1911		 */
1912		var onTouchEnd = function(e){
1913			slider.viewport.off('touchmove', onTouchMove);
1914			var orig = e.originalEvent;
1915			var value = 0;
1916			// record end x, y positions
1917			slider.touch.end.x = orig.changedTouches[0].pageX;
1918			slider.touch.end.y = orig.changedTouches[0].pageY;
1919			// if fade mode, check if absolute x distance clears the threshold
1920			if(slider.settings.mode == 'fade'){
1921				var distance = Math.abs(slider.touch.start.x - slider.touch.end.x);
1922				if(distance >= slider.settings.swipeThreshold){
1923					slider.touch.start.x > slider.touch.end.x ? el.goToNextSlide() : el.goToPrevSlide();
1924					el.stopAuto();
1925				}
1926			// not fade mode
1927			}else{
1928				var distance = 0;
1929				// calculate distance and el's animate property
1930				if(slider.settings.mode == 'horizontal'){
1931					distance = slider.touch.end.x - slider.touch.start.x;
1932					value = slider.touch.originalPos.left;
1933				}else{
1934					distance = slider.touch.end.y - slider.touch.start.y;
1935					value = slider.touch.originalPos.top;
1936				}
1937				// if not infinite loop and first / last slide, do not attempt a slide transition
1938				if(!slider.settings.infiniteLoop && ((slider.active.index == 0 && distance > 0) || (slider.active.last && distance < 0))){
1939					setPositionProperty(value, 'reset', 200);
1940				}else{
1941					// check if distance clears threshold
1942					if(Math.abs(distance) >= slider.settings.swipeThreshold){
1943						distance < 0 ? el.goToNextSlide() : el.goToPrevSlide();
1944						el.stopAuto();
1945					}else{
1946						// el.animate(property, 200);
1947						setPositionProperty(value, 'reset', 200);
1948					}
1949				}
1950			}
1951			slider.viewport.off('touchend', onTouchEnd);
1952		}
1953
1954		/**
1955		 * Window resize event callback
1956		 */
1957		var resizeWindow = function(e){
1958			// don't do anything if slider isn't initialized.
1959			if(!slider.initialized) return;
1960			// get the new window dimens (again, thank you IE)
1961			var windowWidthNew = $(window).width();
1962			var windowHeightNew = $(window).height();
1963			// make sure that it is a true window resize
1964			// *we must check this because our dinosaur friend IE fires a window resize event when certain DOM elements
1965			// are resized. Can you just die already?*
1966			if(windowWidth != windowWidthNew || windowHeight != windowHeightNew){
1967				// set the new window dimens
1968				windowWidth = windowWidthNew;
1969				windowHeight = windowHeightNew;
1970				// update all dynamic elements
1971				el.redrawSlider();
1972				// Call user resize handler
1973				slider.settings.onSliderResize.call(el, slider.active.index);
1974			}
1975		}
1976
1977		/**
1978		 * ===================================================================================
1979		 * = PUBLIC FUNCTIONS
1980		 * ===================================================================================
1981		 */
1982
1983		/**
1984		 * Performs slide transition to the specified slide
1985		 *
1986		 * @param slideIndex (int)
1987		 *  - the destination slide's index (zero-based)
1988		 *
1989		 * @param direction (string)
1990		 *  - INTERNAL USE ONLY - the direction of travel ("prev" / "next")
1991		 */
1992		el.goToSlide = function(slideIndex, direction){
1993			// if plugin is currently in motion, ignore request
1994			//if(slider.working || slider.active.index == slideIndex) return;
1995			if(slider.active.index == slideIndex) return;
1996
1997			// declare that plugin is in motion
1998			slider.working = true;
1999			// store the old index
2000			slider.oldIndex = slider.active.index;
2001			// if slideIndex is less than zero, set active index to last child (this happens during infinite loop)
2002			if(slideIndex < 0){
2003				slider.active.index = getPagerQty() - 1;
2004			// if slideIndex is greater than children length, set active index to 0 (this happens during infinite loop)
2005			}else if(slideIndex >= getPagerQty()){
2006				slider.active.index = 0;
2007			// set active index to requested slide
2008			}else{
2009				slider.active.index = slideIndex;
2010			}
2011			// onSlideBefore, onSlideNext, onSlidePrev callbacks
2012			slider.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
2013			if(direction == 'next'){
2014				slider.settings.onSlideNext(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
2015			}else if(direction == 'prev'){
2016				slider.settings.onSlidePrev(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
2017			}
2018			// check if last slide
2019			slider.active.last = slider.active.index >= getPagerQty() - 1;
2020			// update the pager with active class
2021			if(slider.settings.pager) updatePagerActive(slider.active.index);
2022			// // check for direction control update
2023			if(slider.settings.controls) updateDirectionControls();
2024			// if slider is set to mode: "fade"
2025			if(slider.settings.mode == 'fade'){
2026				// if adaptiveHeight is true and next height is different from current height, animate to the new height
2027				if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHeight()){
2028					slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
2029				}
2030				// fade out the visible child and reset its z-index value
2031				slider.children.filter(':visible').stop(true, true).fadeOut(slider.settings.speed).css({zIndex: 0});
2032
2033				// fade in the newly requested slide
2034				/*
2035				slider.children.eq(slider.active.index).css('zIndex', slider.settings.slideZIndex+1).fadeIn(slider.settings.speed, function(){
2036					$(this).css('zIndex', slider.settings.slideZIndex);
2037					updateAfterSlideTransition();
2038				});*/
2039
2040				slider.children.eq(slider.active.index).stop(true, true).css('zIndex', slider.settings.slideZIndex+1).css({'display':'block','opacity':'0'}).animate({'opacity':'1'},{
2041					complete:function(){
2042						$(this).css('zIndex', slider.settings.slideZIndex);
2043						updateAfterSlideTransition();
2044					}
2045				});
2046
2047
2048			// slider mode is not "fade"
2049			}else{
2050				// if adaptiveHeight is true and next height is different from current height, animate to the new height
2051				if(slider.settings.adaptiveHeight && slider.viewport.height() != getViewportHe
2051ight()){
2052					slider.viewport.animate({height: getViewportHeight()}, slider.settings.adaptiveHeightSpeed);
2053				}
2054				var moveBy = 0;
2055				var position = {left: 0, top: 0};
2056				// if carousel and not infinite loop
2057				if(!slider.settings.infiniteLoop && slider.carousel && slider.active.last){
2058					if(slider.settings.mode == 'horizontal'){
2059						// get the last child position
2060						var lastChild = slider.children.eq(slider.children.length - 1);
2061						position = lastChild.position();
2062						// calculate the position of the last slide
2063						moveBy = slider.viewport.width() - lastChild.outerWidth();
2064					}else{
2065						// get last showing index position
2066						var lastShowingIndex = slider.children.length - slider.settings.minSlides;
2067						position = slider.children.eq(lastShowingIndex).position();
2068					}
2069					// horizontal carousel, going previous while on first slide (infiniteLoop mode)
2070				}else if(slider.carousel && slider.active.last && direction == 'prev'){
2071					// get the last child position
2072					var eq = slider.settings.moveSlides == 1 ? slider.settings.maxSlides - getMoveBy() : ((getPagerQty() - 1) * getMoveBy()) - (slider.children.length - slider.settings.maxSlides);
2073					var lastChild = el.children('.bx-clone').eq(eq);
2074					position = lastChild.position();
2075				// if infinite loop and "Next" is clicked on the last slide
2076				}else if(direction == 'next' && slider.active.index == 0){
2077					// get the last clone position
2078					position = el.find('> .bx-clone').eq(slider.settings.maxSlides).position();
2079					slider.active.last = false;
2080				// normal non-zero requests
2081				}else if(slideIndex >= 0){
2082					var requestEl = slideIndex * getMoveBy();
2083					position = slider.children.eq(requestEl).position();
2084				}
2085
2086				/* If the position doesn't exist
2087				 * (e.g. if you destroy the slider on a next click),
2088				 * it doesn't throw an error.
2089				 */
2090				if ("undefined" !== typeof(position)) {
2091					var value = slider.settings.mode == 'horizontal' ? -(position.left - moveBy) : -position.top;
2092					// plugin values to be animated
2093					setPositionProperty(value, 'slide', slider.settings.speed);
2094				}
2095			}
2096		}
2097
2098		/**
2099		 * Transitions to the next slide in the show
2100		 */
2101		el.goToNextSlide = function(){
2102			// if infiniteLoop is false and last page is showing, disregard call
2103			if (!slider.settings.infiniteLoop && slider.active.last) return;
2104			var pagerIndex = parseInt(slider.active.index) + 1;
2105			el.goToSlide(pagerIndex, 'next');
2106		}
2107
2108		/**
2109		 * Transitions to the prev slide in the show
2110		 */
2111		el.goToPrevSlide = function(){
2112			// if infiniteLoop is false and last page is showing, disregard call
2113			if (!slider.settings.infiniteLoop && slider.active.index == 0) return;
2114			var pagerIndex = parseInt(slider.active.index) - 1;
2115			el.goToSlide(pagerIndex, 'prev');
2116		}
2117
2118		/**
2119		 * Starts the auto show
2120		 *
2121		 * @param preventControlUpdate (boolean)
2122		 *  - if true, auto controls state will not be updated
2123		 */
2124		el.startAuto = function(preventControlUpdate){
2125			// if an interval already exists, disregard call
2126			if(slider.interval) return;
2127			// create an interval
2128			slider.interval = setInterval(function(){
2129				slider.settings.autoDirection == 'next' ? el.goToNextSlide() : el.goToPrevSlide();
2130			}, slider.settings.pause);
2131			// if auto controls are displayed and preventControlUpdate is not true
2132			if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('stop');
2133		}
2134
2135		/**
2136		 * Stops the auto show
2137		 *
2138		 * @param preventControlUpdate (boolean)
2139		 *  - if true, auto controls state will not be updated
2140		 */
2141		el.stopAuto = function(preventControlUpdate){
2142			// if no interval exists, disregard call
2143			if(!slider.interval) return;
2144			// clear the interval
2145			clearInterval(slider.interval);
2146			slider.interval = null;
2147			// if auto controls are displayed and preventControlUpdate is not true
2148			if (slider.settings.autoControls && preventControlUpdate != true) updateAutoControls('start');
2149		}
2150
2151		/**
2152		 * Returns current slide index (zero-based)
2153		 */
2154		el.getCurrentSlide = function(){
2155			return slider.active.index;
2156		}
2157
2158		/**
2159		 * Returns current slide element
2160		 */
2161		el.getCurrentSlideElement = function(){
2162			return slider.children.eq(slider.active.index);
2163		}
2164
2165		/**
2166		 * Returns number of slides in show
2167		 */
2168		el.getSlideCount = function(){
2169			return slider.children.length;
2170		}
2171
2172		/**
2173		 * Update all dynamic slider elements
2174		 */
2175		el.redrawSlider = function(){
2176			// resize all children in ratio to new screen size
2177			slider.children.add(el.find('.bx-clone')).width(getSlideWidth());
2178			// adjust the height
2179			slider.viewport.css('height', getViewportHeight());
2180			// update the slide position
2181			if(!slider.settings.ticker) setSlidePosition();
2182			// if active.last was true before the screen resize, we want
2183			// to keep it last no matter what screen size we end on
2184			if (slider.active.last) slider.active.index = getPagerQty() - 1;
2185			// if the active index (page) no longer exists due to the resize, simply set the index as last
2186			if (slider.active.index >= getPagerQty()) slider.active.last = true;
2187			// if a pager is being displayed and a custom pager is not being used, update it
2188			if(slider.settings.pager && !slider.settings.pagerCustom){
2189				populatePager();
2190				updatePagerActive(slider.active.index);
2191			}
2192		}
2193
2194		/**
2195		 * Destroy the current instance of the slider (revert everything back to original state)
2196		 */
2197		el.destroySlider = function(){
2198			// don't do anything if slider has already been destroyed
2199			if(!slider.initialized) return;
2200			slider.initialized = false;
2201			$('.bx-clone', this).remove();
2202			slider.children.each(function() {
2203				$(this).data("origStyle") != undefined ? $(this).attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
2204			});
2205			$(this).data("origStyle") != undefined ? this.attr("style", $(this).data("origStyle")) : $(this).removeAttr('style');
2206			if ($(this).closest('.' + slider.settings.wrapperClass).length) {
2207				$(this).unwrap().unwrap();
2208			}
2209			if(slider.controls.el) slider.controls.el.remove();
2210			if(slider.controls.next) slider.controls.next.remove();
2211			if(slider.controls.prev) slider.controls.prev.remove();
2212			if(slider.pagerEl && slider.settings.controls) slider.pagerEl.remove();
2213			$('.bx-caption', this).remove();
2214			if(slider.controls.autoEl) slider.controls.autoEl.remove();
2215			clearInterval(slider.interval);
2216			if(slider.settings.responsive) $(window).off('resize', resizeWindow);
2217		}
2218
2219		/**
2220		 * Reload the slider (revert all DOM changes, and re-initialize)
2221		 */
2222		el.reloadSlider = function(settings){
2223			if (settings != undefined) options = settings;
2224			el.destroySlider();
2225			init();
2226		}
2227
2228		init();
2229
2230		// returns the current jQuery object
2231		return this;
2232	}
2233
2234})(jQuery);
2235
2236/*!
2237 * MoveTo - A lightweight scroll animation javascript library without any dependency.
2238 * Version 1.8.2 (28-06-2019 14:30)
2239 * Licensed under MIT
2240 * Copyright 2019 Hasan Aydoğdu <[email protected]>
2241 */
2242
2243"use strict";
2244
2245var MoveTo = function () {
2246  /**
2247   * Defaults
2248   * @type {object}
2249   */
2250  var defaults = {
2251    tolerance: 0,
2252    duration: 2000,
2253    easing: 'easeOutQuart',
2254    container: window,
2255    callback: function callback() {}
2256  };
2257  /**
2258   * easeOutQuart Easing Function
2259   * @param  {number} t - current time
2260   * @param  {number} b - start value
2261   * @param  {number} c - change in value
2262   * @param  {number} d - duration
2263   * @return {number} - calculated value
2264   */
2265
2266  function easeOutQuart(t, b, c, d) {
2267    t /= d;
2268    t--;
2269    return -c * (t * t * t * t - 1) + b;
2270  }
2271  /**
2272   * Merge two object
2273   *
2274   * @param  {object} obj1
2275   * @param  {object} obj2
2276   * @return {object} merged object
2277   */
2278
2279
2280  function mergeObject(obj1, obj2) {
2281    var obj3 = {};
vendor: 4,796 bytes, lines 2282-2446
2282    Object.keys(obj1).forEach(function (propertyName) {
2283      obj3[propertyName] = obj1[propertyName];
2284    });
2285    Object.keys(obj2).forEach(function (propertyName) {
2286      obj3[propertyName] = obj2[propertyName];
2287    });
2288    return obj3;
2289  }
2290
2291  ;
2292  /**
2293   * Converts camel case to kebab case
2294   * @param  {string} val the value to be converted
2295   * @return {string} the converted value
2296   */
2297
2298  function kebabCase(val) {
2299    return val.replace(/([A-Z])/g, function ($1) {
2300      return '-' + $1.toLowerCase();
2301    });
2302  }
2303
2304  ;
2305  /**
2306   * Count a number of item scrolled top
2307   * @param  {Window|HTMLElement} container
2308   * @return {number}
2309   */
2310
2311  function countScrollTop(container) {
2312    if (container instanceof HTMLElement) {
2313      return container.scrollTop;
2314    }
2315
2316    return container.pageYOffset;
2317  }
2318
2319  ;
2320  /**
2321   * MoveTo Constructor
2322   * @param {object} options Options
2323   * @param {object} easeFunctions Custom ease functions
2324   */
2325
2326  function MoveTo() {
2327    var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2328    var easeFunctions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2329    this.options = mergeObject(defaults, options);
2330    this.easeFunctions = mergeObject({
2331      easeOutQuart: easeOutQuart
2332    }, easeFunctions);
2333  }
2334  /**
2335   * Register a dom element as trigger
2336   * @param  {HTMLElement} dom Dom trigger element
2337   * @param  {function} callback Callback function
2338   * @return {function|void} unregister function
2339   */
2340
2341
2342  MoveTo.prototype.registerTrigger = function (dom, callback) {
2343    var _this = this;
2344
2345    if (!dom) {
2346      return;
2347    }
2348
2349    var href = dom.getAttribute('href') || dom.getAttribute('data-target'); // The element to be scrolled
2350
2351    var target = href && (href !== '#' && href !== "#top") ? document.getElementById(href.substring(1)) : document.body;
2352    var options = mergeObject(this.options, _getOptionsFromTriggerDom(dom, this.options));
2353
2354    if (typeof callback === 'function') {
2355      options.callback = callback;
2356    }
2357
2358    var listener = function listener(e) {
2359      e.preventDefault();
2360
2361      _this.move(target, options);
2362    };
2363
2364    dom.addEventListener('click', listener, false);
2365    return function () {
2366      return dom.removeEventListener('click', listener, false);
2367    };
2368  };
2369  /**
2370   * Move
2371   * Scrolls to given element by using easeOutQuart function
2372   * @param  {HTMLElement|number} target Target element to be scrolled or target position
2373   * @param  {object} options Custom options
2374   */
2375
2376
2377  MoveTo.prototype.move = function (target) {
2378    var _this2 = this;
2379
2380    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2381
2382    if (target !== 0 && !target) {
2383      return;
2384    }
2385
2386    options = mergeObject(this.options, options);
2387    var distance = typeof target === 'number' ? target : target.getBoundingClientRect().top;
2388    var from = countScrollTop(options.container);
2389    var startTime = null;
2390    var lastYOffset;
2391    distance -= options.tolerance; // rAF loop
2392
2393    var loop = function loop(currentTime) {
2394      var currentYOffset = countScrollTop(_this2.options.container);
2395
2396      if (!startTime) {
2397        // To starts time from 1, we subtracted 1 from current time
2398        // If time starts from 1 The first loop will not do anything,
2399        // because easing value will be zero
2400        startTime = currentTime - 1;
2401      }
2402
2403      var timeElapsed = currentTime - startTime;
2404
2405      if (lastYOffset) {
2406        if (distance > 0 && lastYOffset > currentYOffset || distance < 0 && lastYOffset < currentYOffset) {
2407          return options.callback(target);
2408        }
2409      }
2410
2411      lastYOffset = currentYOffset;
2412
2413      var val = _this2.easeFunctions[options.easing](timeElapsed, from, distance, options.duration);
2414
2415      options.container.scroll(0, val);
2416
2417      if (timeElapsed < options.duration) {
2418        window.requestAnimationFrame(loop);
2419      } else {
2420        options.container.scroll(0, distance + from);
2421        options.callback(target);
2422      }
2423    };
2424
2425    window.requestAnimationFrame(loop);
2426  };
2427  /**
2428   * Adds custom ease function
2429   * @param {string}   name Ease function name
2430   * @param {function} fn   Ease function
2431   */
2432
2433
2434  MoveTo.prototype.addEaseFunction = function (name, fn) {
2435    this.easeFunctions[name] = fn;
2436  };
2437  /**
2438   * Returns options which created from trigger dom element
2439   * @param  {HTMLElement} dom Trigger dom element
2440   * @param  {object} options The instance's options
2441   * @return {object} The options which created from trigger dom element
2442   */
2443
2444
2445  function _getOptionsFromTriggerDom(dom, options) {
2446    var domOptions = {};
vendor: 4,974 bytes, lines 2447-2467
2447    Object.keys(options).forEach(function (key) {
2448      var value = dom.getAttribute("data-mt-".concat(kebabCase(key)));
2449
2450      if (value) {
2451        domOptions[key] = isNaN(value) ? value : parseInt(value, 10);
2452      }
2453    });
2454    return domOptions;
2455  }
2456
2457  return MoveTo;
2458}();
2459
2460if (typeof module !== 'undefined') {
2461  module.exports = MoveTo;
2462} else {
2463  window.MoveTo = MoveTo;
2464}
2465
2466/*! smooth-scroll v16.1.3 | (c) 2020 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */
2467window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;0<=--t&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),(function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e})(),(function(){for(var r=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var n=(new Date).getTime(),o=Math.max(0,16-(n-r)),a=window.setTimeout((function(){e(n+o)}),o);return r=n+o,a}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})})(),(function(e,t){"function"==typeof define&&define.amd?define([],(function(){return t(e)})):"object"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)})("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,(function(M){"use strict";var q={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,speedAsDuration:!1,durationMax:null,durationMin:null,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},I=function(){var n={};return Array.prototype.forEach.call(arguments,(function(e){for(var t in e){if(!e.hasOwnProperty(t))return;n[t]=e[t]}})),n},r=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,a=-1,r="",i=n.charCodeAt(0);++a<o;){if(0===(t=n.charCodeAt(a)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");1<=t&&t<=31||127==t||0===a&&48<=t&&t<=57||1===a&&48<=t&&t<=57&&45===i?r+="\\"+t.toString(16)+" ":r+=128<=t||45===t||95===t||48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122?n.charAt(a):"\\"+n.charAt(a)}return"#"+r},F=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},L=function(e){return e?(t=e,parseInt(M.getComputedStyle(t).height,10)+e.offsetTop):0;var t},x=function(e,t,n){0===e&&document.body.focus(),n||(e.focus(),document.activeElement!==e&&(e.setAttribute("tabindex","-1"),e.focus(),e.style.outline="none"),M.scrollTo(0,t))},H=function(e,t,n,o){if(t.emitEvents&&"function"==typeof M.CustomEvent){var a=new CustomEvent(e,{bubbles:!0,detail:{anchor:n,toggle:o}});document.dispatchEvent(a)}};return function(o,e){var b,a,A,O,C={};C.cancelScroll=function(e){cancelAnimationFrame(O),O=null,e||H("scrollCancel",b)},C.animateScroll=function(a,r,e){C.cancelScroll();var i=I(b||q,e||{}),c="[object Number]"===Object.prototype.toString.call(a),t=c||!a.tagName?null:a;if(c||t){var s=M.pageYOffset;i.header&&!A&&(A=document.querySelector(i.header));var n,o,u,l,m,d,f,h,p=L(A),g=c?a:(function(e,t,n,o){var a=0;if(e.offsetParent)for(;a+=e.offsetTop,e=e.offsetParent;);return a=Math.max(a-t-n,0),o&&(a=Math.min(a,F()-M.innerHeight)),a})(t,p,parseInt("function"==typeof i.offset?i.offset(a,r):i.offset,10),i.clip),y=g-s,v=F(),w=0,S=(n=y,u=(o=i).speedAsDuration?o.speed:Math.abs(n/1e3*o.speed),o.durationMax&&u>o.durationMax?o.durationMax:o.durationMin&&u<o.durationMin?o.durationMin:parseInt(u,10)),E=function(e){var t,n,o;l||(l=e),w+=e-l,d=s+y*(n=m=1<(m=0===S?0:w/S)?1:m,"easeInQuad"===(t=i).easing&&(o=n*n),"easeOutQuad"===t.easing&&(o=n*(2-n)),"easeInOutQuad"===t.easing&&(o=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===t.easing&&(o=n*n*n),"easeOutCubic"===t.easing&&(o=--n*n*n+1),"easeInOutCubic"===t.easing&&(o=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===t.easing&&(o=n*n*n*n),"easeOutQuart"===t.easing&&(o=1- --n*n*n*n),"easeInOutQuart"===t.easing&&(o=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===t.easing&&(o=n*n*n*n*n),"easeOutQuint"===t.easing&&(o=1+--n*n*n*n*n),"easeInOutQuint"===t.easing&&(o=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),t.customEasing&&(o=t.customEasing(n)),o||n),M.scrollTo(0,Math.floor(d)),(function(e,t){var n=M.pageYOffset;if(e==t||n==t||(s<t&&M.innerHeight+n)>=v)return C.cancelScroll(!0),x(a,t,c),H("scrollStop",i,a,r),!(O=l=null)}
2467)(d,g)||(O=M.requestAnimationFrame(E),l=e)};0===M.pageYOffset&&M.scrollTo(0,0),f=a,h=i,c||history.pushState&&h.updateURL&&history.pushState({smoothScroll:JSON.stringify(h),anchor:f.id},document.title,f===document.documentElement?"#top":"#"+f.id),"matchMedia"in M&&M.matchMedia("(prefers-reduced-motion)").matches?x(a,Math.floor(g),!1):(H("scrollStart",i,a,r),C.cancelScroll(!0),M.requestAnimationFrame(E))}};var t=function(e){if(!e.defaultPrevented&&!(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey)&&"closest"in e.target&&(a=e.target.closest(o))&&"a"===a.tagName.toLowerCase()&&!e.target.closest(b.ignore)&&a.hostname===M.location.hostname&&a.pathname===M.location.pathname&&/#/.test(a.href)){var t,n;try{t=r(decodeURIComponent(a.hash))}catch(e){t=r(a.hash)}if("#"===t){if(!b.topOnEmptyHash)return;n=document.documentElement}else n=document.querySelector(t);(n=n||"#top"!==t?n:document.documentElement)&&(e.preventDefault(),(function(e){if(history.replaceState&&e.updateURL&&!history.state){var t=M.location.hash;t=t||"",history.replaceState({smoothScroll:JSON.stringify(e),anchor:t||M.pageYOffset},document.title,t||M.location.href)}})(b),C.animateScroll(n,a))}},n=function(e){if(null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(b)){var t=history.state.anchor;"string"==typeof t&&t&&!(t=document.querySelector(r(history.state.anchor)))||C.animateScroll(t,null,{updateURL:!1})}};C.destroy=function(){b&&(document.removeEventListener("click",t,!1),M.removeEventListener("popstate",n,!1),C.cancelScroll(),O=A=a=b=null)};return (function(){if(!("querySelector"in document&&"addEventListener"in M&&"requestAnimationFrame"in M&&"closest"in M.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";C.destroy(),b=I(q,e||{}),A=b.header?document.querySelector(b.header):null,document.addEventListener("click",t,!1),b.updateURL&&b.popstate&&M.addEventListener("popstate",n,!1)})(),C}}));
2468
2469/**
2470 * Copyright 2016 Google Inc. All Rights Reserved.
2471 *
2472 * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.
2473 *
2474 *  https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
2475 *
2476 */
2477(function () {
2478    'use strict';
2479
2480    // Exit early if we're not running in a browser.
2481    if (typeof window !== 'object') {
2482        return;
2483    }
2484
2485    // Exit early if all IntersectionObserver and IntersectionObserverEntry
2486    // features are natively supported.
2487    if ('IntersectionObserver' in window &&
2488        'IntersectionObserverEntry' in window &&
2489        'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
2490
2491        // Minimal polyfill for Edge 15's lack of `isIntersecting`
2492        // See: https://github.com/w3c/IntersectionObserver/issues/211
2493        if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {
2494            Object.defineProperty(window.IntersectionObserverEntry.prototype,
2495                'isIntersecting', {
2496                get: function () {
2497                    return this.intersectionRatio > 0;
2498                }
2499            });
2500        }
2501        return;
2502    }
2503
2504    /**
2505     * Returns the embedding frame element, if any.
2506     * @param {!Document} doc
2507     * @return {!Element}
2508     */
2509    function getFrameElement(doc) {
2510        try {
2511            return doc.defaultView && doc.defaultView.frameElement || null;
2512        } catch (e) {
2513            // Ignore the error.
2514            return null;
2515        }
2516    }
2517
2518    /**
2519     * A local reference to the root document.
2520     */
2521    var document = (function (startDoc) {
2522        var doc = startDoc;
2523        var frame = getFrameElement(doc);
2524        while (frame) {
2525            doc = frame.ownerDocument;
2526            frame = getFrameElement(doc);
2527        }
2528        return doc;
2529    })(window.document);
2530
2531    /**
2532     * An IntersectionObserver registry. This registry exists to hold a strong
2533     * reference to IntersectionObserver instances currently observing a target
2534     * element. Without this registry, instances without another reference may be
2535     * garbage collected.
2536     */
2537    var registry = [];
2538
2539    /**
2540     * The signal updater for cross-origin intersection. When not null, it means
2541     * that the polyfill is configured to work in a cross-origin mode.
2542     * @type {function(DOMRect|ClientRect, DOMRect|ClientRect)}
2543     */
2544    var crossOriginUpdater = null;
2545
2546    /**
2547     * The current cross-origin intersection. Only used in the cross-origin mode.
2548     * @type {DOMRect|ClientRect}
2549     */
2550    var crossOriginRect = null;
2551
2552
2553    /**
2554     * Creates the global IntersectionObserverEntry constructor.
2555     * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry
2556     * @param {Object} entry A dictionary of instance properties.
2557     * @constructor
2558     */
2559    function IntersectionObserverEntry(entry) {
2560        this.time = entry.time;
2561        this.target = entry.target;
2562        this.rootBounds = ensureDOMRect(entry.rootBounds);
2563        this.boundingClientRect = ensureDOMRect(entry.boundingClientRect);
2564        this.intersectionRect = ensureDOMRect(entry.intersectionRect || getEmptyRect());
2565        this.isIntersecting = !!entry.intersectionRect;
2566
2567        // Calculates the intersection ratio.
2568        var targetRect = this.boundingClientRect;
2569        var targetArea = targetRect.width * targetRect.height;
2570        var intersectionRect = this.intersectionRect;
2571        var intersectionArea = intersectionRect.width * intersectionRect.height;
2572
2573        // Sets intersection ratio.
2574        if (targetArea) {
2575            // Round the intersection ratio to avoid floating point math issues:
2576            // https://github.com/w3c/IntersectionObserver/issues/324
2577            this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));
2578        } else {
2579            // If area is zero and is intersecting, sets to 1, otherwise to 0
2580            this.intersectionRatio = this.isIntersecting ? 1 : 0;
2581        }
2582    }
2583
2584
2585    /**
2586     * Creates the global IntersectionObserver constructor.
2587     * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
2588     * @param {Function} callback The function to be invoked after intersection
2589     *     changes have queued. The function is not invoked if the queue has
2590     *     been emptied by calling the `takeRecords` method.
2591     * @param {Object=} opt_options Optional configuration options.
2592     * @constructor
2593     */
2594    function IntersectionObserver(callback, opt_options) {
2595
2596        var options = opt_options || {};
2597
2598        if (typeof callback != 'function') {
2599            throw new Error('callback must be a function');
2600        }
2601
2602        if (
2603            options.root &&
2604            options.root.nodeType != 1 &&
2605            options.root.nodeType != 9
2606        ) {
2607            throw new Error('root must be a Document or Element');
2608        }
2609
2610        // Binds and throttles `this._checkForIntersections`.
2611        this._checkForIntersections = throttle(
2612            this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);
2613
2614        // Private properties.
2615        this._callback = callback;
2616        this._observationTargets = [];
2617        this._queuedEntries = [];
2618        this._rootMarginValues = this._parseRootMargin(options.rootMargin);
2619
2620        // Public properties.
2621        this.thresholds = this._initThresholds(options.threshold);
2622        this.root = options.root || null;
2623        this.rootMargin = this._rootMarginValues.map(function (margin) {
2624            return margin.value + margin.unit;
2625        }).join(' ');
2626
2627        /** @private @const {!Array<!Document>} */
2628        this._monitoringDocuments = [];
2629        /** @private @const {!Array<function()>} */
2630        this._monitoringUnsubscribes = [];
2631    }
2632
2633
2634    /**
2635     * The minimum interval within which the document will be checked for
2636     * intersection changes.
2637     */
2638    IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;
2639
2640
2641    /**
2642     * The frequency in which the polyfill polls for intersection changes.
2643     * this can be updated on a per instance basis and must be set prior to
2644     * calling `observe` on the first target.
2645     */
2646    IntersectionObserver.prototype.POLL_INTERVAL = null;
2647
2648    /**
2649     * Use a mutation observer on the root element
2650     * to detect intersection changes.
2651     */
2652    IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;
2653
2654
2655    /**
2656     * Sets up the polyfill in the cross-origin mode. The result is the
2657     * updater function that accepts two arguments: `boundingClientRect` and
2658     * `intersectionRect` - just as these fields would be available to the
2659     * parent via `IntersectionObserverEntry`. This function should be called
2660     * each time the iframe receives intersection information from the parent
2661     * window, e.g. via messaging.
2662     * @return {function(DOMRect|ClientRect, DOMRect|ClientRect)}
2663     */
2664    IntersectionObserver._setupCrossOriginUpdater = function () {
2665        if (!crossOriginUpdater) {
2666            /**
2667             * @param {DOMRect|ClientRect} boundingClientRect
2668             * @param {DOMRect|ClientRect} intersectionRect
2669             */
2670            crossOriginUpdater = function (boundingClientRect, intersectionRect) {
2671                if (!boundingClientRect || !intersectionRect) {
2672                    crossOriginRect = getEmptyRect();
2673                } else {
2674                    crossOriginRect = convertFromParentRect(boundingClientRect, intersectionRect);
2675                }
vendor: 2,073 bytes, lines 2676-2745
2676                registry.forEach(function (observer) {
2677                    observer._checkForIntersections();
2678                });
2679            };
2680        }
2681        return crossOriginUpdater;
2682    };
2683
2684
2685    /**
2686     * Resets the cross-origin mode.
2687     */
2688    IntersectionObserver._resetCrossOriginUpdater = function () {
2689        crossOriginUpdater = null;
2690        crossOriginRect = null;
2691    };
2692
2693
2694    /**
2695     * Starts observing a target element for intersection changes based on
2696     * the thresholds values.
2697     * @param {Element} target The DOM element to observe.
2698     */
2699    IntersectionObserver.prototype.observe = function (target) {
2700        var isTargetAlreadyObserved = this._observationTargets.some(function (item) {
2701            return item.element == target;
2702        });
2703
2704        if (isTargetAlreadyObserved) {
2705            return;
2706        }
2707
2708        if (!(target && target.nodeType == 1)) {
2709            throw new Error('target must be an Element');
2710        }
2711
2712        this._registerInstance();
2713        this._observationTargets.push({ element: target, entry: null });
2714        this._monitorIntersections(target.ownerDocument);
2715        this._checkForIntersections();
2716    };
2717
2718
2719    /**
2720     * Stops observing a target element for intersection changes.
2721     * @param {Element} target The DOM element to observe.
2722     */
2723    IntersectionObserver.prototype.unobserve = function (target) {
2724        this._observationTargets =
2725            this._observationTargets.filter(function (item) {
2726                return item.element != target;
2727            });
2728        this._unmonitorIntersections(target.ownerDocument);
2729        if (this._observationTargets.length == 0) {
2730            this._unregisterInstance();
2731        }
2732    };
2733
2734
2735    /**
2736     * Stops observing all target elements for intersection changes.
2737     */
2738    IntersectionObserver.prototype.disconnect = function () {
2739        this._observationTargets = [];
2740        this._unmonitorAllIntersections();
2741        this._unregisterInstance();
2742    };
2743
2744
2745    /**
2746     * Returns any queue entries that have not yet been reported to the
2747     * callback and clears the queue. This can be used in conjunction with the
2748     * callback to obtain the absolute most up-to-date intersection information.
2749     * @return {Array} The currently queued entries.
2750     */
2751    IntersectionObserver.prototype.takeRecords = function () {
2752        var records = this._queuedEntries.slice();
2753        this._queuedEntries = [];
2754        return records;
2755    };
2756
2757
2758    /**
2759     * Accepts the threshold value from the user configuration object and
2760     * returns a sorted array of unique threshold values. If a value is not
2761     * between 0 and 1 and error is thrown.
2762     * @private
2763     * @param {Array|number=} opt_threshold An optional threshold value or
2764     *     a list of threshold values, defaulting to [0].
2765     * @return {Array} A sorted list of unique and valid threshold values.
2766     */
2767    IntersectionObserver.prototype._initThresholds = function (opt_threshold) {
2768        var threshold = opt_threshold || [0];
2769        if (!Array.isArray(threshold)) threshold = [threshold];
2770
2771        return threshold.sort().filter(function (t, i, a) {
2772            if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {
2773                throw new Error('threshold must be a number between 0 and 1 inclusively');
2774            }
2775            return t !== a[i - 1];
2776        });
2777    };
2778
2779
2780    /**
2781     * Accepts the rootMargin value from the user configuration object
2782     * and returns an array of the four margin values as an object c
2782ontaining
2783     * the value and unit properties. If any of the values are not properly
2784     * formatted or use a unit other than px or %, and error is thrown.
2785     * @private
2786     * @param {string=} opt_rootMargin An optional rootMargin value,
2787     *     defaulting to '0px'.
2788     * @return {Array<Object>} An array of margin objects with the keys
2789     *     value and unit.
2790     */
2791    IntersectionObserver.prototype._parseRootMargin = function (opt_rootMargin) {
2792        var marginString = opt_rootMargin || '0px';
2793        var margins = marginString.split(/\s+/).map(function (margin) {
2794            var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin);
2795            if (!parts) {
2796                throw new Error('rootMargin must be specified in pixels or percent');
2797            }
2798            return { value: parseFloat(parts[1]), unit: parts[2] };
2799        });
2800
2801        // Handles shorthand.
2802        margins[1] = margins[1] || margins[0];
2803        margins[2] = margins[2] || margins[0];
2804        margins[3] = margins[3] || margins[1];
2805
2806        return margins;
2807    };
2808
2809
2810    /**
2811     * Starts polling for intersection changes if the polling is not already
2812     * happening, and if the page's visibility state is visible.
2813     * @param {!Document} doc
2814     * @private
2815     */
2816    IntersectionObserver.prototype._monitorIntersections = function (doc) {
2817        var win = doc.defaultView;
2818        if (!win) {
2819            // Already destroyed.
2820            return;
2821        }
2822        if (this._monitoringDocuments.indexOf(doc) != -1) {
2823            // Already monitoring.
2824            return;
2825        }
2826
2827        // Private state for monitoring.
2828        var callback = this._checkForIntersections;
2829        var monitoringInterval = null;
2830        var domObserver = null;
2831
2832        // If a poll interval is set, use polling instead of listening to
2833        // resize and scroll events or DOM mutations.
2834        if (this.POLL_INTERVAL) {
2835            monitoringInterval = win.setInterval(callback, this.POLL_INTERVAL);
2836        } else {
2837            addEvent(win, 'resize', callback, true);
2838            addEvent(doc, 'scroll', callback, true);
2839            if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in win) {
2840                domObserver = new win.MutationObserver(callback);
2841                domObserver.observe(doc, {
2842                    attributes: true,
2843                    childList: true,
2844                    characterData: true,
2845                    subtree: true
2846                });
2847            }
2848        }
2849
2850        this._monitoringDocuments.push(doc);
2851        this._monitoringUnsubscribes.push(function () {
2852            // Get the window object again. When a friendly iframe is destroyed, it
2853            // will be null.
2854            var win = doc.defaultView;
2855
2856            if (win) {
2857                if (monitoringInterval) {
2858                    win.clearInterval(monitoringInterval);
2859                }
2860                removeEvent(win, 'resize', callback, true);
2861            }
2862
2863            removeEvent(doc, 'scroll', callback, true);
2864            if (domObserver) {
2865                domObserver.disconnect();
2866            }
2867        });
2868
2869        // Also monitor the parent.
2870        var rootDoc =
2871            (this.root && (this.root.ownerDocument || this.root)) || document;
2872        if (doc != rootDoc) {
2873            var frame = getFrameElement(doc);
2874            if (frame) {
2875                this._monitorIntersections(frame.ownerDocument);
2876            }
2877        }
2878    };
2879
2880
2881    /**
2882     * Stops polling for intersection changes.
2883     * @param {!Document} doc
2884     * @private
2885     */
2886    IntersectionObserver.prototype._unmonitorIntersections = function (doc) {
2887        var index = this._monitoringDocuments.indexOf(doc);
2888        if (index == -1) {
2889            return;
2890        }
2891
2892        var rootDoc =
2893            (this.root && (this.root.ownerDocument || this.root)) || document;
2894
2895        // Check if any dependent targets are still remaining.
2896        var hasDependentTargets =
2897            this._observationTargets.some(function (item) {
2898                var itemDoc = item.element.ownerDocument;
vendor: 21,857 bytes, lines 2899-3482
2899                // Target is in this context.
2900                if (itemDoc == doc) {
2901                    return true;
2902                }
2903                // Target is nested in this context.
2904                while (itemDoc && itemDoc != rootDoc) {
2905                    var frame = getFrameElement(itemDoc);
2906                    itemDoc = frame && frame.ownerDocument;
2907                    if (itemDoc == doc) {
2908                        return true;
2909                    }
2910                }
2911                return false;
2912            });
2913        if (hasDependentTargets) {
2914            return;
2915        }
2916
2917        // Unsubscribe.
2918        var unsubscribe = this._monitoringUnsubscribes[index];
2919        this._monitoringDocuments.splice(index, 1);
2920        this._monitoringUnsubscribes.splice(index, 1);
2921        unsubscribe();
2922
2923        // Also unmonitor the parent.
2924        if (doc != rootDoc) {
2925            var frame = getFrameElement(doc);
2926            if (frame) {
2927                this._unmonitorIntersections(frame.ownerDocument);
2928            }
2929        }
2930    };
2931
2932
2933    /**
2934     * Stops polling for intersection changes.
2935     * @param {!Document} doc
2936     * @private
2937     */
2938    IntersectionObserver.prototype._unmonitorAllIntersections = function () {
2939        var unsubscribes = this._monitoringUnsubscribes.slice(0);
2940        this._monitoringDocuments.length = 0;
2941        this._monitoringUnsubscribes.length = 0;
2942        for (var i = 0; i < unsubscribes.length; i++) {
2943            unsubscribes[i]();
2944        }
2945    };
2946
2947
2948    /**
2949     * Scans each observation target for intersection changes and adds them
2950     * to the internal entries queue. If new entries are found, it
2951     * schedules the callback to be invoked.
2952     * @private
2953     */
2954    IntersectionObserver.prototype._checkForIntersections = function () {
2955        if (!this.root && crossOriginUpdater && !crossOriginRect) {
2956            // Cross origin monitoring, but no initial data available yet.
2957            return;
2958        }
2959
2960        var rootIsInDom = this._rootIsInDom();
2961        var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();
2962
2963        this._observationTargets.forEach(function (item) {
2964            var target = item.element;
2965            var targetRect = getBoundingClientRect(target);
2966            var rootContainsTarget = this._rootContainsTarget(target);
2967            var oldEntry = item.entry;
2968            var intersectionRect = rootIsInDom && rootContainsTarget &&
2969                this._computeTargetAndRootIntersection(target, targetRect, rootRect);
2970
2971            var rootBounds = null;
2972            if (!this._rootContainsTarget(target)) {
2973                rootBounds = getEmptyRect();
2974            } else if (!crossOriginUpdater || this.root) {
2975                rootBounds = rootRect;
2976            }
2977
2978            var newEntry = item.entry = new IntersectionObserverEntry({
2979                time: now(),
2980                target: target,
2981                boundingClientRect: targetRect,
2982                rootBounds: rootBounds,
2983                intersectionRect: intersectionRect
2984            });
2985
2986            if (!oldEntry) {
2987                this._queuedEntries.push(newEntry);
2988            } else if (rootIsInDom && rootContainsTarget) {
2989                // If the new entry intersection ratio has crossed any of the
2990                // thresholds, add a new entry.
2991                if (this._hasCrossedThreshold(oldEntry, newEntry)) {
2992                    this._queuedEntries.push(newEntry);
2993                }
2994            } else {
2995                // If the root is not in the DOM or target is not contained within
2996                // root but the previous entry for this target had an intersection,
2997                // add a new record indicating removal.
2998                if (oldEntry && oldEntry.isIntersecting) {
2999                    this._queuedEntries.push(newEntry);
3000                }
3001            }
3002        }, this);
3003
3004        if (this._queuedEntries.length) {
3005            this._callback(this.takeRecords(), this);
3006        }
3007    };
3008
3009
3010    /**
3011     * Accepts a target and root rect computes the intersection between then
3012     * following the algorithm in the spec.
3013     * TODO(philipwalton): at this time clip-path is not considered.
3014     * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo
3015     * @param {Element} target The target DOM element
3016     * @param {Object} targetRect The bounding rect of the target.
3017     * @param {Object} rootRect The bounding rect of the root after being
3018     *     expanded by the rootMargin value.
3019     * @return {?Object} The final intersection rect object or undefined if no
3020     *     intersection is found.
3021     * @private
3022     */
3023    IntersectionObserver.prototype._computeTargetAndRootIntersection =
3024        function (target, targetRect, rootRect) {
3025            // If the element isn't displayed, an intersection can't happen.
3026            if (window.getComputedStyle(target).display == 'none') return;
3027
3028            var intersectionRect = targetRect;
3029            var parent = getParentNode(target);
3030            var atRoot = false;
3031
3032            while (!atRoot && parent) {
3033                var parentRect = null;
3034                var parentComputedStyle = parent.nodeType == 1 ?
3035                    window.getComputedStyle(parent) : {};
3036
3037                // If the parent isn't displayed, an intersection can't happen.
3038                if (parentComputedStyle.display == 'none') return null;
3039
3040                if (parent == this.root || parent.nodeType == /* DOCUMENT */ 9) {
3041                    atRoot = true;
3042                    if (parent == this.root || parent == document) {
3043                        if (crossOriginUpdater && !this.root) {
3044                            if (!crossOriginRect ||
3045                                crossOriginRect.width == 0 && crossOriginRect.height == 0) {
3046                                // A 0-size cross-origin intersection means no-intersection.
3047                                parent = null;
3048                                parentRect = null;
3049                                intersectionRect = null;
3050                            } else {
3051                                parentRect = crossOriginRect;
3052                            }
3053                        } else {
3054                            parentRect = rootRect;
3055                        }
3056                    } else {
3057                        // Check if there's a frame that can be navigated to.
3058                        var frame = getParentNode(parent);
3059                        var frameRect = frame && getBoundingClientRect(frame);
3060                        var frameIntersect =
3061                            frame &&
3062                            this._computeTargetAndRootIntersection(frame, frameRect, rootRect);
3063                        if (frameRect && frameIntersect) {
3064                            parent = frame;
3065                            parentRect = convertFromParentRect(frameRect, frameIntersect);
3066                        } else {
3067                            parent = null;
3068                            intersectionRect = null;
3069                        }
3070                    }
3071                } else {
3072                    // If the element has a non-visible overflow, and it's not the <body>
3073                    // or <html> element, update the intersection rect.
3074                    // Note: <body> and <html> cannot be clipped to a rect that's not also
3075                    // the document rect, so no need to compute a new intersection.
3076                    var doc = parent.ownerDocument;
3077                    if (parent != doc.body &&
3078                        parent != doc.documentElement &&
3079                        parentComputedStyle.overflow != 'visible') {
3080                        parentRect = getBoundingClientRect(parent);
3081                    }
3082                }
3083
3084                // If either of the above conditionals set a new parentRect,
3085                // calculate new intersection data.
3086                if (parentRect) {
3087                    intersectionRect = computeRectIntersection(parentRect, intersectionRect);
3088                }
3089                if (!intersectionRect) break;
3090                parent = parent && getParentNode(parent);
3091            }
3092            return intersectionRect;
3093        };
3094
3095
3096    /**
3097     * Returns the root rect after being expanded by the rootMargin value.
3098     * @return {ClientRect} The expanded root rect.
3099     * @private
3100     */
3101    IntersectionObserver.prototype._getRootRect = function () {
3102        var rootRect;
3103        if (this.root && !isDoc(this.root)) {
3104            rootRect = getBoundingClientRect(this.root);
3105        } else {
3106            // Use <html>/<body> instead of window since scroll bars affect size.
3107            var doc = isDoc(this.root) ? this.root : document;
3108            var html = doc.documentElement;
3109            var body = doc.body;
3110            rootRect = {
3111                top: 0,
3112                left: 0,
3113                right: html.clientWidth || body.clientWidth,
3114                width: html.clientWidth || body.clientWidth,
3115                bottom: html.clientHeight || body.clientHeight,
3116                height: html.clientHeight || body.clientHeight
3117            };
3118        }
3119        return this._expandRectByRootMargin(rootRect);
3120    };
3121
3122
3123    /**
3124     * Accepts a rect and expands it by the rootMargin value.
3125     * @param {DOMRect|ClientRect} rect The rect object to expand.
3126     * @return {ClientRect} The expanded rect.
3127     * @private
3128     */
3129    IntersectionObserver.prototype._expandRectByRootMargin = function (rect) {
3130        var margins = this._rootMarginValues.map(function (margin, i) {
3131            return margin.unit == 'px' ? margin.value :
3132                margin.value * (i % 2 ? rect.width : rect.height) / 100;
3133        });
3134        var newRect = {
3135            top: rect.top - margins[0],
3136            right: rect.right + margins[1],
3137            bottom: rect.bottom + margins[2],
3138            left: rect.left - margins[3]
3139        };
3140        newRect.width = newRect.right - newRect.left;
3141        newRect.height = newRect.bottom - newRect.top;
3142
3143        return newRect;
3144    };
3145
3146
3147    /**
3148     * Accepts an old and new entry and returns true if at least one of the
3149     * threshold values has been crossed.
3150     * @param {?IntersectionObserverEntry} oldEntry The previous entry for a
3151     *    particular target element or null if no previous entry exists.
3152     * @param {IntersectionObserverEntry} newEntry The current entry for a
3153     *    particular target element.
3154     * @return {boolean} Returns true if a any threshold has been crossed.
3155     * @private
3156     */
3157    IntersectionObserver.prototype._hasCrossedThreshold =
3158        function (oldEntry, newEntry) {
3159
3160            // To make comparing easier, an entry that has a ratio of 0
3161            // but does not actually intersect is given a value of -1
3162            var oldRatio = oldEntry && oldEntry.isIntersecting ?
3163                oldEntry.intersectionRatio || 0 : -1;
3164            var newRatio = newEntry.isIntersecting ?
3165                newEntry.intersectionRatio || 0 : -1;
3166
3167            // Ignore unchanged ratios
3168            if (oldRatio === newRatio) return;
3169
3170            for (var i = 0; i < this.thresholds.length; i++) {
3171                var threshold = this.thresholds[i];
3172
3173                // Return true if an entry matches a threshold or if the new ratio
3174                // and the old ratio are on the opposite sides of a threshold.
3175                if (threshold == oldRatio || threshold == newRatio ||
3176                    threshold < oldRatio !== threshold < newRatio) {
3177                    return true;
3178                }
3179            }
3180        };
3181
3182
3183    /**
3184     * Returns whether or not the root element is an element and is in the DOM.
3185     * @return {boolean} True if the root element is an element and is in the DOM.
3186     * @private
3187     */
3188    IntersectionObserver.prototype._rootIsInDom = function () {
3189        return !this.root || containsDeep(document, this.root);
3190    };
3191
3192
3193    /**
3194     * Returns whether or not the target element is a child of root.
3195     * @param {Element} target The target element to check.
3196     * @return {boolean} True if the target element is a child of root.
3197     * @private
3198     */
3199    IntersectionObserver.prototype._rootContainsTarget = function (target) {
3200        var rootDoc =
3201            (this.root && (this.root.ownerDocument || this.root)) || document;
3202        return (
3203            containsDeep(rootDoc, target) &&
3204            (!this.root || rootDoc == target.ownerDocument)
3205        );
3206    };
3207
3208
3209    /**
3210     * Adds the instance to the global IntersectionObserver registry if it isn't
3211     * already present.
3212     * @private
3213     */
3214    IntersectionObserver.prototype._registerInstance = function () {
3215        if (registry.indexOf(this) < 0) {
3216            registry.push(this);
3217        }
3218    };
3219
3220
3221    /**
3222     * Removes the instance from the global IntersectionObserver registry.
3223     * @private
3224     */
3225    IntersectionObserver.prototype._unregisterInstance = function () {
3226        var index = registry.indexOf(this);
3227        if (index != -1) registry.splice(index, 1);
3228    };
3229
3230
3231    /**
3232     * Returns the result of the performance.now() method or null in browsers
3233     * that don't support the API.
3234     * @return {number} The elapsed time since the page was requested.
3235     */
3236    function now() {
3237        return window.performance && performance.now && performance.now();
3238    }
3239
3240
3241    /**
3242     * Throttles a function and delays its execution, so it's only called at most
3243     * once within a given time period.
3244     * @param {Function} fn The function to throttle.
3245     * @param {number} timeout The amount of time that must pass before the
3246     *     function can be called again.
3247     * @return {Function} The throttled function.
3248     */
3249    function throttle(fn, timeout) {
3250        var timer = null;
3251        return function () {
3252            if (!timer) {
3253                timer = setTimeout(function () {
3254                    fn();
3255                    timer = null;
3256                }, timeout);
3257            }
3258        };
3259    }
3260
3261
3262    /**
3263     * Adds an event handler to a DOM node ensuring cross-browser compatibility.
3264     * @param {Node} node The DOM node to add the event handler to.
3265     * @param {string} event The event name.
3266     * @param {Function} fn The event handler to add.
3267     * @param {boolean} opt_useCapture Optionally adds the even to the capture
3268     *     phase. Note: this only works in modern browsers.
3269     */
3270    function addEvent(node, event, fn, opt_useCapture) {
3271        if (typeof node.addEventListener == 'function') {
3272            node.addEventListener(event, fn, opt_useCapture || false);
3273        }
3274        else if (typeof node.attachEvent == 'function') {
3275            node.attachEvent('on' + event, fn);
3276        }
3277    }
3278
3279
3280    /**
3281     * Removes a previously added event handler from a DOM node.
3282     * @param {Node} node The DOM node to remove the event handler from.
3283     * @param {string} event The event name.
3284     * @param {Function} fn The event handler to remove.
3285     * @param {boolean} opt_useCapture If the event handler was added with this
3286     *     flag set to true, it should be set to true here in order to remove it.
3287     */
3288    function removeEvent(node, event, fn, opt_useCapture) {
3289        if (typeof node.removeEventListener == 'function') {
3290            node.removeEventListener(event, fn, opt_useCapture || false);
3291        }
3292        else if (typeof node.detatchEvent == 'function') {
3293            node.detatchEvent('on' + event, fn);
3294        }
3295    }
3296
3297
3298    /**
3299     * Returns the intersection between two rect objects.
3300     * @param {Object} rect1 The first rect.
3301     * @param {Object} rect2 The second rect.
3302     * @return {?Object|?ClientRect} The intersection rect or undefined if no
3303     *     intersection is found.
3304     */
3305    function computeRectIntersection(rect1, rect2) {
3306        var top = Math.max(rect1.top, rect2.top);
3307        var bottom = Math.min(rect1.bottom, rect2.bottom);
3308        var left = Math.max(rect1.left, rect2.left);
3309        var right = Math.min(rect1.right, rect2.right);
3310        var width = right - left;
3311        var height = bottom - top;
3312
3313        return (width >= 0 && height >= 0) && {
3314            top: top,
3315            bottom: bottom,
3316            left: left,
3317            right: right,
3318            width: width,
3319            height: height
3320        } || null;
3321    }
3322
3323
3324    /**
3325     * Shims the native getBoundingClientRect for compatibility with older IE.
3326     * @param {Element} el The element whose bounding rect to get.
3327     * @return {DOMRect|ClientRect} The (possibly shimmed) rect of the element.
3328     */
3329    function getBoundingClientRect(el) {
3330        var rect;
3331
3332        try {
3333            rect = el.getBoundingClientRect();
3334        } catch (err) {
3335            // Ignore Windows 7 IE11 "Unspecified error"
3336            // https://github.com/w3c/IntersectionObserver/pull/205
3337        }
3338
3339        if (!rect) return getEmptyRect();
3340
3341        // Older IE
3342        if (!(rect.width && rect.height)) {
3343            rect = {
3344                top: rect.top,
3345                right: rect.right,
3346                bottom: rect.bottom,
3347                left: rect.left,
3348                width: rect.right - rect.left,
3349                height: rect.bottom - rect.top
3350            };
3351        }
3352        return rect;
3353    }
3354
3355
3356    /**
3357     * Returns an empty rect object. An empty rect is returned when an element
3358     * is not in the DOM.
3359     * @return {ClientRect} The empty rect.
3360     */
3361    function getEmptyRect() {
3362        return {
3363            top: 0,
3364            bottom: 0,
3365            left: 0,
3366            right: 0,
3367            width: 0,
3368            height: 0
3369        };
3370    }
3371
3372
3373    /**
3374     * Ensure that the result has all of the necessary fields of the DOMRect.
3375     * Specifically this ensures that `x` and `y` fields are set.
3376     *
3377     * @param {?DOMRect|?ClientRect} rect
3378     * @return {?DOMRect}
3379     */
3380    function ensureDOMRect(rect) {
3381        // A `DOMRect` object has `x` and `y` fields.
3382        if (!rect || 'x' in rect) {
3383            return rect;
3384        }
3385        // A IE's `ClientRect` type does not have `x` and `y`. The same is the case
3386        // for internally calculated Rect objects. For the purposes of
3387        // `IntersectionObserver`, it's sufficient to simply mirror `left` and `top`
3388        // for these fields.
3389        return {
3390            top: rect.top,
3391            y: rect.top,
3392            bottom: rect.bottom,
3393            left: rect.left,
3394            x: rect.left,
3395            right: rect.right,
3396            width: rect.width,
3397            height: rect.height
3398        };
3399    }
3400
3401
3402    /**
3403     * Inverts the intersection and bounding rect from the parent (frame) BCR to
3404     * the local BCR space.
3405     * @param {DOMRect|ClientRect} parentBoundingRect The parent's bound client rect.
3406     * @param {DOMRect|ClientRect} parentIntersectionRect The parent's own intersection rect.
3407     * @return {ClientRect} The local root bounding rect for the parent's children.
3408     */
3409    function convertFromParentRect(parentBoundingRect, parentIntersectionRect) {
3410        var top = parentIntersectionRect.top - parentBoundingRect.top;
3411        var left = parentIntersectionRect.left - parentBoundingRect.left;
3412        return {
3413            top: top,
3414            left: left,
3415            height: parentIntersectionRect.height,
3416            width: parentIntersectionRect.width,
3417            bottom: top + parentIntersectionRect.height,
3418            right: left + parentIntersectionRect.width
3419        };
3420    }
3421
3422
3423    /**
3424     * Checks to see if a parent element contains a child element (including inside
3425     * shadow DOM).
3426     * @param {Node} parent The parent element.
3427     * @param {Node} child The child element.
3428     * @return {boolean} True if the parent node contains the child node.
3429     */
3430    function containsDeep(parent, child) {
3431        var node = child;
3432        while (node) {
3433            if (node == parent) return true;
3434
3435            node = getParentNode(node);
3436        }
3437        return false;
3438    }
3439
3440
3441    /**
3442     * Gets the parent node of an element or its host element if the parent node
3443     * is a shadow root.
3444     * @param {Node} node The node whose parent to get.
3445     * @return {Node|null} The parent node or null if no parent exists.
3446     */
3447    function getParentNode(node) {
3448        var parent = node.parentNode;
3449
3450        if (node.nodeType == /* DOCUMENT */ 9 && node != document) {
3451            // If this node is a document node, look for the embedding frame.
3452            return getFrameElement(node);
3453        }
3454
3455        // If the parent has element that is assigned through shadow root slot
3456        if (parent && parent.assignedSlot) {
3457            parent = parent.assignedSlot.parentNode
3458        }
3459
3460        if (parent && parent.nodeType == 11 && parent.host) {
3461            // If the parent is a shadow root, return the host element.
3462            return parent.host;
3463        }
3464
3465        return parent;
3466    }
3467
3468    /**
3469     * Returns true if `node` is a Document.
3470     * @param {!Node} node
3471     * @returns {boolean}
3472     */
3473    function isDoc(node) {
3474        return node && node.nodeType === 9;
3475    }
3476
3477
3478    // Exposes the constructors globally.
3479    window.IntersectionObserver = IntersectionObserver;
3480    window.IntersectionObserverEntry = IntersectionObserverEntry;
3481
3482}());

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.