function LazySlider(n,t,i,r){function ct(n,t){n.animate({left:"-50%"},u.slideSpeed,"easeInOutCubic",function(){u.lazyLoad?n.remove():n.hide()}),t.css("left","150%"),u.lazyLoad?e.append(t):t.show(),s(t),t.animate({left:"50%"},u.slideSpeed,"easeInOutCubic",function(){s(t),h=!1})}function lt(n,t){n.animate({left:"150%"},u.slideSpeed,"easeInOutCubic",function(){u.lazyLoad?n.remove():n.hide()}),t.css("left","-50%"),u.lazyLoad?e.append(t):t.show(),s(t),t.animate({left:"50%"},u.slideSpeed,"easeInOutCubic",function(){s(t),h=!1})}function at(n,t){n.fadeOut(u.slideSpeed,function(){u.lazyLoad&&n.remove()}),t.css("left","50%"),u.lazyLoad&&e.append(t),s(t),t.fadeIn(u.slideSpeed,function(){h=!1})}function vt(n,t){ft(n,t,180)}function yt(n,t){ft(n,t,-180)}function ft(n,t,i){var r="rotateY("+i+"deg)",f="rotateY("+(i*-1).toString()+"deg)";c(t,"transform",f),u.lazyLoad?e.append(t):t.show(),s(t),c(t,"transform","rotateY(0deg)"),c(n,"transform",r),setTimeout(function(){u.lazyLoad?n.remove():n.hide(),s(t),h=!1},u.slideSpeed)}function pt(n,t){u.lazyLoad?e.append(t):t.show(),s(t),u.lazyLoad?n.remove():n.hide(),h=!1}function b(n,t,i){if(!i)if($.inArray(n,f)<$.inArray(t,f))i="left";else if($.inArray(n,f)>$.inArray(t,f))i="right";else return;u.lazyLoad&&e.append(t),h=!0;switch(u.transition){case tt:i=="left"?ct(n,t):lt(n,t);break;case it:at(n,t);break;case p:i=="left"?yt(n,t):vt(n,t);break;case st:default:pt(n,t)}}function k(){}function d(n){currentSlideHasVideo=slideHasVideo(1),updateBlurImage(n),currentSlideHasVideo&&initVideo(),audio=document.getElementById("mainAudio"),audioPlayer();var t=!1;audio&&(n.find("audio").length?t&&(audio.play(),t=!1):audio.paused||(t=!0,audio.pause()))}function g(n){var t=f[o],i=f[n];k(t),b(t,i),o=n,d(i),nt()}function v(){h||(o==f.length-1?(k(f[o]),b(f[o],f[0],"left"),o=0,d(f[0]),nt()):g(o+1),y())}function et(){h||(o==0?(k(f[o]),b(f[o],f[f.length-1],"right"),o=f.length-1,d(f[f.length-1]),nt()):g(o-1),y())}function wt(n){var i={delay:1e4,slideSpeed:1e3,lazyLoad:!0,transition:tt,videoDelay:3e4},t;for(t in n)i[t]=n[t];return i}function y(){a&&clearTimeout(a),(u.delay||u.videoDelay)&&(a=currentSlideHasVideo?setTimeout(v,u.videoDelay):setTimeout(v,u.delay))}function bt(n){var u=[],i=0,e=common.getFavoriteStore(),f,r,t;for(l.length=0,w.empty(),f=RulesEngine.runRules(n,e),r=0;r<f.length;r++)t=kt(n,r),t.addClass("slider-content"),t.removeClass("hero-slide"),u.push(t),dt(t,i),gt(i),i++;return ut.length&&ut.text(i),u}function kt(n,t){var i;return i=n[t].Content?$(n[t].Content):$(n[t])}function dt(n,t){u.transition==p?(c(n,"transform-style","preserve-3d"),c(n,"transition","transform "+u.slideSpeed+"ms"),c(n,"backface-visibility","hidden")):u.transition==it&&t!=0&&n.hide()}function gt(n){var t=$("<li><a ><\/a><\/li>");l.push(t),w.length&&(ni(t,n),w.append(t))}function ni(n,t){n.click(function(){h||(g(t),y())})}function s(n){n||(n=f[o]);var t=n.width()/2,i=n.height()/2;n.css("margin-left",-t),n.css("margin-top",-i)}function ti(){s()}function c(n,t,i){t=="transition"?n.css("-webkit-"+t,"-webkit-"+i):n.css("-webkit-"+t,i),n.css("-moz-"+t,i),n.css("-ms-"+t,i),n.css("-o-"+t,i),n.css(t,i)}function ot(){var n,i,h;if(f=bt(t),u.transition==p&&(e.css("-webkit-perspective","500px"),e.css("perspective","500px")),f.length>0)if(u.lazyLoad)e.empty(),e.append(f[0]);else for(n=1;n<f.length;n++)i=f[n],i.hide();if(l.length>0&&(h=l[0].find("a"),h.addClass("lazy-slider-active"),rt.length&&rt.text(1),setTimeout(function(){var n=f[0];s(n)},0)),currentSlideHasVideo=slideHasVideo(o),y(),r)try{r(f,e)}catch(c){}}function nt(){}var tt="slide",it="fade",p="flip",st="none",u=wt(i),e=n.find(".lazy-slider-viewport"),w=n.find(".lazy-slider-control-nav"),rt=n.find(".slider-current-index"),ut=n.find(".slider-total-items"),ht=$(window),h=!1,l=[],o=0,a,f=[];n.find(".hero-slider-arrow-right").click(et),n.find(".hero-slider-arrow-left").click(v);e.on("swipeleft",v);e.on("swiperight",et);if(ht.resize(ti),e.hammer)e.hammer().on("drag",function(n){n.gesture.deltaX>=5?e.hammer().trigger("swiperight",n):n.gesture.deltaX<=-5&&e.hammer().trigger("swipeleft",n)});t||(t=e.children()),$(function(){$(common).on("favoriteStoreChange",ot);ot()})}jQuery.effects||function(n){function t(t,i){var u=t[1]&&t[1].constructor==Object?t[1]:{},r,f;return i&&(u.mode=i),r=t[1]&&t[1].constructor!=Object?t[1]:u.duration?u.duration:t[2],r=n.fx.off?0:typeof r=="number"?r:n.fx.speeds[r]||n.fx.speeds._default,f=u.callback||n.isFunction(t[1])&&t[1]||n.isFunction(t[2])&&t[2]||n.isFunction(t[3])&&t[3],[t[0],u,r,f]}function i(t){var i;return t&&t.constructor==Array&&t.length==3?t:(i=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]:(i=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?[parseFloat(i[1])*2.55,parseFloat(i[2])*2.55,parseFloat(i[3])*2.55]:(i=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]:(i=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]:(i=/rgba\(0, 0, 0, 0\)/.exec(t))?r.transparent:r[n.trim(t).toLowerCase()]}function u(t,r){var u;do{if(u=n.curCSS(t,r),u!=""&&u!="transparent"||n.nodeName(t,"body"))break;r="backgroundColor"}while(t=t.parentNode);return i(u)}n.effects={version:"1.7.2",save:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.data("ec.storage."+t[i],n[0].style[t[i]])},restore:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.css(t[i],n.data("ec.storage."+t[i]))},setMode:function(n,t){return t=="toggle"&&(t=n.is(":hidden")?"show":"hide"),t},getBaseline:function(n,t){var i,r;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=n[1]/t.width}return{x:r,y:i}},createWrapper:function(n){var u,t,i,r;return n.parent().is(".ui-effects-wrapper")?n.parent():(u={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},n.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"><\/div>'),t=n.parent(),n.css("position")=="static"?(t.css({position:"relative"}),n.css({position:"relative"})):(i=n.css("top"),isNaN(parseInt(i,10))&&(i="auto"),r=n.css("left"),isNaN(parseInt(r,10))&&(r="auto"),t.css({position:n.css("position"),top:i,left:r,zIndex:n.css("z-index")}).show(),n.css({position:"relative",top:0,left:0})),t.css(u),t)},removeWrapper:function(n){return n.parent().is(".ui-effects-wrapper")?n.parent().replaceWith(n):n},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){unit=t.cssUnit(i),unit[0]>0&&(u[i]=unit[0]*r+unit[1])}),u},animateClass:function(t,i,r,u){var f=typeof r=="function"?r:u?u:null,e=typeof r=="string"?r:null;return this.each(function(){var c={},u=n(this),s=u.attr("style")||"",h,o,r;typeof s=="object"&&(s=s.cssText),t.toggle&&(u.hasClass(t.toggle)?t.remove=t.toggle:t.add=t.toggle),h=n.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle),t.add&&u.addClass(t.add),t.remove&&u.removeClass(t.remove),o=n.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle),t.add&&u.removeClass(t.add),t.remove&&u.addClass(t.remove);for(r in o)typeof o[r]=="function"||!o[r]||r.indexOf("Moz")!=-1||r.indexOf("length")!=-1||o[r]==h[r]||!r.match(/color/i)&&(r.match(/color/i)||isNaN(parseInt(o[r],10)))||h.position=="static"&&(h.position!="static"||r.match(/left|top|bottom|right/))||(c[r]=o[r]);u.animate(c,i,e,function(){typeof n(this).attr("style")=="object"?(n(this).attr("style").cssText="",n(this).attr("style").cssText=s):n(this).attr("style",s),t.add&&n(this).addClass(t.add),t.remove&&n(this).removeClass(t.remove),f&&f.apply(this,arguments)})})}},n.fn.extend({_show:n.fn.show,_hide:n.fn.hide,__toggle:n.fn.toggle,_addClass:n.fn.addClass,_removeClass:n.fn.removeClass,_toggleClass:n.fn.toggleClass,effect:function(t,i,r,u){return n.effects[t]?n.effects[t].call(this,{method:t,options:i||{},duration:r,callback:u}):null},show:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._show.apply(this,arguments):this.effect.apply(this,t(arguments,"show"))},hide:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._hide.apply(this,arguments):this.effect.apply(this,t(arguments,"hide"))},toggle:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])||n.isFunction(arguments[0])||typeof arguments[0]=="boolean"?this.__toggle.apply(this,arguments):this.effect.apply(this,t(arguments,"toggle"))},addClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{add:t},i,r,u]):this._addClass(t)},removeClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{remove:t},i,r,u]):this._removeClass(t)},toggleClass:function(t,i,r,u){return typeof i!="boolean"&&i?n.effects.animateClass.apply(this,[{toggle:t},i,r,u]):this._toggleClass(t,i)},morph:function(t,i,r,u,f){return n.effects.animateClass.apply(this,[{add:i,remove:t},r,u,f])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r}}),n.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(t,r){n.fx.step[r]=function(n){n.state==0&&(n.start=u(n.elem,r),n.end=i(n.end)),n.elem.style[r]="rgb("+[Math.max(Math.min(parseInt(n.pos*(n.end[0]-n.start[0])+n.start[0],10),255),0),Math.max(Math.min(parseInt(n.pos*(n.end[1]-n.start[1])+n.start[1],10),255),0),Math.max(Math.min(parseInt(n.pos*(n.end[2]-n.start[2])+n.start[2],10),255),0)].join(",")+")"}});var r={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};n.easing.jswing=n.easing.swing,n.extend(n.easing,{def:"easeOutQuad",swing:function(t,i,r,u,f){return n.easing[n.easing.def](t,i,r,u,f)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i},easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return t==0?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return t==0?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin((t*u-o)*2*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u/2)==2?i+r:(f||(f=u*.3*1.5),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),t<1)?-.5*e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)*.5+r+i},easeInBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i},easeInOutBack:function(n,t,i,r,u,f){return(f==undefined&&(f=1.70158),(t/=u/2)<1)?r/2*t*t*(((f*=1.525)+1)*t-f)+i:r/2*((t-=2)*t*(((f*=1.525)+1)*t+f)+2)+i},easeInBounce:function(t,i,r,u,f){return u-n.easing.easeOutBounce(t,f-i,0,u,f)+r},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(t,i,r,u,f){return i<f/2?n.easing.easeInBounce(t,i*2,0,u,f)*.5+r:n.easing.easeOutBounce(t,i*2-f,0,u,f)*.5+u*.5+r}})}(jQuery),!function(n,t){"use strict";function nt(){i.READY||(c.determineEventTypes(),r.each(i.gestures,function(n){f.register(n)}),c.onTouch(i.DOCUMENT,o,f.detect),c.onTouch(i.DOCUMENT,u,f.detect),i.READY=!0)}function b(n,i){Date.now||(Date.now=function(){return+new Date}),n.event.bindDom=function(r,u,f){i(r).on(u,function(i){var r=i.originalEvent||i,u=["pageX","pageY","clientX","clientY","target","preventDefault","stopPropagation"];n.utils.each(u,function(n){null==r[n]&&(r[n]=i[n])}),r.which===t&&(r.which=r.button),f.call(this,r)})},n.utils.each(["on","off"],function(t){n.Instance.prototype[t]=function(n,r){return i(this.element)[t](n,r)}}),n.Instance.prototype.trigger=function(n,t){var r=i(this.element);return r.has(t.target).length&&(r=i(t.target)),r.trigger({type:n,gesture:t})},i.fn.hammer=function(t){return this.each(function(){var u=i(this),r=u.data("hammer");r?r&&t&&n.utils.extend(r.options,t):u.data("hammer",new n(this,t||{}))})}}var i=function(n,t){return new i.Instance(n,t||{})},r;i.VERSION="1.0.10dev",i.defaults={stop_browser_behavior:{userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},i.HAS_POINTEREVENTS=n.navigator.pointerEnabled||n.navigator.msPointerEnabled,i.HAS_TOUCHEVENTS="ontouchstart"in n,i.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android|silk/i,i.NO_MOUSEEVENTS=i.HAS_TOUCHEVENTS&&n.navigator.userAgent.match(i.MOBILE_REGEX),i.EVENT_TYPES={},i.UPDATE_VELOCITY_INTERVAL=16,i.DOCUMENT=n.document;var y=i.DIRECTION_DOWN="down",k=i.DIRECTION_LEFT="left",p=i.DIRECTION_UP="up",d=i.DIRECTION_RIGHT="right",h=i.POINTER_MOUSE="mouse",w=i.POINTER_TOUCH="touch",g=i.POINTER_PEN="pen",e=i.EVENT_START="start",o=i.EVENT_MOVE="move",u=i.EVENT_END="end";i.plugins=i.plugins||{},i.gestures=i.gestures||{},i.READY=!1,r=i.utils={extend:function(n,i,r){for(var u in i)n[u]!==t&&r||(n[u]=i[u]);return n},each:function(n,i,r){var u,f;if("forEach"in n)n.forEach(i,r);else if(n.length!==t){for(u=-1;f=n[++u];)if(i.call(r,f,u,n)===!1)return}else for(u in n)if(n.hasOwnProperty(u)&&i.call(r,n[u],u,n)===!1)return},inStr:function(n,t){return n.indexOf(t)>-1},hasParent:function(n,t){for(;n;){if(n==t)return!0;n=n.parentNode}return!1},getCenter:function(n){var u=[],f=[],e=[],o=[],t=Math.min,i=Math.max;return 1===n.length?{pageX:n[0].pageX,pageY:n[0].pageY,clientX:n[0].clientX,clientY:n[0].clientY}:(r.each(n,function(n){u.push(n.pageX),f.push(n.pageY),e.push(n.clientX),o.push(n.clientY)}),{pageX:(t.apply(Math,u)+i.apply(Math,u))/2,pageY:(t.apply(Math,f)+i.apply(Math,f))/2,clientX:(t.apply(Math,e)+i.apply(Math,e))/2,clientY:(t.apply(Math,o)+i.apply(Math,o))/2})},getVelocity:function(n,t,i){return{x:Math.abs(t/n)||0,y:Math.abs(i/n)||0}},getAngle:function(n,t){var i=t.clientX-n.clientX,r=t.clientY-n.clientY;return 180*Math.atan2(r,i)/Math.PI},getDirection:function(n,t){var i=Math.abs(n.clientX-t.clientX),r=Math.abs(n.clientY-t.clientY);return i>=r?n.clientX-t.clientX>0?k:d:n.clientY-t.clientY>0?p:y},getDistance:function(n,t){var i=t.clientX-n.clientX,r=t.clientY-n.clientY;return Math.sqrt(i*i+r*r)},getScale:function(n,t){return n.length>=2&&t.length>=2?this.getDistance(t[0],t[1])/this.getDistance(n[0],n[1]):1},getRotation:function(n,t){return n.length>=2&&t.length>=2?this.getAngle(t[1],t[0])-this.getAngle(n[1],n[0]):0},isVertical:function(n){return n==p||n==y},toggleDefaultBehavior:function(n,t,i){if(t&&n&&n.style){r.each(["webkit","moz","Moz","ms","o",""],function(u){r.each(t,function(t,r){u&&(r=u+r.substring(0,1).toUpperCase()+r.substring(1)),r in n.style&&(n.style[r]=!i&&t)})});var u=function(){return!1};"none"==t.userSelect&&(n.onselectstart=!i&&u),"none"==t.userDrag&&(n.ondragstart=!i&&u)}}},i.Instance=function(n,t){var u=this;return nt(),this.element=n,this.enabled=!0,this.options=r.extend(r.extend({},i.defaults),t||{}),this.options.stop_browser_behavior&&r.toggleDefaultBehavior(this.element,this.options.stop_browser_behavior,!1),this.eventStartHandler=c.onTouch(n,e,function(n){u.enabled&&f.startDetect(u,n)}),this.eventHandlers=[],this},i.Instance.prototype={on:function(n,t){var i=n.split(" ");return r.each(i,function(n){this.element.addEventListener(n,t,!1),this.eventHandlers.push({gesture:n,handler:t})},this),this},off:function(n,t){var i,u,f=n.split(" ");return r.each(f,function(n){for(this.element.removeEventListener(n,t,!1),i=-1;u=this.eventHandlers[++i];)u.gesture===n&&u.handler===t&&this.eventHandlers.splice(i,1)},this),this},trigger:function(n,t){var u,f;return t||(t={}),u=i.DOCUMENT.createEvent("Event"),u.initEvent(n,!0,!0),u.gesture=t,f=this.element,r.hasParent(t.target,f)&&(f=t.target),f.dispatchEvent(u),this},enable:function(n){return this.enabled=n,this},dispose:function(){var t,n;for(this.options.stop_browser_behavior&&r.toggleDefaultBehavior(this.element,this.options.stop_browser_behavior,!0),t=-1;n=this.eventHandlers[++t];)this.element.removeEventListener(n.gesture,n.handler,!1);return this.eventHandlers=[],c.unbindDom(this.element,i.EVENT_TYPES[e],this.eventStartHandler),null}};var l=null,a=!1,v=!1,c=i.event={bindDom:function(n,t,i){var u=t.split(" ");r.each(u,function(t){n.addEventListener(t,i,!1)})},unbindDom:function(n,t,i){var u=t.split(" ");r.each(u,function(t){n.removeEventListener(t,i,!1)})},onTouch:function(n,t,e){var h=this,c=function(c){var y=c.type.toLowerCase(),p;r.inStr(y,"mouse")&&v||(r.inStr(y,"touch")||r.inStr(y,"pointerdown")||r.inStr(y,"mouse")&&1===c.which?a=!0:r.inStr(y,"mouse")&&!c.which&&(a=!1),(r.inStr(y,"touch")||r.inStr(y,"pointer"))&&(v=!0),p=0,a&&(i.HAS_POINTEREVENTS&&t!=u?p=s.updatePointer(t,c):r.inStr(y,"touch")?p=c.touches.length:v||(p=r.inStr(y,"up")?0:1),p>0&&t==u?t=o:p||(t=u),(p||null===l)&&(l=c),e.call(f,h.collectEventData(n,t,h.getTouchList(l,t),c)),i.HAS_POINTEREVENTS&&t==u&&(p=s.updatePointer(t,c))),p||(l=null,a=!1,v=!1,s.reset()))};return this.bindDom(n,i.EVENT_TYPES[t],c),c},determineEventTypes:function(){var n;n=i.HAS_POINTEREVENTS?s.getEvents():i.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],i.EVENT_TYPES[e]=n[0],i.EVENT_TYPES[o]=n[1],i.EVENT_TYPES[u]=n[2]},getTouchList:function(n){return i.HAS_POINTEREVENTS?s.getTouchList():n.touches?n.touches:(n.identifier=1,[n])},collectEventData:function(n,t,i,u){var e=w;return(r.inStr(u.type,"mouse")||s.matchType(h,u))&&(e=h),{center:r.getCenter(i),timeStamp:Date.now(),target:u.target,touches:i,eventType:t,pointerType:e,srcEvent:u,preventDefault:function(){var n=this.srcEvent;n.preventManipulation&&n.preventManipulation(),n.preventDefault&&n.preventDefault()},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return f.stopDetect()}}}},s=i.PointerEvent={pointers:{},getTouchList:function(){var n=[];return r.each(this.pointers,function(t){n.push(t)}),n},updatePointer:function(n,t){return n==u?delete this.pointers[t.pointerId]:(t.identifier=t.pointerId,this.pointers[t.pointerId]=t),Object.keys(this.pointers).length},matchType:function(n,t){if(!t.pointerType)return!1;var r=t.pointerType,i={};return i[h]=r===h,i[w]=r===w,i[g]=r===g,i[n]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},f=i.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(n,t){this.current||(this.stopped=!1,this.current={inst:n,startEvent:r.extend({},t),lastEvent:!1,lastVelocityEvent:!1,velocity:!1,name:""},this.detect(t))},detect:function(n){if(this.current&&!this.stopped){n=this.extendEventData(n);var t=this.current.inst,i=t.options;return r.each(this.gestures,function(r){if(!this.stopped&&i[r.name]!==!1&&t.enabled!==!1&&r.handler.call(r,n,t)===!1)return this.stopDetect(),!1},this),this.current&&(this.current.lastEvent=n),n.eventType==u&&!n.touches.length-1&&this.stopDetect(),n}},stopDetect:function(){this.previous=r.extend({},this.current),this.current=null,this.stopped=!0},getVelocityData:function(n,t,u,f){var e=this.current,o=e.lastVelocityEvent,s=e.velocity;o&&n.timeStamp-o.timeStamp>i.UPDATE_VELOCITY_INTERVAL?(s=r.getVelocity(n.timeStamp-o.timeStamp,n.center.clientX-o.center.clientX,n.center.clientY-o.center.clientY),e.lastVelocityEvent=n):e.velocity||(s=r.getVelocity(t,u,f),e.lastVelocityEvent=n),e.velocity=s,n.velocityX=s.x,n.velocityY=s.y},getInterimData:function(n){var i,f,t=this.current.lastEvent;n.eventType==u?(i=t&&t.interimAngle,f=t&&t.interimDirection):(i=t&&r.getAngle(t.center,n.center),f=t&&r.getDirection(t.center,n.center)),n.interimAngle=i,n.interimDirection=f},extendEventData:function(n){var e=this.current,t=e.startEvent;(n.touches.length!=t.touches.length||n.touches===t.touches)&&(t.touches=[],r.each(n.touches,function(n){t.touches.push(r.extend({},n))}));var i=n.timeStamp-t.timeStamp,u=n.center.clientX-t.center.clientX,f=n.center.clientY-t.center.clientY;return this.getVelocityData(n,i,u,f),this.getInterimData(n),r.extend(n,{startEvent:t,deltaTime:i,deltaX:u,deltaY:f,distance:r.getDistance(t.center,n.center),angle:r.getAngle(t.center,n.center),direction:r.getDirection(t.center,n.center),scale:r.getScale(t.touches,n.touches),rotation:r.getRotation(t.touches,n.touches)}),n},register:function(n){var u=n.defaults||{};return u[n.name]===t&&(u[n.name]=!0),r.extend(i.defaults,u,!0),n.index=n.index||1e3,this.gestures.push(n),this.gestures.sort(function(n,t){return n.index<t.index?-1:n.index>t.index?1:0}),this.gestures}};i.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!1,drag_block_vertical:!1,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(n,t){var i=f.current,s,h,c,l;if(i.name!=this.name&&this.triggered)return t.trigger(this.name+"end",n),void(this.triggered=!1);if(!(t.options.drag_max_touches>0&&n.touches.length>t.options.drag_max_touches))switch(n.eventType){case e:this.triggered=!1;break;case o:if(n.distance<t.options.drag_min_distance&&i.name!=this.name)return;s=i.startEvent.center,i.name!=this.name&&(i.name=this.name,t.options.correct_for_drag_min_distance&&n.distance>0)&&(h=Math.abs(t.options.drag_min_distance/n.distance),s.pageX+=n.deltaX*h,s.pageY+=n.deltaY*h,s.clientX+=n.deltaX*h,s.clientY+=n.deltaY*h,n=f.extendEventData(n)),(i.lastEvent.drag_locked_to_axis||t.options.drag_lock_to_axis&&t.options.drag_lock_min_distance<=n.distance)&&(n.drag_locked_to_axis=!0),c=i.lastEvent.direction,n.drag_locked_to_axis&&c!==n.direction&&(n.direction=r.isVertical(c)?n.deltaY<0?p:y:n.deltaX<0?k:d),this.triggered||(t.trigger(this.name+"start",n),this.triggered=!0),t.trigger(this.name,n),t.trigger(this.name+n.direction,n),l=r.isVertical(n.direction),(t.options.drag_block_vertical&&l||t.options.drag_block_horizontal&&!l)&&n.preventDefault();break;case u:this.triggered&&t.trigger(this.name+"end",n),this.triggered=!1}}},i.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:2},timer:null,handler:function(n,t){switch(n.eventType){case e:clearTimeout(this.timer),f.current.name=this.name,this.timer=setTimeout(function(){"hold"==f.current.name&&t.trigger("hold",n)},t.options.hold_timeout);break;case o:n.distance>t.options.hold_threshold&&clearTimeout(this.timer);break;case u:clearTimeout(this.timer)}}},i.gestures.Release={name:"release",index:1/0,handler:function(n,t){n.eventType==u&&t.trigger(this.name,n)}},i.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_min_touches:1,swipe_max_touches:1,swipe_velocity:.7},handler:function(n,t){if(n.eventType==u){if(n.touches.length<t.options.swipe_min_touches||n.touches.length>t.options.swipe_max_touches)return;(n.velocityX>t.options.swipe_velocity||n.velocityY>t.options.swipe_velocity)&&(t.trigger(this.name,n),t.trigger(this.name+n.direction,n))}}},i.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},has_moved:!1,handler:function(n,t){var i,r,s;n.eventType==e?this.has_moved=!1:n.eventType!=o||this.moved?n.eventType==u&&"touchcancel"!=n.srcEvent.type&&n.deltaTime<t.options.tap_max_touchtime&&!this.has_moved&&(i=f.previous,r=i&&i.lastEvent&&n.timeStamp-i.lastEvent.timeStamp,s=!1,i&&"tap"==i.name&&r&&r<t.options.doubletap_interval&&n.distance<t.options.doubletap_distance&&(t.trigger("doubletap",n),s=!0),(!s||t.options.tap_always)&&(f.current.name="tap",t.trigger(f.current.name,n))):this.has_moved=n.distance>t.options.tap_max_distance}},i.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(n,t){return t.options.prevent_mouseevents&&n.pointerType==h?void n.stopDetect():(t.options.prevent_default&&n.preventDefault(),void(n.eventType==e&&t.trigger(this.name,n)))}},i.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1,transform_within_instance:!1},triggered:!1,handler:function(n,t){var i,s,h;if(f.current.name!=this.name&&this.triggered)return t.trigger(this.name+"end",n),void(this.triggered=!1);if(!(n.touches.length<2)){if(t.options.transform_always_block&&n.preventDefault(),t.options.transform_within_instance)for(i=-1;n.touches[++i];)if(!r.hasParent(n.touches[i].target,t.element))return;switch(n.eventType){case e:this.triggered=!1;break;case o:if(s=Math.abs(1-n.scale),h=Math.abs(n.rotation),s<t.options.transform_min_scale&&h<t.options.transform_min_rotation)return;f.current.name=this.name,this.triggered||(t.trigger(this.name+"start",n),this.triggered=!0),t.trigger(this.name,n),h>t.options.transform_min_rotation&&t.trigger("rotate",n),s>t.options.transform_min_scale&&(t.trigger("pinch",n),t.trigger("pinch"+(n.scale<1?"in":"out"),n));break;case u:this.triggered&&t.trigger(this.name+"end",n),this.triggered=!1}}}},n.Hammer=i,"object"==typeof module&&module.exports&&(module.exports=i),"function"==typeof define&&define.amd?define(["jquery"],function(t){return b(n.Hammer,t)}):b(n.Hammer,n.jQuery||n.Zepto)}(window);var RulesEngine=function(){function e(n,t,i){typeof i=="undefined"&&(i=new Date);var r=o(n,t,i);return r=s(r,t,i)}function o(n,t,r){for(var e=[],f,u=0;u<n.length;u++)f=n[u],i(f.DisplayRules,t,r)&&e.push(f);return e}function s(n,i,r){for(var o=[],c=n.length,f=[],s=[],e,u=0;u<c;u++)e=n[u],e.PreferredPosition=h(e.PositionRuleGroups,i,r),e.PreferredPosition==-1?s.push(e):f.push(e);for(s.sort(t),f.sort(t),u=0;u<c;u++)f.length>0&&f[0].PreferredPosition<=u+1?o.push(f.shift()):s.length>0?o.push(s.shift()):o.push(f.shift());return o}function h(n,t,r){for(var f,u=0;u<n.length;u++)if(f=n[u],i(f.PositionRules,t,r))return f.PreferredPosition;return-1}function t(n,t){return n.PreferredPosition==t.PreferredPosition?n.NaturalPosition-t.NaturalPosition:n.PreferredPosition==-1?1:t.PreferredPosition==-1?-1:n.PreferredPosition-t.PreferredPosition}function i(n,t,i){for(var u,f,r=0;r<n.length;r++)if(u=n[r],f=c(u,t,i),f&&u.InvertRule||!f&&!u.InvertRule)return!1;return!0}function c(n,t,i){return l(n.StartTime,n.EndTime,n.InvertTimeRange,i)&&a(n.DayRules,i)&&v(n.LunchStatusId,t)&&p(n.HasDineRewards,t)&&w(n.Rule.StoreIds,t)}function l(n,t,i,u){if(n=="12:00 AM"&&t=="11:59 PM"&&!i)return!0;var o=new Date(Date.parse("1/1/2011 "+n)),f=r(o,u),s=new Date(Date.parse("1/1/2011 "+t)),e=r(s,u);if(i){if(!f&&e)return!1}else if(f||!e)return!1;return!0}function r(n,t){return n.getHours()<t.getHours()||n.getHours()==t.getHours()&&n.getMinutes()<t.getMinutes()?!1:!0}function a(n,t){var i,r,u;if(!n||n.length===0)return!0;for(i=t.getDay(),r=0;r<n.length;r++){u=n[r].DayId;switch(u){case 1:if(i==0)return!0;break;case 2:if(i==1)return!0;break;case 3:if(i==2)return!0;break;case 4:if(i==3)return!0;break;case 5:if(i==4)return!0;break;case 6:if(i==5)return!0;break;case 7:if(i==6)return!0}}return!1}function v(t,i){if(t==n)return!0;var r=y(i);return r==t}function y(t){return!t||t.HasWeekendLunch?u:t.HasLunch?f:n}function p(n,t){return n?t&&t.HasDineRewards:!0}function w(n,t){return n.length==0?!0:t?n.contains(t.Id):!1}var n=1,u=2,f=3;return{runRules:e}}()