!function(t){var e,i=this,r=i.Kveik=i.kk=function(){var t,e=0,i=[];for("object"!=typeof arguments[e]&&void 0!==arguments[e]||(t=arguments[e++]);e0))return!1!==a.waitForImages&&"function"==typeof n?n(u,d,h):void 0},y=[];for(var k in u){y.push({e:u[k],s:u[k].currentState});var K=t('
');u[k].currentState=new r.Element.State(u[k],K),u[k].currentState.param(e[k],!0)}for(c=0;c0?(g++,_.bind("imagesLoaded",function(t){return function(){m(t,this)}}(x),!0)):r.trigger("loadedImages",x,e[k],_),r.trigger("loadedElement",x,e[k],a),S[x.cleanId]=_}}else a._failedLoad=!0,r.trigger("loadedElement",x,e[k],a)}for(c=0;c0&&(s+=o.join("/")+"/"),n=t.extend(!0,{},n);var h=t.extend({},n);for(var d in n){var l=kk(d);l.property("noHash")||!1===l.property("pushState")?n[d]=e:(h[d][r.argumentKey]=e,n[d][r.argumentKey]=e)}var c=r.Lib.objectToQuery(n);""!==c&&(c="?"+c);var u=r.Lib.objectToQuery(h);""!==u&&(u="?"+u);var p=a.virtualPath=(r.property("rootPath")||"/")+s+c;a.realPath=(r.property("rootPath")||"/")+s+u;if(!a.noSetState&&!1!==a.pushState&&r.Lib.atRoot())if(i.history.pushState){i.location.pathname,i.location.search;i.history.pushState(n,"",p)}else{var f="#"+r.defaults.hashPrefix+s+c,v=i.location.hash.toString();f!=r.lastHash&&f!=v&&i.location.assign(f)}return r.lastHash=i.location.hash.toString(),this.trigger("postPushState",this,a),this},state:function(){for(var t=this.initiated?this:r.root,e=0;e1||!this.initiated){var u;if(a.elements||a.element){u={};var p="string"==typeof(g=a.elements||a.element)?g.split(","):g;for(var f in p)u[p[f]]=!0}var v=a.excludeElements||{};if("string"==typeof v){p=v.split(",");v=a.excludeElements={};for(f=0;f1){for(var e=0;e.'+r.stateClass+" { display: none; }"),jQuery.extend(jQuery.browser,{mobileSafari:navigator.userAgent.toLowerCase().match(/iP(hone|ad|od)/i),mobile:!1}),t(document).ready(function(){r.bind("queryElement",function(t,e,i){t&&t.bind&&t.trigger("queryElement",t,e,i)}),r.bind("adopted",function(){r.orphanElements={}}),r.trigger("load").trigger("loaded").trigger("prepare").trigger("prepared").trigger("adopt").trigger("adopted").trigger("updateStates").trigger("updatedStates"),r.trigger("activate",r.root.subParam()),setTimeout(function(){r.trigger("postShowStates")},0);if("onhashchange"in i||"onhashchange"in document)i.onhashchange=function(){var t=i.location.hash.toString();r.lastHash!==t&&r.goTo(i.location.href.toString(),{noSetState:!0}),r.lastHash=t},""!=i.location.hash&&i.onhashchange();else{var t=function(){var t=i.location.hash.toString();t!==r.lastHash&&(void 0!==r.lastHash||""!==t?(r.lastHash=t,r.goTo(i.location.href.toString(),{noSetState:!0})):r.lastHash=t)};t(),setInterval(t,100)}i.history.pushState&&(i.onpopstate=function(){r.goTo(i.location.href.toString(),{noSetState:!0})}),r.loaded=!0}),t(i).load(function(){r.trigger("loadedImages",r.root.get())})}(jQuery),Kveik.debug=function(t,e){Kveik.debug.lineCount=Kveik.debug.lineCount||{},void 0===e&&(e="");var i=$("#_isDebug");i.length<=0&&($("body").append('
'),i=$("#_isDebug").css({position:"fixed",bottom:0,right:0,zIndex:99999,background:"white",color:"#2a2a2a"}));var r;e||(e=t,t="_default"),r="#_isDebug_"+t;var a=$(r);a.length<=0&&(i.append('
'+t+":
"),a=$(r).css("fontSize",11));a.find(".entry").length>50&&a.find(".entry:first").remove(":first"),Kveik.debug.lineCount[t]=Kveik.debug.lineCount[t]||1,a.append(''+Kveik.debug.lineCount[t]+++" "+e+"
")},function(t){Kveik.Lib={mergeQueries:function(){var t,e,i=arguments.length,r=0,a=!1;for("boolean"==typeof arguments[r]&&(a=arguments[r++]),t=Kveik.Lib.queryToObject(arguments[r]),r=1;rh;){var f=l[h]||n||"",v=d[h++];if("object"==typeof v)if(c){t=[];for(e in v)t.push(e);for(t.sort(),r=t.length,i=0;i

'),e.iframe=!0;var a=e.success;e.data=void 0,e.success=function(e,i,r){var n=/^.*().*$/m.exec(e)||[];return e=t(n[1]).val(),"json"===kk.dataType&&(e=t.parseJSON(e)),a(e,i,r)},r.ajaxSubmit(e)}}}(jQuery),Kveik.Element=function(){if(!(this instanceof arguments.callee))return new Kveik.Element(arguments);this.init.apply(this,arguments)},Kveik.Element.prototype={init:function(t){this.elementId=t.toString(),this.states=[],this.currentState=new Kveik.Element.State(this),this.catches=[],this.elementId===Kveik.rootId&&(this.$element=$(document)),"#"===this.elementId.charAt(0)?(this.domId=this.elementId,this.cleanId=this.elementId.substr(1)):(this.domId="#"+Kveik.elementClass+"_"+this.elementId,this.cleanId=this.elementId),this.domId="#"==this.elementId.charAt(0)?this.elementId:"#"+Kveik.elementClass+"_"+this.elementId,Kveik.orphanElements[t]=this;var e=t==Kveik.rootId?this:Kveik,i=this;return e.bind("load",function(t){i.prepare(t)},!0),e.bind("adopt",function(t){i.adopt()},!0),this.cleanId!==Kveik.rootId&&e.bind("updateStates",function(t){i.updateState(t)},!0),this},prepare:function(t){if(this.prepared)return this;if(this.trigger("prePrepare",this),(!this.$element||this.$element.length<=0)&&(this.$element=$(this.domId,t)),this.$element.length<=0)return this;this.$element.find("script").remove(),this.$element.data("object",this),this.$element.hasClass(Kveik.elementClass)||this.$element.addClass(Kveik.elementClass);var e=this;return this.elementId!==Kveik.rootId&&Kveik.root.bind("updatedStates",function(){if(window.location.hash){var t=Kveik.Lib.urlToObject(window.location.hash),i=e.currentState.serialize(),r=Kveik.Lib.serialize(t[e.cleanId]);if(!Kveik.loaded&&r!==i)return}e.showState()},!0),Kveik.bind("postShowStates",function(){e.trigger("done",e),Kveik.trigger("done",e),e.trigger("statesShown",e,e.currentState)},!0),this.prepared=1,this.trigger("postPrepare",this),Kveik.trigger("preparedElement",this),this},update:function(){this.trigger("preUpdate",this),this.prepared||this.prepare();for(var t=0;t=0&&this.defaultArg(r,a,n),r>=0&&this.catches.push(r),this.parentState&&this.parentState.elementObject&&this.parentState.elementObject.cleanId!==this.cleanId&&(this.parentState.catchers[this.cleanId]=this),this.parentElement&&this.parentElement.elementId!==this.elementId&&this.parentElement.catchArg(-1),this},setArg:function(t,e,i){if(!this.adopted){var r=this;return this.bind("postAdopt",function(){r.setArg(t,e,i)},!0),this}if(this._insertion){r=this;return Kveik.bind("prePushState",function(){r.setArg(t,e,i)},!0),this}if("object"!=typeof e&&(i=e,e=this.currentState),void 0===i)return this;var a=e.param();a[Kveik.argumentKey]=a[Kveik.argumentKey]||{},a[Kveik.argumentKey][t]=i||Kveik.nullStr;for(var n=Kveik.Lib.serialize(a),o=0;o=s){if("function"==typeof i.endForward)return i.endForward();for(;o>=s;)o=(o-s)%s}return n[e]=o,n},skip:function(t,e,i,r,a){if(this.states.length<=0){var n=this;return this.bind("postAdopt",function(){n.skip.apply(n,arguments)}),this}i=i||{};var o=this.skipParam.apply(this,arguments);return r?this.load(o,i,i.callback):this.goTo(o,i,i.callback),this},estimateLimit:function(){var t;return t=this.states.length>1?this.states[0].precedes(this.states[1])>0?this.states[0]:this.states[1]:this.states[0],this.property("limit")||t.$state.children("div").length||1},goTo:function(t,e,i){this.trigger("preGoto",this),(e=e||{}).relativeLoad=!0,"string"==typeof t&&(t=(t=Kveik.Lib.queryToObject(t)||{})[this.cleanId]);var r=Kveik.Lib.serialize(t),a=this,n=Kveik.root.subParam();n[this.cleanId]=t;var o=Kveik.load(n,e,function(){Kveik.trigger("preShowStates",this),a.showState(r,e,function(t){"function"==typeof i&&i.apply(a,[t]),t&&t.trigger&&t.trigger("statesShown",t,t.currentState),a.trigger("prePushState"),Kveik.pushState(e),a.trigger("postPushState"),Kveik.trigger("postShowStates",this)}),Kveik.trigger("activate",n)});for(var s in o)Kveik.trigger("queryElement",o[s],t,e);return this.trigger("postGoto",this),"function"==typeof e.postGoto&&e.postGoto(),Kveik.trigger("postGoto"),this},load:function(t,e,i){this.trigger("preLoad",this),(e=e||{}).relativeLoad=!0,"string"==typeof t&&(t=(t=Kveik.Lib.queryToObject(t)||{})[this.cleanId]);var r={};return r[this.cleanId]=t,Kveik.load(r,e,i),this.trigger("postLoad",this),this},showState:function(t,e,i){if(this.$element.length<=0)return"function"==typeof i&&i.apply(this,[this]),this;if(void 0===t&&(t=this.currentState),e=e||{},this.switching)return"function"==typeof i&&this.bind("stateShown",i),this;var r=this;if("string"==typeof t&&(t=this.findSerial(t)),!(!1!==e.waitForImages&&t.unloadedImages>0)||e.noPreloadContent){this.trigger("preShowState",this,t,e),Kveik.trigger("preShowState",this,t,e),this.switching=1;var a=e.switcher||this.property("switcher")||Kveik.defaults.switcher||"fade";return Kveik.Switcher.engines[a].show(t,e,function(e){e||(r.currentState=t),r.switching=0;var a=t.serialize({_reset:"true"});r.remove(a),"function"==typeof i&&i.apply(r,[r]),r.trigger("stateShown",r,t)}),r.currentState=t,setTimeout(function(){r.trigger("postShowState",r,t),Kveik.trigger("postShowState",r,t)},0),this}t.bind("imagesLoaded",function(){r.showState(t,e,i)})},adopt:function(){return this.adopted||this.$element.length<=0?this:(this.trigger("preAdopt",this),this.$parentState=this.$element.closest("."+Kveik.stateClass),this.$parentState.length>0?this.parentState=this.$parentState.data("object"):Kveik.root.get()&&(this.parentState=Kveik.root.get().currentState),this.parentState&&(this.parentState.element(this),this.parentElement=this.parentState.elementObject),delete Kveik.orphanElements[this.elementId],this.adopted=1,this.trigger("postAdopt",this),Kveik.trigger("postAdopt",this),this)},defaultArg:function(t,e,i){t=t||0;var r=this.defaultParam(Kveik.argumentKey)||{};return(void 0===r[t]||i)&&(r[t]=e),this.defaultParam(Kveik.argumentKey,r)},defaultParam:function(t,e){if(void 0===t)return this.property("defaultParam");var i=this.property("defaultParam")||{};return void 0!==t&&void 0===e?i[t]:(void 0!==t&&void 0!==e&&(i[t]=e),this.property("defaultParam",i),this)},property:function(t,e){if(this.properties=this.properties||{},void 0===t)return Kveik.Lib.mergeObjects({},this.properties);if("object"==typeof t){if(!0===e)for(var i in t)this.property(i,t[i]);else this.properties=$.extend(!0,this.properties,t);return this}return void 0===e?this.properties[t]:(this.properties[t]=e,this)},bind:function(t,e,i){if(e)return e._single=i||!1,this.events=this.events||{},this.events[t]=this.events[t]||[],this.events[t].push(e),this},unbind:function(t){},one:function(t,e){return this.bind(t,e,!0)},trigger:function(t,e){if(this.events=this.events||{},!this.events[t])return this;for(var i=[],r=1;r0&&this.$element[0].tagName){var e=$('
');this.$element.wrapInner(e),this.$state=this.$element.children(":first")}else this.$state=$(document);return this.$state.data("object",this),this.prepared=1,this.trigger("postPrepare"),Kveik.trigger("preparedState",this),this},element:function(t){this.trigger("preElement",this);var e;"object"==typeof t?t=(e=t).elementId:e=this.findElement(t),e||(e=Kveik.orphanElements[t]||new Kveik.Element(t));var i=this.elementObject.elementId;return this.prepared&&i!==e.elementId&&this.children.push(e),this.trigger("postElement",this),e},countUnloadedImages:function(){if(void 0!==this.unloadedImages)return this.unloadedImages;var t=this.$state.find("img"),e=this;return this.unloadedImages=0,t.each(function(){if(!this.complete&&4!==this.readyState&&"complete"!==this.readyState){var t=$(this);e.unloadedImages++;t.one("load error",function(){--e.unloadedImages<=0&&e.trigger("imagesLoaded",e.elementObject)})}}),0===this.unloadedImages&&this.trigger("imagesLoaded"),this.unloadedImages},serialize:function(t){if(!t&&"string"==typeof this._serialized)return this._serialized;var e=this.param();t&&(e=Kveik.Lib.mergeObjects(t,e));var i=Kveik.Lib.serialize(e);return t||(this._serialized=i),i},deSerialize:function(t){return this.param(Kveik.Lib.queryToObject(t)),this},resetParam:function(t){this.properties=t||{},this._serialized=!1},remove:function(t){for(var e=0;e0?"back":"forward"),"back"!==e.direction?"y"===e.axis||"y"===n.property("slideAxis")?d=s.height():l=s.width():"y"===e.axis||"y"===n.property("slideAxis")?d=-s.height():l=-s.width();var c=e.duration||n.property("switchDuration")||Kveik.defaults.duration||200,u=jQuery.easing?e.easing||Kveik.defaults.easing||void 0:"";h.css({position:"relative",overflow:"hidden",width:h.width()});var p={position:"absolute",width:h.width()},f={},v={position:"relative",top:0,left:0,width:h.width()},g={};"uncover"!==e.style?(l>0?(p.right="auto",p.left=l,f.left=0):(p.left="auto",p.right=-l,f.right=0),d>0?(p.bottom="auto",p.top=d,f.top=0):(p.top="auto",p.bottom=-d,f.bottom=0)):(p.top=0,p.left=0,v.zIndex=(e.zIndex||Kveik.defaults.zIndex||10)+1),"cover"!==e.style?(g.left=-l,g.top=-d):(p.zIndex=(e.zIndex||Kveik.defaults.zIndex||10)+1,g.top=0),o.css(p).show(),s.css(v);Math.max(d,h.height()),Math.max(l,h.width());o&&s&&o.height()!==s.height()&&h.animate({height:o.height()},c,u);var m={width:"",height:"",top:"",left:"",right:"",bottom:"",position:"",overflow:"",opacity:"",zIndex:""};o.stop().animate(f,c,u),s.stop().animate(g,c,u,function(){s.css(m).hide(),o.stop().css(m).show(),h.css(m),"function"==typeof i&&i()})}}},Kveik.Switcher.engines.shuffle={show:function(t,e,i){if(t){var r=t,a=t.elementObject.currentState,n=t.elementObject,o=r.$state,s=a.$state,h=t.$element,d=0,l=0;if(o.length<=0||a.serialize()===r.serialize())return o.show(),void("function"==typeof i&&i(!0));(e=e||{}).direction=e.direction||(r.precedes(a)>0?"back":"forward"),"back"!==e.direction?"y"===e.axis||"y"===n.property("slideAxis")?d=s.height():l=s.width():"y"===e.axis||"y"===n.property("slideAxis")?d=-s.height():l=-s.width();var c=e.duration||n.property("switchDuration")||Kveik.defaults.duration||200,u=jQuery.easing?e.easing||Kveik.defaults.easing||void 0:"";h.css({position:"relative",overflow:"hidden",width:h.width()}),o.css({position:"absolute",width:h.width()}).show(),s.css({position:"relative",left:0,top:0,width:h.width()}),o&&s&&o.height()!==s.height()&&h.animate({height:o.height()},c,u);var p,f,v,g,m={width:"",height:"",top:"",left:"",position:"",overflow:"",opacity:""},y=o[0].style.zIndex,k=o[0].style.zIndex,K=Math.max(y||1,k||1),b=Math.min(y||0,k||0);e.fade=e.fade||.5,e.slideOut?(p={left:0,top:0,opacity:e.fade,zIndex:b},e.fade>0&&(v={opacity:1}),f={zIndex:K},g={left:-l,top:-d}):(p={zIndex:K,left:l,top:d},v={left:0,top:0},f={zIndex:b},e.fade>0&&(g={opacity:e.fade})),o.stop().css(p).animate(v,c,u),s.stop().css(f).animate(g,c,u,function(){s.css(m).hide(),o.stop().css(m).show(),h.css(m),s.css("zIndex",k),o.css("zIndex",y),"function"==typeof i&&i()})}}},Kveik.bgSizeSupport=void 0!==document.createElement("div").style.backgroundSize,Kveik.Ui={listenCursor:function(){if(!Kveik._mouseMove){Kveik._mouseMove={};var t=$("body"),e=function(i){i.pageX&&i.pageY&&(Kveik._mouseMove.pageX=i.pageX,Kveik._mouseMove.pageY=i.pageY),setTimeout(function(){t.one("mousemove",e)},20)};t.one("mousemove",e)}return this},followCursor:function(t,e,i,r,a){var n,o=$(t);if(n=e?o.closest(e):$(document),!o.data("_following")){o.data("_following",!0);var s,h,d,l,c,u,p,f=i,v=r,g=function(t){if((t=t||Kveik._mouseMove||{}).pageX&&t.pageY&&(c=n.offset()||{top:0,left:0},d=n.width(),l=n.height(),!(t.pageXc.left+d||t.pageY>c.top+l)))return s=o.width(),h=o.height(),"NE"===a?i=-s+f:"SE"===a?(i=-s+f,r=-h+v):"SW"===a&&(r=-h+v),p=t.pageX-c.left+(i||15),u=t.pageY-c.top+(r||15),p+s>c.left+d&&(p=c.left+d-s),u+h>c.top+l&&(u=c.top+l-h),[u,p]},m=g()||[];m[0]=m[0]||0,m[1]=m[1]||0,o.css({position:"absolute",top:m[0]+"px",left:m[1]+"px"}),n.bind("mousemove",function(t){var e=g(t);"object"==typeof e&&void 0!==e[0]&&o.css({position:"absolute",top:e[0]+"px",left:e[1]+"px"})})}},fullView:function(){var t,e,i,r=0;if(!("string"==typeof arguments[r]||arguments[r]instanceof jQuery))return this;t=arguments[r++],e="string"==typeof arguments[r]||arguments[r]instanceof jQuery?arguments[r++]:"document",i="object"==typeof arguments[r]?arguments[r++]:{};var a=function(t){for(var r=function(r,a){var n=r[0],o=r.closest(e);o.length<=0&&(o=$(e));var s=r.data("_eData");void 0!==s?o.fakeDisplay():r.fakeDisplay();var h,d,l,c,u=o.width(),p=o.height(),f=u/p;void 0===s?(r.css({width:"auto",height:"auto"}),s={width:h=r.width(),height:d=r.height(),ratio:l=h/d,pos:c="absolute"===r.css("position")?"absolute":"relative"},r.data("_eData",s),r.fakeDisplay(!0)):(h=s.width,d=s.height,l=s.ratio,c=s.pos,o.fakeDisplay(!0));var v={x:0,y:0};if(i.noUpScale){var g=u,m=p;u=Math.min(u,h),p=Math.min(p,d),g!==u&&(v.x=(g-u)/2),m!==p&&(v.y=(m-p)/2)}var y=i.wrap,k=i.mode;if("auto"===k){var K=i.autoThreshold||.5;k=Math.abs(l-f)>K?"contain":"cover"}if(i.backgroundImage&&Kveik.bgSizeSupport&&"img"===n.tagName.toLowerCase()){var b=$("
");(w={display:"block",overflow:"hidden",backgroundImage:"url("+n.src+")"}).backgroundSize="contain"===k?"contain":"cover",r.replaceWith(b),b.data("_eData",s),b.css(w),b.attr("class",r.attr("class")),b.attr("id",r.attr("id")),n=b[0],r=b,t[a]=n,y=!1}if(n.tagName.toLowerCase().match(/(div)|(iframe)/)){var w;(w={width:u,height:p,top:v.y,left:v.x,backgroundPosition:"center center",position:c}).backgroundSize="contain"===k?"contain":"cover",r.css(w)}else if("contain"===k||i.noCrop)if(l>f){var S=p/2-u/l/2;r.css({width:u,height:"auto",left:0+v.x,top:S+v.y,position:c})}else{var x=u/2-p*l/2;r.css({width:"auto",height:p,left:x+v.x,top:0+v.y,position:c})}else if(l>f){x=-Math.floor((p*l-u)/2);r.css({width:"auto",height:p,left:x+v.x,top:0+v.y,position:c})}else{S=-Math.floor((u/l-p)/2);r.css({width:u,height:"auto",left:0+v.x,top:S+v.y,position:c})}if(y){var _,I=r.parent();I.is("._kkImgWrap")?(_=r.parent(),I.css({width:u,height:p})):((_=$('
')).css({position:r.css("position"),left:0,top:0,width:u,height:p,overflow:"hidden"}),r.wrap(_))}r.data("_fadeIn")&&("number"==typeof i.fadeFirst?r.stop().fadeTo(i.fadeFirst,1):r.stop().fadeTo(300,1),r.data("_fadeIn",!1))},a=0;a0||(e.removeData("_eData"),r(a,t))},0))}),(this.complete||4===this.readyState||"complete"===this.readyState)&&e.load()}),n<=0&&r(a,t)}(a,0,o)}};return Kveik.bind("load",function(i,r,n){n&&n.$tate?n.$state:$(e);var o=$(e).find(t).not("._fullView").addClass("_fullView");if(!(o.length<=0)){var s;$(window).bind("resize orientationchange",function(){var t=$(window).width(),e=$(window).height();s&&s.width===t&&s.height===e||(s={width:t,height:e},a(o))}),a(o)}}),this},dynamicImage:function(t,e,i,r,a){i=i||window,r=r||{};var n=window.devicePixelRatio||1,o=$(i).width()*n,s=$(i).height()*n,h=$(t),d=o+"x"+s;return h.each(function(){var t=$(this);if(t.data("currRes")===d)return this;t.data("currRes",d);var i,a=0,n=0,h=!1;for(var l in e){var c=l.split("x"),u=(e[l],c[0]),p=c[1];thisSrc=e[l],r.mode&&"cover"!==r.mode?((!i||u>=o||p>=s&&(u*pa*n)&&(a=u,n=p,i=thisSrc),h=h||u>=o||p>=s):((!i||u>=o&&p>=s&&(u*pa*n)&&(a=u,n=p,i=thisSrc),h=h||u>=o&&p>=s)}"div"===this.tagName.toLowerCase()?t.css("backgroundImage","url("+i+")"):t.attr("src")!=i&&t.removeData("_eData").attr("src",i)}),a||($(window).bind("resize onorientationchange",function(){Kveik.Ui.dynamicImage(t,e,i,r,!0)}),Kveik.bind("loaded",function(){Kveik.Ui.dynamicImage(t,e,i,r,!0)})),this},hasScrollBar:function(t){var e="BackCompat"===document.compatMode?document.body:document.documentElement;return t?e.scrollWidth>e.clientWidth:e.scrollHeight>e.clientHeight},scrollBarWidth:function(){var t=$("
").css({position:"absolute",top:"-9999px",overflow:"hidden",width:"50px"}),e=$("
").css({width:"100px"});t.append(e),$("body").append(t);return t.innerWidth()-t.css("overflow","scroll").innerWidth()},currentScrollBarWidth:function(){return Kveik.Ui.hasVerticalScroll()?Kveik.Ui.scrollBarWidth():0},currentScrollBarHeight:function(){return Kveik.Ui.hasHorizontalScroll()?Kveik.Ui.scrollBarHeight():0}},function(){var t,e,i;t="touchstart",i="touchend",e="touchmove",Kveik.touchSupport="ontouchstart"in document.documentElement,function(){var i,r,a=$(document);a.ready(function(){a.bind("mousemove",function(){if(1===i)return!0;0!==r&&(i=1,$("body").addClass("_notouch").removeClass("_touch"),kk.clickEvent="click"),r=1}).bind(e,function(){return r=0,!0}).bind(t,function(){if(r=0,0===i)return!0;i=0,$("body").addClass("_touch").removeClass("_notouch"),kk.clickEvent="tap"}),a.trigger(t)})}(),Kveik.Element.prototype.swipeable=function(r){var a=this;if(!Kveik.touchSupport)return this;if(!this.adopted)return this.bind("postAdopt",function(){a.swipeable.apply(a,arguments)}),this;if(this._swipeable)return this;this._swipeable=!0;r=$.extend({axis:"x",duration:200,threshold:40,pps:80},r);var n,o,s,h=this.$element,d={width:"",height:"",top:"",left:"",position:"",overflow:"",opacity:"","-webkit-transition":""};return this.$element.bind(t+" "+e,function(t){if(a._swipeanim)return!1;var e=t.originalEvent;if((a._swiping||function(t){if(a.property("entries")<=1)return!1;var e=t.originalEvent;return!(e.targetTouches.length>1||(a._swipe={},a._swipe.startTime=new Date,a._swipe.startPos=a._swipe.prevPos={x:e.targetTouches[0].clientX,y:e.targetTouches[0].clientY},a._swipe.startIndex=a._swipe.currentIndex=0,a._swipe.loaded={0:a.currentState},h.css({width:"",height:""}),o=h.width(),s=h.height(),n={x:o,y:s},h.css({position:"relative",overflow:"hidden",width:o}),a.currentState.$state.css({position:"relative",left:0,top:0,width:o}),a._swipe.$visibles=$(a.currentState.$state),a.currentState.$state.data("_pos",{x:0,y:0}),a._swiping=!0,1))}(t))&&!(e.targetTouches.length>1)){var i={x:e.targetTouches[0].clientX-a._swipe.startPos.x,y:e.targetTouches[0].clientY-a._swipe.startPos.y};if(!("x"===r.axis&&Math.abs(i.x)Math.abs(i.y))){var d=i[r.axis]>0?-1:1,l=d<0?Math.floor(i[r.axis]/o):Math.ceil(i[r.axis]/o);l+=a._swipe.startIndex,l=a._swipe.currentIndex=l+1*d;var c={x:0,y:0};if("y"===r.axis?c.y=(l-a._swipe.startIndex)*s*d:c.x=(l-a._swipe.startIndex)*o*d,"x"===r.axis?i.y=0:i.x=0,!a._swipe.loaded[""+l]){var u={x:"x"===r.axis?l*o:0,y:"y"===r.axis?l*s:0};a._swipe.loaded[""+l]=u;var p=a.skipParam(d),f=a._swipe.newSerial=Kveik.Lib.serialize(p),v=a._swipe.newState=a.findSerial(f),g=function(t,e){var r=t.$state;e&&r.css("opacity",0),r.css({position:"absolute",display:"block",width:o,height:s,left:0,top:0}),r.translate({x:i.x+u.x,y:i.y+u.y}),e&&r.fadeTo(200,1),r.data("_pos",u),a._swipe.$visibles=a._swipe.$visibles.add(r)};v?(a._swipe.loaded[""+l]=v,g(v)):(Kveik.trigger("queryElement",a,p,{}),a.load(p,{},function(){var t=a._swipe.newState=a.findSerial(f);a._swipe.loaded[""+l]=t,g(t,!0),"function"==typeof a._swipe.postLoad&&a._swipe.postLoad.apply(a)}))}return a._swipe.$visibles.each(function(){var t=$(this).data("_pos")||{x:0,y:0};$(this).translate({x:t.x+i.x,y:t.y+i.y})}),a._swipe.prevPos={x:e.targetTouches[0].clientX,y:e.targetTouches[0].clientY},!1}}}).bind(i,function(t){if(a._swiping&&!a._swipeanim){var e=new Date-a._swipe.startTime,i={x:a._swipe.prevPos.x-a._swipe.startPos.x,y:a._swipe.prevPos.y-a._swipe.startPos.y},o=r.duration||200,s=Math.abs(i[r.axis])/n[r.axis]*100,h=s/(e/1e3);if(s>r.threshold||h>r.pps){var l=a._swipe.loaded[""+a._swipe.currentIndex],c=l.$state instanceof jQuery?l.$state.data("_pos"):l;a._swipeanim=!0,a.$element.css({overflow:"hidden !important"}),a._swipe.$visibles.each(function(){var t=$(this).data("_pos")||{x:0,y:0};$(this).translate({x:t.x-c.x,y:t.y-c.y,duration:o,easing:"ease-out"})});var u=!1,p=a._swipe.postLoad=function(){if(u){var t=a._swipe.loaded[""+a._swipe.currentIndex];if(t.$state instanceof jQuery){var e=t.$state;a._swipe.$visibles.each(function(){var t=$(this);t.data("_pos");t.css(d).translate({x:0,y:0}),t.is(e)?a.goTo(a._swipe.newState.param(),{switcher:"instant"}):t.hide(),a._swipe.$visibles=a._swipe.$visibles.not(t)})}}};setTimeout(function(){u=!0,p(),a._swiping=!1,a._swipeanim=!1,a.$element.css("hidden","")},1.01*o)}else a._swiping=!0,a.$element.css({overflow:"hidden !important"}),a._swipe.$visibles.each(function(){var t=$(this).data("_pos")||{x:0,y:0};$(this).translate({x:t.x,y:t.y,duration:200,easing:"ease-out"},function(){$(this).css(d),$(this).is(a.currentState.$state)||$(this).hide(),a._swiping=!1,a._swipeanim=!1,a.$element.css("overflow","")})});return a.$element.css(d),!1}}),this},Kveik.prototype.swipeable=function(){for(var t=this.initiated?this:Kveik.root,e=0;e1)return!1;var o=!1,s=[n.targetTouches[0].clientX,n.targetTouches[0].clientY];setTimeout(function(){o||(t.type="taphold",o=!0,$.event.handle.call(r,t))},1e3);var h=function(t){o||(Math.abs(n.targetTouches[0].clientX-s[0])>10||Math.abs(n.targetTouches[0].clientY-s[1])>10?o=!0:a.one(e,h))};a.one(e,h).one(i,function(t){o||(t.type="tap",$.event.handle.call(r,t)),o=!0})},teardown:function(){$(this).unbind(t,$.event.special.tap.handler)}}}(),function(t,e){var i=function(t){return this instanceof arguments.callee?this.init.apply(this,t.callee?t:arguments):new arguments.callee(arguments)};i.prototype={init:function(t,i){if(t=t||Kveik.root.get(),"string"==typeof i||i&&i.charAt){var r=i;i={},r.match(/^[\#\.]/)?(i.selector=r,i.frames=arguments[2]||"",i.width=arguments[3]||"",i.height=arguments[4]||"",i.frames||i.width||(i.animate=!1)):r.match(/^(\/|http)/)&&(i.url=r,i.frames=arguments[2]||"",i.width=arguments[3]||"",i.height=arguments[4]||"",i.frames||i.width||(i.animate=!1))}var a={position:"cursor",url:Kveik.defaults.loadImage,width:Kveik.defaults.loadWidth,height:Kveik.defaults.loadHeight,frames:Kveik.defaults.loadFrames,cursorOffsetX:14,cursorOffsetY:14,animate:!0};(i=e.extend(a,i)).width||i.frames||(i.width=Kveik.defaults.loadWidth,i.height=Kveik.defaults.loadHeight,i.frames=Kveik.defaults.loadFrames);var n,o=i.$container||t.$element||e("body");if(o[0].tagName||(o=e("body")),i.url){if(n=e('
').css("background","url("+i.url+")").hide(),i.width&&i.height)n.width(i.width),n.height(i.height);else{var s=e('');s.css({position:"absolute",top:-9999}),e("body").append(s),s.load(function(){i.width=e(this).width()/(i.frames||1),i.height=e(this).height(),n.width(i.width),n.height(i.height),e(this).remove()}),s[0].complete&&4!==s[0].readyState&&"complete"!==s[0].readyState&&s.load()}o.append(n)}else i.selector&&(n=e(i.selector));"cursor"===i.position?(Kveik.Ui.listenCursor(),n.css({zIndex:9999})):"center"===i.position&&(this.resize=function(){var t=o.width(),e=o.height()/2-i.height/2-i.height,r=t/2-i.width/2;r&&e&&n.css({position:"absolute",left:r,top:e,zIndex:9999})},e(window).resize(this.resize)),this.$loader=n,this.$container=o,this.options=i},load:function(t){var e=this.$loader;return!e||this.loading?this:(this.options.animate&&e.loopBackground(this.options),"cursor"===this.options.position?e.followCursor({xDiff:this.options.cursorOffsetX,yDiff:this.options.cursorOffsetY}):"center"===this.options.position&&this.resize(),e.stop().fadeTo("fast",1),this.loading=!0,this)},done:function(t){var e=this.$loader;if(!e)return this;var i;return this.options.animate&&(i=function(){e.stopBackground()}),e.stop().fadeOut("fast",i),this.loading=!1,this}},Kveik._loadingElements=0,Kveik._loadQueries={},Kveik.bind("queryElement",function(t,e,i){t._loadingState=t._loadingState||{};var r="object"==typeof e?Kveik.Lib.serialize(e):e;if((i.reset||i.reload||i.refresh)&&(t._loadingState[r]=0),t._loadingState[r]<2){if(t._loaders)for(var a=0;a0||(t._loadingState[i]=1,Kveik._loadingElements++)}),Kveik.bind("loadedImages",function(t,e){t._loadingState=t._loadingState||{};var i="object"==typeof e?Kveik.Lib.serialize(e):e;if(t._loadingState[i]<2){if(t._loadingState[i]=2,t._loaders)for(var r=0;r=0;s--)void 0!==l[s]&&(delete e[o][Kveik.argumentKey][s],d.push(Kveik.Lib.serialize(e[o],o)));for(var c=0;c=p&&(r=r.add(f))}}}for(var s in Kveik.interactor.interactors[Kveik.nullStr]){p=(f=Kveik.interactor.interactors[Kveik.nullStr][s]).data("elementCount"),l=f.data("index");var f,v=f.data("param");for(var o in v)if(e[o]){if(o===Kveik.rootId)continue;""!==Kveik.Lib.serialize(v[o])||e[o]&&""!==Kveik.Lib.serialize(e[o])||(a[l]=(a[l]||0)+1)}(a[l]||0>=p)&&(r=r.add(f))}var g=t([]);return r.each(function(){var e=t(this).data("empty")||{};for(var i in e){var r=e[i];if(Kveik.Lib.serialize(n[r],r).match(new RegExp(i)))return void(g=g.add(this))}}),r=r.not(g)},Kveik.interactor.trigger=function(){var e,i,r,a=0;"string"==typeof arguments[a]&&(e=arguments[a++]),"object"!=typeof arguments[a]||arguments[a].jquery||(i=arguments[a++]),"object"==typeof arguments[a]&&arguments[a].jquery&&(r=t(arguments[a++])),r||(r=this.allMatches(i));var n=r.data("activator")||Kveik.defaults.activator||{};return"function"==typeof n[e]&&n[e](r),this},Kveik.interactor.interactors={},Kveik.interactor.interactorCounter=0,Kveik.defaults.activator={activate:function(e){var i=t(e);Kveik.trigger("preActivate",i),i.each(function(){Kveik.interactor.trigger("preActivate",t(this))}),t("._active").not(i).removeClass("_active"),i.addClass("_active"),i.each(function(){Kveik.interactor.trigger("postActivate",t(this))}),Kveik.trigger("postActivate")},activateExact:function(e){var i=Kveik.interactor.exactMatches();t("._activeExact").not(i).removeClass("_activeExact"),i.addClass("_activeExact")},remoteHover:function(e){t(e).addClass("_remoteHover")},remoteHoverOut:function(e){t(e).removeClass("_remoteHover")},load:function(e){t(e).addClass("_loading")},loaded:function(e){t(e).removeClass("_loading")}},Kveik.bind("activate",function(t){Kveik.interactor.trigger("activate",t).trigger("activateExact",t)}),Kveik.bind("loaded",function(){}),Kveik.bind("preLoad",function(){})}(jQuery,Kveik),function(t){jQuery.fn.isSwipe=function(e){if(!this||t.browser.msie)return!1;var i={limits:[50,50],left:function(){},right:function(){},up:function(){},down:function(){},onMove:void 0};return e=t.extend(i,e),this.each(function(){var t,i;this.addEventListener("touchmove",function(r){var a=document.documentElement.clientWidth!==window.innerWidth;if(!(r.targetTouches.length>1||a)){if(i=[r.targetTouches[0].pageX,r.targetTouches[0].pageY],t||(t=[i[0],i[1]]),e.onMove){var n=[i[0]-t[0],i[1]-t[1]];e.onMove(n)}r.preventDefault()}},!1),this.addEventListener("touchend",function(r){var a=[i[0]-t[0],i[1]-t[1]],n=Math.abs(a[0])/Math.abs(a[1]);a[0]>e.limits[0]&&n>1.1&&e.left(),a[0]<-e.limits[0]&&n>1.1&&e.right(),a[1]>e.limits[1]&&n<.9&&e.up(),a[1]<-e.limits[1]&&n<.9&&e.down(),t=void 0,r.preventDefault()},!1)})},jQuery.expr[":"].Contains=function(t,e,i){return(t.textContent||t.innerText||"").toUpperCase().indexOf(i[3].toUpperCase())>=0},jQuery.fn.defaultValue=function(e,i){return t(this).each(function(){var r=t(this);r.is("input,textarea")&&(""==r.val()||r.data("_default"))&&(i&&r.css("color",i),r.val(e),r.data("_default",!0),r.bind("focus",function(t){r.val()==e&&(r.val(""),r.data("_default",!1),i&&r.css("color",""))}),r.bind("blur",function(t){""==r.val()&&(r.val(e),r.data("_default",!0),i&&r.css("color",i))}),r.parents("form:first").each(function(t){r.submit(function(t){r.val()==e&&r.val("")})}))}),this},jQuery.fn.loopBackground=function(e){return t(this).each(function(){if(e=t.extend({delay:50},t(this).data("options"),e),!t(this).data("_runningAnimation")){t(this).data("_runningAnimation",!0);var i=this;e.frameNo=0;var r=function(){if(e.frames&&e.width){var r=-e.frameNo*e.width;t(i).css("backgroundPosition",r+"px 0px"),e.backwards?e.frameNo=(e.frameNo-1)%e.frames:e.frameNo=(e.frameNo+1)%e.frames}};if(t(this).data("_initiated"))t(this).data("timer",setInterval(r,e.delay));else{var a=(t(this).css("backgroundImage")||"").replace(/^url|[\(\)\"\']/g,""),n=t('').css({position:"absolute",top:-9999});t("body").append(n),n.one("load",function(){e.imgWidth=e.imgWidth||t(this).width(),e.imgHeight=e.imgHeight||t(this).height(),t(this).remove(),e.width=e.width||t(i).width()||parseInt(e.imgWidth/e.frames),e.frames=e.frames||parseInt(e.imgWidth/e.width),(typeof e.width>=0||typeof e.height>=0)&&t(i).css({width:e.width,height:e.height,overflow:"hidden"}),t(i).data("timer",setInterval(r,e.delay))}),(n[0].complete||n[0].readyState)&&n.trigger("load"),t(this).data("options",e),t(this).data("_initiated",!0)}}}),this},jQuery.fn.stopBackground=function(){return t(this).each(function(){var e=t(this).data("timer");e&&clearInterval(e),t(this).data("_runningAnimation",!1)}),this},jQuery.fn.followCursor=function(e){return e=e||{},t(this).each(function(){Kveik.Ui.followCursor(this,e.container,e.xDiff,e.yDiff,e.gravity)}),this},jQuery.fn.backgroundPositionX=function(e){var i=t(this);if(void 0===e){var r=i.css("backgroundPositionX");return r||(r=(/^(-?\d+\%?)/.exec(t(this).css("backgroundPosition"))||[])[1]),void 0===r&&(r=0),r}return i.each(function(){var t=""+i.backgroundPositionY();t=t.match(/\%/)?t:t+"px",e=(e=""+e).match(/\%/)?e:e+"px",i.css("backgroundPosition",e+" "+t),i.css("backgroundPositionX",e)}),this},jQuery.fn.backgroundPositionY=function(e){var i=t(this);if(void 0===e){var r=i.css("backgroundPositionY");return r||(r=(/ (-?\d+\%?)/.exec(t(this).css("backgroundPosition"))||[])[1]),void 0===r&&(r=0),r}return i.each(function(){var t=""+i.backgroundPositionX();t=t.match(/\%/)?t:t+"px",e=(e=""+e).match(/\%/)?e:e+"px",i.css("backgroundPosition",t+" "+e),i.css("backgroundPositionY",e)}),this},jQuery.fn.valign=function(e,i){i=i||{},t(this).each(function(){t(this).hasClass("_valign")||t(this).wrap("<"+(i.tagName||"div")+"/>");var r=t(this).parent(),a=r.parent();if("absolute"!==a.css("position")&&a.css("position","relative"),"bottom"===e);else if("top"===e);else{t(this).fakeDisplay();var n=Math.min(t(this).height(),a.height());r.css({position:"absolute",zIndex:t(this).css("zIndex"),width:"100%",height:"50%",top:"50%",marginTop:-parseInt(n/2)}),t(this).fakeDisplay(!0)}})},jQuery.fn.fakeDisplay=function(e){return t(this).each(function(){var i=t(this),r=i.data("_hiddenElements");if(e){if(!r)return;r.each(function(){var e=t(this),i=e.data("_css");i&&(e.css(i),e.data("_css",""))}),i.data("_hiddenElements",!1)}else{if(r)return this;(r=i.filter(":hidden").add(i.parents(":hidden"))).each(function(){var e=t(this);if(e.is(":hidden")){var i={opacity:this.style.opacity,display:this.style.display,position:this.style.position,top:this.style.top,width:this.style.width,bottom:this.style.bottom,right:this.style.right,left:this.style.left};e.css({top:-99999,left:-99999,bottom:"auto",right:"auto",width:"",display:"block"}).data("_css",i)}}),i.data("_hiddenElements",r)}}),this},jQuery.event.special.imgload={add:function(e){function i(){++h===s&&e.handler.call(n)}var r,a=t(this),n=this,o=a.find("img").add(a.filter("img")),s=o.length,h=-1;for(i(),r=0,s=o.length;r").bind("load error",i).attr("src",d.src)}}},jQuery.fn.imgload=function(e){e?t(this).bind("imgload",e):t(this).trigger("imgload")},jQuery.fn.kkAnimate=function(){var e,i,r,a,n=0,o=t(this),s=this;e="object"==typeof arguments[n]?arguments[n++]:{},"number"==typeof arguments[n]&&(i=arguments[n++]),r="string"==typeof arguments[n]?arguments[n++]:"ease-out","function"==typeof arguments[n]&&(a=arguments[n++]);var h,d=!1;if("WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix&&(d=!0,h="-webkit-"),d){var l=[],c={},u={};if(u[h+"transform"]="","number"==typeof e.left&&(l.push("translateX("+e.left+"px)"),u.left=0,u[h+"transform"]+="translateX("+o.css("left")+") ",c.left=e.left,delete e.left),"number"==typeof e.top&&(l.push("translateY("+e.top+"px)"),u.top=0,u[h+"transform"]+="translateY("+o.css("top")+")",c.top=e.top,delete e.top),"number"==typeof e.z?(l.push("translateZ("+e.z+"px)"),delete e.z):(u[h+"transform"]+="translateZ(0)",l.push("translateZ(0)")),o.css(u),e[h+"transform"]=l.join(" "),"number"==typeof i){var p="";for(var f in e)p+=f+" ";p+=i+"ms "+r||"ease-out",e[h+"transition"]=p,o.css(e),setTimeout(function(){c[h+"transform"]="",c[h+"transition"]="",o.css(c),"function"==typeof a&&a.apply(s)},i)}else t(this).css(e),"function"==typeof a&&a.apply(s)}else i?t(this).animate(e,i,a):(t(this).css(e),"function"==typeof a&&a.apply(s));return this};var e={x:0,y:0,z:0,duration:0};"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix?jQuery.fn.translate=function(i,r){if(!i)return t(this).css({"-webkit-transition":"","-webkit-transform":""}),this;var a=t.extend({},e,i),n=this,o={};return o["-webkit-transform"]="translate3d("+a.x+"px, "+a.y+"px, "+a.z+"px)",a.duration&&(o["-webkit-transition"]="-webkit-transform "+a.duration+"ms "+(a.easing||"ease-out")),t(this).each(function(){t(this).css(o)}),a.duration?setTimeout(function(){t(n).css("-webkit-transition",""),"function"==typeof r&&r.apply(n)},a.duration):"function"==typeof r&&r.apply(n),this}:jQuery.fn.translate=function(i,r){if(!i)return t(this).css({top:"",left:""}),this;var a=t.extend({},e,i),n={left:a.x,top:a.y};return a.duration?t(this).animate(n,a.duration,r):(t(this).css(n),"function"==typeof r&&r.apply(this)),this},t._cleanData=t.cleanData,t.cleanData=function(e){for(var i=0;i<\/script>');t.attr("src",("https:"==document.location.protocol?"https://ssl":"http://www")+r),$("head").append(t)}),Kveik.bind("postPushState",function(t,i){if(i.virtualPath)for(var r in e)window._gaq.push([r+"._trackPageview",i.realPath||i.virtualPath])})}},Kveik.ga=Kveik.Analytics.ga;