;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.csstransforms=function(){return!!F("transform")},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,e.prefixed=function(a,b,c){return b?F(a,b,c):F(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};(function($){$.fn.slidefade=function(){var slides=$(this).children(),interval=$(this).attr('data-interval');if(0==slides.filter(':hidden').length)
return this;slides.filter('.hidden').hide().removeClass('hidden');if(!interval.length)
interval=5;setInterval(function(){var visibileSlides=slides.filter(':visible'),nextSlides=[],nextSlide=visibileSlides.filter(':last');while(nextSlides.length<visibileSlides.length){nextSlide=nextSlide.next();if('undefined'===typeof nextSlide[0])
nextSlide=slides.filter(':first');nextSlides.push(nextSlide[0]);}
visibileSlides.fadeOut(400,function(){$(nextSlides).fadeIn(700);});},interval*1000);return this;};$('.slidefade').slidefade();}(jQuery));(function(){var event=jQuery.event,findHelper=function(events,types,callback,selector){var t,type,typeHandlers,all,h,handle,namespaces,namespace,match;for(t=0;t<types.length;t++){type=types[t];all=type.indexOf(".")<0;if(!all){namespaces=type.split(".");type=namespaces.shift();namespace=new RegExp("(^|\\.)"+namespaces.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");}
typeHandlers=(events[type]||[]).slice(0);for(h=0;h<typeHandlers.length;h++){handle=typeHandlers[h];match=(all||namespace.test(handle.namespace));if(match){if(selector){if(handle.selector===selector){callback(type,handle.origHandler||handle.handler);}}else if(selector===null){callback(type,handle.origHandler||handle.handler,handle.selector);}
else if(!handle.selector){callback(type,handle.origHandler||handle.handler);}}}}};event.find=function(el,types,selector){var events=($._data(el)||{}).events,handlers=[],t,liver,live;if(!events){return handlers;}
findHelper(events,types,function(type,handler){handlers.push(handler);},selector);return handlers;};event.findBySelector=function(el,types){var events=$._data(el).events,selectors={},add=function(selector,event,handler){var select=selectors[selector]||(selectors[selector]={}),events=select[event]||(select[event]=[]);events.push(handler);};if(!events){return selectors;}
findHelper(events,types,function(type,handler,selector){add(selector||"",type,handler);},null);return selectors;};event.supportTouch="ontouchend"in document;$.fn.respondsTo=function(events){if(!this.length){return false;}else{return event.find(this[0],$.isArray(events)?events:[events]).length>0;}};$.fn.triggerHandled=function(event,data){event=(typeof event=="string"?$.Event(event):event);this.trigger(event,data);return event.handled;};event.setupHelper=function(types,startingEvent,onFirst){if(!onFirst){onFirst=startingEvent;startingEvent=null;}
var add=function(handleObj){var bySelector,selector=handleObj.selector||"";if(selector){bySelector=event.find(this,types,selector);if(!bySelector.length){$(this).delegate(selector,startingEvent,onFirst);}}
else{if(!event.find(this,types,selector).length){event.add(this,startingEvent,onFirst,{selector:selector,delegate:this});}}},remove=function(handleObj){var bySelector,selector=handleObj.selector||"";if(selector){bySelector=event.find(this,types,selector);if(!bySelector.length){$(this).undelegate(selector,startingEvent,onFirst);}}
else{if(!event.find(this,types,selector).length){event.remove(this,startingEvent,onFirst,{selector:selector,delegate:this});}}};$.each(types,function(){event.special[this]={add:add,remove:remove,setup:function(){},teardown:function(){}};});};})(jQuery);(function($){var isPhantom=/Phantom/.test(navigator.userAgent),supportTouch=!isPhantom&&"ontouchend"in document,scrollEvent="touchmove scroll",touchStartEvent=supportTouch?"touchstart":"mousedown",touchStopEvent=supportTouch?"touchend":"mouseup",touchMoveEvent=supportTouch?"touchmove":"mousemove",data=function(event){var d=event.originalEvent.touches?event.originalEvent.touches[0]:event;return{time:(new Date).getTime(),coords:[d.pageX,d.pageY],origin:$(event.target)};};var swipe=$.event.swipe={delay:500,max:75,min:30};$.event.setupHelper(["swipe",'swipeleft','swiperight','swipeup','swipedown'],touchStartEvent,function(ev){var
start=data(ev),stop,delegate=ev.delegateTarget||ev.currentTarget,selector=ev.handleObj.selector,entered=this;function moveHandler(event){if(!start){return;}
stop=data(event);if(Math.abs(start.coords[0]-stop.coords[0])>10){event.preventDefault();}};$(document.documentElement).bind(touchMoveEvent,moveHandler).one(touchStopEvent,function(event){$(this).unbind(touchMoveEvent,moveHandler);if(start&&stop){var deltaX=Math.abs(start.coords[0]-stop.coords[0]),deltaY=Math.abs(start.coords[1]-stop.coords[1]),distance=Math.sqrt(deltaX*deltaX+deltaY*deltaY);if(stop.time-start.time<swipe.delay&&distance>=swipe.min){var events=['swipe'];if(deltaX>=swipe.min&&deltaY<swipe.min){events.push(start.coords[0]>stop.coords[0]?"swipeleft":"swiperight");}else
if(deltaY>=swipe.min&&deltaX<swipe.min){events.push(start.coords[1]<stop.coords[1]?"swipedown":"swipeup");}
$.each($.event.find(delegate,events,selector),function(){this.call(entered,ev,{start:start,end:stop})})}}
start=stop=undefined;})});})(jQuery);(function($,window,undefined){'use strict';var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler);},teardown:function(){$(this).off("resize",$special.handler);},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args);};if(resizeTimeout){clearTimeout(resizeTimeout);}
execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold);},threshold:150};var BLANK='data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==';$.fn.imagesLoaded=function(callback){var $this=this,deferred=$.isFunction($.Deferred)?$.Deferred():0,hasNotify=$.isFunction(deferred.notify),$images=$this.find('img').add($this.filter('img')),loaded=[],proper=[],broken=[];if($.isPlainObject(callback)){$.each(callback,function(key,value){if(key==='callback'){callback=value;}else if(deferred){deferred[key](value);}});}
function doneLoading(){var $proper=$(proper),$broken=$(broken);if(deferred){if(broken.length){deferred.reject($images,$proper,$broken);}else{deferred.resolve($images);}}
if($.isFunction(callback)){callback.call($this,$images,$proper,$broken);}}
function imgLoaded(img,isBroken){if(img.src===BLANK||$.inArray(img,loaded)!==-1){return;}
loaded.push(img);if(isBroken){broken.push(img);}else{proper.push(img);}
$.data(img,'imagesLoaded',{isBroken:isBroken,src:img.src});if(hasNotify){deferred.notifyWith($(img),[isBroken,$images,$(proper),$(broken)]);}
if($images.length===loaded.length){setTimeout(doneLoading);$images.unbind('.imagesLoaded');}}
if(!$images.length){doneLoading();}else{$images.bind('load.imagesLoaded error.imagesLoaded',function(event){imgLoaded(event.target,event.type==='error');}).each(function(i,el){var src=el.src;var cached=$.data(el,'imagesLoaded');if(cached&&cached.src===src){imgLoaded(el,cached.isBroken);return;}
if(el.complete&&el.naturalWidth!==undefined){imgLoaded(el,el.naturalWidth===0||el.naturalHeight===0);return;}
if(el.readyState||el.complete){el.src=BLANK;el.src=src;}});}
return deferred?deferred.promise($this):$this;};var $window=$(window),Modernizr=window.Modernizr;$.Elastislide=function(options,element){this.$el=$(element);this._init(options);};$.Elastislide.defaults={orientation:'horizontal',speed:500,easing:'ease-in-out',minItems:3,start:0,onClick:function(el,position,evt){return false;},onReady:function(){return false;},onBeforeSlide:function(){return false;},onAfterSlide:function(){return false;}};$.Elastislide.prototype={_init:function(options){this.options=$.extend(true,{},$.Elastislide.defaults,options);var self=this,transEndEventNames={'WebkitTransition':'webkitTransitionEnd','MozTransition':'transitionend','OTransition':'oTransitionEnd','msTransition':'MSTransitionEnd','transition':'transitionend'};this.transEndEventName=transEndEventNames[Modernizr.prefixed('transition')];this.support=Modernizr.csstransitions&&Modernizr.csstransforms;this.current=this.options.start;this.isSliding=false;this.$items=this.$el.children('li');this.itemsCount=this.$items.length;if(this.itemsCount===0){return false;}
this._validate();this.$items.detach();this.$el.empty();this.$el.append(this.$items);this.$el.wrap('<div class="elastislide-wrapper elastislide-loading elastislide-'+this.options.orientation+'"></div>');this.hasTransition=false;this.hasTransitionTimeout=setTimeout(function(){self._addTransition();},100);this.$el.imagesLoaded(function(){self.$el.show();self._layout();self._configure();if(self.hasTransition){self._removeTransition();self._slideToItem(self.current);self.$el.on(self.transEndEventName,function(){self.$el.off(self.transEndEventName);self._setWrapperSize();self._addTransition();self._initEvents();});}
else{clearTimeout(self.hasTransitionTimeout);self._setWrapperSize();self._initEvents();self._slideToItem(self.current);setTimeout(function(){self._addTransition();},25);}
self.options.onReady();});},_validate:function(){if(this.options.speed<0){this.options.speed=500;}
if(this.options.minItems<1||this.options.minItems>this.itemsCount){this.options.minItems=1;}
if(this.options.start<0||this.options.start>this.itemsCount-1){this.options.start=0;}
if(this.options.orientation!='horizontal'&&this.options.orientation!='vertical'){this.options.orientation='horizontal';}},_layout:function(){this.$el.wrap('<div class="elastislide-carousel"></div>');this.$carousel=this.$el.parent();this.$wrapper=this.$carousel.parent().removeClass('elastislide-loading');var $img=this.$items.find('img:first');this.imgSize={width:$img.outerWidth(true),height:$img.outerHeight(true)};this._setItemsSize();this.options.orientation==='horizontal'?this.$el.css('max-height',this.imgSize.height):this.$el.css('height',this.options.minItems*this.imgSize.height);this._addControls();},_addTransition:function(){if(this.support){this.$el.css('transition','all '+this.options.speed+'ms '+this.options.easing);}
this.hasTransition=true;},_removeTransition:function(){if(this.support){this.$el.css('transition','all 0s');}
this.hasTransition=false;},_addControls:function(){var self=this;this.$navigation=$('<nav><span class="elastislide-prev glyphicon glyphicon-chevron-left"></span><span class="elastislide-next glyphicon glyphicon-chevron-right"></span></nav>').appendTo(this.$wrapper);this.$navPrev=this.$navigation.find('span.elastislide-prev').on('mousedown.elastislide',function(event){self._slide('prev');return false;});this.$navNext=this.$navigation.find('span.elastislide-next').on('mousedown.elastislide',function(event){self._slide('next');return false;});},_setItemsSize:function(){var w=this.options.orientation==='horizontal'?(Math.floor(this.$carousel.width()/this.options.minItems)*100)/this.$carousel.width():100;this.$items.css({'width':w+'%','max-width':this.imgSize.width,'max-height':this.imgSize.height});if(this.options.orientation==='vertical'){this.$wrapper.css('max-width',this.imgSize.width+parseInt(this.$wrapper.css('padding-left'))+parseInt(this.$wrapper.css('padding-right')));}},_setWrapperSize:function(){if(this.options.orientation==='vertical'){this.$wrapper.css({'height':this.options.minItems*this.imgSize.height+parseInt(this.$wrapper.css('padding-top'))+parseInt(this.$wrapper.css('padding-bottom'))});}},_configure:function(){this.fitCount=this.options.orientation==='horizontal'?this.$carousel.width()<this.options.minItems*this.imgSize.width?this.options.minItems:Math.floor(this.$carousel.width()/this.imgSize.width):this.$carousel.height()<this.options.minItems*this.imgSize.height?this.options.minItems:Math.floor(this.$carousel.height()/this.imgSize.height);},_initEvents:function(){var self=this;$window.on('debouncedresize.elastislide',function(){self._setItemsSize();self._configure();self._slideToItem(self.current);});this.$el.on(this.transEndEventName,function(){self._onEndTransition();});if(this.options.orientation==='horizontal'){this.$el.on({swipeleft:function(){self._slide('next');},swiperight:function(){self._slide('prev');}});}
else{this.$el.on({swipeup:function(){self._slide('next');},swipedown:function(){self._slide('prev');}});}
this.$el.on('click.elastislide','li',function(event){var $item=$(this);self.options.onClick($item,$item.index(),event);});},_destroy:function(callback){this.$el.off(this.transEndEventName).off('swipeleft swiperight swipeup swipedown .elastislide');$window.off('.elastislide');this.$el.css({'max-height':'none','transition':'none'}).unwrap(this.$carousel).unwrap(this.$wrapper);this.$items.css({'width':'auto','max-width':'none','max-height':'none'});this.$navigation.remove();this.$wrapper.remove();if(callback){callback.call();}},_toggleControls:function(dir,display){if(display){(dir==='next')?this.$navNext.show():this.$navPrev.show();}
else{(dir==='next')?this.$navNext.hide():this.$navPrev.hide();}},_slide:function(dir,tvalue){if(this.isSliding){return false;}
this.options.onBeforeSlide();this.isSliding=true;var self=this,translation=this.translation||0,itemSpace=this.options.orientation==='horizontal'?this.$items.outerWidth(true):this.$items.outerHeight(true),totalSpace=this.itemsCount*itemSpace,visibleSpace=this.options.orientation==='horizontal'?this.$carousel.width():this.$carousel.height();if(tvalue===undefined){var amount=this.fitCount*itemSpace;if(amount<0){return false;}
if(dir==='next'&&totalSpace-(Math.abs(translation)+amount)<visibleSpace){amount=totalSpace-(Math.abs(translation)+visibleSpace);this._toggleControls('next',false);this._toggleControls('prev',true);}
else if(dir==='prev'&&Math.abs(translation)-amount<0){amount=Math.abs(translation);this._toggleControls('next',true);this._toggleControls('prev',false);}
else{var ftv=dir==='next'?Math.abs(translation)+Math.abs(amount):Math.abs(translation)-Math.abs(amount);ftv>0?this._toggleControls('prev',true):this._toggleControls('prev',false);ftv<totalSpace-visibleSpace?this._toggleControls('next',true):this._toggleControls('next',false);}
tvalue=dir==='next'?translation-amount:translation+amount;}
else{var amount=Math.abs(tvalue);if(Math.max(totalSpace,visibleSpace)-amount<visibleSpace){tvalue=-(Math.max(totalSpace,visibleSpace)-visibleSpace);}
amount>0?this._toggleControls('prev',true):this._toggleControls('prev',false);Math.max(totalSpace,visibleSpace)-visibleSpace>amount?this._toggleControls('next',true):this._toggleControls('next',false);}
this.translation=tvalue;if(translation===tvalue){this._onEndTransition();return false;}
if(this.support){this.options.orientation==='horizontal'?this.$el.css('transform','translateX('+tvalue+'px)'):this.$el.css('transform','translateY('+tvalue+'px)');}
else{$.fn.applyStyle=this.hasTransition?$.fn.animate:$.fn.css;var styleCSS=this.options.orientation==='horizontal'?{left:tvalue}:{top:tvalue};this.$el.stop().applyStyle(styleCSS,$.extend(true,[],{duration:this.options.speed,complete:function(){self._onEndTransition();}}));}
if(!this.hasTransition){this._onEndTransition();}},_onEndTransition:function(){this.isSliding=false;this.options.onAfterSlide();},_slideTo:function(pos){var pos=pos||this.current,translation=Math.abs(this.translation)||0,itemSpace=this.options.orientation==='horizontal'?this.$items.outerWidth(true):this.$items.outerHeight(true),posR=translation+this.$carousel.width(),ftv=Math.abs(pos*itemSpace);if(ftv+itemSpace>posR||ftv<translation){this._slideToItem(pos);}},_slideToItem:function(pos){var amount=this.options.orientation==='horizontal'?pos*this.$items.outerWidth(true):pos*this.$items.outerHeight(true);this._slide('',-amount);},add:function(callback){var self=this,oldcurrent=this.current,$currentItem=this.$items.eq(this.current);this.$items=this.$el.children('li');this.itemsCount=this.$items.length;this.current=$currentItem.index();this._setItemsSize();this._configure();this._removeTransition();oldcurrent<this.current?this._slideToItem(this.current):this._slide('next',this.translation);setTimeout(function(){self._addTransition();},25);if(callback){callback.call();}},setCurrent:function(idx,callback){this.current=idx;this._slideTo();if(callback){callback.call();}},next:function(){self._slide('next');},previous:function(){self._slide('prev');},slideStart:function(){this._slideTo(0);},slideEnd:function(){this._slideTo(this.itemsCount-1);},destroy:function(callback){this._destroy(callback);}};var logError=function(message){if(window.console){window.console.error(message);}};$.fn.elastislide=function(options){var self=$.data(this,'elastislide');if(typeof options==='string'){var args=Array.prototype.slice.call(arguments,1);this.each(function(){if(!self){logError("cannot call methods on elastislide prior to initialization; "+"attempted to call method '"+options+"'");return;}
if(!$.isFunction(self[options])||options.charAt(0)==="_"){logError("no such method '"+options+"' for elastislide self");return;}
self[options].apply(self,args);});}
else{this.each(function(){if(self){self._init();}
else{self=$.data(this,'elastislide',new $.Elastislide(options,this));}});}
return self;};})(jQuery,window);(function($){$('#carousel-popular-items').elastislide({minItems:1});$('#carousel-best-seller-items').elastislide({minItems:1});}(jQuery));!function(a){var b="0.9.3",c={isMsie:function(){var a=/(msie) ([\w.]+)/i.exec(navigator.userAgent);return a?parseInt(a[2],10):!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},bind:a.proxy,bindAll:function(b){var c;for(var d in b)a.isFunction(c=b[d])&&(b[d]=a.proxy(c,b))},indexOf:function(a,b){for(var c=0;c<a.length;c++)if(a[c]===b)return c;return-1},each:a.each,map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,getUniqueId:function(){var a=0;return function(){return a++}}(),defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},tokenizeQuery:function(b){return a.trim(b).toLowerCase().split(/[\s]+/)},tokenizeText:function(b){return a.trim(b).toLowerCase().split(/[\s\-_]+/)},getProtocol:function(){return location.protocol},noop:function(){}},d=function(){var a=/\s+/;return{on:function(b,c){var d;if(!c)return this;for(this._callbacks=this._callbacks||{},b=b.split(a);d=b.shift();)this._callbacks[d]=this._callbacks[d]||[],this._callbacks[d].push(c);return this},trigger:function(b,c){var d,e;if(!this._callbacks)return this;for(b=b.split(a);d=b.shift();)if(e=this._callbacks[d])for(var f=0;f<e.length;f+=1)e[f].call(this,{type:d,data:c});return this}}}(),e=function(){function b(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d="typeahead:";return c.mixin(b.prototype,{trigger:function(a){var b=[].slice.call(arguments,1);this.$el.trigger(d+a,b)}}),b}(),f=function(){function a(a){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+this.prefix)}function b(){return(new Date).getTime()}function d(a){return JSON.stringify(c.isUndefined(a)?null:a)}function e(a){return JSON.parse(a)}var f,g;try{f=window.localStorage,f.setItem("~~~","!"),f.removeItem("~~~")}catch(h){f=null}return g=f&&window.JSON?{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},get:function(a){return this.isExpired(a)&&this.remove(a),e(f.getItem(this._prefix(a)))},set:function(a,e,g){return c.isNumber(g)?f.setItem(this._ttlKey(a),d(b()+g)):f.removeItem(this._ttlKey(a)),f.setItem(this._prefix(a),d(e))},remove:function(a){return f.removeItem(this._ttlKey(a)),f.removeItem(this._prefix(a)),this},clear:function(){var a,b,c=[],d=f.length;for(a=0;d>a;a++)(b=f.key(a)).match(this.keyMatcher)&&c.push(b.replace(this.keyMatcher,""));for(a=c.length;a--;)this.remove(c[a]);return this},isExpired:function(a){var d=e(f.getItem(this._ttlKey(a)));return c.isNumber(d)&&b()>d?!0:!1}}:{get:c.noop,set:c.noop,remove:c.noop,clear:c.noop,isExpired:c.noop},c.mixin(a.prototype,g),a}(),g=function(){function a(a){c.bindAll(this),a=a||{},this.sizeLimit=a.sizeLimit||10,this.cache={},this.cachedKeysByAge=[]}return c.mixin(a.prototype,{get:function(a){return this.cache[a]},set:function(a,b){var c;this.cachedKeysByAge.length===this.sizeLimit&&(c=this.cachedKeysByAge.shift(),delete this.cache[c]),this.cache[a]=b,this.cachedKeysByAge.push(a)}}),a}(),h=function(){function b(a){c.bindAll(this),a=c.isString(a)?{url:a}:a,i=i||new g,h=c.isNumber(a.maxParallelRequests)?a.maxParallelRequests:h||6,this.url=a.url,this.wildcard=a.wildcard||"%QUERY",this.filter=a.filter,this.replace=a.replace,this.ajaxSettings={type:"get",cache:a.cache,timeout:a.timeout,dataType:a.dataType||"json",beforeSend:a.beforeSend},this._get=(/^throttle$/i.test(a.rateLimitFn)?c.throttle:c.debounce)(this._get,a.rateLimitWait||300)}function d(){j++}function e(){j--}function f(){return h>j}var h,i,j=0,k={};return c.mixin(b.prototype,{_get:function(a,b){function c(c){var e=d.filter?d.filter(c):c;b&&b(e),i.set(a,c)}var d=this;f()?this._sendRequest(a).done(c):this.onDeckRequestArgs=[].slice.call(arguments,0)},_sendRequest:function(b){function c(){e(),k[b]=null,f.onDeckRequestArgs&&(f._get.apply(f,f.onDeckRequestArgs),f.onDeckRequestArgs=null)}var f=this,g=k[b];return g||(d(),g=k[b]=a.ajax(b,this.ajaxSettings).always(c)),g},get:function(a,b){var d,e,f=this,g=encodeURIComponent(a||"");return b=b||c.noop,d=this.replace?this.replace(this.url,g):this.url.replace(this.wildcard,g),(e=i.get(d))?c.defer(function(){b(f.filter?f.filter(e):e)}):this._get(d,b),!!e}}),b}(),i=function(){function d(b){c.bindAll(this),c.isString(b.template)&&!b.engine&&a.error("no template engine specified"),b.local||b.prefetch||b.remote||a.error("one of local, prefetch, or remote is required"),this.name=b.name||c.getUniqueId(),this.limit=b.limit||5,this.minLength=b.minLength||1,this.header=b.header,this.footer=b.footer,this.valueKey=b.valueKey||"value",this.template=e(b.template,b.engine,this.valueKey),this.local=b.local,this.prefetch=b.prefetch,this.remote=b.remote,this.itemHash={},this.adjacencyList={},this.storage=b.name?new f(b.name):null}function e(a,b,d){var e,f;return c.isFunction(a)?e=a:c.isString(a)?(f=b.compile(a),e=c.bind(f.render,f)):e=function(a){return"<p>"+a[d]+"</p>"},e}var g={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};return c.mixin(d.prototype,{_processLocalData:function(a){this._mergeProcessedData(this._processData(a))},_loadPrefetchData:function(d){function e(a){var b=d.filter?d.filter(a):a,e=m._processData(b),f=e.itemHash,h=e.adjacencyList;m.storage&&(m.storage.set(g.itemHash,f,d.ttl),m.storage.set(g.adjacencyList,h,d.ttl),m.storage.set(g.thumbprint,n,d.ttl),m.storage.set(g.protocol,c.getProtocol(),d.ttl)),m._mergeProcessedData(e)}var f,h,i,j,k,l,m=this,n=b+(d.thumbprint||"");return this.storage&&(f=this.storage.get(g.thumbprint),h=this.storage.get(g.protocol),i=this.storage.get(g.itemHash),j=this.storage.get(g.adjacencyList)),k=f!==n||h!==c.getProtocol(),d=c.isString(d)?{url:d}:d,d.ttl=c.isNumber(d.ttl)?d.ttl:864e5,i&&j&&!k?(this._mergeProcessedData({itemHash:i,adjacencyList:j}),l=a.Deferred().resolve()):l=a.getJSON(d.url).done(e),l},_transformDatum:function(a){var b=c.isString(a)?a:a[this.valueKey],d=a.tokens||c.tokenizeText(b),e={value:b,tokens:d};return c.isString(a)?(e.datum={},e.datum[this.valueKey]=a):e.datum=a,e.tokens=c.filter(e.tokens,function(a){return!c.isBlankString(a)}),e.tokens=c.map(e.tokens,function(a){return a.toLowerCase()}),e},_processData:function(a){var b=this,d={},e={};return c.each(a,function(a,f){var g=b._transformDatum(f),h=c.getUniqueId(g.value);d[h]=g,c.each(g.tokens,function(a,b){var d=b.charAt(0),f=e[d]||(e[d]=[h]);!~c.indexOf(f,h)&&f.push(h)})}),{itemHash:d,adjacencyList:e}},_mergeProcessedData:function(a){var b=this;c.mixin(this.itemHash,a.itemHash),c.each(a.adjacencyList,function(a,c){var d=b.adjacencyList[a];b.adjacencyList[a]=d?d.concat(c):c})},_getLocalSuggestions:function(a){var b,d=this,e=[],f=[],g=[];return c.each(a,function(a,b){var d=b.charAt(0);!~c.indexOf(e,d)&&e.push(d)}),c.each(e,function(a,c){var e=d.adjacencyList[c];return e?(f.push(e),(!b||e.length<b.length)&&(b=e),void 0):!1}),f.length<e.length?[]:(c.each(b,function(b,e){var h,i,j=d.itemHash[e];h=c.every(f,function(a){return~c.indexOf(a,e)}),i=h&&c.every(a,function(a){return c.some(j.tokens,function(b){return 0===b.indexOf(a)})}),i&&g.push(j)}),g)},initialize:function(){var b;return this.local&&this._processLocalData(this.local),this.transport=this.remote?new h(this.remote):null,b=this.prefetch?this._loadPrefetchData(this.prefetch):a.Deferred().resolve(),this.local=this.prefetch=this.remote=null,this.initialize=function(){return b},b},getSuggestions:function(a,b){function d(a){f=f.slice(0),c.each(a,function(a,b){var d,e=g._transformDatum(b);return d=c.some(f,function(a){return e.value===a.value}),!d&&f.push(e),f.length<g.limit}),b&&b(f)}var e,f,g=this,h=!1;a.length<this.minLength||(e=c.tokenizeQuery(a),f=this._getLocalSuggestions(e).slice(0,this.limit),f.length<this.limit&&this.transport&&(h=this.transport.get(a,d)),!h&&b&&b(f))}}),d}(),j=function(){function b(b){var d=this;c.bindAll(this),this.specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},this.$hint=a(b.hint),this.$input=a(b.input).on("blur.tt",this._handleBlur).on("focus.tt",this._handleFocus).on("keydown.tt",this._handleSpecialKeyEvent),c.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){d.specialKeyCodeMap[a.which||a.keyCode]||c.defer(d._compareQueryToInputValue)}):this.$input.on("input.tt",this._compareQueryToInputValue),this.query=this.$input.val(),this.$overflowHelper=e(this.$input)}function e(b){return a("<span></span>").css({position:"absolute",left:"-9999px",visibility:"hidden",whiteSpace:"nowrap",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return a=(a||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),b=(b||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),a===b}return c.mixin(b.prototype,d,{_handleFocus:function(){this.trigger("focused")},_handleBlur:function(){this.trigger("blured")},_handleSpecialKeyEvent:function(a){var b=this.specialKeyCodeMap[a.which||a.keyCode];b&&this.trigger(b+"Keyed",a)},_compareQueryToInputValue:function(){var a=this.getInputValue(),b=f(this.query,a),c=b?this.query.length!==a.length:!1;c?this.trigger("whitespaceChanged",{value:this.query}):b||this.trigger("queryChanged",{value:this.query=a})},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(a){this.query=a},getInputValue:function(){return this.$input.val()},setInputValue:function(a,b){this.$input.val(a),!b&&this._compareQueryToInputValue()},getHintValue:function(){return this.$hint.val()},setHintValue:function(a){this.$hint.val(a)},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},isOverflow:function(){return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>this.$input.width()},isCursorAtEnd:function(){var a,b=this.$input.val().length,d=this.$input[0].selectionStart;return c.isNumber(d)?d===b:document.selection?(a=document.selection.createRange(),a.moveStart("character",-b),b===a.text.length):!0}}),b}(),k=function(){function b(b){c.bindAll(this),this.isOpen=!1,this.isEmpty=!0,this.isMouseOverDropdown=!1,this.$menu=a(b.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}function e(a){return a.data("suggestion")}var f={suggestionsList:'<span class="tt-suggestions"></span>'},g={suggestionsList:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"}};return c.mixin(b.prototype,d,{_handleMouseenter:function(){this.isMouseOverDropdown=!0},_handleMouseleave:function(){this.isMouseOverDropdown=!1},_handleMouseover:function(b){var c=a(b.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor"),c.addClass("tt-is-under-cursor")},_handleSelection:function(b){var c=a(b.currentTarget);this.trigger("suggestionSelected",e(c))},_show:function(){this.$menu.css("display","block")},_hide:function(){this.$menu.hide()},_moveCursor:function(a){var b,c,d,f;if(this.isVisible()){if(b=this._getSuggestions(),c=b.filter(".tt-is-under-cursor"),c.removeClass("tt-is-under-cursor"),d=b.index(c)+a,d=(d+1)%(b.length+1)-1,-1===d)return this.trigger("cursorRemoved"),void 0;-1>d&&(d=b.length-1),f=b.eq(d).addClass("tt-is-under-cursor"),this._ensureVisibility(f),this.trigger("cursorMoved",e(f))}},_getSuggestions:function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},_ensureVisibility:function(a){var b=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),c=this.$menu.scrollTop(),d=a.position().top,e=d+a.outerHeight(!0);0>d?this.$menu.scrollTop(c+d):e>b&&this.$menu.scrollTop(c+(e-b))},destroy:function(){this.$menu.off(".tt"),this.$menu=null},isVisible:function(){return this.isOpen&&!this.isEmpty},closeUnlessMouseIsOverDropdown:function(){this.isMouseOverDropdown||this.close()},close:function(){this.isOpen&&(this.isOpen=!1,this.isMouseOverDropdown=!1,this._hide(),this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor"),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(a){var b={left:"0",right:"auto"},c={left:"auto",right:" 0"};"ltr"===a?this.$menu.css(b):this.$menu.css(c)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getSuggestionUnderCursor:function(){var a=this._getSuggestions().filter(".tt-is-under-cursor").first();return a.length>0?e(a):null},getFirstSuggestion:function(){var a=this._getSuggestions().first();return a.length>0?e(a):null},renderSuggestions:function(b,d){var e,h,i,j,k,l="tt-dataset-"+b.name,m='<div class="tt-suggestion">%body</div>',n=this.$menu.find("."+l);0===n.length&&(h=a(f.suggestionsList).css(g.suggestionsList),n=a("<div></div>").addClass(l).append(b.header).append(h).append(b.footer).appendTo(this.$menu)),d.length>0?(this.isEmpty=!1,this.isOpen&&this._show(),i=document.createElement("div"),j=document.createDocumentFragment(),c.each(d,function(c,d){d.dataset=b.name,e=b.template(d.datum),i.innerHTML=m.replace("%body",e),k=a(i.firstChild).css(g.suggestion).data("suggestion",d),k.children().each(function(){a(this).css(g.suggestionChild)}),j.appendChild(k[0])}),n.show().find(".tt-suggestions").html(j)):this.clearSuggestions(b.name),this.trigger("suggestionsRendered")},clearSuggestions:function(a){var b=a?this.$menu.find(".tt-dataset-"+a):this.$menu.find('[class^="tt-dataset-"]'),c=b.find(".tt-suggestions");b.hide(),c.empty(),0===this._getSuggestions().length&&(this.isEmpty=!0,this._hide())}}),b}(),l=function(){function b(a){var b,d,f;c.bindAll(this),this.$node=e(a.input),this.datasets=a.datasets,this.dir=null,this.eventBus=a.eventBus,b=this.$node.find(".tt-dropdown-menu"),d=this.$node.find(".tt-query"),f=this.$node.find(".tt-hint"),this.dropdownView=new k({menu:b}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent),this.inputView=new j({input:d,hint:f}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}function e(b){var c=a(g.wrapper),d=a(g.dropdown),e=a(b),f=a(g.hint);c=c.css(h.wrapper),d=d.css(h.dropdown),f.css(h.hint).css({backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}),e.data("ttAttrs",{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")}),e.addClass("tt-query").attr({autocomplete:"off",spellcheck:!1}).css(h.query);try{!e.attr("dir")&&e.attr("dir","auto")}catch(i){}return e.wrap(c).parent().prepend(f).append(d)}function f(a){var b=a.find(".tt-query");c.each(b.data("ttAttrs"),function(a,d){c.isUndefined(d)?b.removeAttr(a):b.attr(a,d)}),b.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(a),a.remove()}var g={wrapper:'<span class="twitter-typeahead"></span>',hint:'<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',dropdown:'<span class="tt-dropdown-menu"></span>'},h={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},query:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"}};return c.isMsie()&&c.mixin(h.query,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),c.isMsie()&&c.isMsie()<=7&&(c.mixin(h.wrapper,{display:"inline",zoom:"1"}),c.mixin(h.query,{marginTop:"-1px"})),c.mixin(b.prototype,d,{_managePreventDefault:function(a){var b,c,d=a.data,e=!1;switch(a.type){case"tabKeyed":b=this.inputView.getHintValue(),c=this.inputView.getInputValue(),e=b&&b!==c;break;case"upKeyed":case"downKeyed":e=!d.shiftKey&&!d.ctrlKey&&!d.metaKey}e&&d.preventDefault()},_setLanguageDirection:function(){var a=this.inputView.getLanguageDirection();a!==this.dir&&(this.dir=a,this.$node.css("direction",a),this.dropdownView.setLanguageDirection(a))},_updateHint:function(){var a,b,d,e,f,g=this.dropdownView.getFirstSuggestion(),h=g?g.value:null,i=this.dropdownView.isVisible(),j=this.inputView.isOverflow();h&&i&&!j&&(a=this.inputView.getInputValue(),b=a.replace(/\s{2,}/g," ").replace(/^\s+/g,""),d=c.escapeRegExChars(b),e=new RegExp("^(?:"+d+")(.*$)","i"),f=e.exec(h),this.inputView.setHintValue(a+(f?f[1]:"")))},_clearHint:function(){this.inputView.setHintValue("")},_clearSuggestions:function(){this.dropdownView.clearSuggestions()},_setInputValueToQuery:function(){this.inputView.setInputValue(this.inputView.getQuery())},_setInputValueToSuggestionUnderCursor:function(a){var b=a.data;this.inputView.setInputValue(b.value,!0)},_openDropdown:function(){this.dropdownView.open()},_closeDropdown:function(a){this.dropdownView["blured"===a.type?"closeUnlessMouseIsOverDropdown":"close"]()},_moveDropdownCursor:function(a){var b=a.data;b.shiftKey||b.ctrlKey||b.metaKey||this.dropdownView["upKeyed"===a.type?"moveCursorUp":"moveCursorDown"]()},_handleSelection:function(a){var b="suggestionSelected"===a.type,d=b?a.data:this.dropdownView.getSuggestionUnderCursor();d&&(this.inputView.setInputValue(d.value),b?this.inputView.focus():a.data.preventDefault(),b&&c.isMsie()?c.defer(this.dropdownView.close):this.dropdownView.close(),this.eventBus.trigger("selected",d.datum,d.dataset))},_getSuggestions:function(){var a=this,b=this.inputView.getQuery();c.isBlankString(b)||c.each(this.datasets,function(c,d){d.getSuggestions(b,function(c){b===a.inputView.getQuery()&&a.dropdownView.renderSuggestions(d,c)})})},_autocomplete:function(a){var b,c,d,e,f;("rightKeyed"!==a.type&&"leftKeyed"!==a.type||(b=this.inputView.isCursorAtEnd(),c="ltr"===this.inputView.getLanguageDirection()?"leftKeyed"===a.type:"rightKeyed"===a.type,b&&!c))&&(d=this.inputView.getQuery(),e=this.inputView.getHintValue(),""!==e&&d!==e&&(f=this.dropdownView.getFirstSuggestion(),this.inputView.setInputValue(f.value),this.eventBus.trigger("autocompleted",f.datum,f.dataset)))},_propagateEvent:function(a){this.eventBus.trigger(a.type)},destroy:function(){this.inputView.destroy(),this.dropdownView.destroy(),f(this.$node),this.$node=null},setQuery:function(a){this.inputView.setQuery(a),this.inputView.setInputValue(a),this._clearHint(),this._clearSuggestions(),this._getSuggestions()}}),b}();!function(){var b,d={},f="ttView";b={initialize:function(b){function g(){var b,d=a(this),g=new e({el:d});b=c.map(h,function(a){return a.initialize()}),d.data(f,new l({input:d,eventBus:g=new e({el:d}),datasets:h})),a.when.apply(a,b).always(function(){c.defer(function(){g.trigger("initialized")})})}var h;return b=c.isArray(b)?b:[b],0===b.length&&a.error("no datasets provided"),h=c.map(b,function(a){var b=d[a.name]?d[a.name]:new i(a);return a.name&&(d[a.name]=b),b}),this.each(g)},destroy:function(){function b(){var b=a(this),c=b.data(f);c&&(c.destroy(),b.removeData(f))}return this.each(b)},setQuery:function(b){function c(){var c=a(this).data(f);c&&c.setQuery(b)}return this.each(c)}},jQuery.fn.typeahead=function(a){return b[a]?b[a].apply(this,[].slice.call(arguments,1)):b.initialize.apply(this,arguments)}}()}(window.jQuery);(function($){$.fn.GSRValidatorCheck=function(checkType,value){var patterns={alnum:/[^A-Za-z0-9\ ]/,alnumhyphen:/[^A-Za-z0-9\-_]/,alpha:/[^A-Za-z]/,cc:/^(3[47]|4|5[1-5]|6011)/,csv:/[^-a-zA-Z0-9,\s]/,custom:/[^A-Za-z0-9\042\047\055\057\ _$.,!?()]/,date:/^[\d]{4}-[\d]{2}-[\d]{2}$/,email:/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/,float:/[^0-9\.]/,img:/^[0-9A-Za-z_ \-]+(.[jJ][pP][gG]|.[jJ][pP][eE][gG]|.[gG][iI][fF]|.[pP][nN][gG])$/,ip:/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/,num:/[^0-9]/,phone:/[^0-9\- ()]/,url:/(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?/,zip:/[0-9]{5}/,postal:/^[A-Za-z][0-9][A-Za-z]\s?[0-9][A-Za-z][0-9]$/};switch(checkType){case'credit-card':var value=$(this).val().replace(/\D/g,''),valueLength=value.length,firstNumber=value[0],cardType='';if(null==patterns['cc'].exec(value))
return false;switch(firstNumber){case'4':if(13!=valueLength&&16!=valueLength)
return false;cardType='visa';break;case'5':if(16!=valueLength)
return false;cardType='master-card';break;case'6':if(16!=valueLength)
return false;cardType='discover';break;case'3':if(15!=valueLength)
return false;cardType='american-express';break;}
if(!luhnCheck(value))
return false;$(this).trigger('gsrv-selected-card',[cardType]);break;case'email':return null!=$(this).val().match(patterns.email);break;case'minlength':return $(this).val().trim().length>=value;break;case'empty':if($(this).is(':radio')){return 0==$('input[name="'+$(this).attr('name')+'"]:checked').length;}else{return 0==$(this).val().trim().length;}
break;case'phone':return $(this).val().search(patterns.phone)<0;break;case'zip':return $(this).val().match(patterns.zip)||$(this).val().match(patterns.postal);break;case'full-name':return $(this).val().indexOf(' ')>-1&&$(this).val().indexOf(' ')!==$(this).val().length;break;}
return true;};var GSRValidator={init:function(options,form){var self=this;self.form=form;self.$form=$(form);self.options=$.extend({},$.fn.GSRValidator.options,options);self.elements=self.$form.find('[data-validation]').filter(':input');self.$form.submit(function(){var is_small=$(window).width()<768;var validation_result=self.validate(self.elements.filter(':visible'));if(is_small&&$('body').data('validator-scroll-to')){$('html, body').animate({scrollTop:($('body').data('validator-scroll-to').offset().top)},function(){$('body').data('validator-scroll-to',false);});}
return validation_result;});self.elements.bind('focusout gsr-validator-check',function(e){var element=$(this);element.data('gsr-validator-success',self.validate($($(this))));if(element.GSRValidatorCheck('empty')&&'gsr-validator-check'!=e.type)
setTimeout(function(){if(!element.is(':focus'))
element.popover('destroy').parent().removeClass('has-error');},self.options.fadeOutSeconds*1000);});},validate:function(elements){var self=this,submit=true,result=false;elements.each(function(){var criteria=$(this).attr('data-validation').split(' ');result=self.checkCriteria($(this),criteria);if(submit)
submit=result;});return submit;},checkCriteria:function(element,criteria){var self=this,errorMessage=false,errorMessages=[];self.element=element;self.element.val($.trim(self.element.val()));for(var i in criteria){errorMessage=self.checkCriterium(criteria[i]);if(errorMessage)
errorMessages.push(errorMessage);}
if(0!=errorMessages.length)
return self.showErrors(errorMessages);self.element.popover('destroy').parent().removeClass('has-error');return true;},checkCriterium:function(criterium){var self=this,message=false,criteriumArray=criterium.split('=');criterium=criteriumArray.shift();value=criteriumArray.shift();switch(criterium){case'credit-card':if(!self.check('empty')&&!self.check('credit-card'))
message='May only be a valid credit card number';break;case'email':if(!self.check('empty')&&!self.check('email'))
message='May only be a valid email address';break;case'minlength':if(!self.check('minlength',value))
message='Must be at least '+value+' characters long';break;case'phone':if(!self.check('empty')&&!self.check('phone'))
message='May only be a valid phone number';break;case'required':if(self.check('empty'))
message=($(self.element).is(':radio'))?'Must select one':'This field is required';break;case'zip':if(!self.check('empty')&&!self.check('zip'))
message='May only be a valid zip code';break;case'postal':if(!self.check('empty')&&!self.check('postal'))
message='May only be a valid canadian postal code';break;case'full-name':if(!self.check('empty')&&!self.check('full-name'))
message='Your full name is required';break;default:break;}
return(message)?self.getErrormessage(criterium,message):false;},check:function(checkType,value){var self=this;return $(self.element).GSRValidatorCheck(checkType,value);},getErrormessage:function(criterium,message){var self=this,elementError=self.element.attr('data-'+criterium+'-error');return(elementError)?elementError:message;},showErrors:function(messages){var self=this;var is_small=$(window).width()<768;var placement=self.element.parents('form').data('popover-placement')||self.options.notificationPlacement;if(is_small){placement='top';}
self.element.popover('destroy').popover({placement:placement,html:true,trigger:'manual',content:'<span class="text-danger">'+messages.join('<br>')+'</span>'}).popover('show').parent().addClass('has-error');if(!$('body').data('validator-scroll-to')){$('body').data('validator-scroll-to',self.element);}
return false;}};$.fn.GSRValidator=function(options){return this.each(function(){var validator=Object.create(GSRValidator);validator.init(options,this);$.data(this,'validator',GSRValidator);});};$.fn.GSRValidator.options={notificationPlacement:'left',fadeOutSeconds:3,patterns:{alnum:/[^A-Za-z0-9\ ]/,alnumhyphen:/[^A-Za-z0-9\-_]/,alpha:/[^A-Za-z]/,cc:/^(3[47]|4|5[1-5]|6011)/,csv:/[^-a-zA-Z0-9,\s]/,custom:/[^A-Za-z0-9\042\047\055\057\ _$.,!?()]/,date:/^[\d]{4}-[\d]{2}-[\d]{2}$/,email:/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/,float:/[^0-9\.]/,img:/^[0-9A-Za-z_ \-]+(.[jJ][pP][gG]|.[jJ][pP][eE][gG]|.[gG][iI][fF]|.[pP][nN][gG])$/,ip:/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/,num:/[^0-9]/,phone:/[^0-9\- ()]/,url:/(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?/,zip:/[^-0-9]/,postal:/^[A-Za-z][0-9][A-Za-z]\s?[0-9][A-Za-z][0-9]$/}};$('.form-validate').GSRValidator();}(jQuery));function luhnCheck(number){var ccnumber=number.replace(/\D/g,'');var number_length=ccnumber.length;var parity=number_length%2;var total=0;for(var i=0;i<number_length;i++){var digit=number.charAt(i);if(i%2==parity){digit=digit*2;if(digit>9)
digit=digit-9;}
total=total+parseInt(digit,10);}
return total%10==0;}
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory);}else if(typeof exports==='object'){module.exports=factory(require('jquery'));}else{factory(jQuery);}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s);}
function decode(s){return config.raw?s:decodeURIComponent(s);}
function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value));}
function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\');}
try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s;}catch(e){}}
function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value;}
var config=$.cookie=function(key,value,options){if(arguments.length>1&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setMilliseconds(t.getMilliseconds()+days*864e+5);}
return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
var result=key?undefined:{},cookies=document.cookie?document.cookie.split('; '):[],i=0,l=cookies.length;for(;i<l;i++){var parts=cookies[i].split('='),name=decode(parts.shift()),cookie=parts.join('=');if(key===name){result=read(cookie,value);break;}
if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie;}}
return result;};config.defaults={};$.removeCookie=function(key,options){$.cookie(key,'',$.extend({},options,{expires:-1}));return!$.cookie(key);};}));(function($){$.fn.slideshow=function(){return this.each(function(){var slideContainer=$('.slides',this);slideContainer.find('.slide.hidden').hide().removeClass('hidden');$(this).find('.slide-left').click(function(e){e.preventDefault();var slideContainer=$(this).parents('.slideshow:first').find('.slides:first');$.fn.slideshow.left(slideContainer);});$(this).find('.slide-right').click(function(e){e.preventDefault();var slideContainer=$(this).parents('.slideshow:first').find('.slides:first');$.fn.slideshow.right(slideContainer);});i=0;slideContainer.find('.slide').each(function(){i++;$(this).data('index',i);});return this;});};$.fn.slideshow.right=function(slideContainer){var slides=slideContainer.find('.slide'),visibleSlides=slides.filter(':visible');if(slides.length==visibleSlides.length)
return;var first=$(slides[0]);first.appendTo(slideContainer).hide();var next=null;if(visibleSlides.length==1)
next=slideContainer.find('.slide:first');else
next=$(visibleSlides[visibleSlides.length-1]).next('.slide');next.show();$.fn.slideshow.callback(next);};$.fn.slideshow.left=function(slideContainer){var slides=slideContainer.find('.slide'),visibleSlides=slides.filter(':visible');if(slides.length==visibleSlides.length)
return;var last=$(visibleSlides[visibleSlides.length-1]);last.hide();var previous=$(slides[slides.length-1]);previous.prependTo(slideContainer).show();$.fn.slideshow.callback(previous);};$.fn.slideshow.callback=function(slide){slide.parents('.slideshow:first').find('.slide-index').text(slide.data('index'));};$('.slideshow').slideshow();}(jQuery));(function($){$('.navmenu-toggle').on('click',function(e){e.preventDefault();$('html, body').toggleClass('slide-out');$('.navmenu-fixed-left').toggleClass('in');});$('.nav.navmenu-nav .dropdown-toggle').on('click',function(e){e.preventDefault();$(this).children('.fa-angle-down').toggleClass('open');$(this).siblings('.dropdown-menu').slideToggle();});})(jQuery);(function($){$("a[href='#top']").click(function(){$('html, body').animate({scrollTop:0},'slow');return false;});})(jQuery);(function($){$('.navbar-top-xs .search-float').hide();$('.navbar-top-xs .search-toggle').click(function(e){e.preventDefault();$(this).toggleClass('active');$('.navbar-top-xs .search-float').slideToggle('fast');});})(jQuery);(function($){form=$('#compare-form');checkboxes=$('form input:checkbox');counter=0;form.submit(function(event){checkboxes.each(function(){if($(this).is(':checked')){counter++;}});if(counter>=2){return true;}else{alert('Please choice more than one product to compare.');return false;}});})(jQuery);(function($){var checkBoxes=$('.compare-product-control input[type=checkbox]');var compareBtn=$('.btn-compare-selected');$(checkBoxes).on('click',function(){if($('.compare-product-control input[type=checkbox]:checked').length>1){$(compareBtn).prop('disabled',false);}else{$(compareBtn).prop('disabled',true);}});})(jQuery);(function(){var method;var noop=function(){};var methods=['assert','clear','count','debug','dir','dirxml','error','exception','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','table','time','timeEnd','timeline','timelineEnd','timeStamp','trace','warn'];var length=methods.length;var console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop;}}})();(function($){var domain='//'+document.domain;prefetch=$('#disable-prefetch').val()==1?false:true;if(prefetch){$('.canvas #s').typeahead([{name:'search-products',template:['<img class="search-img bordered" src="{{image}}" width="48">','<p class="search-name">{{name}}</p>','<p class="search-description">Brand: {{brand}}<br>SKU: {{sku}}</p>'].join(''),valueKey:'name',engine:Hogan,header:'<h3 class="search-group">Products</h3>',prefetch:domain+'/search/prefetch-products/'},{name:'search-categories',template:['<img class="search-img bordered" src="{{image}}" width="48">','<p class="search-name">{{name}}</p>','<p class="search-description">{{description}}</p>'].join(''),valueKey:'name',engine:Hogan,header:'<h3 class="search-group">Categories</h3>',prefetch:domain+'/search/prefetch-categories/'},{name:'search-pages',template:['<img src="/images/icons/search-link.png" class="pull-left">','<div style="padding-left: 3.5rem;">','<p class="search-name">{{name}}</p>','<p class="search-description">{{description}}</p>','</div>'].join(''),valueKey:'name',engine:Hogan,header:'<h3 class="search-group">Pages</h3>',prefetch:domain+'/search/prefetch-pages/'}]).bind('typeahead:selected',function(obj,datum){window.location=datum.url;});}
$('.item-filter li.sub-nav > a').on('click',function(e){e.preventDefault();$(this).parent().toggleClass('open',500);});$('form.form-ajax').on('submit',function(event){var form=$(this),target=$(form.attr('data-target'));form.find(':submit').prop('disabled',true);$.ajax({type:form.attr('method'),url:form.attr('action'),data:form.serialize(),success:function(data,status){$(form.attr('data-target')).html(data).removeClass('hidden');form.find(':submit').prop('disabled',false);},error:function(){form.find(':submit').prop('disabled',false);}});event.preventDefault();});$('[data-toggle=popover]').popover({content:function(){return $($(this).attr('href')).html();}}).click(function(event){event.preventDefault();});$('.toggle-form').click(function(e){$(this).parents('form').toggleClass('hidden');$($(this).attr('href')).toggleClass('hidden');$('#myModalLabel').text($('form[data-title]:not(.hidden)').data('title'));e.preventDefault();});$('[data-load]').each(function(){var reloadEach=0;if($(this).attr('data-reload')){reloadEach=$(this).attr('data-reload');}
var url=$(this).data('load');url+=url.indexOf('?')=='-1'?'?':'&';url+='_nc='+new Date().getTime();$(this).load(url);if(reloadEach>0){var obj=$(this);setInterval(function(){obj.html('');obj.load(url);},reloadEach*1000);}});$('#pp').change(function(){window.location=$(this).find('option:selected').attr('data-href');});$('#pf').change(function(){window.location=$(this).find('option:selected').attr('data-href');});$('.btn-view-all').click(function(){window.location=$(this).attr('data-href');});$('body').on('hidden.bs.modal','.modal',function(){$(this).removeData('bs.modal');});var humanCallback=function(){form=$(this).parents('form:first');if(form.size()==0){return;}
input=form.find('input.human');if(input.size()==0){return;}
input.val('1');};$('body').on('click','input, textarea',humanCallback);$('body').on('focus','input, textarea',humanCallback);})(jQuery);(function($){var marketing_popup_shown_cookie_name='_marketing_popup_popup_shown';var now=new Date();var marketing_popup_current_time=now.getTime();var marketing_popup_started_cookie_name='_marketing_popup_started_at';var marketing_popup_started_at=$.cookie(marketing_popup_started_cookie_name);var marketingpopup_modal=$('#popup_modal_email_capture');if(marketingpopup_modal.size()==0){console.log('marketing popup modal not present. Disabled or captured.');}else{var checkMarketingPopupStatus=function(){var popup_shown=$.cookie(marketing_popup_shown_cookie_name);console.log('--------');if(!popup_shown){var now=new Date();var marketing_popup_current_time=now.getTime();var marketing_popup_elapsed=marketing_popup_current_time-marketing_popup_started_at;var marketing_popup_after_time=parseInt($('#popup_modal_email_capture').data('idle-seconds'))*1000;if(marketing_popup_elapsed>marketing_popup_after_time){console.log('showing marketingpopup popup');$.cookie(marketing_popup_shown_cookie_name,true,{expires:1,path:'/'});$('#popup_modal_email_capture').modal();clearInterval(marketingpopupInterval);}else{console.log(marketing_popup_started_at);console.log('marketingpopup popup in '+
(marketing_popup_after_time-marketing_popup_elapsed)+'ms ');}}else{console.log('popup already shown');clearInterval(marketingpopupInterval);}};if(!marketing_popup_started_at){$.cookie(marketing_popup_started_cookie_name,marketing_popup_current_time,{expires:1,path:'/'});marketing_popup_started_at=marketing_popup_current_time;console.log('cart started at '+marketing_popup_current_time);}
if(window.location.pathname.indexOf('shopping-cart/')==-1){var marketingpopupInterval=setInterval(checkMarketingPopupStatus,1*1000);}
$('#marketing_form_email_capture').on('submit',function(event){$('#popup_modal_email_capture').find('.form-email-capture-alert').addClass('hidden');var form=$(this),target=$(form.attr('data-target'));form.find(':submit').prop('disabled',true);$.ajax({type:form.attr('method'),url:form.attr('action'),data:form.serialize(),success:function(data,status){if(data.success){$('#popup_modal_email_capture').find('.alert.hidden').removeClass('hidden');form.find(':submit').prop('disabled',false);}else{$('#popup_modal_email_capture').find('.form-email-capture-alert').removeClass('hidden').html(data.error);form.find(':submit').prop('disabled',false);}},error:function(){form.find(':submit').prop('disabled',false);}});event.preventDefault();});}
var cart_started_cookie_name='_cart_started_at';var cart_shown_cookie_name='_cart_popup_shown';var cart_started_at=$.cookie(cart_started_cookie_name);var now=new Date();var current_time=now.getTime();var remarketing_modal=$('#modal_email_capture');if(remarketing_modal.size()==0){console.log('Remarketing modal not present. Disabled or captured.');}else{var checkRemarketingStatus=function(){var popup_shown=$.cookie(cart_shown_cookie_name);if(!popup_shown){var now=new Date();var current_time=now.getTime();var elapsed=current_time-cart_started_at;var popup_after_time=parseInt($('#modal_email_capture').data('idle-seconds'))*1000;if(elapsed>popup_after_time){console.log('showing remarketing popup');$.cookie(cart_shown_cookie_name,true,{expires:1,path:'/'});$('#modal_email_capture').modal();clearInterval(remarketingInterval);}else{console.log('remarketing popup in '+(popup_after_time-elapsed)+'ms ');}}else{console.log('popup already shown');clearInterval(remarketingInterval);}};if(!cart_started_at){$.cookie(cart_started_cookie_name,current_time,{expires:1,path:'/'});cart_started_at=current_time;console.log('cart started at '+current_time);}
if(window.location.pathname.indexOf('shopping-cart/')==-1){var remarketingInterval=setInterval(checkRemarketingStatus,1*1000);}else{console.log('in shopping cart -- no remarketing to be shown');}
$('#form_email_capture_remarketing').on('submit',function(event){$('#modal_email_capture').find('.form-email-capture-alert').addClass('hidden');var form=$(this),target=$(form.attr('data-target'));form.find(':submit').prop('disabled',true);$.ajax({type:form.attr('method'),url:form.attr('action'),data:form.serialize(),success:function(data,status){if(data.success){$('#modal_email_capture').find('.alert.hidden').removeClass('hidden');form.find(':submit').prop('disabled',false);}else{$('#modal_email_capture').find('.form-email-capture-alert').removeClass('hidden').html(data.error);form.find(':submit').prop('disabled',false);}},error:function(){form.find(':submit').prop('disabled',false);}});event.preventDefault();});$('#form_email_capture').on('submit',function(event){$('#modal_email_capture').find('.form-email-capture-alert').addClass('hidden');var form=$(this),target=$(form.attr('data-target'));form.find(':submit').prop('disabled',true);$.ajax({type:form.attr('method'),url:form.attr('action'),data:form.serialize(),success:function(data,status){if(data.success){$('#modal_email_capture').find('.alert.hidden').removeClass('hidden');form.find(':submit').prop('disabled',false);}else{$('#modal_email_capture').find('.form-email-capture-alert').removeClass('hidden').html(data.error);form.find(':submit').prop('disabled',false);}},error:function(){form.find(':submit').prop('disabled',false);}});event.preventDefault();});}})(jQuery);;(function($,window,undefined){var $allDropdowns=$();$.fn.dropdownHover=function(options){if('ontouchstart'in document)return this;$allDropdowns=$allDropdowns.add(this.parent());return this.each(function(){var $this=$(this),$parent=$this.parent(),defaults={delay:500,hoverDelay:0,instantlyCloseOthers:true},data={delay:$(this).data('delay'),hoverDelay:$(this).data('hover-delay'),instantlyCloseOthers:$(this).data('close-others')},showEvent='show.bs.dropdown',hideEvent='hide.bs.dropdown',settings=$.extend(true,{},defaults,options,data),timeout,timeoutHover;$parent.hover(function(event){if(!$parent.hasClass('open')&&!$this.is(event.target)){return true;}
openDropdown(event);},function(){window.clearTimeout(timeoutHover)
timeout=window.setTimeout(function(){$this.attr('aria-expanded','false');$parent.removeClass('open');$this.trigger(hideEvent);},settings.delay);});$this.hover(function(event){if(!$parent.hasClass('open')&&!$parent.is(event.target)){return true;}
openDropdown(event);});$parent.find('.dropdown-submenu').each(function(){var $this=$(this);var subTimeout;$this.hover(function(){window.clearTimeout(subTimeout);$this.children('.dropdown-menu').show();$this.siblings().children('.dropdown-menu').hide();},function(){var $submenu=$this.children('.dropdown-menu');subTimeout=window.setTimeout(function(){$submenu.hide();},settings.delay);});});function openDropdown(event){window.clearTimeout(timeout);window.clearTimeout(timeoutHover);timeoutHover=window.setTimeout(function(){$allDropdowns.find(':focus').blur();if(settings.instantlyCloseOthers===true)
$allDropdowns.removeClass('open');window.clearTimeout(timeoutHover);$this.attr('aria-expanded','true');$parent.addClass('open');$this.trigger(showEvent);},settings.hoverDelay);}});};$(document).ready(function(){$('[data-hover="dropdown"]').dropdownHover();});})(jQuery,window);