/* Minification failed. Returning unminified contents.
(5193,372-379): run-time error JS1019: Can't have 'break' outside of loop: break a
(5192,379-386): run-time error JS1019: Can't have 'break' outside of loop: break a
(5140,66-73): run-time error JS1019: Can't have 'break' outside of loop: break a
(5139,286-293): run-time error JS1019: Can't have 'break' outside of loop: break a
(5139,125-132): run-time error JS1019: Can't have 'break' outside of loop: break a
(5090,549-556): run-time error JS1019: Can't have 'break' outside of loop: break a
(5090,618-625): run-time error JS1019: Can't have 'break' outside of loop: break a
(5086,107-114): run-time error JS1019: Can't have 'break' outside of loop: break a
 */
/*! jQuery v1.8.2 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call("﻿ ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);;
/*! jQuery UI - v1.11.4 - 2017-03-15
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, slider.js, effect.js, effect-scale.js, effect-size.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */

(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(e,s){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']")[0],!!a&&i(a)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!e.disabled:"a"===r?e.href||s:s)&&i(e)}function i(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}t.ui=t.ui||{},t.extend(t.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({scrollParent:function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(i){return e(i,!isNaN(t.attr(i,"tabindex")))},tabbable:function(i){var s=t.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&e(i,!n)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var i,s,n=t(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}};var s=0,n=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r,l={},h=e.split(".")[0];return e=e.split(".")[1],n=h+"-"+e,s||(s=i,i=t.Widget),t.expr[":"][n.toLowerCase()]=function(e){return!!t.data(e,n)},t[h]=t[h]||{},o=t[h][e],a=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new a(t,e)},t.extend(a,o,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(s,function(e,s){return t.isFunction(s)?(l[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},n=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(l[e]=s,void 0)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix||e:e},l,{constructor:a,namespace:h,widgetName:e,widgetFullName:n}),o?(t.each(o._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a),a},t.widget.extend=function(e){for(var i,s,o=n.call(arguments,1),a=0,r=o.length;r>a;a++)for(i in o[a])s=o[a][i],o[a].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=n.call(arguments,1),l=this;return a?this.each(function(){var i,n=t.data(this,s);return"instance"===o?(l=n,!1):n?t.isFunction(n[o])&&"_"!==o.charAt(0)?(i=n[o].apply(n,r),i!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,s);e?(e.option(o||{}),e._init&&e._init()):t.data(this,s,new i(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!e),e&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.delegate(c,h,r):i.bind(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(i).undelegate(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget;var o=!1;t(document).mouseup(function(){o=!1}),t.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!o){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),o=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),o=!1,!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.slider",t.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!i),this._super(e,i),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.floor(+(t-e).toFixed(this._precision())/i)*i;t=s+e,this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[h?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[h?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(e.target).addClass("ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}});var a="ui-effects-",r=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=h(),n=s._rgba=[];return i=i.toLowerCase(),f(l,function(t,o){var a,r=o.re.exec(i),l=r&&o.parse(r),h=o.space||"rgba";return l?(a=s[h](l),s[c[h].cache]=a[c[h].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,l=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],h=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=h.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),h.fn=t.extend(h.prototype,{parse:function(n,a,r,l){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,l],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof h?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=h(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=h(t),n=s._space(),o=c[n],a=0===this.alpha()?h("transparent"):this,r=a[o.cache]||o.to(a._rgba),l=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],h=s[o],c=u[n.type]||{};null!==h&&(null===a?l[o]=h:(c.mod&&(h-a>c.mod/2?a+=c.mod:a-h>c.mod/2&&(a-=c.mod)),l[o]=i((h-a)*e+a,n)))}),this[n](l)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=h(e)._rgba;return h(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),h.fn.parse.prototype=h.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),l=Math.min(s,n,o),h=r-l,c=r+l,u=.5*c;return e=l===r?0:s===r?60*(n-o)/h+360:n===r?60*(o-s)/h+120:60*(s-n)/h+240,i=0===h?0:.5>=u?h/c:h/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,l=n.to,c=n.from;h.fn[s]=function(s){if(l&&!this[a]&&(this[a]=l(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=h(c(d)),n[a]=d,n):h(d)},f(o,function(e,i){h.fn[e]||(h.fn[e]=function(n){var o,a=t.type(n),l="alpha"===e?this._hsla?"hsla":"rgba":s,h=this[l](),c=h[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),h[i.idx]=n,this[l](h)))})})}),h.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=h(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(l){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(l){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=h(e.elem,i),e.end=h(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},h.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(r),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(r.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),s=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)
}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.11.4",save:function(t,e){for(var i=0;e.length>i;i++)null!==e[i]&&t.data(a+e[i],t[0].style[e[i]])},restore:function(t,e){var i,s;for(s=0;e.length>s;s++)null!==e[s]&&(i=t.data(a+e[s]),void 0===i&&(i=""),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):a.call(n[0],s,i)}var s=e.apply(this,arguments),n=s.mode,o=s.queue,a=t.effects.effect[s.effect];return t.fx.off||!a?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):o===!1?this.each(i):this.queue(o||"fx",i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}(),t.effects,t.effects.effect.size=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],h=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],_=a.css("position"),v=f?r:l,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||b,a.to=e.from||s):(a.from=e.from||("show"===p?b:s),a.to=e.to||("hide"===p?b:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},("box"===g||"both"===g)&&(o.from.y!==o.to.y&&(v=v.concat(u),a.from=t.effects.setTransition(a,u,o.from.y,a.from),a.to=t.effects.setTransition(a,u,o.to.y,a.to)),o.from.x!==o.to.x&&(v=v.concat(d),a.from=t.effects.setTransition(a,d,o.from.x,a.from),a.to=t.effects.setTransition(a,d,o.to.x,a.to))),("content"===g||"both"===g)&&o.from.y!==o.to.y&&(v=v.concat(c).concat(h),a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),t.effects.save(a,v),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),m&&(n=t.effects.getBaseline(m,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),h=r.concat(u).concat(d),a.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,h),i.from={height:s.height*o.from.y,width:s.width*o.from.x,outerHeight:s.outerHeight*o.from.y,outerWidth:s.outerWidth*o.from.x},i.to={height:s.height*o.to.y,width:s.width*o.to.x,outerHeight:s.height*o.to.y,outerWidth:s.width*o.to.x},o.from.y!==o.to.y&&(i.from=t.effects.setTransition(i,u,o.from.y,i.from),i.to=t.effects.setTransition(i,u,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=t.effects.setTransition(i,d,o.from.x,i.from),i.to=t.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,h)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),t.effects.restore(a,v),f||("static"===_?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){a.css(e,function(e,i){var s=parseInt(i,10),n=t?a.to.left:a.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(a),i()}})},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),o=t.effects.setMode(s,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),r=e.direction||"both",l=e.origin,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?a/100:1,x:"vertical"!==r?a/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==o&&(n.origin=l||["middle","center"],n.restore=!0),n.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:h),n.to={height:h.height*c.y,width:h.width*c.x,outerHeight:h.outerHeight*c.y,outerWidth:h.outerWidth*c.x},n.fade&&("show"===o&&(n.from.opacity=0,n.to.opacity=1),"hide"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)}});;
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=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},z=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=E(e[d],"function"),E(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),A={}.hasOwnProperty,B;!E(A,"undefined")&&!E(A.call,"undefined")?B=function(a,b){return A.call(a,b)}:B=function(a,b){return b in a&&E(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=w.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(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return I("flexWrap")},s.flexboxlegacy=function(){return I("boxDirection")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!E(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!I("indexedDB",a)},s.hashchange=function(){return z("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return C("background-color:rgba(150,255,150,.5)"),F(j.backgroundColor,"rgba")},s.hsla=function(){return C("background-color:hsla(120,40%,100%,.5)"),F(j.backgroundColor,"rgba")||F(j.backgroundColor,"hsla")},s.multiplebgs=function(){return C("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return I("backgroundSize")},s.borderimage=function(){return I("borderImage")},s.borderradius=function(){return I("borderRadius")},s.boxshadow=function(){return I("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return D("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return I("animationName")},s.csscolumns=function(){return I("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return C((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),F(j.backgroundImage,"gradient")},s.cssreflections=function(){return I("boxReflect")},s.csstransforms=function(){return!!I("transform")},s.csstransforms3d=function(){var a=!!I("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return I("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var K in s)B(s,K)&&(x=K.toLowerCase(),e[x]=s[K](),v.push((e[x]?"":"no-")+x));return e.input||J(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)B(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},C(""),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=n,e._domPrefixes=q,e._cssomPrefixes=p,e.hasEvent=z,e.testProp=function(a){return G([a])},e.testAllProps=I,e.testStyles=y,e.prefixed=function(a,b,c){return b?I(a,b,c):I(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.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))};

// https://github.com/Modernizr/Modernizr/issues/1004
Modernizr.touch = undefined;
document.documentElement.className = document.documentElement.className.replace(/(^|\s)touch|no-touch(\s|$)/, '$1$2');
Modernizr.addTest('touch', 'ontouchstart' in window || window.DocumentTouch && document instanceof DocumentTouch);;
//     Underscore.js 1.4.1
//     http://underscorejs.org
//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
//     Underscore may be freely distributed under the MIT license.

(function() {

  // Baseline setup
  // --------------

  // Establish the root object, `window` in the browser, or `global` on the server.
  var root = this;

  // Save the previous value of the `_` variable.
  var previousUnderscore = root._;

  // Establish the object that gets returned to break out of a loop iteration.
  var breaker = {};

  // Save bytes in the minified (but not gzipped) version:
  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;

  // Create quick reference variables for speed access to core prototypes.
  var push             = ArrayProto.push,
      slice            = ArrayProto.slice,
      concat           = ArrayProto.concat,
      unshift          = ArrayProto.unshift,
      toString         = ObjProto.toString,
      hasOwnProperty   = ObjProto.hasOwnProperty;

  // All **ECMAScript 5** native function implementations that we hope to use
  // are declared here.
  var
    nativeForEach      = ArrayProto.forEach,
    nativeMap          = ArrayProto.map,
    nativeReduce       = ArrayProto.reduce,
    nativeReduceRight  = ArrayProto.reduceRight,
    nativeFilter       = ArrayProto.filter,
    nativeEvery        = ArrayProto.every,
    nativeSome         = ArrayProto.some,
    nativeIndexOf      = ArrayProto.indexOf,
    nativeLastIndexOf  = ArrayProto.lastIndexOf,
    nativeIsArray      = Array.isArray,
    nativeKeys         = Object.keys,
    nativeBind         = FuncProto.bind;

  // Create a safe reference to the Underscore object for use below.
  var _ = function(obj) {
    if (obj instanceof _) return obj;
    if (!(this instanceof _)) return new _(obj);
    this._wrapped = obj;
  };

  // Export the Underscore object for **Node.js** and **"CommonJS"**, with
  // backwards-compatibility for the old `require()` API. If we're not in
  // CommonJS, add `_` to the global object via a string identifier for
  // the Closure Compiler "advanced" mode. Registration as an AMD module
  // via define() happens at the end of this file.
  if (typeof exports !== 'undefined') {
    if (typeof module !== 'undefined' && module.exports) {
      exports = module.exports = _;
    }
    exports._ = _;
  } else {
    root['_'] = _;
  }

  // Current version.
  _.VERSION = '1.4.1';

  // Collection Functions
  // --------------------

  // The cornerstone, an `each` implementation, aka `forEach`.
  // Handles objects with the built-in `forEach`, arrays, and raw objects.
  // Delegates to **ECMAScript 5**'s native `forEach` if available.
  var each = _.each = _.forEach = function(obj, iterator, context) {
    if (nativeForEach && obj.forEach === nativeForEach) {
      obj.forEach(iterator, context);
    } else if (obj.length === +obj.length) {
      for (var i = 0, l = obj.length; i < l; i++) {
        if (iterator.call(context, obj[i], i, obj) === breaker) return;
      }
    } else {
      for (var key in obj) {
        if (_.has(obj, key)) {
          if (iterator.call(context, obj[key], key, obj) === breaker) return;
        }
      }
    }
  };

  // Return the results of applying the iterator to each element.
  // Delegates to **ECMAScript 5**'s native `map` if available.
  _.map = _.collect = function(obj, iterator, context) {
    var results = [];
    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
    each(obj, function(value, index, list) {
      results[results.length] = iterator.call(context, value, index, list);
    });
    return results;
  };

  // **Reduce** builds up a single result from a list of values, aka `inject`,
  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
    var initial = arguments.length > 2;
    if (nativeReduce && obj.reduce === nativeReduce) {
      if (context) iterator = _.bind(iterator, context);
      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
    }
    each(obj, function(value, index, list) {
      if (!initial) {
        memo = value;
        initial = true;
      } else {
        memo = iterator.call(context, memo, value, index, list);
      }
    });
    if (!initial) throw new TypeError('Reduce of empty array with no initial value');
    return memo;
  };

  // The right-associative version of reduce, also known as `foldr`.
  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
    var initial = arguments.length > 2;
    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
      if (context) iterator = _.bind(iterator, context);
      return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
    }
    var length = obj.length;
    if (length !== +length) {
      var keys = _.keys(obj);
      length = keys.length;
    }
    each(obj, function(value, index, list) {
      index = keys ? keys[--length] : --length;
      if (!initial) {
        memo = obj[index];
        initial = true;
      } else {
        memo = iterator.call(context, memo, obj[index], index, list);
      }
    });
    if (!initial) throw new TypeError('Reduce of empty array with no initial value');
    return memo;
  };

  // Return the first value which passes a truth test. Aliased as `detect`.
  _.find = _.detect = function(obj, iterator, context) {
    var result;
    any(obj, function(value, index, list) {
      if (iterator.call(context, value, index, list)) {
        result = value;
        return true;
      }
    });
    return result;
  };

  // Return all the elements that pass a truth test.
  // Delegates to **ECMAScript 5**'s native `filter` if available.
  // Aliased as `select`.
  _.filter = _.select = function(obj, iterator, context) {
    var results = [];
    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
    each(obj, function(value, index, list) {
      if (iterator.call(context, value, index, list)) results[results.length] = value;
    });
    return results;
  };

  // Return all the elements for which a truth test fails.
  _.reject = function(obj, iterator, context) {
    var results = [];
    each(obj, function(value, index, list) {
      if (!iterator.call(context, value, index, list)) results[results.length] = value;
    });
    return results;
  };

  // Determine whether all of the elements match a truth test.
  // Delegates to **ECMAScript 5**'s native `every` if available.
  // Aliased as `all`.
  _.every = _.all = function(obj, iterator, context) {
    iterator || (iterator = _.identity);
    var result = true;
    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
    each(obj, function(value, index, list) {
      if (!(result = result && iterator.call(context, value, index, list))) return breaker;
    });
    return !!result;
  };

  // Determine if at least one element in the object matches a truth test.
  // Delegates to **ECMAScript 5**'s native `some` if available.
  // Aliased as `any`.
  var any = _.some = _.any = function(obj, iterator, context) {
    iterator || (iterator = _.identity);
    var result = false;
    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
    each(obj, function(value, index, list) {
      if (result || (result = iterator.call(context, value, index, list))) return breaker;
    });
    return !!result;
  };

  // Determine if the array or object contains a given value (using `===`).
  // Aliased as `include`.
  _.contains = _.include = function(obj, target) {
    var found = false;
    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
    found = any(obj, function(value) {
      return value === target;
    });
    return found;
  };

  // Invoke a method (with arguments) on every item in a collection.
  _.invoke = function(obj, method) {
    var args = slice.call(arguments, 2);
    return _.map(obj, function(value) {
      return (_.isFunction(method) ? method : value[method]).apply(value, args);
    });
  };

  // Convenience version of a common use case of `map`: fetching a property.
  _.pluck = function(obj, key) {
    return _.map(obj, function(value){ return value[key]; });
  };

  // Convenience version of a common use case of `filter`: selecting only objects
  // with specific `key:value` pairs.
  _.where = function(obj, attrs) {
    if (_.isEmpty(attrs)) return [];
    return _.filter(obj, function(value) {
      for (var key in attrs) {
        if (attrs[key] !== value[key]) return false;
      }
      return true;
    });
  };

  // Return the maximum element or (element-based computation).
  // Can't optimize arrays of integers longer than 65,535 elements.
  // See: https://bugs.webkit.org/show_bug.cgi?id=80797
  _.max = function(obj, iterator, context) {
    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
      return Math.max.apply(Math, obj);
    }
    if (!iterator && _.isEmpty(obj)) return -Infinity;
    var result = {computed : -Infinity};
    each(obj, function(value, index, list) {
      var computed = iterator ? iterator.call(context, value, index, list) : value;
      computed >= result.computed && (result = {value : value, computed : computed});
    });
    return result.value;
  };

  // Return the minimum element (or element-based computation).
  _.min = function(obj, iterator, context) {
    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
      return Math.min.apply(Math, obj);
    }
    if (!iterator && _.isEmpty(obj)) return Infinity;
    var result = {computed : Infinity};
    each(obj, function(value, index, list) {
      var computed = iterator ? iterator.call(context, value, index, list) : value;
      computed < result.computed && (result = {value : value, computed : computed});
    });
    return result.value;
  };

  // Shuffle an array.
  _.shuffle = function(obj) {
    var rand;
    var index = 0;
    var shuffled = [];
    each(obj, function(value) {
      rand = _.random(index++);
      shuffled[index - 1] = shuffled[rand];
      shuffled[rand] = value;
    });
    return shuffled;
  };

  // An internal function to generate lookup iterators.
  var lookupIterator = function(value) {
    return _.isFunction(value) ? value : function(obj){ return obj[value]; };
  };

  // Sort the object's values by a criterion produced by an iterator.
  _.sortBy = function(obj, value, context) {
    var iterator = lookupIterator(value);
    return _.pluck(_.map(obj, function(value, index, list) {
      return {
        value : value,
        index : index,
        criteria : iterator.call(context, value, index, list)
      };
    }).sort(function(left, right) {
      var a = left.criteria;
      var b = right.criteria;
      if (a !== b) {
        if (a > b || a === void 0) return 1;
        if (a < b || b === void 0) return -1;
      }
      return left.index < right.index ? -1 : 1;
    }), 'value');
  };

  // An internal function used for aggregate "group by" operations.
  var group = function(obj, value, context, behavior) {
    var result = {};
    var iterator = lookupIterator(value);
    each(obj, function(value, index) {
      var key = iterator.call(context, value, index, obj);
      behavior(result, key, value);
    });
    return result;
  };

  // Groups the object's values by a criterion. Pass either a string attribute
  // to group by, or a function that returns the criterion.
  _.groupBy = function(obj, value, context) {
    return group(obj, value, context, function(result, key, value) {
      (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
    });
  };

  // Counts instances of an object that group by a certain criterion. Pass
  // either a string attribute to count by, or a function that returns the
  // criterion.
  _.countBy = function(obj, value, context) {
    return group(obj, value, context, function(result, key, value) {
      if (!_.has(result, key)) result[key] = 0;
      result[key]++;
    });
  };

  // Use a comparator function to figure out the smallest index at which
  // an object should be inserted so as to maintain order. Uses binary search.
  _.sortedIndex = function(array, obj, iterator, context) {
    iterator = iterator == null ? _.identity : lookupIterator(iterator);
    var value = iterator.call(context, obj);
    var low = 0, high = array.length;
    while (low < high) {
      var mid = (low + high) >>> 1;
      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
    }
    return low;
  };

  // Safely convert anything iterable into a real, live array.
  _.toArray = function(obj) {
    if (!obj) return [];
    if (obj.length === +obj.length) return slice.call(obj);
    return _.values(obj);
  };

  // Return the number of elements in an object.
  _.size = function(obj) {
    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
  };

  // Array Functions
  // ---------------

  // Get the first element of an array. Passing **n** will return the first N
  // values in the array. Aliased as `head` and `take`. The **guard** check
  // allows it to work with `_.map`.
  _.first = _.head = _.take = function(array, n, guard) {
    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
  };

  // Returns everything but the last entry of the array. Especially useful on
  // the arguments object. Passing **n** will return all the values in
  // the array, excluding the last N. The **guard** check allows it to work with
  // `_.map`.
  _.initial = function(array, n, guard) {
    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
  };

  // Get the last element of an array. Passing **n** will return the last N
  // values in the array. The **guard** check allows it to work with `_.map`.
  _.last = function(array, n, guard) {
    if ((n != null) && !guard) {
      return slice.call(array, Math.max(array.length - n, 0));
    } else {
      return array[array.length - 1];
    }
  };

  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
  // Especially useful on the arguments object. Passing an **n** will return
  // the rest N values in the array. The **guard**
  // check allows it to work with `_.map`.
  _.rest = _.tail = _.drop = function(array, n, guard) {
    return slice.call(array, (n == null) || guard ? 1 : n);
  };

  // Trim out all falsy values from an array.
  _.compact = function(array) {
    return _.filter(array, function(value){ return !!value; });
  };

  // Internal implementation of a recursive `flatten` function.
  var flatten = function(input, shallow, output) {
    each(input, function(value) {
      if (_.isArray(value)) {
        shallow ? push.apply(output, value) : flatten(value, shallow, output);
      } else {
        output.push(value);
      }
    });
    return output;
  };

  // Return a completely flattened version of an array.
  _.flatten = function(array, shallow) {
    return flatten(array, shallow, []);
  };

  // Return a version of the array that does not contain the specified value(s).
  _.without = function(array) {
    return _.difference(array, slice.call(arguments, 1));
  };

  // Produce a duplicate-free version of the array. If the array has already
  // been sorted, you have the option of using a faster algorithm.
  // Aliased as `unique`.
  _.uniq = _.unique = function(array, isSorted, iterator, context) {
    var initial = iterator ? _.map(array, iterator, context) : array;
    var results = [];
    var seen = [];
    each(initial, function(value, index) {
      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
        seen.push(value);
        results.push(array[index]);
      }
    });
    return results;
  };

  // Produce an array that contains the union: each distinct element from all of
  // the passed-in arrays.
  _.union = function() {
    return _.uniq(concat.apply(ArrayProto, arguments));
  };

  // Produce an array that contains every item shared between all the
  // passed-in arrays.
  _.intersection = function(array) {
    var rest = slice.call(arguments, 1);
    return _.filter(_.uniq(array), function(item) {
      return _.every(rest, function(other) {
        return _.indexOf(other, item) >= 0;
      });
    });
  };

  // Take the difference between one array and a number of other arrays.
  // Only the elements present in just the first array will remain.
  _.difference = function(array) {
    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
    return _.filter(array, function(value){ return !_.contains(rest, value); });
  };

  // Zip together multiple lists into a single array -- elements that share
  // an index go together.
  _.zip = function() {
    var args = slice.call(arguments);
    var length = _.max(_.pluck(args, 'length'));
    var results = new Array(length);
    for (var i = 0; i < length; i++) {
      results[i] = _.pluck(args, "" + i);
    }
    return results;
  };

  // Converts lists into objects. Pass either a single array of `[key, value]`
  // pairs, or two parallel arrays of the same length -- one of keys, and one of
  // the corresponding values.
  _.object = function(list, values) {
    var result = {};
    for (var i = 0, l = list.length; i < l; i++) {
      if (values) {
        result[list[i]] = values[i];
      } else {
        result[list[i][0]] = list[i][1];
      }
    }
    return result;
  };

  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
  // we need this function. Return the position of the first occurrence of an
  // item in an array, or -1 if the item is not included in the array.
  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
  // If the array is large and already in sort order, pass `true`
  // for **isSorted** to use binary search.
  _.indexOf = function(array, item, isSorted) {
    var i = 0, l = array.length;
    if (isSorted) {
      if (typeof isSorted == 'number') {
        i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted);
      } else {
        i = _.sortedIndex(array, item);
        return array[i] === item ? i : -1;
      }
    }
    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
    for (; i < l; i++) if (array[i] === item) return i;
    return -1;
  };

  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
  _.lastIndexOf = function(array, item, from) {
    var hasIndex = from != null;
    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
    }
    var i = (hasIndex ? from : array.length);
    while (i--) if (array[i] === item) return i;
    return -1;
  };

  // Generate an integer Array containing an arithmetic progression. A port of
  // the native Python `range()` function. See
  // [the Python documentation](http://docs.python.org/library/functions.html#range).
  _.range = function(start, stop, step) {
    if (arguments.length <= 1) {
      stop = start || 0;
      start = 0;
    }
    step = arguments[2] || 1;

    var len = Math.max(Math.ceil((stop - start) / step), 0);
    var idx = 0;
    var range = new Array(len);

    while(idx < len) {
      range[idx++] = start;
      start += step;
    }

    return range;
  };

  // Function (ahem) Functions
  // ------------------

  // Reusable constructor function for prototype setting.
  var ctor = function(){};

  // Create a function bound to a given object (assigning `this`, and arguments,
  // optionally). Binding with arguments is also known as `curry`.
  // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
  // We check for `func.bind` first, to fail fast when `func` is undefined.
  _.bind = function bind(func, context) {
    var bound, args;
    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
    if (!_.isFunction(func)) throw new TypeError;
    args = slice.call(arguments, 2);
    return bound = function() {
      if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
      ctor.prototype = func.prototype;
      var self = new ctor;
      var result = func.apply(self, args.concat(slice.call(arguments)));
      if (Object(result) === result) return result;
      return self;
    };
  };

  // Bind all of an object's methods to that object. Useful for ensuring that
  // all callbacks defined on an object belong to it.
  _.bindAll = function(obj) {
    var funcs = slice.call(arguments, 1);
    if (funcs.length == 0) funcs = _.functions(obj);
    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
    return obj;
  };

  // Memoize an expensive function by storing its results.
  _.memoize = function(func, hasher) {
    var memo = {};
    hasher || (hasher = _.identity);
    return function() {
      var key = hasher.apply(this, arguments);
      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
    };
  };

  // Delays a function for the given number of milliseconds, and then calls
  // it with the arguments supplied.
  _.delay = function(func, wait) {
    var args = slice.call(arguments, 2);
    return setTimeout(function(){ return func.apply(null, args); }, wait);
  };

  // Defers a function, scheduling it to run after the current call stack has
  // cleared.
  _.defer = function(func) {
    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
  };

  // Returns a function, that, when invoked, will only be triggered at most once
  // during a given window of time.
  _.throttle = function(func, wait) {
    var context, args, timeout, throttling, more, result;
    var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
    return function() {
      context = this; args = arguments;
      var later = function() {
        timeout = null;
        if (more) {
          result = func.apply(context, args);
        }
        whenDone();
      };
      if (!timeout) timeout = setTimeout(later, wait);
      if (throttling) {
        more = true;
      } else {
        throttling = true;
        result = func.apply(context, args);
      }
      whenDone();
      return result;
    };
  };

  // Returns a function, that, as long as it continues to be invoked, will not
  // be triggered. The function will be called after it stops being called for
  // N milliseconds. If `immediate` is passed, trigger the function on the
  // leading edge, instead of the trailing.
  _.debounce = function(func, wait, immediate) {
    var timeout, result;
    return function() {
      var context = this, args = arguments;
      var later = function() {
        timeout = null;
        if (!immediate) result = func.apply(context, args);
      };
      var callNow = immediate && !timeout;
      clearTimeout(timeout);
      timeout = setTimeout(later, wait);
      if (callNow) result = func.apply(context, args);
      return result;
    };
  };

  // Returns a function that will be executed at most one time, no matter how
  // often you call it. Useful for lazy initialization.
  _.once = function(func) {
    var ran = false, memo;
    return function() {
      if (ran) return memo;
      ran = true;
      memo = func.apply(this, arguments);
      func = null;
      return memo;
    };
  };

  // Returns the first function passed as an argument to the second,
  // allowing you to adjust arguments, run code before and after, and
  // conditionally execute the original function.
  _.wrap = function(func, wrapper) {
    return function() {
      var args = [func];
      push.apply(args, arguments);
      return wrapper.apply(this, args);
    };
  };

  // Returns a function that is the composition of a list of functions, each
  // consuming the return value of the function that follows.
  _.compose = function() {
    var funcs = arguments;
    return function() {
      var args = arguments;
      for (var i = funcs.length - 1; i >= 0; i--) {
        args = [funcs[i].apply(this, args)];
      }
      return args[0];
    };
  };

  // Returns a function that will only be executed after being called N times.
  _.after = function(times, func) {
    if (times <= 0) return func();
    return function() {
      if (--times < 1) {
        return func.apply(this, arguments);
      }
    };
  };

  // Object Functions
  // ----------------

  // Retrieve the names of an object's properties.
  // Delegates to **ECMAScript 5**'s native `Object.keys`
  _.keys = nativeKeys || function(obj) {
    if (obj !== Object(obj)) throw new TypeError('Invalid object');
    var keys = [];
    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
    return keys;
  };

  // Retrieve the values of an object's properties.
  _.values = function(obj) {
    var values = [];
    for (var key in obj) if (_.has(obj, key)) values.push(obj[key]);
    return values;
  };

  // Convert an object into a list of `[key, value]` pairs.
  _.pairs = function(obj) {
    var pairs = [];
    for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]);
    return pairs;
  };

  // Invert the keys and values of an object. The values must be serializable.
  _.invert = function(obj) {
    var result = {};
    for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key;
    return result;
  };

  // Return a sorted list of the function names available on the object.
  // Aliased as `methods`
  _.functions = _.methods = function(obj) {
    var names = [];
    for (var key in obj) {
      if (_.isFunction(obj[key])) names.push(key);
    }
    return names.sort();
  };

  // Extend a given object with all the properties in passed-in object(s).
  _.extend = function(obj) {
    each(slice.call(arguments, 1), function(source) {
      for (var prop in source) {
        obj[prop] = source[prop];
      }
    });
    return obj;
  };

  // Return a copy of the object only containing the whitelisted properties.
  _.pick = function(obj) {
    var copy = {};
    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
    each(keys, function(key) {
      if (key in obj) copy[key] = obj[key];
    });
    return copy;
  };

   // Return a copy of the object without the blacklisted properties.
  _.omit = function(obj) {
    var copy = {};
    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
    for (var key in obj) {
      if (!_.contains(keys, key)) copy[key] = obj[key];
    }
    return copy;
  };

  // Fill in a given object with default properties.
  _.defaults = function(obj) {
    each(slice.call(arguments, 1), function(source) {
      for (var prop in source) {
        if (obj[prop] == null) obj[prop] = source[prop];
      }
    });
    return obj;
  };

  // Create a (shallow-cloned) duplicate of an object.
  _.clone = function(obj) {
    if (!_.isObject(obj)) return obj;
    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
  };

  // Invokes interceptor with the obj, and then returns obj.
  // The primary purpose of this method is to "tap into" a method chain, in
  // order to perform operations on intermediate results within the chain.
  _.tap = function(obj, interceptor) {
    interceptor(obj);
    return obj;
  };

  // Internal recursive comparison function for `isEqual`.
  var eq = function(a, b, aStack, bStack) {
    // Identical objects are equal. `0 === -0`, but they aren't identical.
    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
    if (a === b) return a !== 0 || 1 / a == 1 / b;
    // A strict comparison is necessary because `null == undefined`.
    if (a == null || b == null) return a === b;
    // Unwrap any wrapped objects.
    if (a instanceof _) a = a._wrapped;
    if (b instanceof _) b = b._wrapped;
    // Compare `[[Class]]` names.
    var className = toString.call(a);
    if (className != toString.call(b)) return false;
    switch (className) {
      // Strings, numbers, dates, and booleans are compared by value.
      case '[object String]':
        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
        // equivalent to `new String("5")`.
        return a == String(b);
      case '[object Number]':
        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
        // other numeric values.
        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
      case '[object Date]':
      case '[object Boolean]':
        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
        // millisecond representations. Note that invalid dates with millisecond representations
        // of `NaN` are not equivalent.
        return +a == +b;
      // RegExps are compared by their source patterns and flags.
      case '[object RegExp]':
        return a.source == b.source &&
               a.global == b.global &&
               a.multiline == b.multiline &&
               a.ignoreCase == b.ignoreCase;
    }
    if (typeof a != 'object' || typeof b != 'object') return false;
    // Assume equality for cyclic structures. The algorithm for detecting cyclic
    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
    var length = aStack.length;
    while (length--) {
      // Linear search. Performance is inversely proportional to the number of
      // unique nested structures.
      if (aStack[length] == a) return bStack[length] == b;
    }
    // Add the first object to the stack of traversed objects.
    aStack.push(a);
    bStack.push(b);
    var size = 0, result = true;
    // Recursively compare objects and arrays.
    if (className == '[object Array]') {
      // Compare array lengths to determine if a deep comparison is necessary.
      size = a.length;
      result = size == b.length;
      if (result) {
        // Deep compare the contents, ignoring non-numeric properties.
        while (size--) {
          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
        }
      }
    } else {
      // Objects with different constructors are not equivalent, but `Object`s
      // from different frames are.
      var aCtor = a.constructor, bCtor = b.constructor;
      if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
                               _.isFunction(bCtor) && (bCtor instanceof bCtor))) {
        return false;
      }
      // Deep compare objects.
      for (var key in a) {
        if (_.has(a, key)) {
          // Count the expected number of properties.
          size++;
          // Deep compare each member.
          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
        }
      }
      // Ensure that both objects contain the same number of properties.
      if (result) {
        for (key in b) {
          if (_.has(b, key) && !(size--)) break;
        }
        result = !size;
      }
    }
    // Remove the first object from the stack of traversed objects.
    aStack.pop();
    bStack.pop();
    return result;
  };

  // Perform a deep comparison to check if two objects are equal.
  _.isEqual = function(a, b) {
    return eq(a, b, [], []);
  };

  // Is a given array, string, or object empty?
  // An "empty" object has no enumerable own-properties.
  _.isEmpty = function(obj) {
    if (obj == null) return true;
    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
    for (var key in obj) if (_.has(obj, key)) return false;
    return true;
  };

  // Is a given value a DOM element?
  _.isElement = function(obj) {
    return !!(obj && obj.nodeType === 1);
  };

  // Is a given value an array?
  // Delegates to ECMA5's native Array.isArray
  _.isArray = nativeIsArray || function(obj) {
    return toString.call(obj) == '[object Array]';
  };

  // Is a given variable an object?
  _.isObject = function(obj) {
    return obj === Object(obj);
  };

  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
    _['is' + name] = function(obj) {
      return toString.call(obj) == '[object ' + name + ']';
    };
  });

  // Define a fallback version of the method in browsers (ahem, IE), where
  // there isn't any inspectable "Arguments" type.
  if (!_.isArguments(arguments)) {
    _.isArguments = function(obj) {
      return !!(obj && _.has(obj, 'callee'));
    };
  }

  // Optimize `isFunction` if appropriate.
  if (typeof (/./) !== 'function') {
    _.isFunction = function(obj) {
      return typeof obj === 'function';
    };
  }

  // Is a given object a finite number?
  _.isFinite = function(obj) {
    return _.isNumber(obj) && isFinite(obj);
  };

  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
  _.isNaN = function(obj) {
    return _.isNumber(obj) && obj != +obj;
  };

  // Is a given value a boolean?
  _.isBoolean = function(obj) {
    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
  };

  // Is a given value equal to null?
  _.isNull = function(obj) {
    return obj === null;
  };

  // Is a given variable undefined?
  _.isUndefined = function(obj) {
    return obj === void 0;
  };

  // Shortcut function for checking if an object has a given property directly
  // on itself (in other words, not on a prototype).
  _.has = function(obj, key) {
    return hasOwnProperty.call(obj, key);
  };

  // Utility Functions
  // -----------------

  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
  // previous owner. Returns a reference to the Underscore object.
  _.noConflict = function() {
    root._ = previousUnderscore;
    return this;
  };

  // Keep the identity function around for default iterators.
  _.identity = function(value) {
    return value;
  };

  // Run a function **n** times.
  _.times = function(n, iterator, context) {
    for (var i = 0; i < n; i++) iterator.call(context, i);
  };

  // Return a random integer between min and max (inclusive).
  _.random = function(min, max) {
    if (max == null) {
      max = min;
      min = 0;
    }
    return min + (0 | Math.random() * (max - min + 1));
  };

  // List of HTML entities for escaping.
  var entityMap = {
    escape: {
      '&': '&amp;',
      '<': '&lt;',
      '>': '&gt;',
      '"': '&quot;',
      "'": '&#x27;',
      '/': '&#x2F;'
    }
  };
  entityMap.unescape = _.invert(entityMap.escape);

  // Regexes containing the keys and values listed immediately above.
  var entityRegexes = {
    escape:   new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
    unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
  };

  // Functions for escaping and unescaping strings to/from HTML interpolation.
  _.each(['escape', 'unescape'], function(method) {
    _[method] = function(string) {
      if (string == null) return '';
      return ('' + string).replace(entityRegexes[method], function(match) {
        return entityMap[method][match];
      });
    };
  });

  // If the value of the named property is a function then invoke it;
  // otherwise, return it.
  _.result = function(object, property) {
    if (object == null) return null;
    var value = object[property];
    return _.isFunction(value) ? value.call(object) : value;
  };

  // Add your own custom functions to the Underscore object.
  _.mixin = function(obj) {
    each(_.functions(obj), function(name){
      var func = _[name] = obj[name];
      _.prototype[name] = function() {
        var args = [this._wrapped];
        push.apply(args, arguments);
        return result.call(this, func.apply(_, args));
      };
    });
  };

  // Generate a unique integer id (unique within the entire client session).
  // Useful for temporary DOM ids.
  var idCounter = 0;
  _.uniqueId = function(prefix) {
    var id = idCounter++;
    return prefix ? prefix + id : id;
  };

  // By default, Underscore uses ERB-style template delimiters, change the
  // following template settings to use alternative delimiters.
  _.templateSettings = {
    evaluate    : /<%([\s\S]+?)%>/g,
    interpolate : /<%=([\s\S]+?)%>/g,
    escape      : /<%-([\s\S]+?)%>/g
  };

  // When customizing `templateSettings`, if you don't want to define an
  // interpolation, evaluation or escaping regex, we need one that is
  // guaranteed not to match.
  var noMatch = /(.)^/;

  // Certain characters need to be escaped so that they can be put into a
  // string literal.
  var escapes = {
    "'":      "'",
    '\\':     '\\',
    '\r':     'r',
    '\n':     'n',
    '\t':     't',
    '\u2028': 'u2028',
    '\u2029': 'u2029'
  };

  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;

  // JavaScript micro-templating, similar to John Resig's implementation.
  // Underscore templating handles arbitrary delimiters, preserves whitespace,
  // and correctly escapes quotes within interpolated code.
  _.template = function(text, data, settings) {
    settings = _.defaults({}, settings, _.templateSettings);

    // Combine delimiters into one regular expression via alternation.
    var matcher = new RegExp([
      (settings.escape || noMatch).source,
      (settings.interpolate || noMatch).source,
      (settings.evaluate || noMatch).source
    ].join('|') + '|$', 'g');

    // Compile the template source, escaping string literals appropriately.
    var index = 0;
    var source = "__p+='";
    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
      source += text.slice(index, offset)
        .replace(escaper, function(match) { return '\\' + escapes[match]; });
      source +=
        escape ? "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'" :
        interpolate ? "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'" :
        evaluate ? "';\n" + evaluate + "\n__p+='" : '';
      index = offset + match.length;
    });
    source += "';\n";

    // If a variable is not specified, place data values in local scope.
    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';

    source = "var __t,__p='',__j=Array.prototype.join," +
      "print=function(){__p+=__j.call(arguments,'');};\n" +
      source + "return __p;\n";

    try {
      var render = new Function(settings.variable || 'obj', '_', source);
    } catch (e) {
      e.source = source;
      throw e;
    }

    if (data) return render(data, _);
    var template = function(data) {
      return render.call(this, data, _);
    };

    // Provide the compiled function source as a convenience for precompilation.
    template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';

    return template;
  };

  // Add a "chain" function, which will delegate to the wrapper.
  _.chain = function(obj) {
    return _(obj).chain();
  };

  // OOP
  // ---------------
  // If Underscore is called as a function, it returns a wrapped object that
  // can be used OO-style. This wrapper holds altered versions of all the
  // underscore functions. Wrapped objects may be chained.

  // Helper function to continue chaining intermediate results.
  var result = function(obj) {
    return this._chain ? _(obj).chain() : obj;
  };

  // Add all of the Underscore functions to the wrapper object.
  _.mixin(_);

  // Add all mutator Array functions to the wrapper.
  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      var obj = this._wrapped;
      method.apply(obj, arguments);
      if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
      return result.call(this, obj);
    };
  });

  // Add all accessor Array functions to the wrapper.
  each(['concat', 'join', 'slice'], function(name) {
    var method = ArrayProto[name];
    _.prototype[name] = function() {
      return result.call(this, method.apply(this._wrapped, arguments));
    };
  });

  _.extend(_.prototype, {

    // Start chaining a wrapped Underscore object.
    chain: function() {
      this._chain = true;
      return this;
    },

    // Extracts the result from a wrapped and chained object.
    value: function() {
      return this._wrapped;
    }

  });

  // AMD define happens at the end for compatibility with AMD loaders
  // that don't enforce next-turn semantics on modules.
  if (typeof define === 'function' && define.amd) {
    define('underscore', function() {
      return _;
    });
  }

}).call(this);
;
(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index<t.index?-1:1}),"value")};var F=function(n,t,r,e){var u={},i=k(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return F(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return F(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=function(n,t,r,e){r=null==r?w.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);;
//     Backbone.js 0.9.10

//     (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://backbonejs.org

(function(){

  // Initial Setup
  // -------------

  // Save a reference to the global object (`window` in the browser, `exports`
  // on the server).
  var root = this;

  // Save the previous value of the `Backbone` variable, so that it can be
  // restored later on, if `noConflict` is used.
  var previousBackbone = root.Backbone;

  // Create a local reference to array methods.
  var array = [];
  var push = array.push;
  var slice = array.slice;
  var splice = array.splice;

  // The top-level namespace. All public Backbone classes and modules will
  // be attached to this. Exported for both CommonJS and the browser.
  var Backbone;
  if (typeof exports !== 'undefined') {
    Backbone = exports;
  } else {
    Backbone = root.Backbone = {};
  }

  // Current version of the library. Keep in sync with `package.json`.
  Backbone.VERSION = '0.9.10';

  // Require Underscore, if we're on the server, and it's not already present.
  var _ = root._;
  if (!_ && (typeof require !== 'undefined')) _ = require('underscore');

  // For Backbone's purposes, jQuery, Zepto, or Ender owns the `$` variable.
  Backbone.$ = root.jQuery || root.Zepto || root.ender;

  // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable
  // to its previous owner. Returns a reference to this Backbone object.
  Backbone.noConflict = function() {
    root.Backbone = previousBackbone;
    return this;
  };

  // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option
  // will fake `"PUT"` and `"DELETE"` requests via the `_method` parameter and
  // set a `X-Http-Method-Override` header.
  Backbone.emulateHTTP = false;

  // Turn on `emulateJSON` to support legacy servers that can't deal with direct
  // `application/json` requests ... will encode the body as
  // `application/x-www-form-urlencoded` instead and will send the model in a
  // form param named `model`.
  Backbone.emulateJSON = false;

  // Backbone.Events
  // ---------------

  // Regular expression used to split event strings.
  var eventSplitter = /\s+/;

  // Implement fancy features of the Events API such as multiple event
  // names `"change blur"` and jQuery-style event maps `{change: action}`
  // in terms of the existing API.
  var eventsApi = function(obj, action, name, rest) {
    if (!name) return true;
    if (typeof name === 'object') {
      for (var key in name) {
        obj[action].apply(obj, [key, name[key]].concat(rest));
      }
    } else if (eventSplitter.test(name)) {
      var names = name.split(eventSplitter);
      for (var i = 0, l = names.length; i < l; i++) {
        obj[action].apply(obj, [names[i]].concat(rest));
      }
    } else {
      return true;
    }
  };

  // Optimized internal dispatch function for triggering events. Tries to
  // keep the usual cases speedy (most Backbone events have 3 arguments).
  var triggerEvents = function(events, args) {
    var ev, i = -1, l = events.length;
    switch (args.length) {
    case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx);
    return;
    case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0]);
    return;
    case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1]);
    return;
    case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, args[0], args[1], args[2]);
    return;
    default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args);
    }
  };

  // A module that can be mixed in to *any object* in order to provide it with
  // custom events. You may bind with `on` or remove with `off` callback
  // functions to an event; `trigger`-ing an event fires all callbacks in
  // succession.
  //
  //     var object = {};
  //     _.extend(object, Backbone.Events);
  //     object.on('expand', function(){ alert('expanded'); });
  //     object.trigger('expand');
  //
  var Events = Backbone.Events = {

    // Bind one or more space separated events, or an events map,
    // to a `callback` function. Passing `"all"` will bind the callback to
    // all events fired.
    on: function(name, callback, context) {
      if (!(eventsApi(this, 'on', name, [callback, context]) && callback)) return this;
      this._events || (this._events = {});
      var list = this._events[name] || (this._events[name] = []);
      list.push({callback: callback, context: context, ctx: context || this});
      return this;
    },

    // Bind events to only be triggered a single time. After the first time
    // the callback is invoked, it will be removed.
    once: function(name, callback, context) {
      if (!(eventsApi(this, 'once', name, [callback, context]) && callback)) return this;
      var self = this;
      var once = _.once(function() {
        self.off(name, once);
        callback.apply(this, arguments);
      });
      once._callback = callback;
      this.on(name, once, context);
      return this;
    },

    // Remove one or many callbacks. If `context` is null, removes all
    // callbacks with that function. If `callback` is null, removes all
    // callbacks for the event. If `name` is null, removes all bound
    // callbacks for all events.
    off: function(name, callback, context) {
      var list, ev, events, names, i, l, j, k;
      if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
      if (!name && !callback && !context) {
        this._events = {};
        return this;
      }

      names = name ? [name] : _.keys(this._events);
      for (i = 0, l = names.length; i < l; i++) {
        name = names[i];
        if (list = this._events[name]) {
          events = [];
          if (callback || context) {
            for (j = 0, k = list.length; j < k; j++) {
              ev = list[j];
              if ((callback && callback !== ev.callback &&
                               callback !== ev.callback._callback) ||
                  (context && context !== ev.context)) {
                events.push(ev);
              }
            }
          }
          this._events[name] = events;
        }
      }

      return this;
    },

    // Trigger one or many events, firing all bound callbacks. Callbacks are
    // passed the same arguments as `trigger` is, apart from the event name
    // (unless you're listening on `"all"`, which will cause your callback to
    // receive the true name of the event as the first argument).
    trigger: function(name) {
      if (!this._events) return this;
      var args = slice.call(arguments, 1);
      if (!eventsApi(this, 'trigger', name, args)) return this;
      var events = this._events[name];
      var allEvents = this._events.all;
      if (events) triggerEvents(events, args);
      if (allEvents) triggerEvents(allEvents, arguments);
      return this;
    },

    // An inversion-of-control version of `on`. Tell *this* object to listen to
    // an event in another object ... keeping track of what it's listening to.
    listenTo: function(obj, name, callback) {
      var listeners = this._listeners || (this._listeners = {});
      var id = obj._listenerId || (obj._listenerId = _.uniqueId('l'));
      listeners[id] = obj;
      obj.on(name, typeof name === 'object' ? this : callback, this);
      return this;
    },

    // Tell this object to stop listening to either specific events ... or
    // to every object it's currently listening to.
    stopListening: function(obj, name, callback) {
      var listeners = this._listeners;
      if (!listeners) return;
      if (obj) {
        obj.off(name, typeof name === 'object' ? this : callback, this);
        if (!name && !callback) delete listeners[obj._listenerId];
      } else {
        if (typeof name === 'object') callback = this;
        for (var id in listeners) {
          listeners[id].off(name, callback, this);
        }
        this._listeners = {};
      }
      return this;
    }
  };

  // Aliases for backwards compatibility.
  Events.bind   = Events.on;
  Events.unbind = Events.off;

  // Allow the `Backbone` object to serve as a global event bus, for folks who
  // want global "pubsub" in a convenient place.
  //_.extend(Backbone, Events);

  // Backbone.Model
  // --------------

  // Create a new model, with defined attributes. A client id (`cid`)
  // is automatically generated and assigned for you.
  var Model = Backbone.Model = function(attributes, options) {
    var defaults;
    var attrs = attributes || {};
    this.cid = _.uniqueId('c');
    this.attributes = {};
    if (options && options.collection) this.collection = options.collection;
    if (options && options.parse) attrs = this.parse(attrs, options) || {};
    if (defaults = _.result(this, 'defaults')) {
      attrs = _.defaults({}, attrs, defaults);
    }
    this.set(attrs, options);
    this.changed = {};
    this.initialize.apply(this, arguments);
  };

  // Attach all inheritable methods to the Model prototype.
  _.extend(Model.prototype, Events, {

    // A hash of attributes whose current and previous value differ.
    changed: null,

    // The default name for the JSON `id` attribute is `"id"`. MongoDB and
    // CouchDB users may want to set this to `"_id"`.
    idAttribute: 'id',

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize: function(){},

    // Return a copy of the model's `attributes` object.
    toJSON: function(options) {
      return _.clone(this.attributes);
    },

    // Proxy `Backbone.sync` by default.
    sync: function() {
      return Backbone.sync.apply(this, arguments);
    },

    // Get the value of an attribute.
    get: function(attr) {
      return this.attributes[attr];
    },

    // Get the HTML-escaped value of an attribute.
    escape: function(attr) {
      return _.escape(this.get(attr));
    },

    // Returns `true` if the attribute contains a value that is not null
    // or undefined.
    has: function(attr) {
      return this.get(attr) != null;
    },

    // ----------------------------------------------------------------------

    // Set a hash of model attributes on the object, firing `"change"` unless
    // you choose to silence it.
    set: function(key, val, options) {
      var attr, attrs, unset, changes, silent, changing, prev, current;
      if (key == null) return this;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (typeof key === 'object') {
        attrs = key;
        options = val;
      } else {
        (attrs = {})[key] = val;
      }

      options || (options = {});

      // Run validation.
      if (!this._validate(attrs, options)) return false;

      // Extract attributes and options.
      unset           = options.unset;
      silent          = options.silent;
      changes         = [];
      changing        = this._changing;
      this._changing  = true;

      if (!changing) {
        this._previousAttributes = _.clone(this.attributes);
        this.changed = {};
      }
      current = this.attributes, prev = this._previousAttributes;

      // Check for changes of `id`.
      if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];

      // For each `set` attribute, update or delete the current value.
      for (attr in attrs) {
        val = attrs[attr];
        if (!_.isEqual(current[attr], val)) changes.push(attr);
        if (!_.isEqual(prev[attr], val)) {
          this.changed[attr] = val;
        } else {
          delete this.changed[attr];
        }
        unset ? delete current[attr] : current[attr] = val;
      }

      // Trigger all relevant attribute changes.
      if (!silent) {
        if (changes.length) this._pending = true;
        for (var i = 0, l = changes.length; i < l; i++) {
          this.trigger('change:' + changes[i], this, current[changes[i]], options);
        }
      }

      if (changing) return this;
      if (!silent) {
        while (this._pending) {
          this._pending = false;
          this.trigger('change', this, options);
        }
      }
      this._pending = false;
      this._changing = false;
      return this;
    },

    // Remove an attribute from the model, firing `"change"` unless you choose
    // to silence it. `unset` is a noop if the attribute doesn't exist.
    unset: function(attr, options) {
      return this.set(attr, void 0, _.extend({}, options, {unset: true}));
    },

    // Clear all attributes on the model, firing `"change"` unless you choose
    // to silence it.
    clear: function(options) {
      var attrs = {};
      for (var key in this.attributes) attrs[key] = void 0;
      return this.set(attrs, _.extend({}, options, {unset: true}));
    },

    // Determine if the model has changed since the last `"change"` event.
    // If you specify an attribute name, determine if that attribute has changed.
    hasChanged: function(attr) {
      if (attr == null) return !_.isEmpty(this.changed);
      return _.has(this.changed, attr);
    },

    // Return an object containing all the attributes that have changed, or
    // false if there are no changed attributes. Useful for determining what
    // parts of a view need to be updated and/or what attributes need to be
    // persisted to the server. Unset attributes will be set to undefined.
    // You can also pass an attributes object to diff against the model,
    // determining if there *would be* a change.
    changedAttributes: function(diff) {
      if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;
      var val, changed = false;
      var old = this._changing ? this._previousAttributes : this.attributes;
      for (var attr in diff) {
        if (_.isEqual(old[attr], (val = diff[attr]))) continue;
        (changed || (changed = {}))[attr] = val;
      }
      return changed;
    },

    // Get the previous value of an attribute, recorded at the time the last
    // `"change"` event was fired.
    previous: function(attr) {
      if (attr == null || !this._previousAttributes) return null;
      return this._previousAttributes[attr];
    },

    // Get all of the attributes of the model at the time of the previous
    // `"change"` event.
    previousAttributes: function() {
      return _.clone(this._previousAttributes);
    },

    // ---------------------------------------------------------------------

    // Fetch the model from the server. If the server's representation of the
    // model differs from its current attributes, they will be overriden,
    // triggering a `"change"` event.
    fetch: function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var success = options.success;
      options.success = function(model, resp, options) {
        if (!model.set(model.parse(resp, options), options)) return false;
        if (success) success(model, resp, options);
      };
      return this.sync('read', this, options);
    },

    // Set a hash of model attributes, and sync the model to the server.
    // If the server returns an attributes hash that differs, the model's
    // state will be `set` again.
    save: function(key, val, options) {
      var attrs, success, method, xhr, attributes = this.attributes;

      // Handle both `"key", value` and `{key: value}` -style arguments.
      if (key == null || typeof key === 'object') {
        attrs = key;
        options = val;
      } else {
        (attrs = {})[key] = val;
      }

      // If we're not waiting and attributes exist, save acts as `set(attr).save(null, opts)`.
      if (attrs && (!options || !options.wait) && !this.set(attrs, options)) return false;

      options = _.extend({validate: true}, options);

      // Do not persist invalid models.
      if (!this._validate(attrs, options)) return false;

      // Set temporary attributes if `{wait: true}`.
      if (attrs && options.wait) {
        this.attributes = _.extend({}, attributes, attrs);
      }

      // After a successful server-side save, the client is (optionally)
      // updated with the server-side state.
      if (options.parse === void 0) options.parse = true;
      success = options.success;
      options.success = function(model, resp, options) {
        // Ensure attributes are restored during synchronous saves.
        model.attributes = attributes;
        var serverAttrs = model.parse(resp, options);
        if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);
        if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {
          return false;
        }
        if (success) success(model, resp, options);
      };

      // Finish configuring and sending the Ajax request.
      method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');
      if (method === 'patch') options.attrs = attrs;
      xhr = this.sync(method, this, options);

      // Restore attributes.
      if (attrs && options.wait) this.attributes = attributes;

      return xhr;
    },

    // Destroy this model on the server if it was already persisted.
    // Optimistically removes the model from its collection, if it has one.
    // If `wait: true` is passed, waits for the server to respond before removal.
    destroy: function(options) {
      options = options ? _.clone(options) : {};
      var model = this;
      var success = options.success;

      var destroy = function() {
        model.trigger('destroy', model, model.collection, options);
      };

      options.success = function(model, resp, options) {
        if (options.wait || model.isNew()) destroy();
        if (success) success(model, resp, options);
      };

      if (this.isNew()) {
        options.success(this, null, options);
        return false;
      }

      var xhr = this.sync('delete', this, options);
      if (!options.wait) destroy();
      return xhr;
    },

    // Default URL for the model's representation on the server -- if you're
    // using Backbone's restful methods, override this to change the endpoint
    // that will be called.
    url: function() {
      var base = _.result(this, 'urlRoot') || _.result(this.collection, 'url') || urlError();
      if (this.isNew()) return base;
      return base + (base.charAt(base.length - 1) === '/' ? '' : '/') + encodeURIComponent(this.id);
    },

    // **parse** converts a response into the hash of attributes to be `set` on
    // the model. The default implementation is just to pass the response along.
    parse: function(resp, options) {
      return resp;
    },

    // Create a new model with identical attributes to this one.
    clone: function() {
      return new this.constructor(this.attributes);
    },

    // A model is new if it has never been saved to the server, and lacks an id.
    isNew: function() {
      return this.id == null;
    },

    // Check if the model is currently in a valid state.
    isValid: function(options) {
      return !this.validate || !this.validate(this.attributes, options);
    },

    // Run validation against the next complete set of model attributes,
    // returning `true` if all is well. Otherwise, fire a general
    // `"error"` event and call the error callback, if specified.
    _validate: function(attrs, options) {
      if (!options.validate || !this.validate) return true;
      attrs = _.extend({}, this.attributes, attrs);
      var error = this.validationError = this.validate(attrs, options) || null;
      if (!error) return true;
      this.trigger('invalid', this, error, options || {});
      return false;
    }

  });

  // Backbone.Collection
  // -------------------

  // Provides a standard collection class for our sets of models, ordered
  // or unordered. If a `comparator` is specified, the Collection will maintain
  // its models in sort order, as they're added and removed.
  var Collection = Backbone.Collection = function(models, options) {
    options || (options = {});
    if (options.model) this.model = options.model;
    if (options.comparator !== void 0) this.comparator = options.comparator;
    this.models = [];
    this._reset();
    this.initialize.apply(this, arguments);
    if (models) this.reset(models, _.extend({silent: true}, options));
  };

  // Define the Collection's inheritable methods.
  _.extend(Collection.prototype, Events, {

    // The default model for a collection is just a **Backbone.Model**.
    // This should be overridden in most cases.
    model: Model,

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize: function(){},

    // The JSON representation of a Collection is an array of the
    // models' attributes.
    toJSON: function(options) {
      return this.map(function(model){ return model.toJSON(options); });
    },

    // Proxy `Backbone.sync` by default.
    sync: function() {
      return Backbone.sync.apply(this, arguments);
    },

    // Add a model, or list of models to the set.
    add: function(models, options) {
      models = _.isArray(models) ? models.slice() : [models];
      options || (options = {});
      var i, l, model, attrs, existing, doSort, add, at, sort, sortAttr;
      add = [];
      at = options.at;
      sort = this.comparator && (at == null) && options.sort != false;
      sortAttr = _.isString(this.comparator) ? this.comparator : null;

      // Turn bare objects into model references, and prevent invalid models
      // from being added.
      for (i = 0, l = models.length; i < l; i++) {
        if (!(model = this._prepareModel(attrs = models[i], options))) {
          this.trigger('invalid', this, attrs, options);
          continue;
        }

        // If a duplicate is found, prevent it from being added and
        // optionally merge it into the existing model.
        if (existing = this.get(model)) {
          if (options.merge) {
            existing.set(attrs === model ? model.attributes : attrs, options);
            if (sort && !doSort && existing.hasChanged(sortAttr)) doSort = true;
          }
          continue;
        }

        // This is a new model, push it to the `add` list.
        add.push(model);

        // Listen to added models' events, and index models for lookup by
        // `id` and by `cid`.
        model.on('all', this._onModelEvent, this);
        this._byId[model.cid] = model;
        if (model.id != null) this._byId[model.id] = model;
      }

      // See if sorting is needed, update `length` and splice in new models.
      if (add.length) {
        if (sort) doSort = true;
        this.length += add.length;
        if (at != null) {
          splice.apply(this.models, [at, 0].concat(add));
        } else {
          push.apply(this.models, add);
        }
      }

      // Silently sort the collection if appropriate.
      if (doSort) this.sort({silent: true});

      if (options.silent) return this;

      // Trigger `add` events.
      for (i = 0, l = add.length; i < l; i++) {
        (model = add[i]).trigger('add', model, this, options);
      }

      // Trigger `sort` if the collection was sorted.
      if (doSort) this.trigger('sort', this, options);

      return this;
    },

    // Remove a model, or a list of models from the set.
    remove: function(models, options) {
      models = _.isArray(models) ? models.slice() : [models];
      options || (options = {});
      var i, l, index, model;
      for (i = 0, l = models.length; i < l; i++) {
        model = this.get(models[i]);
        if (!model) continue;
        delete this._byId[model.id];
        delete this._byId[model.cid];
        index = this.indexOf(model);
        this.models.splice(index, 1);
        this.length--;
        if (!options.silent) {
          options.index = index;
          model.trigger('remove', model, this, options);
        }
        this._removeReference(model);
      }
      return this;
    },

    // Add a model to the end of the collection.
    push: function(model, options) {
      model = this._prepareModel(model, options);
      this.add(model, _.extend({at: this.length}, options));
      return model;
    },

    // Remove a model from the end of the collection.
    pop: function(options) {
      var model = this.at(this.length - 1);
      this.remove(model, options);
      return model;
    },

    // Add a model to the beginning of the collection.
    unshift: function(model, options) {
      model = this._prepareModel(model, options);
      this.add(model, _.extend({at: 0}, options));
      return model;
    },

    // Remove a model from the beginning of the collection.
    shift: function(options) {
      var model = this.at(0);
      this.remove(model, options);
      return model;
    },

    // Slice out a sub-array of models from the collection.
    slice: function(begin, end) {
      return this.models.slice(begin, end);
    },

    // Get a model from the set by id.
    get: function(obj) {
      if (obj == null) return void 0;
      this._idAttr || (this._idAttr = this.model.prototype.idAttribute);
      return this._byId[obj.id || obj.cid || obj[this._idAttr] || obj];
    },

    // Get the model at the given index.
    at: function(index) {
      return this.models[index];
    },

    // Return models with matching attributes. Useful for simple cases of `filter`.
    where: function(attrs) {
      if (_.isEmpty(attrs)) return [];
      return this.filter(function(model) {
        for (var key in attrs) {
          if (attrs[key] !== model.get(key)) return false;
        }
        return true;
      });
    },

    // Force the collection to re-sort itself. You don't need to call this under
    // normal circumstances, as the set will maintain sort order as each item
    // is added.
    sort: function(options) {
      if (!this.comparator) {
        throw new Error('Cannot sort a set without a comparator');
      }
      options || (options = {});

      // Run sort based on type of `comparator`.
      if (_.isString(this.comparator) || this.comparator.length === 1) {
        this.models = this.sortBy(this.comparator, this);
      } else {
        this.models.sort(_.bind(this.comparator, this));
      }

      if (!options.silent) this.trigger('sort', this, options);
      return this;
    },

    // Pluck an attribute from each model in the collection.
    pluck: function(attr) {
      return _.invoke(this.models, 'get', attr);
    },

    // Smartly update a collection with a change set of models, adding,
    // removing, and merging as necessary.
    update: function(models, options) {
      options = _.extend({add: true, merge: true, remove: true}, options);
      if (options.parse) models = this.parse(models, options);
      var model, i, l, existing;
      var add = [], remove = [], modelMap = {};

      // Allow a single model (or no argument) to be passed.
      if (!_.isArray(models)) models = models ? [models] : [];

      // Proxy to `add` for this case, no need to iterate...
      if (options.add && !options.remove) return this.add(models, options);

      // Determine which models to add and merge, and which to remove.
      for (i = 0, l = models.length; i < l; i++) {
        model = models[i];
        existing = this.get(model);
        if (options.remove && existing) modelMap[existing.cid] = true;
        if ((options.add && !existing) || (options.merge && existing)) {
          add.push(model);
        }
      }
      if (options.remove) {
        for (i = 0, l = this.models.length; i < l; i++) {
          model = this.models[i];
          if (!modelMap[model.cid]) remove.push(model);
        }
      }

      // Remove models (if applicable) before we add and merge the rest.
      if (remove.length) this.remove(remove, options);
      if (add.length) this.add(add, options);
      return this;
    },

    // When you have more items than you want to add or remove individually,
    // you can reset the entire set with a new list of models, without firing
    // any `add` or `remove` events. Fires `reset` when finished.
    reset: function(models, options) {
      options || (options = {});
      if (options.parse) models = this.parse(models, options);
      for (var i = 0, l = this.models.length; i < l; i++) {
        this._removeReference(this.models[i]);
      }
      options.previousModels = this.models.slice();
      this._reset();
      if (models) this.add(models, _.extend({silent: true}, options));
      if (!options.silent) this.trigger('reset', this, options);
      return this;
    },

    // Fetch the default set of models for this collection, resetting the
    // collection when they arrive. If `update: true` is passed, the response
    // data will be passed through the `update` method instead of `reset`.
    fetch: function(options) {
      options = options ? _.clone(options) : {};
      if (options.parse === void 0) options.parse = true;
      var success = options.success;
      options.success = function(collection, resp, options) {
        var method = options.update ? 'update' : 'reset';
        collection[method](resp, options);
        if (success) success(collection, resp, options);
      };
      return this.sync('read', this, options);
    },

    // Create a new instance of a model in this collection. Add the model to the
    // collection immediately, unless `wait: true` is passed, in which case we
    // wait for the server to agree.
    create: function(model, options) {
      options = options ? _.clone(options) : {};
      if (!(model = this._prepareModel(model, options))) return false;
      if (!options.wait) this.add(model, options);
      var collection = this;
      var success = options.success;
      options.success = function(model, resp, options) {
        if (options.wait) collection.add(model, options);
        if (success) success(model, resp, options);
      };
      model.save(null, options);
      return model;
    },

    // **parse** converts a response into a list of models to be added to the
    // collection. The default implementation is just to pass it through.
    parse: function(resp, options) {
      return resp;
    },

    // Create a new collection with an identical list of models as this one.
    clone: function() {
      return new this.constructor(this.models);
    },

    // Reset all internal state. Called when the collection is reset.
    _reset: function() {
      this.length = 0;
      this.models.length = 0;
      this._byId  = {};
    },

    // Prepare a model or hash of attributes to be added to this collection.
    _prepareModel: function(attrs, options) {
      if (attrs instanceof Model) {
        if (!attrs.collection) attrs.collection = this;
        return attrs;
      }
      options || (options = {});
      options.collection = this;
      var model = new this.model(attrs, options);
      if (!model._validate(attrs, options)) return false;
      return model;
    },

    // Internal method to remove a model's ties to a collection.
    _removeReference: function(model) {
      if (this === model.collection) delete model.collection;
      model.off('all', this._onModelEvent, this);
    },

    // Internal method called every time a model in the set fires an event.
    // Sets need to update their indexes when models change ids. All other
    // events simply proxy through. "add" and "remove" events that originate
    // in other collections are ignored.
    _onModelEvent: function(event, model, collection, options) {
      if ((event === 'add' || event === 'remove') && collection !== this) return;
      if (event === 'destroy') this.remove(model, options);
      if (model && event === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        if (model.id != null) this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    },

    sortedIndex: function (model, value, context) {
      value || (value = this.comparator);
      var iterator = _.isFunction(value) ? value : function(model) {
        return model.get(value);
      };
      return _.sortedIndex(this.models, model, iterator, context);
    }

  });

  // Underscore methods that we want to implement on the Collection.
  var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',
    'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',
    'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
    'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',
    'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle', 'lastIndexOf',
    'isEmpty', 'chain'];

  // Mix in each Underscore method as a proxy to `Collection#models`.
  _.each(methods, function(method) {
    Collection.prototype[method] = function() {
      var args = slice.call(arguments);
      args.unshift(this.models);
      return _[method].apply(_, args);
    };
  });

  // Underscore methods that take a property name as an argument.
  var attributeMethods = ['groupBy', 'countBy', 'sortBy'];

  // Use attributes instead of properties.
  _.each(attributeMethods, function(method) {
    Collection.prototype[method] = function(value, context) {
      var iterator = _.isFunction(value) ? value : function(model) {
        return model.get(value);
      };
      return _[method](this.models, iterator, context);
    };
  });

  // Backbone.Router
  // ---------------

  // Routers map faux-URLs to actions, and fire events when routes are
  // matched. Creating a new one sets its `routes` hash, if not set statically.
  var Router = Backbone.Router = function(options) {
    options || (options = {});
    if (options.routes) this.routes = options.routes;
    this._bindRoutes();
    this.initialize.apply(this, arguments);
  };

  // Cached regular expressions for matching named param parts and splatted
  // parts of route strings.
  var optionalParam = /\((.*?)\)/g;
  var namedParam    = /(\(\?)?:\w+/g;
  var splatParam    = /\*\w+/g;
  var escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#\s]/g;

  // Set up all inheritable **Backbone.Router** properties and methods.
  _.extend(Router.prototype, Events, {

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize: function(){},

    // Manually bind a single named route to a callback. For example:
    //
    //     this.route('search/:query/p:num', 'search', function(query, num) {
    //       ...
    //     });
    //
    route: function(route, name, callback) {
      if (!_.isRegExp(route)) route = this._routeToRegExp(route);
      if (!callback) callback = this[name];
      Backbone.history.route(route, _.bind(function(fragment) {
        var args = this._extractParameters(route, fragment);
        callback && callback.apply(this, args);
        this.trigger.apply(this, ['route:' + name].concat(args));
        this.trigger('route', name, args);
        Backbone.history.trigger('route', this, name, args);
      }, this));
      return this;
    },

    // Simple proxy to `Backbone.history` to save a fragment into the history.
    navigate: function(fragment, options) {
      Backbone.history.navigate(fragment, options);
      return this;
    },

    // Bind all defined routes to `Backbone.history`. We have to reverse the
    // order of the routes here to support behavior where the most general
    // routes can be defined at the bottom of the route map.
    _bindRoutes: function() {
      if (!this.routes) return;
      var route, routes = _.keys(this.routes);
      while ((route = routes.pop()) != null) {
        this.route(route, this.routes[route]);
      }
    },

    // Convert a route string into a regular expression, suitable for matching
    // against the current location hash.
    _routeToRegExp: function(route) {
      route = route.replace(escapeRegExp, '\\$&')
                   .replace(optionalParam, '(?:$1)?')
                   .replace(namedParam, function(match, optional){
                     return optional ? match : '([^\/]+)';
                   })
                   .replace(splatParam, '(.*?)');
      return new RegExp('^' + route + '$');
    },

    // Given a route, and a URL fragment that it matches, return the array of
    // extracted parameters.
    _extractParameters: function(route, fragment) {
      return route.exec(fragment).slice(1);
    }

  });

  // Backbone.History
  // ----------------

  // Handles cross-browser history management, based on URL fragments. If the
  // browser does not support `onhashchange`, falls back to polling.
  var History = Backbone.History = function() {
    this.handlers = [];
    _.bindAll(this, 'checkUrl');

    // Ensure that `History` can be used outside of the browser.
    if (typeof window !== 'undefined') {
      this.location = window.location;
      this.history = window.history;
    }
  };

  // Cached regex for stripping a leading hash/slash and trailing space.
  var routeStripper = /^[#\/]|\s+$/g;

  // Cached regex for stripping leading and trailing slashes.
  var rootStripper = /^\/+|\/+$/g;

  // Cached regex for detecting MSIE.
  var isExplorer = /msie [\w.]+/;

  // Cached regex for removing a trailing slash.
  var trailingSlash = /\/$/;

  // Has the history handling already been started?
  History.started = false;

  // Set up all inheritable **Backbone.History** properties and methods.
  _.extend(History.prototype, Events, {

    // The default interval to poll for hash changes, if necessary, is
    // twenty times a second.
    interval: 50,

    // Gets the true hash value. Cannot use location.hash directly due to bug
    // in Firefox where location.hash will always be decoded.
    getHash: function(window) {
      var match = (window || this).location.href.match(/#(.*)$/);
      return match ? match[1] : '';
    },

    // Get the cross-browser normalized URL fragment, either from the URL,
    // the hash, or the override.
    getFragment: function(fragment, forcePushState) {
      if (fragment == null) {
        if (this._hasPushState || !this._wantsHashChange || forcePushState) {
          fragment = this.location.pathname;
          var root = this.root.replace(trailingSlash, '');
          if (!fragment.indexOf(root)) fragment = fragment.substr(root.length);
        } else {
          fragment = this.getHash();
        }
      }
      return fragment.replace(routeStripper, '');
    },

    // Start the hash change handling, returning `true` if the current URL matches
    // an existing route, and `false` otherwise.
    start: function(options) {
      if (History.started) throw new Error("Backbone.history has already been started");
      History.started = true;

      // Figure out the initial configuration. Do we need an iframe?
      // Is pushState desired ... is it available?
      this.options          = _.extend({}, {root: '/'}, this.options, options);
      this.root             = this.options.root;
      this._wantsHashChange = this.options.hashChange !== false;
      this._wantsPushState  = !!this.options.pushState;
      this._hasPushState    = !!(this.options.pushState && this.history && this.history.pushState);
      var fragment          = this.getFragment();
      var docMode           = document.documentMode;
      var oldIE             = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));

      // Normalize root to always include a leading and trailing slash.
      this.root = ('/' + this.root + '/').replace(rootStripper, '/');

      if (oldIE && this._wantsHashChange) {
        this.iframe = Backbone.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo('body')[0].contentWindow;
        this.navigate(fragment);
      }

      // Depending on whether we're using pushState or hashes, and whether
      // 'onhashchange' is supported, determine how we check the URL state.
      if (this._hasPushState) {
        Backbone.$(window).on('popstate', this.checkUrl);
      } else if (this._wantsHashChange && ('onhashchange' in window) && !oldIE) {
        Backbone.$(window).on('hashchange', this.checkUrl);
      } else if (this._wantsHashChange) {
        this._checkUrlInterval = setInterval(this.checkUrl, this.interval);
      }

      // Determine if we need to change the base url, for a pushState link
      // opened by a non-pushState browser.
      this.fragment = fragment;
      var loc = this.location;
      var atRoot = loc.pathname.replace(/[^\/]$/, '$&/') === this.root;

      // If we've started off with a route from a `pushState`-enabled browser,
      // but we're currently in a browser that doesn't support it...
      if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !atRoot) {
        this.fragment = this.getFragment(null, true);
        this.location.replace(this.root + this.location.search + '#' + this.fragment);
        // Return immediately as browser will do redirect to new url
        return true;

      // Or if we've started out with a hash-based route, but we're currently
      // in a browser where it could be `pushState`-based instead...
      } else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
        this.fragment = this.getHash().replace(routeStripper, '');
        this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);
      }

      if (!this.options.silent) return this.loadUrl();
    },

    // Disable Backbone.history, perhaps temporarily. Not useful in a real app,
    // but possibly useful for unit testing Routers.
    stop: function() {
      Backbone.$(window).off('popstate', this.checkUrl).off('hashchange', this.checkUrl);
      clearInterval(this._checkUrlInterval);
      History.started = false;
    },

    // Add a route to be tested when the fragment changes. Routes added later
    // may override previous routes.
    route: function(route, callback) {
      this.handlers.unshift({route: route, callback: callback});
    },

    // Checks the current URL to see if it has changed, and if it has,
    // calls `loadUrl`, normalizing across the hidden iframe.
    checkUrl: function(e) {
      var current = this.getFragment();
      if (current === this.fragment && this.iframe) {
        current = this.getFragment(this.getHash(this.iframe));
      }
      if (current === this.fragment) return false;
      if (this.iframe) this.navigate(current);
      this.loadUrl() || this.loadUrl(this.getHash());
    },

    // Attempt to load the current URL fragment. If a route succeeds with a
    // match, returns `true`. If no defined routes matches the fragment,
    // returns `false`.
    loadUrl: function(fragmentOverride) {
      var fragment = this.fragment = this.getFragment(fragmentOverride);
      var matched = _.any(this.handlers, function(handler) {
        if (handler.route.test(fragment)) {
          handler.callback(fragment);
          return true;
        }
      });
      return matched;
    },

    // Save a fragment into the hash history, or replace the URL state if the
    // 'replace' option is passed. You are responsible for properly URL-encoding
    // the fragment in advance.
    //
    // The options object can contain `trigger: true` if you wish to have the
    // route callback be fired (not usually desirable), or `replace: true`, if
    // you wish to modify the current URL without adding an entry to the history.
    navigate: function(fragment, options) {
      if (!History.started) return false;
      if (!options || options === true) options = {trigger: options};
      fragment = this.getFragment(fragment || '');
      if (this.fragment === fragment) return;
      this.fragment = fragment;
      var url = this.root + fragment;

      // If pushState is available, we use it to set the fragment as a real URL.
      if (this._hasPushState) {
        this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);

      // If hash changes haven't been explicitly disabled, update the hash
      // fragment to store history.
      } else if (this._wantsHashChange) {
        this._updateHash(this.location, fragment, options.replace);
        if (this.iframe && (fragment !== this.getFragment(this.getHash(this.iframe)))) {
          // Opening and closing the iframe tricks IE7 and earlier to push a
          // history entry on hash-tag change.  When replace is true, we don't
          // want this.
          if(!options.replace) this.iframe.document.open().close();
          this._updateHash(this.iframe.location, fragment, options.replace);
        }

      // If you've told us that you explicitly don't want fallback hashchange-
      // based history, then `navigate` becomes a page refresh.
      } else {
        return this.location.assign(url);
      }
      if (options.trigger) this.loadUrl(fragment);
    },

    // Update the hash location, either replacing the current entry, or adding
    // a new one to the browser history.
    _updateHash: function(location, fragment, replace) {
      if (replace) {
        var href = location.href.replace(/(javascript:|#).*$/, '');
        location.replace(href + '#' + fragment);
      } else {
        // Some browsers require that `hash` contains a leading #.
        location.hash = '#' + fragment;
      }
    }

  });

  // Create the default Backbone.history.
  Backbone.history = new History;

  // Backbone.View
  // -------------

  // Creating a Backbone.View creates its initial element outside of the DOM,
  // if an existing element is not provided...
  var View = Backbone.View = function(options) {
    this.cid = _.uniqueId('view');
    this._configure(options || {});
    this._ensureElement();
    this.initialize.apply(this, arguments);
    this.delegateEvents();
  };

  // Cached regex to split keys for `delegate`.
  var delegateEventSplitter = /^(\S+)\s*(.*)$/;

  // List of view options to be merged as properties.
  var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];

  // Set up all inheritable **Backbone.View** properties and methods.
  _.extend(View.prototype, Events, {

    // The default `tagName` of a View's element is `"div"`.
    tagName: 'div',

    // jQuery delegate for element lookup, scoped to DOM elements within the
    // current view. This should be prefered to global lookups where possible.
    $: function(selector) {
      return this.$el.find(selector);
    },

    // Initialize is an empty function by default. Override it with your own
    // initialization logic.
    initialize: function(){},

    // **render** is the core function that your view should override, in order
    // to populate its element (`this.el`), with the appropriate HTML. The
    // convention is for **render** to always return `this`.
    render: function() {
      return this;
    },

    // Remove this view by taking the element out of the DOM, and removing any
    // applicable Backbone.Events listeners.
    remove: function() {
      this.$el.remove();
      this.stopListening();
      return this;
    },

    // Change the view's element (`this.el` property), including event
    // re-delegation.
    setElement: function(element, delegate) {
      if (this.$el) this.undelegateEvents();
      this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);
      this.el = this.$el[0];
      if (delegate !== false) this.delegateEvents();
      return this;
    },

    // Set callbacks, where `this.events` is a hash of
    //
    // *{"event selector": "callback"}*
    //
    //     {
    //       'mousedown .title':  'edit',
    //       'click .button':     'save'
    //       'click .open':       function(e) { ... }
    //     }
    //
    // pairs. Callbacks will be bound to the view, with `this` set properly.
    // Uses event delegation for efficiency.
    // Omitting the selector binds the event to `this.el`.
    // This only works for delegate-able events: not `focus`, `blur`, and
    // not `change`, `submit`, and `reset` in Internet Explorer.
    delegateEvents: function(events) {
      if (!(events || (events = _.result(this, 'events')))) return;
      this.undelegateEvents();
      for (var key in events) {
        var method = events[key];
        if (!_.isFunction(method)) method = this[events[key]];
        if (!method) throw new Error('Method "' + events[key] + '" does not exist');
        var match = key.match(delegateEventSplitter);
        var eventName = match[1], selector = match[2];
        method = _.bind(method, this);
        eventName += '.delegateEvents' + this.cid;
        if (selector === '') {
          this.$el.on(eventName, method);
        } else {
          this.$el.on(eventName, selector, method);
        }
      }
    },

    // Clears all callbacks previously bound to the view with `delegateEvents`.
    // You usually don't need to use this, but may wish to if you have multiple
    // Backbone views attached to the same DOM element.
    undelegateEvents: function() {
      this.$el.off('.delegateEvents' + this.cid);
    },

    // Performs the initial configuration of a View with a set of options.
    // Keys with special meaning *(model, collection, id, className)*, are
    // attached directly to the view.
    _configure: function(options) {
      if (this.options) options = _.extend({}, _.result(this, 'options'), options);
      _.extend(this, _.pick(options, viewOptions));
      this.options = options;
    },

    // Ensure that the View has a DOM element to render into.
    // If `this.el` is a string, pass it through `$()`, take the first
    // matching element, and re-assign it to `el`. Otherwise, create
    // an element from the `id`, `className` and `tagName` properties.
    _ensureElement: function() {
      if (!this.el) {
        var attrs = _.extend({}, _.result(this, 'attributes'));
        if (this.id) attrs.id = _.result(this, 'id');
        if (this.className) attrs['class'] = _.result(this, 'className');
        var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);
        this.setElement($el, false);
      } else {
        this.setElement(_.result(this, 'el'), false);
      }
    }

  });

  // Backbone.sync
  // -------------

  // Map from CRUD to HTTP for our default `Backbone.sync` implementation.
  var methodMap = {
    'create': 'POST',
    'update': 'PUT',
    'patch':  'PATCH',
    'delete': 'DELETE',
    'read':   'GET'
  };

  // Override this function to change the manner in which Backbone persists
  // models to the server. You will be passed the type of request, and the
  // model in question. By default, makes a RESTful Ajax request
  // to the model's `url()`. Some possible customizations could be:
  //
  // * Use `setTimeout` to batch rapid-fire updates into a single request.
  // * Send up the models as XML instead of JSON.
  // * Persist models via WebSockets instead of Ajax.
  //
  // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests
  // as `POST`, with a `_method` parameter containing the true HTTP method,
  // as well as all requests with the body as `application/x-www-form-urlencoded`
  // instead of `application/json` with the model in a param named `model`.
  // Useful when interfacing with server-side languages like **PHP** that make
  // it difficult to read the body of `PUT` requests.
  Backbone.sync = function(method, model, options) {
    var type = methodMap[method];

    // Default options, unless specified.
    _.defaults(options || (options = {}), {
      emulateHTTP: Backbone.emulateHTTP,
      emulateJSON: Backbone.emulateJSON
    });

    // Default JSON-request options.
    var params = {type: type, dataType: 'json'};

    // Ensure that we have a URL.
    if (!options.url) {
      params.url = _.result(model, 'url') || urlError();
    }

    // Ensure that we have the appropriate request data.
    if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
      params.contentType = 'application/json';
      params.data = JSON.stringify(options.attrs || model.toJSON(options));
    }

    // For older servers, emulate JSON by encoding the request into an HTML-form.
    if (options.emulateJSON) {
      params.contentType = 'application/x-www-form-urlencoded';
      params.data = params.data ? {model: params.data} : {};
    }

    // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
    // And an `X-HTTP-Method-Override` header.
    if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
      params.type = 'POST';
      if (options.emulateJSON) params.data._method = type;
      var beforeSend = options.beforeSend;
      options.beforeSend = function(xhr) {
        xhr.setRequestHeader('X-HTTP-Method-Override', type);
        if (beforeSend) return beforeSend.apply(this, arguments);
      };
    }

    // Don't process data on a non-GET request.
    if (params.type !== 'GET' && !options.emulateJSON) {
      params.processData = false;
    }

    var success = options.success;
    options.success = function(resp) {
      if (success) success(model, resp, options);
      model.trigger('sync', model, resp, options);
    };

    var error = options.error;
    options.error = function(xhr) {
      if (error) error(model, xhr, options);
      model.trigger('error', model, xhr, options);
    };

    // Make the request, allowing the user to override any Ajax options.
    var xhr = options.xhr = Backbone.ajax(_.extend(params, options));
    model.trigger('request', model, xhr, options);
    return xhr;
  };

  // Set the default implementation of `Backbone.ajax` to proxy through to `$`.
  Backbone.ajax = function() {
    return Backbone.$.ajax.apply(Backbone.$, arguments);
  };

  // Helpers
  // -------

  // Helper function to correctly set up the prototype chain, for subclasses.
  // Similar to `goog.inherits`, but uses a hash of prototype properties and
  // class properties to be extended.
  var extend = function(protoProps, staticProps) {
    var parent = this;
    var child;

    // The constructor function for the new subclass is either defined by you
    // (the "constructor" property in your `extend` definition), or defaulted
    // by us to simply call the parent's constructor.
    if (protoProps && _.has(protoProps, 'constructor')) {
      child = protoProps.constructor;
    } else {
      child = function(){ return parent.apply(this, arguments); };
    }

    // Add static properties to the constructor function, if supplied.
    _.extend(child, parent, staticProps);

    // Set the prototype chain to inherit from `parent`, without calling
    // `parent`'s constructor function.
    var Surrogate = function(){ this.constructor = child; };
    Surrogate.prototype = parent.prototype;
    child.prototype = new Surrogate;

    // Add prototype properties (instance properties) to the subclass,
    // if supplied.
    if (protoProps) _.extend(child.prototype, protoProps);

    // Set a convenience property in case the parent's prototype is needed
    // later.
    child.__super__ = parent.prototype;

    return child;
  };

  // Set up inheritance for the model, collection, router, view and history.
  Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;

  // Throw an error when a URL is needed, and none is supplied.
  var urlError = function() {
    throw new Error('A "url" property or function must be specified');
  };

}).call(this);;
// Backbone.CrossDomainModel 0.1.0
//
// (c) 2013 Victor Quinn
// Licensed under the MIT license.

(function (root, factory) {
   if (typeof define === "function" && define.amd) {
      // AMD. Register as an anonymous module.
      define(["underscore","backbone"], function(_, Backbone) {
        // Use global variables if the locals are undefined.
        return factory(_ || root._, Backbone || root.Backbone);
      });
   } else if (typeof module === "object" && typeof exports === "object") {
      module.exports = factory(require("underscore"), require("backbone"));
   } else {
      // RequireJS isn't being used. Assume underscore and backbone are loaded in <script> tags
      factory(_, Backbone);
   }
}(this, function(_, Backbone) {

    // Helper function to determine the request url given model and options objects
    function requestUrl(model, options) {
        var requestUrl = null;
        // First try the options object
        try {
            requestUrl = options.url;
        } catch(x) {}

        // Then try the model's url
        if (!requestUrl) {
            try {
                requestUrl = _.result(model, 'url');
            } catch(x) {}
        }

        return requestUrl;
    }

    // Helper function to determine whether protocols differ.
    function protocolsDiffer(thisProtocol, requestProtocol) {
        if (thisProtocol === ':' || requestProtocol === ":") {
            return false;
        }

        else if (thisProtocol === requestProtocol) {
            return false;
        }

        return true;
    }

    // Map from CRUD to HTTP for our default `Backbone.sync` implementation.

    var methodMap = {
        'create': 'POST',
        'update': 'PUT',
        'patch':  'PATCH',
        'delete': 'DELETE',
        'read':   'GET'
    };

    Backbone.vanillaSync = Backbone.sync;

    // Override 'Backbone.sync' to default to CrossDomainModel sync.
    // the original 'Backbone.sync' is still available in 'Backbone.vanillaSync'
    Backbone.sync = function(method, model, options) {

        // avoid to enter in conflict with jsonp mechanism
        if (options.dataType === 'jsonp') {
            return Backbone.vanillaSync.apply(this, arguments);
        }

        // See if we need to use the XDomainRequest object for IE. If the request is on the
        // same domain, we can fall back on the normal Backbone.ajax handling.
        var useXDomainRequest = false;

        // See https://gist.github.com/jlong/2428561
        var thisDomainParser = document.createElement('a');
        thisDomainParser.href = document.URL;

        var requestDomainParser = document.createElement('a');
        requestDomainParser.href = requestUrl(model, options);

        if (requestDomainParser.host !== "" && (thisDomainParser.host !== requestDomainParser.host)) {
            useXDomainRequest = true;
        }

        // Only use this if browser doesn't support CORS natively. This should
        // catch IE7/8/9 but keep IE10 using the built in XMLHttpRequest which
        // IE10 finally supports for CORS.
        if (useXDomainRequest && !Backbone.$.support.cors) {

            // See this article for more details on all the silly nuances: http://vq.io/14DJ1Tv

            // Basically Backbone.sync rewritten to use XDomainRequest object
            var type = methodMap[method];

            // Default options, unless specified.
            _.defaults(options || (options = {}), {
                emulateHTTP: Backbone.emulateHTTP,
                emulateJSON: Backbone.emulateJSON
            });

            // XDomainRequest only works with POST. So DELETE/PUT/PATCH can't work here.

            // Note: Conscious decision to throw error rather than try to munge the request and
            // do something like force "options.emulateHTTP = true" because we want developers
            // to notice they're trying to do something illegal with this request and it may
            // require server-side changes for compatibility.
            if (!options.emulateHTTP && (method === 'update' || method === 'patch' || method === 'delete')) {
                throw new Error('Backbone.CrossDomain cannot use PUT, PATCH, DELETE with XDomainRequest (IE) and emulateHTTP=false');
            }

            // Default JSON-request options.
            var params = {type: type, dataType: 'json', url: requestUrl(model, options)};

            // Ensure that we have a URL.
            if (!params.url) throw new Error('No URL!');

            // Check if protocols differ, if so try the request with the current domain protocol
            if (protocolsDiffer(thisDomainParser.protocol, requestDomainParser.protocol)) {
                params.url = params.url.replace(new RegExp(requestDomainParser.protocol), thisDomainParser.protocol);
            }

            // TODO: XDomainRequest only accepts text/plain Content-Type header

            // TODO: XDomainRequest doesn't like other headers

            // Ensure that we have the appropriate request data.
            if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
                params.data = JSON.stringify(options.attrs || model.toJSON(options));
            }

            // For older servers, emulate JSON by encoding the request into an HTML-form.
            if (options.emulateJSON) {
                params.data = params.data ? {model: params.data} : {};
            }

            // For older servers, emulate HTTP by mimicking the HTTP method with `_method`
            // And an `X-HTTP-Method-Override` header.

            if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {
                params.type = 'POST';
                if (options.emulateJSON) params.data._method = type;
                var beforeSend = options.beforeSend;
                options.beforeSend = function(xhr) {
                    if (beforeSend) return beforeSend.apply(this, arguments);
                };
            }

            // Don't process data on a non-GET request.
            if (params.type !== 'GET' && !options.emulateJSON) {
                params.processData = false;
            }

            // Need to send this along as key/value pairs, can't send JSON blob
            if (params.type === 'POST') {
                params.data = Backbone.$.param(Backbone.$.parseJSON(params.data));
            }

            // Append the .data parameters to the url of GET request
            if (params.type === 'GET' && !_.include(params.url, '?') && options.data ){
                params.url += '?' + Backbone.$.param(options.data);
            }

            var xdr = options.xhr = new XDomainRequest(),
                success = options.success,
                error = options.error;

            // Attach deferreds, but only if $ is jQuery (if we don't do this check,
            // we'll break support for Zepto or other libraries without promise support
            if (Backbone.$.fn.jquery) {
                var deferred = Backbone.$.Deferred(),
                    completeDeferred = Backbone.$.Callbacks("once memory");
                deferred.promise(xdr).complete = completeDeferred.add;
            }

            xdr.onload = function () {
                var obj = {};
                if (xdr.responseText) {
                    obj = Backbone.$.parseJSON(xdr.responseText);
                }
                if (obj) {
                    success(obj);
                    if(deferred) deferred.resolveWith(this, [obj, 'success', xdr]);
                }
            };
            xdr.onerror = function () {
                if (error) {
                    error(model, xdr, options);
                   if(deferred) deferred.rejectWith(this, [xdr, 'error', error]);
                }
                model.trigger('error', model, xdr, options);
            };

            // Make the request using XDomainRequest
            xdr.open(params.type, params.url);

            // Must declare these even if empty or IE will abort randomly: http://vq.io/12bnhye
            xdr.onprogress = function () {};
            xdr.ontimeout = function () {};

            setTimeout(function () {
                xdr.send(params.data);
            }, 0);

            model.trigger('request', model, xdr, options);
            return xdr;
        }
        else {
            return Backbone.vanillaSync.apply(this, arguments);
        }
    };

    return Backbone;
}));
;
/*! Hammer.JS - v2.0.8 - 2016-04-23
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */
!function(a,b,c,d){"use strict";if(typeof Object.create !== 'function'){return;}function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d),b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}function v(){return ua++}function w(b){var c=b.ownerDocument||b;return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,b.rotation=g?J(g.pointers,d):0,b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{}),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend","Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart",_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute",hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;Y.prototype={defaults:{},set:function(a){return la(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),this._super.attrTest.call(this,a)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ib]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ha.VERSION="2.0.8",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,"function"==typeof define&&define.amd?define(function(){return ha}):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
//# sourceMappingURL=hammer.min.js.map;
/*! jQuery plugin for Hammer.JS - v1.0.5 - 2014-03-18
 * http://eightmedia.github.com/hammer.js
 *
 * Copyright (c) 2014 Jorik Tangelder <j.tangelder@gmail.com>;
 * Licensed under the MIT license */
(function(window, undefined) {
  'use strict';

/**
 * Hammer
 * use this to create instances
 * @param   {HTMLElement}   element
 * @param   {Object}        options
 * @returns {Hammer.Instance}
 * @constructor
 */
var Hammer = function(element, options) {
  return new Hammer.Instance(element, options || {});
};

// default settings
Hammer.defaults = {
  // add styles and attributes to the element to prevent the browser from doing
  // its native behavior. this doesnt prevent the scrolling, but cancels
  // the contextmenu, tap highlighting etc
  // set to false to disable this
  stop_browser_behavior: {
    // this also triggers onselectstart=false for IE
    userSelect       : 'none',
    // this makes the element blocking in IE10 >, you could experiment with the value
    // see for more options this issue; https://github.com/EightMedia/hammer.js/issues/241
    touchAction      : 'none',
    touchCallout     : 'none',
    contentZooming   : 'none',
    userDrag         : 'none',
    tapHighlightColor: 'rgba(0,0,0,0)'
  }

  //
  // more settings are defined per gesture at gestures.js
  //
};


// detect touchevents
Hammer.HAS_POINTEREVENTS = window.navigator.pointerEnabled || window.navigator.msPointerEnabled;
Hammer.HAS_TOUCHEVENTS = ('ontouchstart' in window);

// dont use mouseevents on mobile devices
Hammer.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android|silk/i;
Hammer.NO_MOUSEEVENTS = Hammer.HAS_TOUCHEVENTS && window.navigator.userAgent.match(Hammer.MOBILE_REGEX);

// eventtypes per touchevent (start, move, end)
// are filled by Event.determineEventTypes on setup
Hammer.EVENT_TYPES = {};

// interval in which Hammer recalculates current velocity in ms
Hammer.UPDATE_VELOCITY_INTERVAL = 16;

// hammer document where the base events are added at
Hammer.DOCUMENT = window.document;

// define these also as vars, for internal usage.
// direction defines
var DIRECTION_DOWN = Hammer.DIRECTION_DOWN = 'down';
var DIRECTION_LEFT = Hammer.DIRECTION_LEFT = 'left';
var DIRECTION_UP = Hammer.DIRECTION_UP = 'up';
var DIRECTION_RIGHT = Hammer.DIRECTION_RIGHT = 'right';

// pointer type
var POINTER_MOUSE = Hammer.POINTER_MOUSE = 'mouse';
var POINTER_TOUCH = Hammer.POINTER_TOUCH = 'touch';
var POINTER_PEN = Hammer.POINTER_PEN = 'pen';

// touch event defines
var EVENT_START = Hammer.EVENT_START = 'start';
var EVENT_MOVE = Hammer.EVENT_MOVE = 'move';
var EVENT_END = Hammer.EVENT_END = 'end';


// plugins and gestures namespaces
Hammer.plugins = Hammer.plugins || {};
Hammer.gestures = Hammer.gestures || {};


// if the window events are set...
Hammer.READY = false;

/**
 * setup events to detect gestures on the document
 */
function setup() {
  if(Hammer.READY) {
    return;
  }

  // find what eventtypes we add listeners to
  Event.determineEventTypes();

  // Register all gestures inside Hammer.gestures
  Utils.each(Hammer.gestures, function(gesture){
    Detection.register(gesture);
  });

  // Add touch events on the document
  Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);
  Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);

  // Hammer is ready...!
  Hammer.READY = true;
}

var Utils = Hammer.utils = {
  /**
   * extend method,
   * also used for cloning when dest is an empty object
   * @param   {Object}    dest
   * @param   {Object}    src
   * @parm  {Boolean}  merge    do a merge
   * @returns {Object}    dest
   */
  extend: function extend(dest, src, merge) {
    for(var key in src) {
      if(dest[key] !== undefined && merge) {
        continue;
      }
      dest[key] = src[key];
    }
    return dest;
  },


  /**
   * for each
   * @param obj
   * @param iterator
   */
  each: function(obj, iterator, context) {
    var i, o;
    // native forEach on arrays
    if ('forEach' in obj) {
      obj.forEach(iterator, context);
    }
    // arrays
    else if(obj.length !== undefined) {
      for(i=-1; (o=obj[++i]);) {
        if (iterator.call(context, o, i, obj) === false) {
          return;
        }
      }
    }
    // objects
    else {
      for(i in obj) {
        if(obj.hasOwnProperty(i) &&
            iterator.call(context, obj[i], i, obj) === false) {
          return;
        }
      }
    }
  },

  /**
   * find if a node is in the given parent
   * used for event delegation tricks
   * @param   {HTMLElement}   node
   * @param   {HTMLElement}   parent
   * @returns {boolean}       has_parent
   */
  hasParent: function(node, parent) {
    while(node) {
      if(node == parent) {
        return true;
      }
      node = node.parentNode;
    }
    return false;
  },


  /**
   * get the center of all the touches
   * @param   {Array}     touches
   * @returns {Object}    center
   */
  getCenter: function getCenter(touches) {
    var valuesX = [], valuesY = [];

    Utils.each(touches, function(touch) {
      // I prefer clientX because it ignore the scrolling position
      valuesX.push(typeof touch.clientX !== 'undefined' ? touch.clientX : touch.pageX);
      valuesY.push(typeof touch.clientY !== 'undefined' ? touch.clientY : touch.pageY);
    });

    return {
      pageX: (Math.min.apply(Math, valuesX) + Math.max.apply(Math, valuesX)) / 2,
      pageY: (Math.min.apply(Math, valuesY) + Math.max.apply(Math, valuesY)) / 2
    };
  },


  /**
   * calculate the velocity between two points
   * @param   {Number}    delta_time
   * @param   {Number}    delta_x
   * @param   {Number}    delta_y
   * @returns {Object}    velocity
   */
  getVelocity: function getVelocity(delta_time, delta_x, delta_y) {
    return {
      x: Math.abs(delta_x / delta_time) || 0,
      y: Math.abs(delta_y / delta_time) || 0
    };
  },


  /**
   * calculate the angle between two coordinates
   * @param   {Touch}     touch1
   * @param   {Touch}     touch2
   * @returns {Number}    angle
   */
  getAngle: function getAngle(touch1, touch2) {
    var y = touch2.pageY - touch1.pageY
      , x = touch2.pageX - touch1.pageX;
    return Math.atan2(y, x) * 180 / Math.PI;
  },


  /**
   * angle to direction define
   * @param   {Touch}     touch1
   * @param   {Touch}     touch2
   * @returns {String}    direction constant, like DIRECTION_LEFT
   */
  getDirection: function getDirection(touch1, touch2) {
    var x = Math.abs(touch1.pageX - touch2.pageX)
      , y = Math.abs(touch1.pageY - touch2.pageY);
    if(x >= y) {
      return touch1.pageX - touch2.pageX > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
    }
    return touch1.pageY - touch2.pageY > 0 ? DIRECTION_UP : DIRECTION_DOWN;
  },


  /**
   * calculate the distance between two touches
   * @param   {Touch}     touch1
   * @param   {Touch}     touch2
   * @returns {Number}    distance
   */
  getDistance: function getDistance(touch1, touch2) {
    var x = touch2.pageX - touch1.pageX
      , y = touch2.pageY - touch1.pageY;
    return Math.sqrt((x * x) + (y * y));
  },


  /**
   * calculate the scale factor between two touchLists (fingers)
   * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
   * @param   {Array}     start
   * @param   {Array}     end
   * @returns {Number}    scale
   */
  getScale: function getScale(start, end) {
    // need two fingers...
    if(start.length >= 2 && end.length >= 2) {
      return this.getDistance(end[0], end[1]) / this.getDistance(start[0], start[1]);
    }
    return 1;
  },


  /**
   * calculate the rotation degrees between two touchLists (fingers)
   * @param   {Array}     start
   * @param   {Array}     end
   * @returns {Number}    rotation
   */
  getRotation: function getRotation(start, end) {
    // need two fingers
    if(start.length >= 2 && end.length >= 2) {
      return this.getAngle(end[1], end[0]) - this.getAngle(start[1], start[0]);
    }
    return 0;
  },


  /**
   * boolean if the direction is vertical
   * @param    {String}    direction
   * @returns  {Boolean}   is_vertical
   */
  isVertical: function isVertical(direction) {
    return direction == DIRECTION_UP || direction == DIRECTION_DOWN;
  },


  /**
   * toggle browser default behavior with css props
   * @param   {HtmlElement}   element
   * @param   {Object}        css_props
   * @param   {Boolean}       toggle
   */
  toggleDefaultBehavior: function toggleDefaultBehavior(element, css_props, toggle) {
    if(!css_props || !element || !element.style) {
      return;
    }

    // with css properties for modern browsers
    Utils.each(['webkit', 'moz', 'Moz', 'ms', 'o', ''], function(vendor) {
      Utils.each(css_props, function(value, prop) {
          // vender prefix at the property
          if(vendor) {
            prop = vendor + prop.substring(0, 1).toUpperCase() + prop.substring(1);
          }
          // set the style
          if(prop in element.style) {
            element.style[prop] = !toggle && value;
          }
      });
    });

    var false_fn = function(){ return false; };

    // also the disable onselectstart
    if(css_props.userSelect == 'none') {
      element.onselectstart = !toggle && false_fn;
    }
    // and disable ondragstart
    if(css_props.userDrag == 'none') {
      element.ondragstart = !toggle && false_fn;
    }
  }
};


/**
 * create new hammer instance
 * all methods should return the instance itself, so it is chainable.
 * @param   {HTMLElement}       element
 * @param   {Object}            [options={}]
 * @returns {Hammer.Instance}
 * @constructor
 */
Hammer.Instance = function(element, options) {
  var self = this;

  // setup HammerJS window events and register all gestures
  // this also sets up the default options
  setup();

  this.element = element;

  // start/stop detection option
  this.enabled = true;

  // merge options
  this.options = Utils.extend(
    Utils.extend({}, Hammer.defaults),
    options || {});

  // add some css to the element to prevent the browser from doing its native behavoir
  if(this.options.stop_browser_behavior) {
    Utils.toggleDefaultBehavior(this.element, this.options.stop_browser_behavior, false);
  }

  // start detection on touchstart
  this.eventStartHandler = Event.onTouch(element, EVENT_START, function(ev) {
    if(self.enabled) {
      Detection.startDetect(self, ev);
    }
  });

  // keep a list of user event handlers which needs to be removed when calling 'dispose'
  this.eventHandlers = [];

  // return instance
  return this;
};


Hammer.Instance.prototype = {
  /**
   * bind events to the instance
   * @param   {String}      gesture
   * @param   {Function}    handler
   * @returns {Hammer.Instance}
   */
  on: function onEvent(gesture, handler) {
    var gestures = gesture.split(' ');
    Utils.each(gestures, function(gesture) {
      this.element.addEventListener(gesture, handler, false);
      this.eventHandlers.push({ gesture: gesture, handler: handler });
    }, this);
    return this;
  },


  /**
   * unbind events to the instance
   * @param   {String}      gesture
   * @param   {Function}    handler
   * @returns {Hammer.Instance}
   */
  off: function offEvent(gesture, handler) {
    var gestures = gesture.split(' ')
      , i, eh;
    Utils.each(gestures, function(gesture) {
      this.element.removeEventListener(gesture, handler, false);

      // remove the event handler from the internal list
      for(i=-1; (eh=this.eventHandlers[++i]);) {
        if(eh.gesture === gesture && eh.handler === handler) {
          this.eventHandlers.splice(i, 1);
        }
      }
    }, this);
    return this;
  },


  /**
   * trigger gesture event
   * @param   {String}      gesture
   * @param   {Object}      [eventData]
   * @returns {Hammer.Instance}
   */
  trigger: function triggerEvent(gesture, eventData) {
    // optional
    if(!eventData) {
      eventData = {};
    }

    // create DOM event
    var event = Hammer.DOCUMENT.createEvent('Event');
    event.initEvent(gesture, true, true);
    event.gesture = eventData;

    // trigger on the target if it is in the instance element,
    // this is for event delegation tricks
    var element = this.element;
    if(Utils.hasParent(eventData.target, element)) {
      element = eventData.target;
    }

    element.dispatchEvent(event);
    return this;
  },


  /**
   * enable of disable hammer.js detection
   * @param   {Boolean}   state
   * @returns {Hammer.Instance}
   */
  enable: function enable(state) {
    this.enabled = state;
    return this;
  },


  /**
   * dispose this hammer instance
   * @returns {Hammer.Instance}
   */
  dispose: function dispose() {
    var i, eh;

    // undo all changes made by stop_browser_behavior
    if(this.options.stop_browser_behavior) {
      Utils.toggleDefaultBehavior(this.element, this.options.stop_browser_behavior, true);
    }

    // unbind all custom event handlers
    for(i=-1; (eh=this.eventHandlers[++i]);) {
      this.element.removeEventListener(eh.gesture, eh.handler, false);
    }
    this.eventHandlers = [];

    // unbind the start event listener
    Event.unbindDom(this.element, Hammer.EVENT_TYPES[EVENT_START], this.eventStartHandler);

    return null;
  }
};


/**
 * this holds the last move event,
 * used to fix empty touchend issue
 * see the onTouch event for an explanation
 * @type {Object}
 */
var last_move_event = null;

/**
 * when the mouse is hold down, this is true
 * @type {Boolean}
 */
var enable_detect = false;

/**
 * when touch events have been fired, this is true
 * @type {Boolean}
 */
var touch_triggered = false;

var Event = Hammer.event = {
  /**
   * simple addEventListener
   * @param   {HTMLElement}   element
   * @param   {String}        type
   * @param   {Function}      handler
   */
  bindDom: function(element, type, handler) {
    var types = type.split(' ');
    Utils.each(types, function(type){
      element.addEventListener(type, handler, false);
    });
  },


  /**
   * simple removeEventListener
   * @param   {HTMLElement}   element
   * @param   {String}        type
   * @param   {Function}      handler
   */
  unbindDom: function(element, type, handler) {
    var types = type.split(' ');
    Utils.each(types, function(type){
      element.removeEventListener(type, handler, false);
    });
  },


  /**
   * touch events with mouse fallback
   * @param   {HTMLElement}   element
   * @param   {String}        eventType        like EVENT_MOVE
   * @param   {Function}      handler
   */
  onTouch: function onTouch(element, eventType, handler) {
    var self = this;

    var bindDomOnTouch = function(ev) {
      var srcEventType = ev.type.toLowerCase();

      // onmouseup, but when touchend has been fired we do nothing.
      // this is for touchdevices which also fire a mouseup on touchend
      if(srcEventType.match(/mouse/) && touch_triggered) {
        return;
      }

      // mousebutton must be down or a touch event
      else if(srcEventType.match(/touch/) ||   // touch events are always on screen
        srcEventType.match(/pointerdown/) || // pointerevents touch
        (srcEventType.match(/mouse/) && ev.which === 1)   // mouse is pressed
        ) {
        enable_detect = true;
      }

      // mouse isn't pressed
      else if(srcEventType.match(/mouse/) && !ev.which) {
        enable_detect = false;
      }


      // we are in a touch event, set the touch triggered bool to true,
      // this for the conflicts that may occur on ios and android
      if(srcEventType.match(/touch|pointer/)) {
        touch_triggered = true;
      }

      // count the total touches on the screen
      var count_touches = 0;

      // when touch has been triggered in this detection session
      // and we are now handling a mouse event, we stop that to prevent conflicts
      if(enable_detect) {
        // update pointerevent
        if(Hammer.HAS_POINTEREVENTS && eventType != EVENT_END) {
          count_touches = PointerEvent.updatePointer(eventType, ev);
        }
        // touch
        else if(srcEventType.match(/touch/)) {
          count_touches = ev.touches.length;
        }
        // mouse
        else if(!touch_triggered) {
          count_touches = srcEventType.match(/up/) ? 0 : 1;
        }

        // if we are in a end event, but when we remove one touch and
        // we still have enough, set eventType to move
        if(count_touches > 0 && eventType == EVENT_END) {
          eventType = EVENT_MOVE;
        }
        // no touches, force the end event
        else if(!count_touches) {
          eventType = EVENT_END;
        }

        // store the last move event
        if(count_touches || last_move_event === null) {
          last_move_event = ev;
        }

        // trigger the handler
        handler.call(Detection, self.collectEventData(element, eventType,
                                         self.getTouchList(last_move_event, eventType),
                                         ev));

        // remove pointerevent from list
        if(Hammer.HAS_POINTEREVENTS && eventType == EVENT_END) {
          count_touches = PointerEvent.updatePointer(eventType, ev);
        }
      }

      // on the end we reset everything
      if(!count_touches) {
        last_move_event = null;
        enable_detect = false;
        touch_triggered = false;
        PointerEvent.reset();
      }
    };

    this.bindDom(element, Hammer.EVENT_TYPES[eventType], bindDomOnTouch);

    // return the bound function to be able to unbind it later
    return bindDomOnTouch;
  },


  /**
   * we have different events for each device/browser
   * determine what we need and set them in the Hammer.EVENT_TYPES constant
   */
  determineEventTypes: function determineEventTypes() {
    // determine the eventtype we want to set
    var types;

    // pointerEvents magic
    if(Hammer.HAS_POINTEREVENTS) {
      types = PointerEvent.getEvents();
    }
    // on Android, iOS, blackberry, windows mobile we dont want any mouseevents
    else if(Hammer.NO_MOUSEEVENTS) {
      types = [
        'touchstart',
        'touchmove',
        'touchend touchcancel'];
    }
    // for non pointer events browsers and mixed browsers,
    // like chrome on windows8 touch laptop
    else {
      types = [
        'touchstart mousedown',
        'touchmove mousemove',
        'touchend touchcancel mouseup'];
    }

    Hammer.EVENT_TYPES[EVENT_START] = types[0];
    Hammer.EVENT_TYPES[EVENT_MOVE] = types[1];
    Hammer.EVENT_TYPES[EVENT_END] = types[2];
  },


  /**
   * create touchlist depending on the event
   * @param   {Object}    ev
   * @param   {String}    eventType   used by the fakemultitouch plugin
   */
  getTouchList: function getTouchList(ev/*, eventType*/) {
    // get the fake pointerEvent touchlist
    if(Hammer.HAS_POINTEREVENTS) {
      return PointerEvent.getTouchList();
    }

    // get the touchlist
    if(ev.touches) {
      return ev.touches;
    }

    // make fake touchlist from mouse position
    ev.identifier = 1;
    return [ev];
  },


  /**
   * collect event data for Hammer js
   * @param   {HTMLElement}   element
   * @param   {String}        eventType        like EVENT_MOVE
   * @param   {Object}        eventData
   */
  collectEventData: function collectEventData(element, eventType, touches, ev) {
    // find out pointerType
    var pointerType = POINTER_TOUCH;
    if(ev.type.match(/mouse/) || PointerEvent.matchType(POINTER_MOUSE, ev)) {
      pointerType = POINTER_MOUSE;
    }

    return {
      center     : Utils.getCenter(touches),
      timeStamp  : new Date().getTime(),
      target     : ev.target,
      touches    : touches,
      eventType  : eventType,
      pointerType: pointerType,
      srcEvent   : ev,

      /**
       * prevent the browser default actions
       * mostly used to disable scrolling of the browser
       */
      preventDefault: function() {
        if(this.srcEvent.preventManipulation) {
          this.srcEvent.preventManipulation();
        }

        if(this.srcEvent.preventDefault) {
          this.srcEvent.preventDefault();
        }
      },

      /**
       * stop bubbling the event up to its parents
       */
      stopPropagation: function() {
        this.srcEvent.stopPropagation();
      },

      /**
       * immediately stop gesture detection
       * might be useful after a swipe was detected
       * @return {*}
       */
      stopDetect: function() {
        return Detection.stopDetect();
      }
    };
  }
};

var PointerEvent = Hammer.PointerEvent = {
  /**
   * holds all pointers
   * @type {Object}
   */
  pointers: {},

  /**
   * get a list of pointers
   * @returns {Array}     touchlist
   */
  getTouchList: function() {
    var touchlist = [];
    // we can use forEach since pointerEvents only is in IE10
    Utils.each(this.pointers, function(pointer){
      touchlist.push(pointer);
    });

    return touchlist;
  },

  /**
   * update the position of a pointer
   * @param   {String}   type             EVENT_END
   * @param   {Object}   pointerEvent
   */
  updatePointer: function(type, pointerEvent) {
    if(type == EVENT_END) {
      delete this.pointers[pointerEvent.pointerId];
    }
    else {
      pointerEvent.identifier = pointerEvent.pointerId;
      this.pointers[pointerEvent.pointerId] = pointerEvent;
    }

    // it's save to use Object.keys, since pointerEvents are only in newer browsers
    return Object.keys(this.pointers).length;
  },

  /**
   * check if ev matches pointertype
   * @param   {String}        pointerType     POINTER_MOUSE
   * @param   {PointerEvent}  ev
   */
  matchType: function(pointerType, ev) {
    if(!ev.pointerType) {
      return false;
    }

    var pt = ev.pointerType
      , types = {};

    types[POINTER_MOUSE] = (pt === POINTER_MOUSE);
    types[POINTER_TOUCH] = (pt === POINTER_TOUCH);
    types[POINTER_PEN] = (pt === POINTER_PEN);
    return types[pointerType];
  },


  /**
   * get events
   */
  getEvents: function() {
    return [
      'pointerdown MSPointerDown',
      'pointermove MSPointerMove',
      'pointerup pointercancel MSPointerUp MSPointerCancel'
    ];
  },

  /**
   * reset the list
   */
  reset: function() {
    this.pointers = {};
  }
};


var Detection = Hammer.detection = {
  // contains all registred Hammer.gestures in the correct order
  gestures: [],

  // data of the current Hammer.gesture detection session
  current : null,

  // the previous Hammer.gesture session data
  // is a full clone of the previous gesture.current object
  previous: null,

  // when this becomes true, no gestures are fired
  stopped : false,


  /**
   * start Hammer.gesture detection
   * @param   {Hammer.Instance}   inst
   * @param   {Object}            eventData
   */
  startDetect: function startDetect(inst, eventData) {
    // already busy with a Hammer.gesture detection on an element
    if(this.current) {
      return;
    }

    this.stopped = false;

    this.current = {
      inst              : inst, // reference to HammerInstance we're working for
      startEvent        : Utils.extend({}, eventData), // start eventData for distances, timing etc
      lastEvent         : false, // last eventData
      lastVelocityEvent : false, // last eventData for velocity.
      velocity          : false, // current velocity
      name              : '' // current gesture we're in/detected, can be 'tap', 'hold' etc
    };

    this.detect(eventData);
  },


  /**
   * Hammer.gesture detection
   * @param   {Object}    eventData
   */
  detect: function detect(eventData) {
    if(!this.current || this.stopped) {
      return;
    }

    // extend event data with calculations about scale, distance etc
    eventData = this.extendEventData(eventData);

    // instance options
    var inst_options = this.current.inst.options;

    // call Hammer.gesture handlers
    Utils.each(this.gestures, function(gesture) {
      // only when the instance options have enabled this gesture
      if(!this.stopped && inst_options[gesture.name] !== false) {
        // if a handler returns false, we stop with the detection
        if(gesture.handler.call(gesture, eventData, this.current.inst) === false) {
          this.stopDetect();
          return false;
        }
      }
    }, this);

    // store as previous event event
    if(this.current) {
      this.current.lastEvent = eventData;
    }

    // endevent, but not the last touch, so dont stop
    if(eventData.eventType == EVENT_END && !eventData.touches.length - 1) {
      this.stopDetect();
    }

    return eventData;
  },


  /**
   * clear the Hammer.gesture vars
   * this is called on endDetect, but can also be used when a final Hammer.gesture has been detected
   * to stop other Hammer.gestures from being fired
   */
  stopDetect: function stopDetect() {
    // clone current data to the store as the previous gesture
    // used for the double tap gesture, since this is an other gesture detect session
    this.previous = Utils.extend({}, this.current);

    // reset the current
    this.current = null;

    // stopped!
    this.stopped = true;
  },


  /**
   * extend eventData for Hammer.gestures
   * @param   {Object}   ev
   * @returns {Object}   ev
   */
  extendEventData: function extendEventData(ev) {
    var cur = this.current
      , startEv = cur.startEvent;

    // if the touches change, set the new touches over the startEvent touches
    // this because touchevents don't have all the touches on touchstart, or the
    // user must place his fingers at the EXACT same time on the screen, which is not realistic
    // but, sometimes it happens that both fingers are touching at the EXACT same time
    if(ev.touches.length != startEv.touches.length || ev.touches === startEv.touches) {
      // extend 1 level deep to get the touchlist with the touch objects
      startEv.touches = [];
      Utils.each(ev.touches, function(touch) {
        startEv.touches.push(Utils.extend({}, touch));
      });
    }

    var delta_time = ev.timeStamp - startEv.timeStamp
      , delta_x = ev.center.pageX - startEv.center.pageX
      , delta_y = ev.center.pageY - startEv.center.pageY
      , interimAngle
      , interimDirection
      , velocityEv = cur.lastVelocityEvent
      , velocity = cur.velocity;

    // calculate velocity every x ms
    if (velocityEv && ev.timeStamp - velocityEv.timeStamp > Hammer.UPDATE_VELOCITY_INTERVAL) {
        velocity = Utils.getVelocity(ev.timeStamp - velocityEv.timeStamp,
                                            ev.center.pageX - velocityEv.center.pageX,
                                            ev.center.pageY - velocityEv.center.pageY);

        cur.lastVelocityEvent = ev;
        cur.velocity = velocity;
    }
    else if(!cur.velocity) {
        velocity = Utils.getVelocity(delta_time, delta_x, delta_y);

        cur.lastVelocityEvent = ev;
        cur.velocity = velocity;
    }

    // end events (e.g. dragend) don't have useful values for interimDirection & interimAngle
    // because the previous event has exactly the same coordinates
    // so for end events, take the previous values of interimDirection & interimAngle
    // instead of recalculating them and getting a spurious '0'
    if(ev.eventType == EVENT_END) {
      interimAngle = cur.lastEvent && cur.lastEvent.interimAngle;
      interimDirection = cur.lastEvent && cur.lastEvent.interimDirection;
    }
    else {
      interimAngle = cur.lastEvent &&
        Utils.getAngle(cur.lastEvent.center, ev.center);
      interimDirection = cur.lastEvent &&
        Utils.getDirection(cur.lastEvent.center, ev.center);
    }

    Utils.extend(ev, {
      deltaTime: delta_time,

      deltaX: delta_x,
      deltaY: delta_y,

      velocityX: velocity.x,
      velocityY: velocity.y,

      distance: Utils.getDistance(startEv.center, ev.center),

      angle: Utils.getAngle(startEv.center, ev.center),
      interimAngle: interimAngle,

      direction: Utils.getDirection(startEv.center, ev.center),
      interimDirection: interimDirection,

      scale: Utils.getScale(startEv.touches, ev.touches),
      rotation: Utils.getRotation(startEv.touches, ev.touches),

      startEvent: startEv
    });

    return ev;
  },


  /**
   * register new gesture
   * @param   {Object}    gesture object, see gestures.js for documentation
   * @returns {Array}     gestures
   */
  register: function register(gesture) {
    // add an enable gesture options if there is no given
    var options = gesture.defaults || {};
    if(options[gesture.name] === undefined) {
      options[gesture.name] = true;
    }

    // extend Hammer default options with the Hammer.gesture options
    Utils.extend(Hammer.defaults, options, true);

    // set its index
    gesture.index = gesture.index || 1000;

    // add Hammer.gesture to the list
    this.gestures.push(gesture);

    // sort the list by index
    this.gestures.sort(function(a, b) {
      if(a.index < b.index) { return -1; }
      if(a.index > b.index) { return 1; }
      return 0;
    });

    return this.gestures;
  }
};


/**
 * Drag
 * Move with x fingers (default 1) around on the page. Blocking the scrolling when
 * moving left and right is a good practice. When all the drag events are blocking
 * you disable scrolling on that area.
 * @events  drag, drapleft, dragright, dragup, dragdown
 */
Hammer.gestures.Drag = {
  name     : 'drag',
  index    : 50,
  defaults : {
    drag_min_distance            : 10,

    // Set correct_for_drag_min_distance to true to make the starting point of the drag
    // be calculated from where the drag was triggered, not from where the touch started.
    // Useful to avoid a jerk-starting drag, which can make fine-adjustments
    // through dragging difficult, and be visually unappealing.
    correct_for_drag_min_distance: true,

    // set 0 for unlimited, but this can conflict with transform
    drag_max_touches             : 1,

    // prevent default browser behavior when dragging occurs
    // be careful with it, it makes the element a blocking element
    // when you are using the drag gesture, it is a good practice to set this true
    drag_block_horizontal        : false,
    drag_block_vertical          : false,

    // drag_lock_to_axis keeps the drag gesture on the axis that it started on,
    // It disallows vertical directions if the initial direction was horizontal, and vice versa.
    drag_lock_to_axis            : false,

    // drag lock only kicks in when distance > drag_lock_min_distance
    // This way, locking occurs only when the distance has become large enough to reliably determine the direction
    drag_lock_min_distance       : 25
  },

  triggered: false,
  handler  : function dragGesture(ev, inst) {
    // current gesture isnt drag, but dragged is true
    // this means an other gesture is busy. now call dragend
    if(Detection.current.name != this.name && this.triggered) {
      inst.trigger(this.name + 'end', ev);
      this.triggered = false;
      return;
    }

    // max touches
    if(inst.options.drag_max_touches > 0 &&
      ev.touches.length > inst.options.drag_max_touches) {
      return;
    }

    switch(ev.eventType) {
      case EVENT_START:
        this.triggered = false;
        break;

      case EVENT_MOVE:
        // when the distance we moved is too small we skip this gesture
        // or we can be already in dragging
        if(ev.distance < inst.options.drag_min_distance &&
          Detection.current.name != this.name) {
          return;
        }

        // we are dragging!
        if(Detection.current.name != this.name) {
          Detection.current.name = this.name;
          if(inst.options.correct_for_drag_min_distance && ev.distance > 0) {
            // When a drag is triggered, set the event center to drag_min_distance pixels from the original event center.
            // Without this correction, the dragged distance would jumpstart at drag_min_distance pixels instead of at 0.
            // It might be useful to save the original start point somewhere
            var factor = Math.abs(inst.options.drag_min_distance / ev.distance);
            Detection.current.startEvent.center.pageX += ev.deltaX * factor;
            Detection.current.startEvent.center.pageY += ev.deltaY * factor;

            // recalculate event data using new start point
            ev = Detection.extendEventData(ev);
          }
        }

        // lock drag to axis?
        if(Detection.current.lastEvent.drag_locked_to_axis ||
            ( inst.options.drag_lock_to_axis &&
              inst.options.drag_lock_min_distance <= ev.distance
            )) {
          ev.drag_locked_to_axis = true;
        }
        var last_direction = Detection.current.lastEvent.direction;
        if(ev.drag_locked_to_axis && last_direction !== ev.direction) {
          // keep direction on the axis that the drag gesture started on
          if(Utils.isVertical(last_direction)) {
            ev.direction = (ev.deltaY < 0) ? DIRECTION_UP : DIRECTION_DOWN;
          }
          else {
            ev.direction = (ev.deltaX < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
          }
        }

        // first time, trigger dragstart event
        if(!this.triggered) {
          inst.trigger(this.name + 'start', ev);
          this.triggered = true;
        }

        // trigger events
        inst.trigger(this.name, ev);
        inst.trigger(this.name + ev.direction, ev);

        var is_vertical = Utils.isVertical(ev.direction);

        // block the browser events
        if((inst.options.drag_block_vertical && is_vertical) ||
          (inst.options.drag_block_horizontal && !is_vertical)) {
          ev.preventDefault();
        }
        break;

      case EVENT_END:
        // trigger dragend
        if(this.triggered) {
          inst.trigger(this.name + 'end', ev);
        }

        this.triggered = false;
        break;
    }
  }
};

/**
 * Hold
 * Touch stays at the same place for x time
 * @events  hold
 */
Hammer.gestures.Hold = {
  name    : 'hold',
  index   : 10,
  defaults: {
    hold_timeout  : 500,
    hold_threshold: 1
  },
  timer   : null,

  handler : function holdGesture(ev, inst) {
    switch(ev.eventType) {
      case EVENT_START:
        // clear any running timers
        clearTimeout(this.timer);

        // set the gesture so we can check in the timeout if it still is
        Detection.current.name = this.name;

        // set timer and if after the timeout it still is hold,
        // we trigger the hold event
        this.timer = setTimeout(function() {
          if(Detection.current.name == 'hold') {
            inst.trigger('hold', ev);
          }
        }, inst.options.hold_timeout);
        break;

      // when you move or end we clear the timer
      case EVENT_MOVE:
        if(ev.distance > inst.options.hold_threshold) {
          clearTimeout(this.timer);
        }
        break;

      case EVENT_END:
        clearTimeout(this.timer);
        break;
    }
  }
};

/**
 * Release
 * Called as last, tells the user has released the screen
 * @events  release
 */
Hammer.gestures.Release = {
  name   : 'release',
  index  : Infinity,
  handler: function releaseGesture(ev, inst) {
    if(ev.eventType == EVENT_END) {
      inst.trigger(this.name, ev);
    }
  }
};

/**
 * Swipe
 * triggers swipe events when the end velocity is above the threshold
 * for best usage, set prevent_default (on the drag gesture) to true
 * @events  swipe, swipeleft, swiperight, swipeup, swipedown
 */
Hammer.gestures.Swipe = {
  name    : 'swipe',
  index   : 40,
  defaults: {
    swipe_min_touches: 1,
    swipe_max_touches: 1,
    swipe_velocity   : 0.7
  },
  handler : function swipeGesture(ev, inst) {
    if(ev.eventType == EVENT_END) {
      // max touches
      if(ev.touches.length < inst.options.swipe_min_touches ||
        ev.touches.length > inst.options.swipe_max_touches) {
        return;
      }

      // when the distance we moved is too small we skip this gesture
      // or we can be already in dragging
      if(ev.velocityX > inst.options.swipe_velocity ||
        ev.velocityY > inst.options.swipe_velocity) {
        // trigger swipe events
        inst.trigger(this.name, ev);
        inst.trigger(this.name + ev.direction, ev);
      }
    }
  }
};

/**
 * Tap/DoubleTap
 * Quick touch at a place or double at the same place
 * @events  tap, doubletap
 */
Hammer.gestures.Tap = {
  name    : 'tap',
  index   : 100,
  defaults: {
    tap_max_touchtime : 250,
    tap_max_distance  : 10,
    tap_always        : true,
    doubletap_distance: 20,
    doubletap_interval: 300
  },

  has_moved: false,

  handler : function tapGesture(ev, inst) {
    var prev, since_prev, did_doubletap;

    // reset moved state
    if(ev.eventType == EVENT_START) {
      this.has_moved = false;
    }

    // Track the distance we've moved. If it's above the max ONCE, remember that (fixes #406).
    else if(ev.eventType == EVENT_MOVE && !this.moved) {
      this.has_moved = (ev.distance > inst.options.tap_max_distance);
    }

    else if(ev.eventType == EVENT_END &&
        ev.srcEvent.type != 'touchcancel' &&
        ev.deltaTime < inst.options.tap_max_touchtime && !this.has_moved) {

      // previous gesture, for the double tap since these are two different gesture detections
      prev = Detection.previous;
      since_prev = prev && prev.lastEvent && ev.timeStamp - prev.lastEvent.timeStamp;
      did_doubletap = false;

      // check if double tap
      if(prev && prev.name == 'tap' &&
          (since_prev && since_prev < inst.options.doubletap_interval) &&
          ev.distance < inst.options.doubletap_distance) {
        inst.trigger('doubletap', ev);
        did_doubletap = true;
      }

      // do a single tap
      if(!did_doubletap || inst.options.tap_always) {
        Detection.current.name = 'tap';
        inst.trigger(Detection.current.name, ev);
      }
    }
  }
};

/**
 * Touch
 * Called as first, tells the user has touched the screen
 * @events  touch
 */
Hammer.gestures.Touch = {
  name    : 'touch',
  index   : -Infinity,
  defaults: {
    // call preventDefault at touchstart, and makes the element blocking by
    // disabling the scrolling of the page, but it improves gestures like
    // transforming and dragging.
    // be careful with using this, it can be very annoying for users to be stuck
    // on the page
    prevent_default    : false,

    // disable mouse events, so only touch (or pen!) input triggers events
    prevent_mouseevents: false
  },
  handler : function touchGesture(ev, inst) {
    if(inst.options.prevent_mouseevents &&
        ev.pointerType == POINTER_MOUSE) {
      ev.stopDetect();
      return;
    }

    if(inst.options.prevent_default) {
      ev.preventDefault();
    }

    if(ev.eventType == EVENT_START) {
      inst.trigger(this.name, ev);
    }
  }
};


/**
 * Transform
 * User want to scale or rotate with 2 fingers
 * @events  transform, pinch, pinchin, pinchout, rotate
 */
Hammer.gestures.Transform = {
  name     : 'transform',
  index    : 45,
  defaults : {
    // factor, no scale is 1, zoomin is to 0 and zoomout until higher then 1
    transform_min_scale      : 0.01,
    // rotation in degrees
    transform_min_rotation   : 1,
    // prevent default browser behavior when two touches are on the screen
    // but it makes the element a blocking element
    // when you are using the transform gesture, it is a good practice to set this true
    transform_always_block   : false,
    // ensures that all touches occurred within the instance element
    transform_within_instance: false
  },

  triggered: false,

  handler  : function transformGesture(ev, inst) {
    // current gesture isnt drag, but dragged is true
    // this means an other gesture is busy. now call dragend
    if(Detection.current.name != this.name && this.triggered) {
      inst.trigger(this.name + 'end', ev);
      this.triggered = false;
      return;
    }

    // at least multitouch
    if(ev.touches.length < 2) {
      return;
    }

    // prevent default when two fingers are on the screen
    if(inst.options.transform_always_block) {
      ev.preventDefault();
    }

    // check if all touches occurred within the instance element
    if(inst.options.transform_within_instance) {
      for(var i=-1; ev.touches[++i];) {
        if(!Utils.hasParent(ev.touches[i].target, inst.element)) {
          return;
        }
      }
    }

    switch(ev.eventType) {
      case EVENT_START:
        this.triggered = false;
        break;

      case EVENT_MOVE:
        var scale_threshold = Math.abs(1 - ev.scale);
        var rotation_threshold = Math.abs(ev.rotation);

        // when the distance we moved is too small we skip this gesture
        // or we can be already in dragging
        if(scale_threshold < inst.options.transform_min_scale &&
          rotation_threshold < inst.options.transform_min_rotation) {
          return;
        }

        // we are transforming!
        Detection.current.name = this.name;

        // first time, trigger dragstart event
        if(!this.triggered) {
          inst.trigger(this.name + 'start', ev);
          this.triggered = true;
        }

        inst.trigger(this.name, ev); // basic transform event

        // trigger rotate event
        if(rotation_threshold > inst.options.transform_min_rotation) {
          inst.trigger('rotate', ev);
        }

        // trigger pinch event
        if(scale_threshold > inst.options.transform_min_scale) {
          inst.trigger('pinch', ev);
          inst.trigger('pinch' + (ev.scale<1 ? 'in' : 'out'), ev);
        }
        break;

      case EVENT_END:
        // trigger dragend
        if(this.triggered) {
          inst.trigger(this.name + 'end', ev);
        }

        this.triggered = false;
        break;
    }
  }
};

window.Hammer = Hammer;

if(typeof module == 'object' && module.exports) {
  module.exports = Hammer;
}

function setupPlugin(Hammer, $) {
  /**
   * bind dom events
   * this overwrites addEventListener
   * @param   {HTMLElement}   element
   * @param   {String}        eventTypes
   * @param   {Function}      handler
   */
  Hammer.event.bindDom = function(element, eventTypes, handler) {
    $(element).on(eventTypes, function(ev) {
      var data = ev.originalEvent || ev;

      if(data.pageX === undefined) {
        data.pageX = ev.pageX;
        data.pageY = ev.pageY;
      }

      if(!data.target) {
        data.target = ev.target;
      }

      if(data.which === undefined) {
        data.which = data.button;
      }

      if(!data.preventDefault) {
        data.preventDefault = ev.preventDefault;
      }

      if(!data.stopPropagation) {
        data.stopPropagation = ev.stopPropagation;
      }

      handler.call(this, data);
    });
  };

  /**
   * the methods are called by the instance, but with the jquery plugin
   * we use the jquery event methods instead.
   * @this    {Hammer.Instance}
   * @return  {jQuery}
   */
  Hammer.Instance.prototype.on = function(types, handler) {
    return $(this.element).on(types, handler);
  };
  Hammer.Instance.prototype.off = function(types, handler) {
    return $(this.element).off(types, handler);
  };


  /**
   * trigger events
   * this is called by the gestures to trigger an event like 'tap'
   * @this    {Hammer.Instance}
   * @param   {String}    gesture
   * @param   {Object}    eventData
   * @return  {jQuery}
   */
  Hammer.Instance.prototype.trigger = function(gesture, eventData) {
    var el = $(this.element);
    if(el.has(eventData.target).length) {
      el = $(eventData.target);
    }

    return el.trigger({
      type   : gesture,
      gesture: eventData
    });
  };


  /**
   * jQuery plugin
   * create instance of Hammer and watch for gestures,
   * and when called again you can change the options
   * @param   {Object}    [options={}]
   * @return  {jQuery}
   */
  $.fn.hammer = function(options) {
    return this.each(function() {
      var el = $(this);
      var inst = el.data('hammer');
      // start new hammer instance
      if(!inst) {
        el.data('hammer', new Hammer(this, options || {}));
      }
      // change the options
      else if(inst && options) {
        Hammer.utils.extend(inst.options, options);
      }
    });
  };
}

// AMD
if(typeof define == 'function' && define.amd) {
  define(['jquery'], function ($) {
    return setupPlugin(window.Hammer, $);
  });
}

else {
  setupPlugin(window.Hammer, window.jQuery || window.Zepto);
}


})(window);;
// basic file to run scripts prior to the html rendering (mostly for css)

var userAgent = window.navigator.userAgent.toLowerCase();

function iOSCheck() {
	if (userAgent.match(/(ipad|iphone|ipod)/g)) {
		document.documentElement.className += ' iOS';
	}
}

iOSCheck();;
/*!
 * LBI.common
 * @version 1.3
 * @author LBi - http://www.lbi.com/en
 * @requires jQuery Core 1.4.1 - http://www.jquery.com/
*/
/*jslint bitwise: true, eqeqeq: true, passfail: false, nomen: true, plusplus: false, undef: true, evil: true */
/*global window, document, navigator, $, jQuery, */

var LBI = window.LBI || {};
/**
 * @namespace Common re-used functionality.
 */
LBI.common = {
	version					: 1.2,

	ajaxQueryParam			: 'rc=1',
	webSafeChar				: '<span class="webSafeChar"> </span>',
	printLinkSelector		: 'a.printwin',
	printLinkText			: 'This link will open the Print dialog',

	/**
	 * Returns object of all queries within a string.
	 * <p>
	 * Will return undefined for no query string.
	 *
	 * @param {Object} 	theString
	 * @return {Object}	key:values of query string
	 */
	getStringQueries: function(theString) {
		// returns object of all queries within a string
		if (typeof theString !== 'string') {
			return;
		}

		if (theString.indexOf('?') > -1) {
			// make sure you get query side of url
			theString = theString.split('?')[1];
		}

		var qs = theString, qsKey, qsValue, stringElements = {};
		// make an array of query string items
		qs = qs.split("&");
		// create object
		for (var i = qs.length - 1; i >= 0; i--) {
			qsKey = qs[i].split("=")[0];
			qsValue = qs[i].split("=")[1];
			stringElements[qsKey] = qsValue;
		}
		return stringElements;

	},
	/**
	 * Splits a string that would not normally wrap (like and email address) with wrapping characters.
	 * <p>
	 * Since wrapping characters are not supported in IE6 without East Asian language support an empty
	 * styled <span> is used instead. This leads to some accessibility issues.
	 *
	 * @param (String) myString
	 * @return {String}
	 */
	webSafeString: function (myString) {
		var stringAsArray = myString.split("");
		var stringLength = stringAsArray.length;
		var newArray = [];
		for (var i=0; i < stringLength; i++ ) {
			newArray.push(stringAsArray[i],LBI.common.webSafeChar);
		}
		var newString = newArray.join("");
		return newString;
	},

	/**
	 * Strip out and return local page anchor from URL.
	 *
	 * @param 	{Object} anchor
	 * @return 	Return the anchor portion of the URL (or false if no anchor)
	 */
	urlGetAnchor: function(anchor) {
		if ( anchor.href.indexOf("#") >= 0 ) { //Check for anchorness
			anchor.destination = anchor.href.slice(anchor.href.indexOf("#")+1);
			return anchor.destination;
		} else {
			return false;
		}
	},

	/**
	 * Print dialog function.
	 * <p>
	 * Add the window.print function to the onclick event of elements matching a specified selector.
	 */
	getPrintLinks: function() {
		$(LBI.common.printLinkSelector).each(function(){
			$(this).attr('title', $(this).attr('title') + " " + LBI.common.printLinkText);
		}).live('click', function(e){
			window.print();
			e.preventDefault();
		});
	},

	/**
	 * @namespace Common AJAX functionality.
	 */
	ajax: {
		bufferFieldID	: 'ajaxVirtualBufferUpdate',
		/**
		 * Insert form field for buffer update
		 */
		prepareBuffer: function() {
			var objHidden = document.createElement('input');
			objHidden.setAttribute('type', 'hidden');
			objHidden.setAttribute('value', '1');
			objHidden.setAttribute('id', LBI.common.ajax.bufferFieldID);
			objHidden.setAttribute('name', LBI.common.ajax.bufferFieldID);

			document.body.appendChild(objHidden);
		},
		/**
		 * Updates value of hidden form field to nudge screen readers into recognising page state change.
		 *
		 * @see LBI.common.ajax.prepareBuffer()
		 */
		updateBuffer: function() {
			var objHidden = document.getElementById(LBI.common.ajax.bufferFieldID);
			if (objHidden) {
				if (objHidden.getAttribute('value') === '1') {
					objHidden.setAttribute('value', '0');
				} else {
					objHidden.setAttribute('value', '1');
				}
			} else {
				LBI.common.ajax.prepareBuffer();
				LBI.common.ajax.updateBuffer();
			}
		},
		/**
		 * Update the page buffer for assistive tech and focus on optional element.
		 *
		 * @param {Object} focusEL
		 * @param {Boolean} timeout
		 */
		pageUpdated: function (focusEL, timeout) {
			// Update page 'buffer'
			LBI.common.ajax.updateBuffer();
			// If an element is provided focus it
			if (focusEL) {
				if ($.isArray(focusEL) || (focusEL.length > 0)) {
					// If focusEL is an array object
					focusEL[0].focus();
				} else {
					// If focusEL is a single object
					focusEL.focus();
				}
			}
		},
		/**
		 * Takes a string (URL expected) and appends parameter to identify as AJAX request for backend processing.
		 *
		 * @param {String}	URL
		 * @return {String}	An AJAXed URL
		 */
		tagUrl: function(url) {
			//
			var prefix =(url.indexOf('?') < 0 ) ? "?" : "&" ;
			var ajaxURL = url + prefix + LBI.common.ajaxQueryParam;
			return ajaxURL;
		}
	},


	/**
	 * Parse version string.
	 * <p>
	 * Parse the version strings with a simple function and return them as objects with appropriate properties whose values are integers.
	 * Once in this form, we can compare them with simple mathematics.
	 *
	 * @param 	{String} str
	 * @return 	{Object} Return the major, minor and patch numbers
	 */
	parseVersionString: function(str) {
	    if (typeof(str) !== 'string') { return false; }
	    var x = str.split('.');
	    // parse from string or default to 0 if can't parse
	    var maj = parseInt(x[0], 10) || 0;
	    var min = parseInt(x[1], 10) || 0;
	    var pat = parseInt(x[2], 10) || 0;
	    return {
	        major: maj,
	        minor: min,
	        patch: pat
	    };
	},

	/**
	 * If within a frame kill the frame and reload at top
	 */
	frameKill: function() {
		if (window.top !== window.self) {
			window.top.location.href = window.self.location.href;
		}
	},

	/**
	 * Escapes special characters in DOM ID strings.
	 * <p>Used with jQuery when an ID has special characters. For example, JSF outputs IDs with colons separating namespaces,
	 * which breaks jQuery's getElementById implementation. This function will escape any such characters in the ID string.
	 * @param {String} id The DOM ID string containing special characters to be escaped.
	 * @returns {String} A DOM ID string with the special characters escaped.
	 */
	escapeSpecialCharsInId: function(id) {
		return '#' + id.replace(/:/g,"\\:").replace(/\./g,"\\.");
	},

	/**
	 * Input field text population.
	 * <p>
	 * Takes current value of placeholder attribute and handles clearing and re-populating on focus.
	 * @param {String} CSS selector of the element to be handled
	 * @requires Modernizr 2.0+ - http://www.modernizr.com/
	 */
	dynamicInputText: function(selector) {
		/*
		 * If modernizer tells us we can use the placeholder attribute
		 * then don't go any further
		 */
		if (Modernizr.input.placeholder){
			return false;
		}
		$(selector).each(function (i) {
			var $this = $(this);
			if ($this.attr('placeholder')) {
				$this
					.data('_default', $this.attr('placeholder')) // keep track of the original placeholder attribute value
					.val($this.data('_default'))
					.addClass('dynaTextPlaceHolder')
					.focus(function(){
						var $this = $(this);
						$this.val($.trim($this.val()));
						if ($this.val() === $this.data('_default')) {
							$this
								.val('')
								.removeClass('dynaTextPlaceHolder');
						}
					})
					.blur(function(){
						var $this = $(this);
						$this.val($.trim($this.val()));
						if ($this.val() === "") {
							$this
								.val($this.data('_default'))
								.addClass('dynaTextPlaceHolder');
						}
					})
					.blur();
			}
		});
	},

	convert: {
		currentTimeToDurationPercentage: function( currentTimeInSeconds, durationInSeconds ) {
			if (durationInSeconds === 0) {
				return 0;
			}

			return ( currentTimeInSeconds / durationInSeconds ) * 100;
		}
	},

	/**
	 * zero padding for strings/numbers.
	 * <p>
	 * Takes the string and ensures that it's padded to meet the length (e.g. 1 becomes 01 );
	 * TODO: add checks if the value's length exceeds the total zero padded length
	 * @param {String} value to add padding to
	 * @param {Number} length of returned zero padded value
	 */
	zeroPad: function( value, length ) {
		return ( new Array( length + 1 ).join( '0' ) + value ).slice( -Math.abs( length ) );
	},

	/**
	 * Check if number is equal too or within a range.
	 * @param {Number} num value to check
	 * @param {Number} min lower range
	 * @param {Number} max upper range
	 */
	isNumberInRange: function( num, min, max ) {
		return num >= min && num <= max;
	}

};/* /LBI.common */
;








(function(){



geolocation = {};
geolocation.requestGeo=function(c){geolocation.cdn3Requested=+new Date;var b=document.head||document.getElementsByTagName("head")[0]||document.documentElement,a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src=c;b.insertBefore(a,b.firstChild)};


var optly={nativity:{}};optly.nativity.getNativeGetElementsByClassName=function(){var a=document.getElementsByClassName;if(!optly.nativity.isNativeFunction(a))var a=(window.optimizely||{}).getElementsByClassName,b=(window.optly||{}).getElementsByClassName,a=optly.nativity.isNativeFunction(a)?a:optly.nativity.isNativeFunction(b)?b:null;return a};optly.nativity.isNativeFunction=function(a){return a&&-1!==String(a).indexOf("[native code]")};optly.Cleanse={};optly.Cleanse.each=function(a,b,d){var h=!!Object.prototype.__lookupGetter__,e=!!Object.prototype.__lookupSetter__,c;for(c in a)if(a.hasOwnProperty(c)){var f=h?a.__lookupGetter__(c):null,g=e?a.__lookupSetter__(c):null;try{b.call(d,c,!f?a[c]:null,f,g)}catch(i){}}};
optly.Cleanse.finish=function(){if(optly.Cleanse.running){optly.Cleanse.running=!1;optly.Cleanse.each(optly.Cleanse.types,function(a,d){Object.prototype.__defineGetter__&&optly.Cleanse.each(optly.Cleanse.getters[a],function(c,b){d.prototype.__defineGetter__(c,b);optly.Cleanse.log("restored getter",a,c)});Object.prototype.__defineSetter__&&optly.Cleanse.each(optly.Cleanse.setters[a],function(c,b){d.prototype.__defineSetter__(c,b);optly.Cleanse.log("restored setter",a,c)});optly.Cleanse.each(optly.Cleanse.properties[a],
function(b,f){d.prototype[b]=f;optly.Cleanse.log("restored property",a,b)})});optly.Cleanse.unfixGetElementsByClassName();optly.Cleanse.log("finish");var a=window.console;if((-1!==window.location.hash.indexOf("optimizely_log=true")||-1!==window.location.search.indexOf("optimizely_log=true"))&&a&&a.log)for(var b=optly.Cleanse.logs,d=0;d<b.length;d++)a.log(b[d])}};
optly.Cleanse.log=function(a,b,d){b?(b=b.replace(/_/g,""),optly.Cleanse.logs.push("Optimizely / Info / Cleanse / "+a+": "+b+"."+d)):optly.Cleanse.logs.push("Optimizely / Info / Cleanse / "+a)};
optly.Cleanse.start=function(){var a=window.location.hostname;if(!(-1!==a.indexOf("optimizely")&&-1===a.indexOf("edit")&&-1===a.indexOf("preview")&&-1===a.indexOf("test")))if(optly.Cleanse.running)optly.Cleanse.log("already running so didn't start");else{optly.Cleanse.log("start");optly.Cleanse.running=!0;for(var b in optly.Cleanse.types)optly.Cleanse.types[b]||delete optly.Cleanse.types[b];optly.Cleanse.each(optly.Cleanse.types,function(a,b){optly.Cleanse.getters[a]={};optly.Cleanse.properties[a]=
{};optly.Cleanse.setters[a]={};optly.Cleanse.each(b.prototype,function(e,c,f,g){optly.nativity.isNativeFunction(c)||optly.nativity.isNativeFunction(f)||optly.nativity.isNativeFunction(g)?optly.Cleanse.log("ignore native code",a,e):(f?(optly.Cleanse.getters[a][e]=f,optly.Cleanse.log("cleansed getter",a,e)):(optly.Cleanse.properties[a][e]=c,optly.Cleanse.log("cleansed property",a,e)),g&&(optly.Cleanse.setters[a][e]=g,optly.Cleanse.log("cleansed setter",a,e)),delete b.prototype[e])})});optly.Cleanse.fixGetElementsByClassName();
optly.Cleanse.hasRunStart=!0}};optly.Cleanse.fixGetElementsByClassName=function(){if(!optly.nativity.isNativeFunction(document.getElementsByClassName)){var a=optly.nativity.getNativeGetElementsByClassName();a?(optly.Cleanse.getElementsByClassName=document.getElementsByClassName,document.getElementsByClassName=a):optly.Cleanse.log("Error: native HTMLElement.prototype.getElementsByClassName missing")}};
optly.Cleanse.unfixGetElementsByClassName=function(){optly.Cleanse.getElementsByClassName&&(document.getElementsByClassName=optly.Cleanse.getElementsByClassName,optly.Cleanse.getElementsByClassName=null)};optly.Cleanse.getElementsByClassName=null;optly.Cleanse.getters={};optly.Cleanse.logs=[];optly.Cleanse.properties={};optly.Cleanse.setters={};optly.Cleanse.types={Object_:Object};window.optly=window.optly||{};window.optly.Cleanse={finish:optly.Cleanse.finish,logs:optly.Cleanse.logs,start:optly.Cleanse.start};
optly.Cleanse.start();
var $=function(r,m){function ya(a,b,c){if(c===m&&1===a.nodeType)if(c="data-"+b.replace(kb,"-$1").toLowerCase(),c=a.getAttribute(c),"string"===typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:!d.isNaN(c)?parseFloat(c):lb.test(c)?d.parseJSON(c):c}catch(g){}d.data(a,b,c)}else c=m;return c}function ha(a){for(var b in a)if("toJSON"!==b)return!1;return!0}function za(a,b,c){var g=b+"defer",e=b+"queue",f=b+"mark",h=d.data(a,g,m,!0);h&&(("queue"===c||!d.data(a,e,m,!0))&&("mark"===c||!d.data(a,
f,m,!0)))&&setTimeout(function(){!d.data(a,e,m,!0)&&!d.data(a,f,m,!0)&&(d.removeData(a,g,!0),h.resolve())},0)}function w(){return!1}function O(){return!0}function Aa(a,b,c){var g=d.extend({},c[0]);g.type=a;g.originalEvent={};g.liveFired=m;d.event.handle.call(b,g);g.isDefaultPrevented()&&c[0].preventDefault()}function mb(a){var b,c,g,e,f,h,i,j,k,m,l,q=[];e=[];f=d._data(this,"events");if(!(a.liveFired===this||!f||!f.live||a.target.disabled||a.button&&"click"===a.type)){a.namespace&&(l=RegExp("(^|\\.)"+
a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)"));a.liveFired=this;var n=f.live.slice(0);for(i=0;i<n.length;i++)f=n[i],f.origType.replace(ia,"")===a.type?e.push(f.selector):n.splice(i--,1);e=d(a.target).closest(e,a.currentTarget);j=0;for(k=e.length;j<k;j++){m=e[j];for(i=0;i<n.length;i++)if(f=n[i],m.selector===f.selector&&(!l||l.test(f.namespace))&&!m.elem.disabled){h=m.elem;g=null;if("mouseenter"===f.preType||"mouseleave"===f.preType)a.type=f.preType,(g=d(a.relatedTarget).closest(f.selector)[0])&&
d.contains(h,g)&&(g=h);(!g||g!==h)&&q.push({elem:h,handleObj:f,level:m.level})}}j=0;for(k=q.length;j<k;j++){e=q[j];if(c&&e.level>c)break;a.currentTarget=e.elem;a.data=e.handleObj.data;a.handleObj=e.handleObj;l=e.handleObj.origHandler.apply(e.elem,arguments);if(!1===l||a.isPropagationStopped())if(c=e.level,!1===l&&(b=!1),a.isImmediatePropagationStopped())break}return b}}function P(a,b){return(a&&"*"!==a?a+".":"")+b.replace(nb,"`").replace(ob,"&")}function Ba(a,b,c){b=b||0;if(d.isFunction(b))return d.grep(a,
function(a,g){return!!b.call(a,g,a)===c});if(b.nodeType)return d.grep(a,function(a){return a===b===c});if("string"===typeof b){var g=d.grep(a,function(a){return 1===a.nodeType});if(pb.test(b))return d.filter(b,g,!c);b=d.filter(b,g)}return d.grep(a,function(a){return 0<=d.inArray(a,b)===c})}function Ca(a,b){if(1===b.nodeType&&d.hasData(a)){var c=d.expando,g=d.data(a),e=d.data(b,g);if(g=g[c]){var f=g.events,e=e[c]=d.extend({},g);if(f){delete e.handle;e.events={};for(var h in f){c=0;for(g=f[h].length;c<
g;c++)d.event.add(b,h+(f[h][c].namespace?".":"")+f[h][c].namespace,f[h][c],f[h][c].data)}}}}}function Da(a,b){var c;if(1===b.nodeType){b.clearAttributes&&b.clearAttributes();b.mergeAttributes&&b.mergeAttributes(a);c=b.nodeName.toLowerCase();if("object"===c)b.outerHTML=a.outerHTML;else if("input"===c&&("checkbox"===a.type||"radio"===a.type)){if(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value)b.value=a.value}else if("option"===c)b.selected=a.defaultSelected;else if("input"===c||
"textarea"===c)b.defaultValue=a.defaultValue;b.removeAttribute(d.expando)}}function Q(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function Ea(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function Fa(a){d.nodeName(a,"input")?Ea(a):"getElementsByTagName"in a&&d.grep(a.getElementsByTagName("input"),Ea)}function qb(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval((b.text||b.textContent||
b.innerHTML||"").replace(rb,"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)}function Ga(a,b,c){var g="width"===b?a.offsetWidth:a.offsetHeight,e="width"===b?sb:tb;if(0<g)return"border"!==c&&d.each(e,function(){c||(g-=parseFloat(d.css(a,"padding"+this))||0);g="margin"===c?g+(parseFloat(d.css(a,c+this))||0):g-(parseFloat(d.css(a,"border"+this+"Width"))||0)}),g+"px";g=A(a,b,b);if(0>g||null==g)g=a.style[b]||0;g=parseFloat(g)||0;c&&d.each(e,function(){g+=parseFloat(d.css(a,"padding"+this))||0;"padding"!==
c&&(g+=parseFloat(d.css(a,"border"+this+"Width"))||0);"margin"===c&&(g+=parseFloat(d.css(a,c+this))||0)});return g+"px"}var l=r.document,d,Ha=function(){if(!k.isReady){try{l.documentElement.doScroll("left")}catch(a){setTimeout(Ha,1);return}k.ready()}},k=function(a,b){return new k.fn.init(a,b,Ia)},ub=r.jQuery,vb=r.$,Ia,wb=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,Ja=/\S/,Ka=/^\s+/,La=/\s+$/,xb=/\d/,yb=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,zb=/^[\],:{}\s]*$/,Ab=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,Bb=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
Cb=/(?:^|:|,)(?:\s*\[)+/g,Db=/(webkit)[ \/]([\w.]+)/,Eb=/(opera)(?:.*version)?[ \/]([\w.]+)/,Fb=/(msie) ([\w.]+)/,Gb=/(mozilla)(?:.*? rv:([\w.]+))?/,Hb=/-([a-z]|[0-9])/ig,Ib=/^-ms-/,Jb=function(a,b){return(b+"").toUpperCase()},Kb=r.navigator.userAgent,R,S,B,Lb=Object.prototype.toString,ja=Object.prototype.hasOwnProperty,ka=Array.prototype.push,I=Array.prototype.slice,Ma=String.prototype.trim,Na=Array.prototype.indexOf,Oa={};k.fn=k.prototype={constructor:k,init:function(a,b,c){var g;if(!a)return this;
if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("body"===a&&!b&&l.body)return this.context=l,this[0]=l.body,this.selector=a,this.length=1,this;if("string"===typeof a){if((g="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&3<=a.length?[null,a,null]:wb.exec(a))&&(g[1]||!b)){if(g[1])return c=(b=b instanceof k?b[0]:b)?b.ownerDocument||b:l,(a=yb.exec(a))?k.isPlainObject(b)?(a=[l.createElement(a[1])],k.fn.attr.call(a,b,!0)):a=[c.createElement(a[1])]:(a=k.buildFragment([g[1]],[c]),a=(a.cacheable?
k.clone(a.fragment):a.fragment).childNodes),k.merge(this,a);if((b=l.getElementById(g[2]))&&b.parentNode){if(b.id!==g[2])return c.find(a);this.length=1;this[0]=b}this.context=l;this.selector=a;return this}return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a)}if(k.isFunction(a))return c.ready(a);a.selector!==m&&(this.selector=a.selector,this.context=a.context);return k.makeArray(a,this)},selector:"",jquery:"1.6.4",length:0,size:function(){return this.length},toArray:function(){return I.call(this,
0)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var g=this.constructor();k.isArray(a)?ka.apply(g,a):k.merge(g,a);g.prevObject=this;g.context=this.context;"find"===b?g.selector=this.selector+(this.selector?" ":"")+c:b&&(g.selector=this.selector+"."+b+"("+c+")");return g},each:function(a,b){return k.each(this,a,b)},ready:function(a){k.bindReady();S.done(a);return this},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},
last:function(){return this.eq(-1)},slice:function(){return this.pushStack(I.apply(this,arguments),"slice",I.call(arguments).join(","))},map:function(a){return this.pushStack(k.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:ka,sort:[].sort,splice:[].splice};k.fn.init.prototype=k.fn;k.extend=k.fn.extend=function(){var a,b,c,g,d,f=arguments[0]||{},h=1,i=arguments.length,j=!1;"boolean"===typeof f&&(j=f,f=arguments[1]||{},h=2);"object"!==
typeof f&&!k.isFunction(f)&&(f={});i===h&&(f=this,--h);for(;h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=f[b],g=a[b],f!==g&&(j&&g&&(k.isPlainObject(g)||(d=k.isArray(g)))?(d?(d=!1,c=c&&k.isArray(c)?c:[]):c=c&&k.isPlainObject(c)?c:{},f[b]=k.extend(j,c,g)):g!==m&&(f[b]=g));return f};k.extend({noConflict:function(a){r.$===k&&(r.$=vb);a&&r.jQuery===k&&(r.jQuery=ub);return k},isReady:!1,readyWait:1,holdReady:function(a){a?k.readyWait++:k.ready(!0)},ready:function(a){if(!0===a&&!--k.readyWait||!0!==a&&
!k.isReady){if(!l.body)return setTimeout(k.ready,1);k.isReady=!0;!0!==a&&0<--k.readyWait||(S.resolveWith(l,[k]),k.fn.trigger&&k(l).trigger("ready").unbind("ready"))}},bindReady:function(){if(!S){S=k._Deferred();if("complete"===l.readyState)return setTimeout(k.ready,1);if(l.addEventListener)l.addEventListener("DOMContentLoaded",B,!1),r.addEventListener("load",k.ready,!1);else if(l.attachEvent){l.attachEvent("onreadystatechange",B);r.attachEvent("onload",k.ready);var a=!1;try{a=null==r.frameElement}catch(b){}l.documentElement.doScroll&&
a&&Ha()}}},isFunction:function(a){return"function"===k.type(a)},isArray:Array.isArray||function(a){return"array"===k.type(a)},isWindow:function(a){return a&&"object"===typeof a&&"setInterval"in a},isNaN:function(a){return null==a||!xb.test(a)||isNaN(a)},type:function(a){return null==a?String(a):Oa[Lb.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==k.type(a)||a.nodeType||k.isWindow(a))return!1;try{if(a.constructor&&!ja.call(a,"constructor")&&!ja.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}for(var c in a);
return c===m||ja.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a;},parseJSON:function(a){if("string"!==typeof a||!a)return null;a=k.trim(a);if(r.JSON&&r.JSON.parse)return r.JSON.parse(a);if(zb.test(a.replace(Ab,"@").replace(Bb,"]").replace(Cb,"")))return(new Function("return "+a))();k.error("Invalid JSON: "+a)},parseXML:function(a){var b,c;try{r.DOMParser?(c=new DOMParser,b=c.parseFromString(a,"text/xml")):(b=new ActiveXObject("Microsoft.XMLDOM"),b.async=
"false",b.loadXML(a))}catch(g){b=m}(!b||!b.documentElement||b.getElementsByTagName("parsererror").length)&&k.error("Invalid XML: "+a);return b},noop:function(){},globalEval:function(a){a&&Ja.test(a)&&(r.execScript||function(a){r.eval.call(r,a)})(a)},camelCase:function(a){return a.replace(Ib,"ms-").replace(Hb,Jb)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,c){var g,d=0,f=a.length,h=f===m||k.isFunction(a);if(c)if(h)for(g in a){if(!1===b.apply(a[g],
c))break}else for(;d<f&&!1!==b.apply(a[d++],c););else if(h)for(g in a){if(!1===b.call(a[g],g,a[g]))break}else for(;d<f&&!1!==b.call(a[d],d,a[d++]););return a},trim:Ma?function(a){return null==a?"":Ma.call(a)}:function(a){return null==a?"":a.toString().replace(Ka,"").replace(La,"")},makeArray:function(a,b){var c=b||[];if(null!=a){var g=k.type(a);null==a.length||"string"===g||"function"===g||"regexp"===g||k.isWindow(a)?ka.call(c,a):k.merge(c,a)}return c},inArray:function(a,b){if(!b)return-1;if(Na)return Na.call(b,
a);for(var c=0,g=b.length;c<g;c++)if(b[c]===a)return c;return-1},merge:function(a,b){var c=a.length,g=0;if("number"===typeof b.length)for(var d=b.length;g<d;g++)a[c++]=b[g];else for(;b[g]!==m;)a[c++]=b[g++];a.length=c;return a},grep:function(a,b,c){for(var g=[],d,c=!!c,f=0,h=a.length;f<h;f++)d=!!b(a[f],f),c!==d&&g.push(a[f]);return g},map:function(a,b,c){var g,d,f=[],h=0,i=a.length;if(a instanceof k||i!==m&&"number"===typeof i&&(0<i&&a[0]&&a[i-1]||0===i||k.isArray(a)))for(;h<i;h++)g=b(a[h],h,c),null!=
g&&(f[f.length]=g);else for(d in a)g=b(a[d],d,c),null!=g&&(f[f.length]=g);return f.concat.apply([],f)},guid:1,proxy:function(a,b){if("string"===typeof b)var c=a[b],b=a,a=c;if(!k.isFunction(a))return m;var d=I.call(arguments,2),c=function(){return a.apply(b,d.concat(I.call(arguments)))};c.guid=a.guid=a.guid||c.guid||k.guid++;return c},access:function(a,b,c,d,e,f){var h=a.length;if("object"===typeof b){for(var i in b)k.access(a,i,b[i],d,e,c);return a}if(c!==m){d=!f&&d&&k.isFunction(c);for(i=0;i<h;i++)e(a[i],
b,d?c.call(a[i],i,e(a[i],b)):c,f);return a}return h?e(a[0],b):m},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();a=Db.exec(a)||Eb.exec(a)||Fb.exec(a)||0>a.indexOf("compatible")&&Gb.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},sub:function(){function a(b,d){return new a.fn.init(b,d)}k.extend(!0,a,this);a.superclass=this;a.fn=a.prototype=this();a.fn.constructor=a;a.sub=this.sub;a.fn.init=function(c,d){d&&(d instanceof k&&!(d instanceof a))&&(d=a(d));return k.fn.init.call(this,
c,d,b)};a.fn.init.prototype=a.fn;var b=a(l);return a},browser:{}});k.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){Oa["[object "+b+"]"]=b.toLowerCase()});R=k.uaMatch(Kb);R.browser&&(k.browser[R.browser]=!0,k.browser.version=R.version);k.browser.webkit&&(k.browser.safari=!0);Ja.test("\u00a0")&&(Ka=/^[\s\xA0]+/,La=/[\s\xA0]+$/);Ia=k(l);l.addEventListener?B=function(){l.removeEventListener("DOMContentLoaded",B,false);k.ready()}:l.attachEvent&&(B=function(){if(l.readyState===
"complete"){l.detachEvent("onreadystatechange",B);k.ready()}});d=k;var la="done fail isResolved isRejected promise then always pipe".split(" "),Pa=[].slice;d.extend({_Deferred:function(){var a=[],b,c,g,e={done:function(){if(!g){var c=arguments,h,i,j,k,m;if(b){m=b;b=0}h=0;for(i=c.length;h<i;h++){j=c[h];k=d.type(j);k==="array"?e.done.apply(e,j):k==="function"&&a.push(j)}m&&e.resolveWith(m[0],m[1])}return this},resolveWith:function(d,e){if(!g&&!b&&!c){e=e||[];c=1;try{for(;a[0];)a.shift().apply(d,e)}finally{b=
[d,e];c=0}}return this},resolve:function(){e.resolveWith(this,arguments);return this},isResolved:function(){return!(!c&&!b)},cancel:function(){g=1;a=[];return this}};return e},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),g;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},always:function(){return b.done.apply(b,arguments).fail.apply(this,arguments)},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,pipe:function(a,c){return d.Deferred(function(g){d.each({done:[a,
"resolve"],fail:[c,"reject"]},function(a,c){var f=c[0],e=c[1],k;if(d.isFunction(f))b[a](function(){if((k=f.apply(this,arguments))&&d.isFunction(k.promise))k.promise().then(g.resolve,g.reject);else g[e+"With"](this===b?g:this,[k])});else b[a](g[e])})}).promise()},promise:function(a){if(a==null){if(g)return g;g=a={}}for(var c=la.length;c--;)a[la[c]]=b[la[c]];return a}});b.done(c.cancel).fail(b.cancel);delete b.cancel;a&&a.call(b,b);return b},when:function(a){function b(a){return function(b){c[a]=arguments.length>
1?Pa.call(arguments,0):b;--f||h.resolveWith(h,Pa.call(c,0))}}var c=arguments,g=0,e=c.length,f=e,h=e<=1&&a&&d.isFunction(a.promise)?a:d.Deferred();if(e>1){for(;g<e;g++)c[g]&&d.isFunction(c[g].promise)?c[g].promise().then(b(g),h.reject):--f;f||h.resolveWith(h,c)}else h!==a&&h.resolveWith(h,e?[a]:[]);return h.promise()}});var Mb=d,ma;var o=l.createElement("div"),Nb=l.documentElement,na,C,T,U,u,D,s,V,J,W,x,X,K,Y,E,F;o.setAttribute("className","t");o.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
na=o.getElementsByTagName("*");C=o.getElementsByTagName("a")[0];if(!na||!na.length||!C)ma={};else{T=l.createElement("select");U=T.appendChild(l.createElement("option"));u=o.getElementsByTagName("input")[0];s={leadingWhitespace:3===o.firstChild.nodeType,tbody:!o.getElementsByTagName("tbody").length,htmlSerialize:!!o.getElementsByTagName("link").length,style:/top/.test(C.getAttribute("style")),hrefNormalized:"/a"===C.getAttribute("href"),opacity:/^0.55$/.test(C.style.opacity),cssFloat:!!C.style.cssFloat,
checkOn:"on"===u.value,optSelected:U.selected,getSetAttribute:"t"!==o.className,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0};u.checked=!0;s.noCloneChecked=u.cloneNode(!0).checked;T.disabled=!0;s.optDisabled=!U.disabled;try{delete o.test}catch(jc){s.deleteExpando=!1}!o.addEventListener&&(o.attachEvent&&o.fireEvent)&&(o.attachEvent("onclick",function(){s.noCloneEvent=false}),o.cloneNode(!0).fireEvent("onclick"));
u=l.createElement("input");u.value="t";u.setAttribute("type","radio");s.radioValue="t"===u.value;u.setAttribute("checked","checked");o.appendChild(u);V=l.createDocumentFragment();V.appendChild(o.firstChild);s.checkClone=V.cloneNode(!0).cloneNode(!0).lastChild.checked;o.innerHTML="";o.style.width=o.style.paddingLeft="1px";J=l.getElementsByTagName("body")[0];x=l.createElement(J?"div":"body");X={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};J&&d.extend(X,{position:"absolute",
left:"-1000px",top:"-1000px"});for(E in X)x.style[E]=X[E];x.appendChild(o);W=J||Nb;W.insertBefore(x,W.firstChild);s.appendChecked=u.checked;s.boxModel=2===o.offsetWidth;"zoom"in o.style&&(o.style.display="inline",o.style.zoom=1,s.inlineBlockNeedsLayout=2===o.offsetWidth,o.style.display="",o.innerHTML="<div style='width:4px;'></div>",s.shrinkWrapBlocks=2!==o.offsetWidth);o.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";K=o.getElementsByTagName("td");
F=0===K[0].offsetHeight;K[0].style.display="";K[1].style.display="none";s.reliableHiddenOffsets=F&&0===K[0].offsetHeight;o.innerHTML="";l.defaultView&&l.defaultView.getComputedStyle&&(D=l.createElement("div"),D.style.width="0",D.style.marginRight="0",o.appendChild(D),s.reliableMarginRight=0===(parseInt((l.defaultView.getComputedStyle(D,null)||{marginRight:0}).marginRight,10)||0));x.innerHTML="";W.removeChild(x);if(o.attachEvent)for(E in{submit:1,change:1,focusin:1})Y="on"+E,F=Y in o,F||(o.setAttribute(Y,
"return;"),F="function"===typeof o[Y]),s[E+"Bubbles"]=F;x=V=T=U=J=D=o=u=null;ma=s}Mb.support=ma;d.boxModel=d.support.boxModel;var lb=/^(?:\{.*\}|\[.*\])$/,kb=/([A-Z])/g;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!ha(a)},data:function(a,b,c,g){if(d.acceptData(a)){var e=d.expando,f=typeof b==="string",
h=a.nodeType,i=h?d.cache:a,j=h?a[d.expando]:a[d.expando]&&d.expando;if(j&&(!g||!j||!i[j]||i[j][e])||!(f&&c===m)){if(!j)h?a[d.expando]=j=++d.uuid:j=d.expando;if(!i[j]){i[j]={};if(!h)i[j].toJSON=d.noop}if(typeof b==="object"||typeof b==="function")g?i[j][e]=d.extend(i[j][e],b):i[j]=d.extend(i[j],b);a=i[j];if(g){a[e]||(a[e]={});a=a[e]}c!==m&&(a[d.camelCase(b)]=c);if(b==="events"&&!a[b])return a[e]&&a[e].events;if(f){c=a[b];c==null&&(c=a[d.camelCase(b)])}else c=a;return c}}},removeData:function(a,b,c){if(d.acceptData(a)){var g,
e=d.expando,f=a.nodeType,h=f?d.cache:a,i=f?a[d.expando]:d.expando;if(h[i]){if(b)if(g=c?h[i][e]:h[i]){g[b]||(b=d.camelCase(b));delete g[b];if(!ha(g))return}if(c){delete h[i][e];if(!ha(h[i]))return}b=h[i][e];d.support.deleteExpando||!h.setInterval?delete h[i]:h[i]=null;if(b){h[i]={};if(!f)h[i].toJSON=d.noop;h[i][e]=b}else f&&(d.support.deleteExpando?delete a[d.expando]:a.removeAttribute?a.removeAttribute(d.expando):a[d.expando]=null)}}},_data:function(a,b,c){return d.data(a,b,c,true)},acceptData:function(a){if(a.nodeName){var b=
d.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});d.fn.extend({data:function(a,b){var c=null;if(typeof a==="undefined"){if(this.length){c=d.data(this[0]);if(this[0].nodeType===1)for(var g=this[0].attributes,e,f=0,h=g.length;f<h;f++){e=g[f].name;if(e.indexOf("data-")===0){e=d.camelCase(e.substring(5));ya(this[0],e,c[e])}}}return c}if(typeof a==="object")return this.each(function(){d.data(this,a)});var i=a.split(".");i[1]=i[1]?"."+i[1]:"";if(b===
m){c=this.triggerHandler("getData"+i[1]+"!",[i[0]]);if(c===m&&this.length){c=d.data(this[0],a);c=ya(this[0],a,c)}return c===m&&i[1]?this.data(i[0]):c}return this.each(function(){var c=d(this),g=[i[0],b];c.triggerHandler("setData"+i[1]+"!",g);d.data(this,a,b);c.triggerHandler("changeData"+i[1]+"!",g)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}});d.extend({_mark:function(a,b){if(a){b=(b||"fx")+"mark";d.data(a,b,(d.data(a,b,m,true)||0)+1,true)}},_unmark:function(a,b,
c){if(a!==true){c=b;b=a;a=false}if(b){var c=c||"fx",g=c+"mark";if(a=a?0:(d.data(b,g,m,true)||1)-1)d.data(b,g,a,true);else{d.removeData(b,g,true);za(b,c,"mark")}}},queue:function(a,b,c){if(a){var b=(b||"fx")+"queue",g=d.data(a,b,m,true);c&&(!g||d.isArray(c)?g=d.data(a,b,d.makeArray(c),true):g.push(c));return g||[]}},dequeue:function(a,b){var b=b||"fx",c=d.queue(a,b),g=c.shift();g==="inprogress"&&(g=c.shift());if(g){b==="fx"&&c.unshift("inprogress");g.call(a,function(){d.dequeue(a,b)})}if(!c.length){d.removeData(a,
b+"queue",true);za(a,b,"queue")}}});d.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}return b===m?d.queue(this[0],a):this.each(function(){var c=d.queue(this,a,b);a==="fx"&&c[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a){function b(){--f||
c.resolveWith(g,[g])}typeof a!=="string"&&(a=m);for(var a=a||"fx",c=d.Deferred(),g=this,e=g.length,f=1,h=a+"defer",i=a+"queue",a=a+"mark",j;e--;)if(j=d.data(g[e],h,m,true)||(d.data(g[e],i,m,true)||d.data(g[e],a,m,true))&&d.data(g[e],h,d._Deferred(),true)){f++;j.done(b)}b();return c.promise()}});var Qa=/[\n\t\r]/g,oa=/\s+/,Ob=/\r/g,Pb=/^(?:button|input)$/i,Qb=/^(?:button|input|object|select|textarea)$/i,Rb=/^a(?:rea)?$/i,Ra=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
y,Sa;d.fn.extend({attr:function(a,b){return d.access(this,a,b,true,d.attr)},removeAttr:function(a){return this.each(function(){d.removeAttr(this,a)})},prop:function(a,b){return d.access(this,a,b,true,d.prop)},removeProp:function(a){a=d.propFix[a]||a;return this.each(function(){try{this[a]=m;delete this[a]}catch(b){}})},addClass:function(a){var b,c,g,e,f,h,i;if(d.isFunction(a))return this.each(function(b){d(this).addClass(a.call(this,b,this.className))});if(a&&typeof a==="string"){b=a.split(oa);c=
0;for(g=this.length;c<g;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";h=0;for(i=b.length;h<i;h++)~f.indexOf(" "+b[h]+" ")||(f=f+(b[h]+" "));e.className=d.trim(f)}}}return this},removeClass:function(a){var b,c,g,e,f,h,i;if(d.isFunction(a))return this.each(function(b){d(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a==="string"||a===m){b=(a||"").split(oa);c=0;for(g=this.length;c<g;c++){e=this[c];if(e.nodeType===1&&e.className)if(a){f=
(" "+e.className+" ").replace(Qa," ");h=0;for(i=b.length;h<i;h++)f=f.replace(" "+b[h]+" "," ");e.className=d.trim(f)}else e.className=""}}return this},toggleClass:function(a,b){var c=typeof a,g=typeof b==="boolean";return d.isFunction(a)?this.each(function(c){d(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string")for(var e,f=0,h=d(this),i=b,j=a.split(oa);e=j[f++];){i=g?i:!h.hasClass(e);h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean"){this.className&&
d._data(this,"__className__",this.className);this.className=this.className||a===false?"":d._data(this,"__className__")||""}})},hasClass:function(a){for(var a=" "+a+" ",b=0,c=this.length;b<c;b++)if(this[b].nodeType===1&&(" "+this[b].className+" ").replace(Qa," ").indexOf(a)>-1)return true;return false},val:function(a){var b,c,g=this[0];if(!arguments.length){if(g){if((b=d.valHooks[g.nodeName.toLowerCase()]||d.valHooks[g.type])&&"get"in b&&(c=b.get(g,"value"))!==m)return c;c=g.value;return typeof c===
"string"?c.replace(Ob,""):c==null?"":c}return m}var e=d.isFunction(a);return this.each(function(c){var g=d(this);if(this.nodeType===1){c=e?a.call(this,c,g.val()):a;c==null?c="":typeof c==="number"?c=c+"":d.isArray(c)&&(c=d.map(c,function(a){return a==null?"":a+""}));b=d.valHooks[this.nodeName.toLowerCase()]||d.valHooks[this.type];if(!b||!("set"in b)||b.set(this,c,"value")===m)this.value=c}})}});d.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},
select:{get:function(a){var b,c=a.selectedIndex,g=[],e=a.options,a=a.type==="select-one";if(c<0)return null;for(var f=a?c:0,h=a?c+1:e.length;f<h;f++){b=e[f];if(b.selected&&(d.support.optDisabled?!b.disabled:b.getAttribute("disabled")===null)&&(!b.parentNode.disabled||!d.nodeName(b.parentNode,"optgroup"))){b=d(b).val();if(a)return b;g.push(b)}}return a&&!g.length&&e.length?d(e[c]).val():g},set:function(a,b){var c=d.makeArray(b);d(a).find("option").each(function(){this.selected=d.inArray(d(this).val(),
c)>=0});if(!c.length)a.selectedIndex=-1;return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,b,c,g){var e=a.nodeType;if(!a||e===3||e===8||e===2)return m;if(g&&b in d.attrFn)return d(a)[b](c);if(!("getAttribute"in a))return d.prop(a,b,c);var f,h;if(g=e!==1||!d.isXMLDoc(a)){b=d.attrFix[b]||b;(h=d.attrHooks[b])||(Ra.test(b)?h=Sa:y&&(h=y))}if(c!==m){if(c===null){d.removeAttr(a,b);return m}if(h&&"set"in h&&g&&(f=h.set(a,c,
b))!==m)return f;a.setAttribute(b,""+c);return c}if(h&&"get"in h&&g&&(f=h.get(a,b))!==null)return f;f=a.getAttribute(b);return f===null?m:f},removeAttr:function(a,b){var c;if(a.nodeType===1){b=d.attrFix[b]||b;d.attr(a,b,"");a.removeAttribute(b);if(Ra.test(b)&&(c=d.propFix[b]||b)in a)a[c]=false}},attrHooks:{type:{set:function(a,b){if(Pb.test(a.nodeName)&&a.parentNode)d.error("type property can't be changed");else if(!d.support.radioValue&&b==="radio"&&d.nodeName(a,"input")){var c=a.value;a.setAttribute("type",
b);if(c)a.value=c;return b}}},value:{get:function(a,b){return y&&d.nodeName(a,"button")?y.get(a,b):b in a?a.value:null},set:function(a,b,c){if(y&&d.nodeName(a,"button"))return y.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,b,c){var g=
a.nodeType;if(!a||g===3||g===8||g===2)return m;var e,f;if(g!==1||!d.isXMLDoc(a)){b=d.propFix[b]||b;f=d.propHooks[b]}return c!==m?f&&"set"in f&&(e=f.set(a,c,b))!==m?e:a[b]=c:f&&"get"in f&&(e=f.get(a,b))!==null?e:a[b]},propHooks:{tabIndex:{get:function(a){var b=a.getAttributeNode("tabindex");return b&&b.specified?parseInt(b.value,10):Qb.test(a.nodeName)||Rb.test(a.nodeName)&&a.href?0:m}}}});d.attrHooks.tabIndex=d.propHooks.tabIndex;Sa={get:function(a,b){var c;return d.prop(a,b)===true||(c=a.getAttributeNode(b))&&
c.nodeValue!==false?b.toLowerCase():m},set:function(a,b,c){if(b===false)d.removeAttr(a,c);else{b=d.propFix[c]||c;b in a&&(a[b]=true);a.setAttribute(c,c.toLowerCase())}return c}};d.support.getSetAttribute||(y=d.valHooks.button={get:function(a,b){var c;return(c=a.getAttributeNode(b))&&c.nodeValue!==""?c.nodeValue:m},set:function(a,b,c){var d=a.getAttributeNode(c);if(!d){d=l.createAttribute(c);a.setAttributeNode(d)}return d.nodeValue=b+""}},d.each(["width","height"],function(a,b){d.attrHooks[b]=d.extend(d.attrHooks[b],
{set:function(a,d){if(d===""){a.setAttribute(b,"auto");return d}}})}));d.support.hrefNormalized||d.each(["href","src","width","height"],function(a,b){d.attrHooks[b]=d.extend(d.attrHooks[b],{get:function(a){a=a.getAttribute(b,2);return a===null?m:a}})});d.support.style||(d.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||m},set:function(a,b){return a.style.cssText=""+b}});d.support.optSelected||(d.propHooks.selected=d.extend(d.propHooks.selected,{get:function(a){if(a=a.parentNode){a.selectedIndex;
a.parentNode&&a.parentNode.selectedIndex}return null}}));d.support.checkOn||d.each(["radio","checkbox"],function(){d.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}});d.each(["radio","checkbox"],function(){d.valHooks[this]=d.extend(d.valHooks[this],{set:function(a,b){if(d.isArray(b))return a.checked=d.inArray(d(a).val(),b)>=0}})});var ia=/\.(.*)$/,pa=/^(?:textarea|input|select)$/i,nb=/\./g,ob=/ /g,Sb=/[^\w\s.|`]/g,Tb=function(a){return a.replace(Sb,"\\$&")};d.event=
{add:function(a,b,c,g){if(!(a.nodeType===3||a.nodeType===8)){if(c===false)c=w;else if(!c)return;var e,f;if(c.handler){e=c;c=e.handler}if(!c.guid)c.guid=d.guid++;if(f=d._data(a)){var h=f.events,i=f.handle;if(!h)f.events=h={};if(!i)f.handle=i=function(a){return typeof d!=="undefined"&&(!a||d.event.triggered!==a.type)?d.event.handle.apply(i.elem,arguments):m};i.elem=a;for(var b=b.split(" "),j,k=0,l;j=b[k++];){f=e?d.extend({},e):{handler:c,data:g};if(j.indexOf(".")>-1){l=j.split(".");j=l.shift();f.namespace=
l.slice(0).sort().join(".")}else{l=[];f.namespace=""}f.type=j;if(!f.guid)f.guid=c.guid;var n=h[j],q=d.event.special[j]||{};if(!n){n=h[j]=[];if(!q.setup||q.setup.call(a,g,l,i)===false)a.addEventListener?a.addEventListener(j,i,false):a.attachEvent&&a.attachEvent("on"+j,i)}if(q.add){q.add.call(a,f);if(!f.handler.guid)f.handler.guid=c.guid}n.push(f);d.event.global[j]=true}a=null}}},global:{},remove:function(a,b,c,g){if(!(a.nodeType===3||a.nodeType===8)){c===false&&(c=w);var e,f,h=0,i,j,k,l,n,q,p=d.hasData(a)&&
d._data(a),o=p&&p.events;if(p&&o){if(b&&b.type){c=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in o)d.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[h++];){l=e;i=e.indexOf(".")<0;j=[];if(!i){j=e.split(".");e=j.shift();k=RegExp("(^|\\.)"+d.map(j.slice(0).sort(),Tb).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(n=o[e])if(c){l=d.event.special[e]||{};for(f=g||0;f<n.length;f++){q=n[f];if(c.guid===q.guid){if(i||k.test(q.namespace)){g==null&&n.splice(f--,1);l.remove&&l.remove.call(a,
q)}if(g!=null)break}}if(n.length===0||g!=null&&n.length===1){(!l.teardown||l.teardown.call(a,j)===false)&&d.removeEvent(a,e,p.handle);delete o[e]}}else for(f=0;f<n.length;f++){q=n[f];if(i||k.test(q.namespace)){d.event.remove(a,l,q.handler,f);n.splice(f--,1)}}}if(d.isEmptyObject(o)){if(b=p.handle)b.elem=null;delete p.events;delete p.handle;d.isEmptyObject(p)&&d.removeData(a,m,true)}}}}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(a,b,c,g){var e=a.type||a,f=[],h;if(e.indexOf("!")>=
0){e=e.slice(0,-1);h=true}if(e.indexOf(".")>=0){f=e.split(".");e=f.shift();f.sort()}if(c&&!d.event.customEvent[e]||d.event.global[e]){a=typeof a==="object"?a[d.expando]?a:new d.Event(e,a):new d.Event(e);a.type=e;a.exclusive=h;a.namespace=f.join(".");a.namespace_re=RegExp("(^|\\.)"+f.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!c){a.preventDefault();a.stopPropagation()}if(c){if(!(c.nodeType===3||c.nodeType===8)){a.result=m;a.target=c;b=b!=null?d.makeArray(b):[];b.unshift(a);f=c;g=e.indexOf(":")<0?"on"+
e:"";do{h=d._data(f,"handle");a.currentTarget=f;h&&h.apply(f,b);if(g&&d.acceptData(f)&&f[g]&&f[g].apply(f,b)===false){a.result=false;a.preventDefault()}f=f.parentNode||f.ownerDocument||f===a.target.ownerDocument&&r}while(f&&!a.isPropagationStopped());if(!a.isDefaultPrevented()){var i,f=d.event.special[e]||{};if((!f._default||f._default.call(c.ownerDocument,a)===false)&&!(e==="click"&&d.nodeName(c,"a"))&&d.acceptData(c)){try{if(g&&c[e]){(i=c[g])&&(c[g]=null);d.event.triggered=e;c[e]()}}catch(j){}i&&
(c[g]=i);d.event.triggered=m}}return a.result}}else d.each(d.cache,function(){var c=this[d.expando];c&&(c.events&&c.events[e])&&d.event.trigger(a,b,c.handle.elem)})}},handle:function(a){var a=d.event.fix(a||r.event),b=((d._data(this,"events")||{})[a.type]||[]).slice(0),c=!a.exclusive&&!a.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=a;a.currentTarget=this;for(var e=0,f=b.length;e<f;e++){var h=b[e];if(c||a.namespace_re.test(h.namespace)){a.handler=h.handler;a.data=h.data;a.handleObj=h;h=
h.handler.apply(this,g);if(h!==m){a.result=h;if(h===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;
for(var b=a,a=d.Event(b),c=this.props.length,g;c;){g=this.props[--c];a[g]=b[g]}if(!a.target)a.target=a.srcElement||l;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){c=a.target.ownerDocument||l;b=c.documentElement;c=c.body;a.pageX=a.clientX+(b&&b.scrollLeft||c&&c.scrollLeft||0)-(b&&b.clientLeft||c&&c.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||c&&c.scrollTop||
0)-(b&&b.clientTop||c&&c.clientTop||0)}if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==m)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,P(a.origType,a.selector),d.extend({},a,{handler:mb,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,P(a.origType,
a.selector),a)}},beforeunload:{setup:function(a,b,c){if(d.isWindow(this))this.onbeforeunload=c},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};d.removeEvent=l.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,false)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};d.Event=function(a,b){if(!this.preventDefault)return new d.Event(a,b);if(a&&a.type){this.originalEvent=a;this.type=a.type;this.isDefaultPrevented=a.defaultPrevented||
a.returnValue===false||a.getPreventDefault&&a.getPreventDefault()?O:w}else this.type=a;b&&d.extend(this,b);this.timeStamp=d.now();this[d.expando]=true};d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=O;var a=this.originalEvent;if(a)a.preventDefault?a.preventDefault():a.returnValue=false},stopPropagation:function(){this.isPropagationStopped=O;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=
O;this.stopPropagation()},isDefaultPrevented:w,isPropagationStopped:w,isImmediatePropagationStopped:w};var Ta=function(a){var b=a.relatedTarget,c=false,g=a.type;a.type=a.data;if(b!==this){b&&(c=d.contains(this,b));if(!c){d.event.handle.apply(this,arguments);a.type=g}}},Ua=function(a){a.type=a.data;d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?Ua:Ta,a)},teardown:function(a){d.event.remove(this,
b,a&&a.selector?Ua:Ta)}}});d.support.submitBubbles||(d.event.special.submit={setup:function(){if(d.nodeName(this,"form"))return false;d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=d.nodeName(b,"input")||d.nodeName(b,"button")?b.type:"";(c==="submit"||c==="image")&&d(b).closest("form").length&&Aa("submit",this,arguments)});d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=d.nodeName(b,"input")||d.nodeName(b,"button")?b.type:"";(c==="text"||c==="password")&&
(d(b).closest("form").length&&a.keyCode===13)&&Aa("submit",this,arguments)})},teardown:function(){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var L,Va=function(a){var b=d.nodeName(a,"input")?a.type:"",c=a.value;if(b==="radio"||b==="checkbox")c=a.checked;else if(b==="select-multiple")c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"";else if(d.nodeName(a,"select"))c=a.selectedIndex;return c},Z=function(a,b){var c=a.target,g,e;if(pa.test(c.nodeName)&&
!c.readOnly){g=d._data(c,"_change_data");e=Va(c);(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",e);if(!(g===m||e===g))if(g!=null||e){a.type="change";a.liveFired=m;d.event.trigger(a,b,c)}}};d.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,c=d.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||d.nodeName(b,"select"))&&Z.call(this,a)},keydown:function(a){var b=a.target,c=d.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!d.nodeName(b,
"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&Z.call(this,a)},beforeactivate:function(a){a=a.target;d._data(a,"_change_data",Va(a))}},setup:function(){if(this.type==="file")return false;for(var a in L)d.event.add(this,a+".specialChange",L[a]);return pa.test(this.nodeName)},teardown:function(){d.event.remove(this,".specialChange");return pa.test(this.nodeName)}};L=d.event.special.change.filters;L.focus=L.beforeactivate}d.support.focusinBubbles||d.each({focus:"focusin",
blur:"focusout"},function(a,b){function c(a){var c=d.event.fix(a);c.type=b;c.originalEvent={};d.event.trigger(c,null,c.target);c.isDefaultPrevented()&&a.preventDefault()}var g=0;d.event.special[b]={setup:function(){g++===0&&l.addEventListener(a,c,true)},teardown:function(){--g===0&&l.removeEventListener(a,c,true)}}});d.each(["bind","one"],function(a,b){d.fn[b]=function(a,g,e){var f;if(typeof a==="object"){for(var h in a)this[b](h,g,a[h],e);return this}if(arguments.length===2||g===false){e=g;g=m}if(b===
"one"){f=function(a){d(this).unbind(a,f);return e.apply(this,arguments)};f.guid=e.guid||d.guid++}else f=e;if(a==="unload"&&b!=="one")this.one(a,g,e);else{h=0;for(var i=this.length;h<i;h++)d.event.add(this[h],a,f,g)}return this}});d.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var c in a)this.unbind(c,a[c]);else{c=0;for(var g=this.length;c<g;c++)d.event.remove(this[c],a,b)}return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===
0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return d.event.trigger(a,b,this[0],true)},toggle:function(a){var b=arguments,c=a.guid||d.guid++,g=0,e=function(c){var e=(d.data(this,"lastToggle"+a.guid)||0)%g;d.data(this,"lastToggle"+a.guid,e+1);c.preventDefault();return b[e].apply(this,arguments)||false};for(e.guid=c;g<b.length;)b[g++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||
a)}});var qa={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,b){d.fn[b]=function(a,g,e,f){var h=0,i,j,k=f||this.selector,l=f?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(i in a)l[b](i,g,a[i],k);return this}if(b==="die"&&!a&&f&&f.charAt(0)==="."){l.unbind(f);return this}if(g===false||d.isFunction(g)){e=g||w;g=m}for(a=(a||"").split(" ");(f=a[h++])!=null;){i=ia.exec(f);j="";if(i){j=i[0];f=f.replace(ia,"")}if(f==="hover")a.push("mouseenter"+
j,"mouseleave"+j);else{i=f;if(qa[f]){a.push(qa[f]+j);f=f+j}else f=(qa[f]||f)+j;if(b==="live"){j=0;for(var n=l.length;j<n;j++)d.event.add(l[j],"live."+P(f,k),{data:g,selector:k,handler:e,origType:f,origHandler:e,preType:i})}else l.unbind("live."+P(f,k),e)}}return this}});d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=
function(a,d){if(d==null){d=a;a=null}return arguments.length>0?this.bind(b,a,d):this.trigger(b)};d.attrFn&&(d.attrFn[b]=true)});var Wa=function(a,b,c,d,e,f){for(var e=0,h=d.length;e<h;e++){var i=d[e];if(i){for(var j=false,i=i[a];i;){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1&&!f){i.sizcache=c;i.sizset=e}if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[e]=j}}},Xa=function(a,b,c,d,e,f){for(var e=0,h=d.length;e<h;e++){var i=d[e];if(i){for(var j=false,i=i[a];i;){if(i.sizcache===c){j=
d[i.sizset];break}if(i.nodeType===1){if(!f){i.sizcache=c;i.sizset=e}if(typeof b!=="string"){if(i===b){j=true;break}}else if(n.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[e]=j}}},ra=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,sa=0,Ya=Object.prototype.toString,aa=!1,Za=!0,G=/\\/g,ba=/\W/;[0,0].sort(function(){Za=false;return 0});var n=function(a,b,c,d){var c=c||[],e=b=b||l;if(b.nodeType!==1&&b.nodeType!==9)return[];
if(!a||typeof a!=="string")return c;var f,h,i,j,k,m=true,o=n.isXML(b),q=[],r=a;do{ra.exec("");if(f=ra.exec(r)){r=f[3];q.push(f[1]);if(f[2]){j=f[3];break}}}while(f);if(q.length>1&&Ub.exec(a))if(q.length===2&&p.relative[q[0]])h=$a(q[0]+q[1],b);else for(h=p.relative[q[0]]?[b]:n(q.shift(),b);q.length;){a=q.shift();p.relative[a]&&(a=a+q.shift());h=$a(a,h)}else{if(!d&&q.length>1&&b.nodeType===9&&!o&&p.match.ID.test(q[0])&&!p.match.ID.test(q[q.length-1])){f=n.find(q.shift(),b,o);b=f.expr?n.filter(f.expr,
f.set)[0]:f.set[0]}if(b){f=d?{expr:q.pop(),set:v(d)}:n.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&b.parentNode?b.parentNode:b,o);h=f.expr?n.filter(f.expr,f.set):f.set;for(q.length>0?i=v(h):m=false;q.length;){f=k=q.pop();p.relative[k]?f=q.pop():k="";f==null&&(f=b);p.relative[k](i,f,o)}}else i=[]}i||(i=h);i||n.error(k||a);if(Ya.call(i)==="[object Array]")if(m)if(b&&b.nodeType===1)for(a=0;i[a]!=null;a++)i[a]&&(i[a]===true||i[a].nodeType===1&&n.contains(b,i[a]))&&c.push(h[a]);else for(a=0;i[a]!=
null;a++)i[a]&&i[a].nodeType===1&&c.push(h[a]);else c.push.apply(c,i);else v(i,c);if(j){n(j,e,c,d);n.uniqueSort(c)}return c};n.uniqueSort=function(a){if(ca){aa=Za;a.sort(ca);if(aa)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a};n.matches=function(a,b){return n(a,null,null,b)};n.matchesSelector=function(a,b){return n(b,null,null,[a]).length>0};n.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=p.order.length;e<f;e++){var h,i=p.order[e];if(h=p.leftMatch[i].exec(a)){var j=
h[1];h.splice(1,1);if(j.substr(j.length-1)!=="\\"){h[1]=(h[1]||"").replace(G,"");d=p.find[i](h,b,c);if(d!=null){a=a.replace(p.match[i],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};n.filter=function(a,b,c,d){for(var e,f,h=a,i=[],j=b,k=b&&b[0]&&n.isXML(b[0]);a&&b.length;){for(var l in p.filter)if((e=p.leftMatch[l].exec(a))!=null&&e[2]){var o,q,r=p.filter[l];q=e[1];f=false;e.splice(1,1);if(q.substr(q.length-1)!=="\\"){j===i&&(i=
[]);if(p.preFilter[l])if(e=p.preFilter[l](e,j,c,i,d,k)){if(e===true)continue}else f=o=true;if(e)for(var s=0;(q=j[s])!=null;s++)if(q){o=r(q,e,s,j);var t=d^!!o;if(c&&o!=null)t?f=true:j[s]=false;else if(t){i.push(q);f=true}}if(o!==m){c||(j=i);a=a.replace(p.match[l],"");if(!f)return[];break}}}if(a===h)if(f==null)n.error(a);else break;h=a}return j};n.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var p=n.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},
leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!ba.test(b),c=c&&!d;d&&(b=b.toLowerCase());for(var d=0,e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[d]=c||f&&f.nodeName.toLowerCase()===b?f||false:f===b}c&&n.filter(b,a,true)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&
!ba.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e]){c=c.parentNode;a[e]=c.nodeName.toLowerCase()===b?c:false}}else{for(;e<f;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&n.filter(b,a,true)}},"":function(a,b,c){var d,e=sa++,f=Xa;if(typeof b==="string"&&!ba.test(b)){d=b=b.toLowerCase();f=Wa}f("parentNode",b,e,a,d,c)},"~":function(a,b,c){var d,e=sa++,f=Xa;if(typeof b==="string"&&!ba.test(b)){d=b=b.toLowerCase();f=Wa}f("previousSibling",b,e,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!==
"undefined"&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(G,"")+" ";if(f)return a;for(var f=0,h;(h=b[f])!=null;f++)h&&(e^(h.className&&
(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[f]=false));return false},ID:function(a){return a[1].replace(G,"")},TAG:function(a){return a[1].replace(G,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||n.error(a[0]);a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}else a[2]&&n.error(a[0]);a[0]=sa++;return a},ATTR:function(a,
b,c,d,e,f){b=a[1]=a[1].replace(G,"");!f&&p.attrMap[b]&&(a[1]=p.attrMap[b]);a[4]=(a[4]||a[5]||"").replace(G,"");a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,d,e){if(a[1]==="not")if((ra.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=n(a[3],null,null,b);else{a=n.filter(a[3],b,c,1^e);c||d.push.apply(d,a);return false}else if(p.match.POS.test(a[0])||p.match.CHILD.test(a[0]))return true;return a},POS:function(a){a.unshift(true);return a}},filters:{enabled:function(a){return a.disabled===
false&&a.type!=="hidden"},disabled:function(a){return a.disabled===true},checked:function(a){return a.checked===true},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===true},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!n(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===
a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===
0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=p.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return false;return true}n.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case "only":case "first":for(;d=
d.previousSibling;)if(d.nodeType===1)return false;if(c==="first")return true;d=a;case "last":for(;d=d.nextSibling;)if(d.nodeType===1)return false;return true;case "nth":var c=b[2],e=b[3];if(c===1&&e===0)return true;var f=b[0],h=a.parentNode;if(h&&(h.sizcache!==f||!a.nodeIndex)){for(var i=0,d=h.firstChild;d;d=d.nextSibling)if(d.nodeType===1)d.nodeIndex=++i;h.sizcache=f}d=a.nodeIndex-e;return c===0?d===0:d%c===0&&d/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,
b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],c=p.attrHandle[c]?p.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),d=c+"",e=b[2],f=b[4];return c==null?e==="!=":e==="="?d===f:e==="*="?d.indexOf(f)>=0:e==="~="?(" "+d+" ").indexOf(f)>=0:!f?d&&c!==false:e==="!="?d!==f:e==="^="?d.indexOf(f)===0:e==="$="?d.substr(d.length-f.length)===f:e==="|="?d===f||d.substr(0,f.length+
1)===f+"-":false},POS:function(a,b,c,d){var e=p.setFilters[b[2]];if(e)return e(a,c,b,d)}}},Ub=p.match.POS,Vb=function(a,b){return"\\"+(b-0+1)},M;for(M in p.match)p.match[M]=RegExp(p.match[M].source+/(?![^\[]*\])(?![^\(]*\))/.source),p.leftMatch[M]=RegExp(/(^(?:.|\r|\n)*?)/.source+p.match[M].source.replace(/\\(\d+)/g,Vb));var v=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(l.documentElement.childNodes,0)[0].nodeType}catch(kc){v=
function(a,b){var c=0,d=b||[];if(Ya.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var ca,N;l.documentElement.compareDocumentPosition?ca=function(a,b){if(a===b){aa=true;return 0}return!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition?-1:1:a.compareDocumentPosition(b)&4?-1:1}:(ca=function(a,b){var c,d,e=[],f=[];c=a.parentNode;d=b.parentNode;
var h=c;if(a===b){aa=true;return 0}if(c===d)return N(a,b);if(c){if(!d)return 1}else return-1;for(;h;){e.unshift(h);h=h.parentNode}for(h=d;h;){f.unshift(h);h=h.parentNode}c=e.length;d=f.length;for(h=0;h<c&&h<d;h++)if(e[h]!==f[h])return N(e[h],f[h]);return h===c?N(a,f[h],-1):N(e[h],b,1)},N=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});n.getText=function(a){for(var b="",c,d=0;a[d];d++){c=a[d];c.nodeType===3||c.nodeType===4?b=b+c.nodeValue:c.nodeType!==
8&&(b=b+n.getText(c.childNodes))}return b};var da=l.createElement("div"),ab="script"+(new Date).getTime(),ea=l.documentElement;da.innerHTML="<a name='"+ab+"'/>";ea.insertBefore(da,ea.firstChild);l.getElementById(ab)&&(p.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c)return(b=b.getElementById(a[1]))?b.id===a[1]||typeof b.getAttributeNode!=="undefined"&&b.getAttributeNode("id").nodeValue===a[1]?[b]:m:[]},p.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&
a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b});ea.removeChild(da);var ea=da=null,z=l.createElement("div");z.appendChild(l.createComment(""));0<z.getElementsByTagName("*").length&&(p.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){for(var d=[],e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c});z.innerHTML="<a href='#'></a>";z.firstChild&&("undefined"!==typeof z.firstChild.getAttribute&&"#"!==z.firstChild.getAttribute("href"))&&(p.attrHandle.href=
function(a){return a.getAttribute("href",2)});z=null;if(l.querySelectorAll){var ta=n,fa=l.createElement("div");fa.innerHTML="<p class='TEST'></p>";if(!(fa.querySelectorAll&&0===fa.querySelectorAll(".TEST").length)){var n=function(a,b,c,d){b=b||l;if(!d&&!n.isXML(b)){var e=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(a);if(e&&(b.nodeType===1||b.nodeType===9)){if(e[1])return v(b.getElementsByTagName(a),c);if(e[2]&&p.find.CLASS&&b.getElementsByClassName)return v(b.getElementsByClassName(e[2]),c)}if(b.nodeType===
9){if(a==="body"&&b.body)return v([b.body],c);if(e&&e[3]){var f=b.getElementById(e[3]);if(f&&f.parentNode){if(f.id===e[3])return v([f],c)}else return v([],c)}try{return v(b.querySelectorAll(a),c)}catch(h){}}else if(b.nodeType===1&&b.nodeName.toLowerCase()!=="object"){var e=b,i=(f=b.getAttribute("id"))||"__sizzle__",j=b.parentNode,k=/^\s*[+~]/.test(a);f?i=i.replace(/'/g,"\\$&"):b.setAttribute("id",i);if(k&&j)b=b.parentNode;try{if(!k||j)return v(b.querySelectorAll("[id='"+i+"'] "+a),c)}catch(m){}finally{f||
e.removeAttribute("id")}}}return ta(a,b,c,d)},ua;for(ua in ta)n[ua]=ta[ua];fa=null}}var ga=l.documentElement,va=ga.matchesSelector||ga.mozMatchesSelector||ga.webkitMatchesSelector||ga.msMatchesSelector,bb=!1;try{va.call(l.documentElement,"[test!='']:sizzle")}catch(lc){bb=!0}va&&(n.matchesSelector=function(a,b){b=b.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!n.isXML(a))try{if(bb||!p.match.PSEUDO.test(b)&&!/!=/.test(b))return va.call(a,b)}catch(c){}return n(b,null,null,[a]).length>0});var H=l.createElement("div");
H.innerHTML="<div class='test e'></div><div class='test'></div>";H.getElementsByClassName&&0!==H.getElementsByClassName("e").length&&(H.lastChild.className="e",1!==H.getElementsByClassName("e").length&&(p.order.splice(1,0,"CLASS"),p.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},H=null));n.contains=l.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):true)}:l.documentElement.compareDocumentPosition?
function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return false};n.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false};var $a=function(a,b){for(var c,d=[],e="",f=b.nodeType?[b]:b;c=p.match.PSEUDO.exec(a);){e=e+c[0];a=a.replace(p.match.PSEUDO,"")}a=p.relative[a]?a+"*":a;c=0;for(var h=f.length;c<h;c++)n(a,f[c],d);return n.filter(e,d)};d.find=n;d.expr=n.selectors;d.expr[":"]=d.expr.filters;d.unique=n.uniqueSort;d.text=n.getText;d.isXMLDoc=
n.isXML;d.contains=n.contains;var Wb=/Until$/,Xb=/^(?:parents|prevUntil|prevAll)/,Yb=/,/,pb=/^.[^:#\[\.,]*$/,Zb=Array.prototype.slice,cb=d.expr.match.POS,$b={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this,c,g;if(typeof a!=="string")return d(a).filter(function(){c=0;for(g=b.length;c<g;c++)if(d.contains(b[c],this))return true});var e=this.pushStack("","find",a),f,h,i;c=0;for(g=this.length;c<g;c++){f=e.length;d.find(a,this[c],e);if(c>0)for(h=f;h<e.length;h++)for(i=
0;i<f;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,g=b.length;a<g;a++)if(d.contains(this,b[a]))return true})},not:function(a){return this.pushStack(Ba(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ba(this,a,true),"filter",a)},is:function(a){return!!a&&(typeof a==="string"?d.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],g,e,f=this[0];if(d.isArray(a)){var h,i={},j=1;if(f&&
a.length){g=0;for(e=a.length;g<e;g++){h=a[g];i[h]||(i[h]=cb.test(h)?d(h,b||this.context):h)}for(;f&&f.ownerDocument&&f!==b;){for(h in i){g=i[h];(g.jquery?g.index(f)>-1:d(f).is(g))&&c.push({selector:h,elem:f,level:j})}f=f.parentNode;j++}}return c}h=cb.test(a)||typeof a!=="string"?d(a,b||this.context):0;g=0;for(e=this.length;g<e;g++)for(f=this[g];f;)if(h?h.index(f)>-1:d.find.matchesSelector(f,a)){c.push(f);break}else{f=f.parentNode;if(!f||!f.ownerDocument||f===b||f.nodeType===11)break}c=c.length>1?
d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return!a?this[0]&&this[0].parentNode?this.prevAll().length:-1:typeof a==="string"?d.inArray(this[0],d(a)):d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a&&a.nodeType?[a]:a),g=d.merge(this.get(),c);return this.pushStack(!c[0]||!c[0].parentNode||c[0].parentNode.nodeType===11||!g[0]||!g[0].parentNode||g[0].parentNode.nodeType===11?g:d.unique(g))},andSelf:function(){return this.add(this.prevObject)}});
d.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",
c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,g){var e=d.map(this,b,c),f=Zb.call(arguments);Wb.test(a)||(g=c);g&&typeof g==="string"&&(e=d.filter(g,e));e=this.length>1&&!$b[a]?d.unique(e):e;if((this.length>1||Yb.test(g))&&Xb.test(a))e=e.reverse();return this.pushStack(e,
a,f.join(","))}});d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,b,c){for(var g=[],a=a[b];a&&a.nodeType!==9&&(c===m||a.nodeType!==1||!d(a).is(c));){a.nodeType===1&&g.push(a);a=a[b]}return g},nth:function(a,b,c){for(var b=b||1,d=0;a;a=a[c])if(a.nodeType===1&&++d===b)break;return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var ac=/ jQuery\d+="(?:\d+|null)"/g,
wa=/^\s+/,db=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,eb=/<([\w:]+)/,bc=/<tbody/i,cc=/<|&#?\w+;/,fb=/<(?:script|object|embed|option|style)/i,gb=/checked\s*(?:[^=]|=\s*.checked.)/i,dc=/\/(java|ecma)script/i,rb=/^\s*<!(?:\[CDATA\[|\-\-)/,t={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>",
"</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};t.optgroup=t.option;t.tbody=t.tfoot=t.colgroup=t.caption=t.thead;t.th=t.td;d.support.htmlSerialize||(t._default=[1,"div<div>","</div>"]);d.fn.extend({text:function(a){return d.isFunction(a)?this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))}):typeof a!=="object"&&a!==m?this.empty().append((this[0]&&this[0].ownerDocument||l).createTextNode(a)):d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,
b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&a.firstChild.nodeType===1;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return d.isFunction(a)?this.each(function(b){d(this).wrapInner(a.call(this,b))}):this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,
"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,
"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,g;(g=this[c])!=null;c++)if(!a||d.filter(a,[g]).length){if(!b&&g.nodeType===1){d.cleanData(g.getElementsByTagName("*"));d.cleanData([g])}g.parentNode&&g.parentNode.removeChild(g)}return this},
empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a,b){a=a==null?false:a;b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===m)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ac,""):null;if(typeof a==="string"&&!fb.test(a)&&(d.support.leadingWhitespace||!wa.test(a))&&!t[(eb.exec(a)||["",""])[1].toLowerCase()]){a=
a.replace(db,"<$1></$2>");try{for(var b=0,c=this.length;b<c;b++)if(this[b].nodeType===1){d.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(g){this.empty().append(a)}}else d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),g=c.html();c.replaceWith(a.call(this,b,g))});typeof a!=="string"&&
(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove();b?d(b).before(a):d(c).append(a)})}return this.length?this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,true)},domManip:function(a,b,c){var g,e,f,h=a[0],i=[];if(!d.support.checkClone&&arguments.length===3&&typeof h==="string"&&gb.test(h))return this.each(function(){d(this).domManip(a,b,c,true)});if(d.isFunction(h))return this.each(function(e){var f=
d(this);a[0]=h.call(this,e,b?f.html():m);f.domManip(a,b,c)});if(this[0]){g=h&&h.parentNode;g=d.support.parentNode&&g&&g.nodeType===11&&g.childNodes.length===this.length?{fragment:g}:d.buildFragment(a,this,i);f=g.fragment;if(e=f.childNodes.length===1?f=f.firstChild:f.firstChild){b=b&&d.nodeName(e,"tr");e=0;for(var j=this.length,k=j-1;e<j;e++)c.call(b?d.nodeName(this[e],"table")?this[e].getElementsByTagName("tbody")[0]||this[e].appendChild(this[e].ownerDocument.createElement("tbody")):this[e]:this[e],
g.cacheable||j>1&&e<k?d.clone(f,true,true):f)}i.length&&d.each(i,qb)}return this}});d.buildFragment=function(a,b,c){var g,e,f,h;b&&b[0]&&(h=b[0].ownerDocument||b[0]);h.createDocumentFragment||(h=l);if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&h===l&&a[0].charAt(0)==="<"&&!fb.test(a[0])&&(d.support.checkClone||!gb.test(a[0]))){e=true;(f=d.fragments[a[0]])&&f!==1&&(g=f)}if(!g){g=h.createDocumentFragment();d.clean(a,h,g,c)}e&&(d.fragments[a[0]]=f?g:1);return{fragment:g,cacheable:e}};d.fragments=
{};d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var g=[],c=d(c),e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&c.length===1){c[b](this[0]);return this}for(var e=0,f=c.length;e<f;e++){var h=(e>0?this.clone(true):this).get();d(c[e])[b](h);g=g.concat(h)}return this.pushStack(g,a,c.selector)}});d.extend({clone:function(a,b,c){var g=a.cloneNode(true),e,f,h;if((!d.support.noCloneEvent||
!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){Da(a,g);e=Q(a);f=Q(g);for(h=0;e[h];++h)f[h]&&Da(e[h],f[h])}if(b){Ca(a,g);if(c){e=Q(a);f=Q(g);for(h=0;e[h];++h)Ca(e[h],f[h])}}return g},clean:function(a,b,c,g){b=b||l;typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||l);for(var e=[],f,h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i=i+"");if(i){if(typeof i==="string")if(cc.test(i)){i=i.replace(db,"<$1></$2>");f=(eb.exec(i)||["",""])[1].toLowerCase();
var j=t[f]||t._default,k=j[0],m=b.createElement("div");for(m.innerHTML=j[1]+i+j[2];k--;)m=m.lastChild;if(!d.support.tbody){k=bc.test(i);j=f==="table"&&!k?m.firstChild&&m.firstChild.childNodes:j[1]==="<table>"&&!k?m.childNodes:[];for(f=j.length-1;f>=0;--f)d.nodeName(j[f],"tbody")&&!j[f].childNodes.length&&j[f].parentNode.removeChild(j[f])}!d.support.leadingWhitespace&&wa.test(i)&&m.insertBefore(b.createTextNode(wa.exec(i)[0]),m.firstChild);i=m.childNodes}else i=b.createTextNode(i);var n;if(!d.support.appendChecked)if(i[0]&&
typeof(n=i.length)==="number")for(f=0;f<n;f++)Fa(i[f]);else Fa(i);i.nodeType?e.push(i):e=d.merge(e,i)}}if(c){a=function(a){return!a.type||dc.test(a.type)};for(h=0;e[h];h++)if(g&&d.nodeName(e[h],"script")&&(!e[h].type||e[h].type.toLowerCase()==="text/javascript"))g.push(e[h].parentNode?e[h].parentNode.removeChild(e[h]):e[h]);else{if(e[h].nodeType===1){b=d.grep(e[h].getElementsByTagName("script"),a);e.splice.apply(e,[h+1,0].concat(b))}c.appendChild(e[h])}}return e},cleanData:function(a){for(var b,c,
g=d.cache,e=d.expando,f=d.event.special,h=d.support.deleteExpando,i=0,j;(j=a[i])!=null;i++)if(!j.nodeName||!d.noData[j.nodeName.toLowerCase()])if(c=j[d.expando]){if((b=g[c]&&g[c][e])&&b.events){for(var k in b.events)f[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);if(b.handle)b.handle.elem=null}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando);delete g[c]}}});var xa=/alpha\([^)]*\)/i,ec=/opacity=([^)]*)/,fc=/([A-Z]|^ms)/g,hb=/^-?\d+(?:px)?$/i,gc=/^-?\d/,hc=/^([\-+])=([\-+.\de]+)/,
ic={position:"absolute",visibility:"hidden",display:"block"},sb=["Left","Right"],tb=["Top","Bottom"],A,ib,jb;d.fn.css=function(a,b){return arguments.length===2&&b===m?this:d.access(this,a,b,true,function(a,b,e){return e!==m?d.style(a,b,e):d.css(a,b)})};d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=A(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":d.support.cssFloat?
"cssFloat":"styleFloat"},style:function(a,b,c,g){if(a&&!(a.nodeType===3||a.nodeType===8||!a.style)){var e,f=d.camelCase(b),h=a.style,i=d.cssHooks[f],b=d.cssProps[f]||f;if(c!==m){g=typeof c;if(g==="string"&&(e=hc.exec(c))){c=+(e[1]+1)*+e[2]+parseFloat(d.css(a,b));g="number"}if(!(c==null||g==="number"&&isNaN(c))){g==="number"&&!d.cssNumber[f]&&(c=c+"px");if(!i||!("set"in i)||(c=i.set(a,c))!==m)try{h[b]=c}catch(j){}}}else return i&&"get"in i&&(e=i.get(a,false,g))!==m?e:h[b]}},css:function(a,b,c){var g,
e,b=d.camelCase(b);e=d.cssHooks[b];b=d.cssProps[b]||b;b==="cssFloat"&&(b="float");if(e&&"get"in e&&(g=e.get(a,true,c))!==m)return g;if(A)return A(a,b)},swap:function(a,b,c){var d={},e;for(e in b){d[e]=a.style[e];a.style[e]=b[e]}c.call(a);for(e in b)a.style[e]=d[e]}});d.curCSS=d.css;d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,g,e){var f;if(g){if(a.offsetWidth!==0)return Ga(a,b,e);d.swap(a,ic,function(){f=Ga(a,b,e)});return f}},set:function(a,b){if(hb.test(b)){b=parseFloat(b);
if(b>=0)return b+"px"}else return b}}});d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return ec.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,g=a.currentStyle,e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=g&&g.filter||c.filter||"";c.zoom=1;if(b>=1&&d.trim(f.replace(xa,""))===""){c.removeAttribute("filter");if(g&&!g.filter)return}c.filter=xa.test(f)?f.replace(xa,e):f+" "+e}});d(function(){if(!d.support.reliableMarginRight)d.cssHooks.marginRight=
{get:function(a,b){var c;d.swap(a,{display:"inline-block"},function(){c=b?A(a,"margin-right","marginRight"):a.style.marginRight});return c}}});l.defaultView&&l.defaultView.getComputedStyle&&(ib=function(a,b){var c,g,b=b.replace(fc,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return m;if(g=g.getComputedStyle(a,null)){c=g.getPropertyValue(b);c===""&&!d.contains(a.ownerDocument.documentElement,a)&&(c=d.style(a,b))}return c});l.documentElement.currentStyle&&(jb=function(a,b){var c,d=a.currentStyle&&
a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;if(!hb.test(d)&&gc.test(d)){c=f.left;if(e)a.runtimeStyle.left=a.currentStyle.left;f.left=b==="fontSize"?"1em":d||0;d=f.pixelLeft+"px";f.left=c;if(e)a.runtimeStyle.left=e}return d===""?"auto":d});A=ib||jb;d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});
return d}(window);


var optimizelyCode = function(){
var DATA={"log_host":"log.optimizely.com","goal_expressions":{"7721681791":["^all\\_clicks$"],"3392121218":["^footer\\:\\_test\\_drive$"],"4206871171":["^next\\_steps\\_offers$"],"7727650226":["^all\\_sticky\\_clicks$"],"4211940745":["^next\\_steps\\_specs$"],"4318790025":["^(https?://)?(www\\.)?\\/cars\\/test\\-drive\\/secure\\/confirmation\\.html/?(\\?.*)?(#.*)?$"],"2995100171":["^brochureware\\_cta$"],"4234461250":["^all\\_dealer\\_ctas$"],"3419070222":["^new\\_cta\\:\\_test\\_drive$"],"3236900013":["^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-drive\\/find\\-a\\-dealer\\.html/?(\\?.*)?(#.*)?$","^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-driveab\\/find\\-a\\-dealer\\.html/?(\\?.*)?(#.*)?$"],"3415840779":["^all$"],"3404500881":["^new\\_cta\\:\\_dealer$"],"3406480658":["^header\\:\\_dealer$"],"2996390170":["^configurator\\_cta$"],"3422830107":["^test\\_drive$"],"3211040666":["^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-drive\\/search\\.html/?(\\?.*)?(#.*)?$","^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-driveab\\/search\\.html/?(\\?.*)?(#.*)?$"],"3514000542":["^all\\_test\\_drive$"],"3420250271":["^brochure$"],"3526377248":["^all$"],"7676190626":["^sticky\\_download\\_brochure$"],"3406480682":["^footer\\:\\_dealer$"],"7773760170":["^(https?://)?(www\\.)?secure\\.honda\\.es\\/cars\\/test\\-drive\\/secure\\/confirmation\\.html/?(\\?.*)?(#.*)?$"],"2797860141":["^engagement$"],"7828693148":["^(https?://)?(www\\.)?honda\\.co\\.uk\\/cars\\/test\\-drive\\/book\\-a\\-test\\-drive\\-phone\\.html/?(\\?.*)?(#.*)?$"],"4212800817":["^next\\_steps\\_brochure$"],"4272406962":["^(https?://)?(www\\.)?cars\\/test\\-drive\\/book\\-a\\-test\\-drive\\-phone/?(\\?.*)?(#.*)?$"],"4206082483":["^sticky\\_nav\\_dealer$"],"3047910581":["^all\\_cta's$"],"7848940597":["^select\\_car$"],"3523612857":["^all\\_brochureware$"],"3421990075":["^header\\:\\_brochure$"],"3219990204":["^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-drive\\/book\\-a\\-test\\-drive\\-phone\\.html/?(\\?.*)?(#.*)?$","^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-driveab\\/book\\-a\\-test\\-drive\\-phone\\.html/?(\\?.*)?(#.*)?$"],"7766911804":["^select\\_card$"],"3230820414":["^(https?://)?(www\\.)?secure\\.honda\\.es\\/cars\\/test\\-drive\\/secure\\/book\\-a\\-test\\-drive\\-form\\.html/?(\\?.*)?(#.*)?$","^(https?://)?(www\\.)?secure\\.honda\\.es\\/cars\\/test\\-driveab\\/secure\\/book\\-a\\-test\\-drive\\-form\\.html/?(\\?.*)?(#.*)?$"],"7667272884":["^all\\_find\\_a\\_dealer$"],"7774450462":["^(https?://)?(www\\.)?honda\\.co\\.uk\\/cars\\/test\\-drive\\/search\\.html/?(\\?.*)?(#.*)?$"],"2909590337":["^click\\_goal$"],"3385651266":["^bottom\\:\\_test\\_drive$"],"3048390851":["^find\\_a\\_dealer$"],"3419500357":["^footer\\:\\_brochure$"],"7645706438":["^all\\_test\\_drive$"],"3546753143":["^all\\_dealer$"],"7842643403":["^(https?://)?(www\\.)?honda\\.co\\.uk\\/cars\\/test\\-drive\\/search\\.html/?(\\?.*)?(#.*)?$"],"3426690133":["^header\\:\\_test\\_drive$"],"4169581088":["^scrolling\\_header\\_brochure$"],"3406350936":["^bottom\\:\\_brochureware$"],"4205851099":["^next\\_steps\\_dealer$"],"7777350465":["^(https?://)?(www\\.)?secure\\.honda\\.co\\.uk\\/cars\\/test\\-drive\\/secure\\/book\\-a\\-test\\-drive\\-form\\.html/?(\\?.*)?(#.*)?$"],"3401680605":["^new\\_cta\\:\\_brochure$"],"7661021406":["^all\\_brochure\\_download$"],"3422010465":["^bottom\\:\\_dealer$"],"7848940609":["^(https?://)?(www\\.)?secure\\.honda\\.co\\.uk\\/cars\\/test\\-drive\\/secure\\/confirmation\\.html/?(\\?.*)?(#.*)?$"],"3201091302":["^(https?://)?(www\\.)?honda\\.es\\/cars\\/test\\-drive\\/models\\.html/?$"],"2975543657":["^test\\_drive\\_cta$"],"7774480478":["^(https?://)?(www\\.)?honda\\.co\\.uk\\/cars\\/test\\-drive\\/book\\-a\\-test\\-drive\\-phone\\.html/?(\\?.*)?(#.*)?$"],"4235151519":["^alll\\_brochure\\_ctas$"],"4200076141":["^sticky\\_nav\\_brochure$"],"7668352879":["^sticky\\_find\\_a\\_dealer$"],"3225090289":["^(https?://)?(www\\.)?secure\\.honda\\.es\\/cars\\/test\\-drive\\/secure\\/confirmation\\.html/?(\\?.*)?(#.*)?$","^(https?://)?(www\\.)?secure\\.honda\\.es\\/cars\\/test\\-driveab\\/secure\\/confirmation\\.html/?(\\?.*)?(#.*)?$"],"7666294517":["^sticky\\_test\\_drive$"],"3372382583":["^dealer$"],"7846090617":["^(https?://)?(www\\.)?secure\\.honda\\.co\\.uk\\/cars\\/test\\-drive\\/secure\\/book\\-a\\-test\\-drive\\-form\\.html/?(\\?.*)?(#.*)?$"],"4238041173":["^all\\_next\\_steps\\_ctas$"]},"experiments":{"7982984600":{"universal_analytics":{"slot":7},"audiences":[7812932795],"name":"UK - Test 4a - QA - Rename BATD - 19Dec16","variation_ids":["7995431069","7988941406"],"urls":[{"match":"substring","value":"http://www.honda.co.uk/cars/test-drive/"},{"match":"substring","value":"https://secure.honda.co.uk/cars/test-drive/"}],"enabled_variation_ids":["7995431069","7988941406"]},"7823791273":{"universal_analytics":{"slot":7},"audiences":[7812932795],"name":"DE - Test 1 - Persistent Global Nav - Nov2016 (1)","variation_ids":["7838770735","7818593168"],"urls":[{"match":"substring","value":"http://www.honda.de/cars/"}],"enabled_variation_ids":["7838770735","7818593168"]},"8245557626":{"sessioncam":true,"name":"UK - Test Drive Exit Points","variation_ids":["8255290722","8254203713"],"urls":[{"match":"exact","value":"http://www.honda.co.uk/cars/test-drive/models.html"},{"match":"regex","value":"http://www.honda.co.uk/cars/test-drive/find-a-dealer.html?*"},{"match":"regex","value":"http://www.honda.co.uk/cars/test-drive/search.html?*"},{"match":"regex","value":"https://secure.honda.co.uk/cars/test-drive/secure/book-a-test-drive-form.html?*"},{"match":"regex","value":"http://www.honda.co.uk/cars/test-drive/book-a-test-drive-phone.html?*"}],"enabled_variation_ids":["8255290722","8254203713"]},"8265515939":{"sessioncam":true,"name":"Qualaroo Civic RVTD Post Survey","variation_ids":["8273651170","8267784188"],"urls":[{"match":"simple","value":"http://www.honda.co.uk/cars/new/civic-5-door/real-view-test-drive.html"}],"enabled_variation_ids":["8273651170","8267784188"]},"7966320034":{"universal_analytics":{"slot":7},"audiences":[7812932795],"css":".modelSelector a.model {\n\tbackground: #f4f3f8;\n}","name":"ES - Test 2 - Prod - BATD Highlighted Interactions - 30Nov16","variation_ids":["7960531266","7923616060"],"urls":[{"match":"simple","value":"http://www.honda.es/cars/test-drive/models.html"}],"enabled_variation_ids":["7960531266","7923616060"]}},"audiences":{"7812932795":{"conditions":["and",["or",["or",{"dimension_id":7821970627,"value":"ff"},{"dimension_id":7821970627,"value":"gc"},{"dimension_id":7821970627,"value":"ie11"},{"dimension_id":7821970627,"value":"ie10"},{"dimension_id":7821970627,"value":"safari10"},{"dimension_id":7821970627,"value":"safari9"},{"dimension_id":7821970627,"value":"safari8"}]]],"name":"Browser Rules"}},"www_host":"app.optimizely.com","public_suffixes":{"honda.es":["www.honda.es"],"honda.de":["www.honda.de"],"honda.co.uk":["www.honda.co.uk"]},"force_variation":true,"dimensions":{"7973415610":{"api_name":"BATD","condition_type":"custom_dimension","name":"BATD","segment_id":7964886631},"7821970627":{"condition_type":"browser_version"}},"version":"master-pci-102.399657715811466897","admin_account_id":2797860140,"blacklisted_experiments":[8126836768,7832142117,8072160971,8062960821,8138721142,8065120698],"project_id":2797860140,"revision":1202,"summary_revenue_goal_id":2799890427,"installation_verified":true,"preview_host":"//optimizely.s3.amazonaws.com","api_host":"api.optimizely.com","variations":{"8254203713":{"code":"$(\".primaryNavigation ul > li:eq(0) > a:eq(0)\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".primaryNavigation ul > li:eq(1) > a:eq(0)\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".primaryNavigation ul > li:eq(2) > a:eq(0)\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".primaryNavigation ul > li:eq(3) > a:eq(0)\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".primaryNavigation ul > li:eq(4) > a:eq(0)\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".ctas ul\").css({\"display\":\"none\", \"visibility\":\"\"});\n$(\".inner > form\").css({\"display\":\"none\", \"visibility\":\"\"});","name":"Variation #1"},"8255290722":{"name":"Original"},"7960531266":{"name":"Original"},"7923616060":{"name":"Highlighted Interactions"},"7838770735":{"name":"Original"},"7818593168":{"code":"(function( $ ) {  \n\tif($('.secondaryxResponsive').length === 0) {\n    $( window ).on('scroll', function (e) {\n      var offsetTop = 96;\n\n      if($('#pageBillboard')){\n        offsetTop = offsetTop + $('#pageBillboard').height();\n      }\n\n      if ($(window).scrollTop() > offsetTop && $( window ).width() > 1023) {\n\n        if(!$('nav.ctas').data('isScroll')){\n          $('nav.ctas')\n            .data('isScroll', true)\n            .css({'position':'fixed', 'z-index': '99', 'background-color': '#fff', 'height': '46px', 'display':'none'})\n            .slideDown();\t\n        }\t\t\t\n      }\n      else {\n        $('nav.ctas').removeAttr('style').data('isScroll',false);\n      }\n    });\n\t}\n}( jQuery ));","name":"Sticky Nav"},"8273651170":{"name":"Original"},"8267784188":{"name":"Variation #1"},"7995431069":{"name":"Original"},"7988941406":{"code":"var loc = window.location.href;\nvar ref = document.referrer;\n\nfunction isEnabled() {\n\treturn window.localStorage['BATD'] === 'true';\n}\n\nfunction enable() {\n\twindow.localStorage.setItem('BATD', 'true');\n}\n\nfunction disable() {\n\twindow.localStorage.setItem('BATD', 'false');\n}\n\nfunction isModels() {\n\treturn loc.indexOf('/cars/test-drive/models.html') > 0;\n}\n\nfunction isFindDealer() {\n\treturn isEnabled() && loc.indexOf('/cars/test-drive/find-a-dealer.html') > 0 && ref.indexOf('/cars/test-drive/models.html') > 0;\n}\n\nfunction isSearch() {\n\treturn isEnabled() && loc.indexOf('/cars/test-drive/search.html') > 0 && ref.indexOf('/cars/test-drive/find-a-dealer.html') > 0;\n}\n\nfunction isBookPhone() {\n\treturn isEnabled() && loc.indexOf('/cars/test-drive/book-a-test-drive-phone.html') > 0 && ref.indexOf('/cars/test-drive/search.html') > 0;\n}\n\nfunction isBookOnline() {\n\treturn loc.indexOf('/cars/test-drive/secure/book-a-test-drive-form.html') > 0 && ref.indexOf('/cars/test-drive/search.html') > 0;\n}\n\nfunction isConfirmation() {\n\treturn loc.indexOf('/cars/test-drive/secure/confirmation') > 0 && ref.indexOf('/cars/test-drive/secure/book-a-test-drive-form.html') > 0;\n}\n\nfunction updateHTML() {\n\t$(\"h1\").html(\"Request a test drive\");\n}\n\nif (window.localStorage && window.jQuery) {\n\tif (isModels()) {\n\t\tenable();\n\t\tupdateHTML();\n\t}\n\telse {\n\t\tif (isFindDealer() || isSearch() || isBookPhone() || isBookOnline() || isConfirmation()) {\n\t\t\tupdateHTML();\n\t\t}\n\t\telse {\n\t\t\tdisable();\n\t\t}\n\t}\n}","name":"Rename"}},"segments":{"7964886631":{"api_name":"BATD","is_api_only":true,"dimension_id":7973415610,"id":7964886631,"name":"BATD"},"2803520153":{"segment_value_type":"browser","api_name":"optimizely_browser","id":2803520153,"name":"Browser"},"2801172554":{"segment_value_type":"campaign","api_name":"optimizely_campaign","id":2801172554,"name":"Campaign"},"2804720079":{"segment_value_type":"mobile","api_name":"optimizely_mobile","id":2804720079,"name":"Mobile Visitors"},"2796900447":{"segment_value_type":"source_type","api_name":"optimizely_source_type","id":2796900447,"name":"Source Type"}},"click_goals":[{"event_name":"click_goal","experiments":{"2913951136":true},"selector":".clearfix > p,.primaryCta"},{"event_name":"test_drive_cta","experiments":{"3557910433":true,"3256260347":true,"2974350814":true},"selector":".productLogoCTAs .testDriveDiamond56Ico, #stickyNav_testDriveDiamond56Ico"},{"event_name":"brochureware_cta","experiments":{"3557910433":true,"3064590954":true,"3256260347":true,"2974350814":true},"selector":".productLogoCTAs .brochureDiamond56Ico, #stickyNav_brochureDiamond56Ico"},{"event_name":"configurator_cta","experiments":{"3557910433":true,"3256260347":true,"2974350814":true},"selector":".wrapper .yourHondaDiamond56Ico, #stickyNav_yourHondaDiamond56Ico"},{"event_name":"all_cta's","experiments":{"3557910433":true,"3256260347":true,"2974350814":true},"selector":".wrapper .yourHondaDiamond56Ico,.brochureDiamond56Ico > .analyticsEvent,.productLogoCTAs .testDriveDiamond56Ico,#stickyNav_testDriveDiamond56Ico,#stickyNav_brochureDiamond56Ico,#stickyNav_yourHondaDiamond56Ico"},{"event_name":"find_a_dealer","experiments":{"3557910433":true,"3256260347":true,"2974350814":true},"selector":"#stickyNav_findDealerDiamond56Ico"},{"event_name":"dealer","experiments":{"3099190487":true},"selector":".ctaWrap .findDealerDiamond56Ico,.secondaryCta > .analyticsEvent"},{"event_name":"bottom:_test_drive","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true},"selector":".nextSteps_TestDrive"},{"event_name":"footer:_test_drive","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true},"selector":"ul.ctas > li:eq(1)"},{"event_name":"new_cta:_brochure","experiments":{"3512511120":true,"3390910827":true,"3403261053":true},"selector":".brochureDiamond56Ico > .analyticsEvent"},{"event_name":"new_cta:_dealer","experiments":{"3512511120":true,"3390910827":true,"3403261053":true},"selector":".findDealerDiamond56Ico > .analyticsEvent"},{"event_name":"bottom:_brochureware","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true},"selector":".nextSteps_Brochure"},{"event_name":"header:_dealer","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true,"4167151537":true},"selector":".ctas ul > li:eq(0)"},{"event_name":"footer:_dealer","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true,"4167151537":true},"selector":"ul.ctas > li:eq(0)"},{"event_name":"all","experiments":{"3512511120":true,"3099190487":true},"selector":"ul.ctas > li:eq(2),.nextSteps_Brochure,.ctas ul > li:eq(2),.brochureDiamond56Ico > .analyticsEvent,ul.ctas > li:eq(0),.nextSteps_FindDealer,.ctas ul > li:eq(0),.findDealerDiamond56Ico > .analyticsEvent,ul.ctas > li:eq(1),.nextSteps_TestDrive,.ctas ul > li:eq(1),.testDriveDiamond56Ico > .analyticsEvent"},{"event_name":"new_cta:_test_drive","experiments":{"3512511120":true,"3390910827":true,"3403261053":true},"selector":".testDriveDiamond56Ico > .analyticsEvent"},{"event_name":"footer:_brochure","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true,"4167151537":true},"selector":"ul.ctas > li:eq(2)"},{"event_name":"brochure","experiments":{"3099190487":true},"selector":".ctaWrap .contactUsDiamond56Ico"},{"event_name":"header:_brochure","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true,"4167151537":true},"selector":".ctas ul > li:eq(2)"},{"event_name":"bottom:_dealer","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true},"selector":".nextSteps_FindDealer"},{"event_name":"test_drive","experiments":{"3099190487":true},"selector":".ctaWrap .testDriveDiamond56Ico"},{"event_name":"header:_test_drive","experiments":{"3512511120":true,"3708696929":true,"3390910827":true,"3403261053":true},"selector":".ctas ul > li:eq(1)"},{"event_name":"All_Test_Drive","experiments":{"3512511120":true,"3708696929":true},"selector":"ul.ctas > li:eq(1),.nextSteps_TestDrive,.ctas ul > li:eq(1),.testDriveDiamond56Ico > .analyticsEvent"},{"event_name":"All_Brochureware","experiments":{"3512511120":true,"3708696929":true},"selector":"ul.ctas > li:eq(2),.nextSteps_Brochure,.ctas ul > li:eq(2),.brochureDiamond56Ico > .analyticsEvent"},{"event_name":"All_Dealer","experiments":{"3512511120":true,"3708696929":true},"selector":"ul.ctas > li:eq(0),.nextSteps_FindDealer,.ctas ul > li:eq(0),.findDealerDiamond56Ico > .analyticsEvent"},{"event_name":"scrolling_header_brochure","experiments":{"4167151537":true},"selector":".productLogoCTAs .brochureDiamond56Ico"},{"event_name":"sticky_nav_brochure","experiments":{"4167151537":true},"selector":".brochureDiamond56Ico > .cropText > span:eq(0)"},{"event_name":"next_steps_dealer","experiments":{"4167151537":true},"selector":".relatedContentListing > li:eq(0) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0)"},{"event_name":"sticky_nav_dealer","experiments":{"4167151537":true},"selector":".findDealerDiamond56Ico > .cropText > span:eq(0)"},{"event_name":"next_steps_offers","experiments":{"4167151537":true},"selector":".nextStepsCTAs .offersDiamond56Ico a"},{"event_name":"next_steps_specs","experiments":{"4167151537":true},"selector":".nextStepsCTAs .specificationDiamond56Ico a"},{"event_name":"next_steps_brochure","experiments":{"4167151537":true},"selector":".relatedContentListing > li:eq(1) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0)"},{"event_name":"all_dealer_ctas","experiments":{"4167151537":true},"selector":"ul.ctas > li:eq(0),.ctas ul > li:eq(0),.relatedContentListing > li:eq(0) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0),.findDealerDiamond56Ico > .cropText > span:eq(0)"},{"event_name":"alll_brochure_ctas","experiments":{"4167151537":true},"selector":"ul.ctas > li:eq(2), .ctas ul > li:eq(2), .relatedContentListing > li:eq(1) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0), .productLogoCTAs .brochureDiamond56Ico, .brochureDiamond56Ico > .cropText > span:eq(0)"},{"event_name":"all_next_steps_ctas","experiments":{"4167151537":true},"selector":".nextStepsCTAs .specificationDiamond56Ico a, .relatedContentListing > li:eq(1) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0), .relatedContentListing > li:eq(0) > div:eq(0) > div:eq(0) > p:eq(1) > a:eq(0), .nextStepsCTAs .offersDiamond56Ico a"},{"event_name":"all_test_drive","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".content .testDriveDiamond56Ico,.responsiveFooter .testDriveDiamond56Ico,.ctas .testDriveDiamond56Ico"},{"event_name":"All_Brochure_Download","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".content .brochureDiamond56Ico,.ctas .brochureDiamond56Ico,.responsiveFooter .brochureDiamond56Ico"},{"event_name":"Sticky_test_drive","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".header .ctas .testDriveDiamond56Ico"},{"event_name":"All_find_a_dealer","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".content .findDealerDiamond56Ico,.responsiveFooter .findDealerDiamond56Ico,.ctas .findDealerDiamond56Ico"},{"event_name":"sticky_find_a_dealer","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".header .findDealerDiamond56Ico"},{"event_name":"Sticky_download_brochure","experiments":{"7718250816":true,"7823791273":true,"7634200642":true,"7733160166":true},"selector":".header .brochureDiamond56Ico"},{"event_name":"all_clicks","experiments":{"7718250816":true,"7733160166":true},"selector":"body .brochureDiamond56Ico,body .findDealerDiamond56Ico,body .testDriveDiamond56Ico, .responsiveFooter .brochureDiamond56Ico,.responsiveFooter .findDealerDiamond56Ico,.responsiveFooter .findDealerDiamond56Ico"},{"event_name":"all_sticky_clicks","experiments":{"7718250816":true,"7733160166":true},"selector":".header .brochureDiamond56Ico,.header .findDealerDiamond56Ico,.header .testDriveDiamond56Ico"},{"event_name":"select_card","experiments":{"7735958058":true,"7966320034":true,"8245557626":true},"selector":".modelSelector .model"},{"event_name":"select_car","experiments":{"7982984600":true,"7832142117":true},"selector":".productList > li:eq(0) > a:eq(0),.productList > li:eq(1) > a:eq(0),.productList > li:eq(2) > a:eq(0),.productList > li:eq(3) > a:eq(0),.productList > li:eq(4) > a:eq(0),.productList > li:eq(5) > a:eq(0)"}]};

function h(a){throw a;}var i=void 0,j=!0,k=null,o=!1;function aa(){return function(a){return a}}function ba(a){var b=typeof a;return"object"==b&&a!=k||"function"==b}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(a,b,c){a||h(Error());if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}
function p(a,b,c){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ca:da;return p.apply(k,arguments)}function t(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var b=Array.prototype.slice.call(arguments);b.unshift.apply(b,c);return a.apply(this,b)}};function u(a){try{return window.JSON.stringify(a)}catch(b){h(Error("JSON: Unable to stringify ("+b.message+")"))}}function ea(a){try{return window.JSON.parse(a)}catch(b){h(Error("JSON: Unable to parse ("+b.message+")"))}};var fa=/\s*;\s*/,ha=/^([^=]+)=?(.*)$/;function v(a){var b=[];w(ia(),function(c){a===c.name&&b.push(ja(c.value))});if(0===b.length)return k;1<b.length&&x("Cookie","Values found for %s: %s",a,b.length);return b.pop()}var ka=o;function ia(){var a,b=[];a=a||"";w((document.cookie||"").split(fa),function(c){var d=c.match(ha);d&&0===d[1].indexOf(a)&&b.push({name:d[1],value:d[2],P:c})});return b}
function y(a,b,c){if(ka)x("Cookie","Already initialized.");else{x("Cookie","Initializing.");var d=document.location.hostname;if(la()){ma=d;for(var d=document.location.hostname.split("."),e=[],f=d.length-1;0<=f;--f){var g=d.slice(f).join("."),l="optimizelyDomainTest-"+Math.random().toString(16).replace("0.",""),m=Math.random().toString(16).replace("0.","");na(l,m,g,3);v(l)===m&&e.push(g)}oa=e;0<oa.length?(ma=oa[0],x("Cookie","Highest level domain: %s",ma)):(x("Cookie","Disabling event tracking because cookies could not be set"),
qa=o)}else e=d.split("."),f=d,g=e[e.length-1],2<e.length&&"appspot"===e[e.length-2]&&"com"===g?f=e[e.length-3]+".appspot.com":1<e.length&&ra(g,ta)&&(f=e[e.length-2]+"."+g),ua=f,x("Cookie","Guessed public suffix: %s",ua),va=wa(d),x("Cookie","Public suffix (from data): %s",va);xa&&x("Cookie","Domain specified by API: %s",xa);ka=j;x("Cookie","Done initializing.")}b=b||"";la()?(w(oa,function(b){ya(a,b)}),d=za(),na(a,b,d,c),c=v(a)===b?"Succeeded":"Failed",x("Cookie","%s setting %s=%s on %s",c,a,b,d)):
(d=za(),e=document.location.hostname,!va&&z("remote_public_suffix")&&Aa.push({yb:c,name:a,value:b}),d&&(d===va&&d!==ua)&&(ya(a,e),ya(a,ua)),na(a,b,d,c),f=v(a),f===b)?x("Cookie","Successfully set %s=%s on %s",a,b,d):(x("Cookie","Setting %s on %s apparently failed (%s != %s)",a,d,f,b),x("Cookie","Setting %s on %s",a,e),na(a,b,e,c),f=v(a),f===b?(x("Cookie","Setting %s on %s worked; saving as new public suffix",a,e),ua=e):(x("Cookie","Could not set cookie %s, disabling event tracking.",a),qa=o))}
function ya(a,b){var c=[a,"=","; ",Ba(b),"; path=/","; expires=",(new Date(0)).toUTCString()];document.cookie=c.join("")}function za(){return la()?xa||ma:xa||va||ua}function Ba(a){var b=[];b.push("domain=");"localhost"!==a&&(b.push("."),b.push(a));return b.join("")}function na(a,b,c,d){a=[a,"=",encodeURIComponent(b),"; ",Ba(c),"; path=/"];d&&a.push("; expires=",(new Date(+new Date+1E3*d)).toUTCString());document.cookie=a.join("")}
function Ca(a){za()!==a&&(xa=String(a)||"",x("Cookie","Api public suffix set to: %s",xa))}var ua="",xa="",ma="",oa=[],va="",Aa=[];var Da=window.OPTIMIZELY_TEST_MODULE,ta="com local net org xxx edu es gov biz info fr nl ca de kr it me ly tv mx cn jp il in iq test".split(" "),Ea=/\/\*\s*_optimizely_variation_url( +include="([^"]*)")?( +exclude="([^"]*)")?( +match_type="([^"]*)")?( +include_match_types="([^"]*)")?( +exclude_match_types="([^"]*)")?( +id="([^"]*)")?\s*\*\//;var Fa=0,Ga=o,B=j,Ha=j,Ia=o,Ja=o,Ka=o,La=o,Ma="",Na=o,Oa=o,Pa=o,Qa=o,Ra=o,Sa=o,qa=j,Ua=31536E4;function Va(){var a=v("optimizelyEndUserId");a||(a="oeu"+ +new Date+"r"+Math.random(),y("optimizelyEndUserId",a,Ua));return a}function Wa(){return v("optimizelyPPID")};function Xa(a,b){var c=j;w(a,function(a){if(!b(a))return c=o});return c}function D(a,b){var c=o;w(a,function(a){if(b(a))return c=j});return c}function E(a,b){for(var c=0;c<a.length;c++)if(b==a[c])return j;return o}function Ya(a,b){var c=Za(arguments,1);return function(){var b=Za(arguments);b.unshift.apply(b,c);return a.apply(this,b)}}
function w(a,b){var c=k;if(F(a))for(var d=a.length,e=0;e<d&&!(c=b.call(i,a[e],e),H(c));++e);else for(d in a)if(Object.prototype.hasOwnProperty.call(a,d)&&(c=b.call(i,d,a[d]),H(c)))break;return c}function I(a,b){if("function"===typeof a.map)return a.map(b);for(var c=[],d=0;d<a.length;d++)c.push(b(a[d],d));return c}function J(a,b){w(b,function(b,d){a[b]=d});return a}function $a(a,b){if(F(b)){for(var c=a,d=0;d<b.length;d++){var e=b[d];if(!ba(c)||!c.hasOwnProperty(e))return;c=c[e]}return c}}
function K(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d];b(f)&&c.push(f)}return c}function ra(a,b){return w(b,function(b){if(b===a)return j})||o}function F(a){return!!a&&"object"===typeof a&&"number"===typeof a.length}function H(a){return"undefined"!==typeof a}function ab(a){return"object"===typeof a&&a!==k}function bb(a){return("number"===typeof a||"string"===typeof a)&&Number(a)==a}function cb(a){return"string"===typeof a}
function L(a){L=Object.zb||function(a){var c=[];w(a,function(a){c.push(a)});return c};return L.call(k,a)}
function db(a,b){function c(){var b=document.head||document.getElementsByTagName("head")[0]||document.documentElement,c=document.createElement("script");c.src=a;c.type="text/javascript";b.appendChild(c)}if(b)try{if("loading"===document.readyState){var d="optimizely_synchronous_script_"+Math.floor(1E5*Math.random());-1!==a.indexOf('"')?M("loadScript","Blocked attempt to load unsafe script: "+a):(document.write('<script id="'+d+'" src="'+a+'"><\/script>'),1!==$("#"+d).length&&h(Error("Document.write failed to append script")))}else h(Error("Not safe to attempt document.write"))}catch(e){try{var f=
new XMLHttpRequest;f.open("GET",a,o);f.onload=function(){eval(f.responseText)};f.onerror=function(){h(Error())};f.send()}catch(g){x("Common","Failed to load %s synchronously",a),c()}}else c()}function x(a,b,c){var d=window.console;if(Pa&&d&&d.log){var e=Za(arguments,1);e[0]="Optimizely / "+a+" / "+b;Function.prototype.apply.call(d.log,d,e)}}function ja(a){try{return decodeURIComponent(a)}catch(b){return a}}function Za(a,b){return Array.prototype.slice.call(a,b||0,a.length)}
function eb(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function fb(a){this.r=a;this.c={totalGets:0,totalGetLength:0,totalGetTime:0,totalSets:0,totalSetLength:0,totalSetTime:0,numKeys:0,totalSize:0}}fb.prototype.get=function(a){try{var b=+new Date,c=this.r.getItem([gb,a].join("$$")),d=ea(c);this.c.totalGetTime+=+new Date-b;this.c.totalGets++;this.c.totalGetLength+=(c||"").length;return d}catch(e){return k}};
fb.prototype.set=function(a,b){try{var c=+new Date,d=u(b);H(b)?this.r.setItem([gb,a].join("$$"),d):this.r.removeItem([gb,a].join("$$"));this.c.totalSetTime+=+new Date-c;this.c.totalSets++;this.c.totalSetLength+=d.length}catch(e){}};fb.prototype.wa=function(){var a=0,b=0,c;for(c in this.r)if(0===c.indexOf(gb)){b++;var d=this.r.getItem(c),a=a+(c.length+(d?d.length:0))}this.c.numKeys=b;this.c.totalSize=a;return this.c};
var hb={get:function(){},set:function(){},wa:function(){return{}}},gb="optimizely_data",N=hb,ib=hb;
try{var N=new fb(window.localStorage),ib=new fb(window.sessionStorage),jb=N,kb=jb.r.getItem(gb),lb={};try{lb=ea(kb)||{}}catch(mb){}if(0!==L(lb).length){var nb=Wa()||v("optimizelyEndUserId"),ob=lb[nb]||{},pb;for(pb in ob)if(ob.hasOwnProperty(pb)){var qb=[nb,pb].join("$$");jb.get(qb)===k&&jb.set(qb,ob[pb])}delete lb[nb];for(pb in lb)lb.hasOwnProperty(pb)&&(jb.get(pb)===k&&jb.set(pb,lb[pb]),delete lb[pb]);try{kb=u(lb)}catch(rb){kb={}}jb.r.setItem(gb,kb)}}catch(sb){};function tb(){return z("admin_account_id")}function ub(a){return z("audiences",a)}function vb(a){a=z("audiences",a,"segment_id");return!a?k:a}
function wb(){if(!xb){var a=z("click_goals")||[];xb=[];for(var b=0,c=a.length;b<c;b++)for(var d=a[b],e=d.selector.split(","),f=0,g=e.length;f<g;f++){var l=e[f];l&&(l={event_name:d.event_name,selector:l},"experiments"in d?l.experiments=d.experiments:"url_conditions"in d&&(l.url_conditions=d.url_conditions),"revenue"in d&&(l.revenue=d.revenue),xb.push(l))}}return xb}function yb(a,b){return z("dimensions",a,b)}function zb(a){a=yb(a,"condition_type");return!a?k:a}
function Ab(a){a=yb(a,"name");return!a?k:a}function Cb(){Db||(Db=K(Eb(),Fb));return Db}function Gb(a){var b=z("goal_expressions"),c=[],d;for(d in b)if(b.hasOwnProperty(d))for(var e=b[d],f=0;f<e.length;f++)try{if(RegExp(e[f],"i").test(a)){c.push(d);break}}catch(g){}return c}function Hb(a){var b=Ib(),c;for(c in b)if(Object.prototype.hasOwnProperty.call(b,c)){var d=b[c];if(d&&d.api_name===a)return String(c)}return k}function Jb(){return z("experiments")||{}}
function Eb(){return L(z("experiments")||{})}function Kb(a){return"manual"===O(a,"activation_mode")}function Lb(a){return"conditional"===O(a,"activation_mode")}function Mb(a){return O(a,"name")||"Exp "+a}function Nb(a){return'experiment "'+Mb(a)+'" ('+a+")"}function Ob(a){return O(a,"section_ids")||[]}function Pb(a){return O(a,"variation_ids")||[]}function Qb(){return z("list_targeted_keys")||{}}function P(){return z("project_id")}function Ib(){return z("segments")||{}}
function Rb(a,b){for(var c=Ob(a),d=0;d<c.length;d++){var e=Sb(c[d]);if(E(e,b))return c[d]}return""}function wa(a){var b={},c=z("public_suffixes")||{};w(c,function(a,c){w(c,function(c){b[c]=a})});wa=function(a){return b[a]||""};return wa.call(k,a)}function Sb(a){return z("sections",a,"variation_ids")||[]}function Tb(a){var b=[];w(a.split("_"),function(a){(a=z("variations",a,"code"))&&b.push(a)});return b.join("\n")}
function Q(a){if(!Ub){var b={};w(Eb(),function(a){w(Ob(a),function(d){w(Sb(d),function(d){b[d]=a})});w(Pb(a),function(d){b[d]=a})});Ub=b}return Ub[a.split("_")[0]]||""}function Vb(a){var b=Q(a),c=Ob(b);if(0===c.length){c=Pb(b);for(b=0;b<c.length;b++)if(c[b]===a)return b}else{for(var a=a.split("_"),b=[],d=0;d<c.length;d++)for(var e=Sb(c[d]),f=0;f<e.length;f++)e[f]===a[d]&&b.push(f);if(b!==[])return b}return-1}function Wb(a){var b;return Xb(a).join(b||", ")}
function Xb(a){var b=[];w(a.split("_"),function(a){b.push(z("variations",a,"name")||"Var "+a)});return b}function Yb(){return z("www_host")}function Fb(a){return!!O(a,"enabled")}function la(){return!!z("simple_cookies")}function O(a,b){return z("experiments",a,b)}function Zb(a){a=O(a,"comscore");return H(a)?a.url:k}function $b(a){return O(a,"google_analytics")}function ac(a,b){var c=O(a,"universal_analytics");return H(c)?c[b]:k}
function z(a){var b=DATA;if(w(arguments,function(a){a=b[a];if(H(a))b=a;else return k})!==k)return b}function bc(a,b){return z("segments",a,b)}function cc(){var a=z("rum_sampling_rate");return H(a)?a:0.003}var xb=k,Db=k,Ub=k;function dc(a,b){function c(a,b){var c=b&65535;return((b-c)*a|0)+(c*a|0)|0}for(var d=a.length,e=b||0,f=d&-4,g,l=0;l<f;l+=4)g=a.charCodeAt(l)&255|(a.charCodeAt(l+1)&255)<<8|(a.charCodeAt(l+2)&255)<<16|(a.charCodeAt(l+3)&255)<<24,g=c(g,3432918353),g=(g&131071)<<15|g>>>17,g=c(g,461845907),e^=g,e=(e&524287)<<13|e>>>19,e=5*e+3864292196|0;g=0;switch(d%4){case 3:g=(a.charCodeAt(f+2)&255)<<16;case 2:g|=(a.charCodeAt(f+1)&255)<<8;case 1:g|=a.charCodeAt(f)&255,g=c(g,3432918353),e^=c((g&131071)<<15|g>>>17,461845907)}e^=
d;e=c(e^e>>>16,2246822507);e=c(e^e>>>13,3266489909);return e^e>>>16};var ec=Math.pow(2,32);function fc(a,b){var c=dc(a,b);return(c>>>16).toString(16)+(c&65535).toString(16)};function gc(){return hc=hc||ic()}function jc(){return gc().aa}function kc(){return gc().ba}function lc(){return gc().F}function mc(a){if(!a)return"";try{return a.match(/:\/\/(?:www[0-9]?\.)?(.[^/:]+)/)[1]}catch(b){return""}}function nc(){return gc().platform}function oc(a){return N.get([Wa()||Va(),a].join("$$"))}function pc(a){N.set([Wa()||Va(),"asyncInfo"].join("$$"),a)}
function qc(){var a="android;blackberry;ipad;iphone;ipod;windows phone".split(";");return E(a,lc().id)?lc().id:E(a,nc().id)?nc().id:rc()?"mobile":"unknown"}function rc(){return lc().w}function sc(){return tc?"returning":"new"}nc=function(){return gc().platform};function uc(a){x("User","Setting current URL to %s",a);vc=a}var vc=i,hc=i,tc=i;function M(a,b,c){wc.push({Fa:new Date,Da:a,message:b,ua:c||o});xc&&yc()}function zc(){Pa=j}function Ac(){Qa=Pa=j}function yc(){Pa&&(w(wc,function(a){if(!a.cb&&(!a.ua||a.ua===Qa)){var b=+a.Fa;x(a.Da,a.message+(" [time "+(Bc?b-Bc:0)+" +"+(Cc?b-Cc:0)+"]"));Cc=b;Bc||(Bc=b);a.cb=j}}),xc=j)}var Cc=k,Bc=k,wc=[],xc=o;var R={};function Dc(a,b){R[a]=b}function Ec(a,b){var c=oc("asyncInfo")||{};c[a]=b;pc(c)}function Gc(){var a=(R.odds||k)&&(R.odds||k).ip||(R.cdn3||k)&&(R.cdn3||k).ip;return a?Hc(a):k}function Ic(){return!R.odds?k:(R.odds||k).lists||{}}
function Jc(a){if(!Ic())return M("Async Info","Invalid response from ODDS"),{value:i,M:o};if(!Ic().hasOwnProperty(a))return M("Async Info","Deduced cachetime value that was checked for presence in list: "+a),{value:i,M:j};var b=!R.odds?k:(R.odds||k).lists_metadata||{};if(!b||!b[a]||!b[a][0])return M("Async Info","Can't find cachetime value that was checked for presence in list: "+a),{value:i,M:o};M("Async Info","Found cachetime value that was checked for presence in list: "+a);return{value:b[a][0].value,
M:j}}function Kc(a){var b=Qb()[a],c=H(b)&&Lc(b);if(c){var d=Mc(b);if(d===k)return M("Async Info","Deduced membership status (false) for list: "+a),o;M("Async Info","Found current value to check for presence in list: "+a)}b=Ic();if(!b)return M("Async Info","No list membership info."),k;if(c&&(c=Jc(a),c.M&&c.value!==d))return M("Async Info","Ignoring out-of-date membership status for list: "+a),k;d=!!b[a];M("Async Info","Found membership status ("+d+") for list: "+a);return d}
function Nc(){if(!R.cdn3)return k;var a=(R.cdn3||k).location||{};return{continent:Hc(a.continent),country:Hc(a.country),region:Hc(a.region),city:Hc(a.city)}}var Oc={get:function(){return R.dcps||k},set:function(a){Ec("dcps",a);R.dcps=a}};function Pc(){var a=Oc.get();return!a||a.rulesResults===k?k:a.rulesResults||{}}function Hc(a){return"string"!==typeof a||"N/A"===a.toUpperCase()?k:a.toUpperCase()};function Qc(a){a=a||{};if(qa){a&&a.sVariable&&(Rc=a.sVariable);var b=Rc||("undefined"!==typeof window.s?window.s:k);if(b)if(Sc){a=Tc;if(a!==k&&b)try{x("Integrator","Fixing SiteCatalyst referrer to %s",a),b.referrer=String(a)}catch(c){x("Integrator","Error setting SiteCatalyst referrer: %s",c)}x("Integrator","Tracking with SiteCatalyst");w(Uc(),function(a){var c=Q(a),a=S(c,a,100,100,25,j),f=a.key+": "+a.value,a=[],g=O(c,"site_catalyst_evar")||k,c=O(c,"site_catalyst_prop")||k;g!==k&&a.push("eVar"+g);
c!==k&&a.push("prop"+c);w(a,function(a){x("Integrator","Setting SiteCatalyst %s='%s'",a,f);b[a]=f})})}else Vc=j;else M("Integrator","Error with SiteCatalyst integration: 's' variable not defined")}}function Wc(a){a=bb(a)?Number(a):-1;if(-1!==[1,2,3].indexOf(a))Xc=a;else return Xc}
function Yc(){if(qa){var a=Tc;if(a!==k)try{x("Integrator","Fixing _gaq._setReferrerOverride with %s",a),_gaq.push(["_setReferrerOverride",a])}catch(b){x("Integrator","Error setting Google Analytics referrer: %s",b)}var c=[];w(Uc(),function(a){var b=Q(a);if(O(b,"chartbeat")){var d=Zc;Zc="";var e=S(b,a,10,10,5,o);Zc=d;d=Vb(a);$c=e.key+": "+String(d);try{x("Integrator","Calling _cbq.push"),_cbq.push(["_optlyx",$c])}catch(n){M("Integrator","Error sending Chartbeat data for "+Nb(b))}}if(Zb(b)){var e=Zb(b),
d=S(b,a,100,100,25,j),r=e+(-1!==e.indexOf("?")?"&":"?")+"optimizely_experiment_id="+b+"&optimizely_experiment_name="+encodeURIComponent(d.key)+"&optimizely_variation_id="+a+"&optimizely_variation_name="+encodeURIComponent(d.value)+"&ns_m_exp=("+b+") "+encodeURIComponent(d.key)+"&ns_m_chs=("+a+") "+encodeURIComponent(d.value)+"&type=hidden";try{$(window).load(function(){M("Integrator","Sending comScore log call");ad(r,k)})}catch(q){M("Integrator","Error sending comScore data for "+Nb(b))}}if(O(b,"crazyegg")){e=
S(b,a,100,100,15,o);try{x("Integrator","Defining CE_SNAPSHOT_NAME"),window.CE_SNAPSHOT_NAME=e.key+": "+e.value}catch(G){M("Integrator","Error sending CrazyEgg data for "+Nb(b))}}if($b(b)){e=$b(b);d=0;H(e)&&(d=e.slot||d);var e=d,d=$b(b),A="";H(d)&&(A=d.tracker||A);d=A;A=S(b,a,28,24,5,j);try{var C="";""!==d&&(C=d+".");x("Integrator","Calling _gaq._setCustomVar for slot %d and scope %d",e,Xc);_gaq.push([C+"_setCustomVar",e,A.key,A.value,Xc])}catch(pa){M("Integrator","Error sending Google Analytics data for "+
Nb(b))}}if(O(b,"inspectlet")){e=Zc;Zc="";d=S(b,a,100,100,25,o);Zc=e;try{M("Integrator","Calling __insp.push for sending data to Inspectlet"),window.__insp=window.__insp||[],window.__insp.push(["tagSession",{"Optimizely Experiment Name":d.key,"Optimizely Variation Name":d.value,"Optimizely Experiment ID":b,"Optimizely Variation ID":a}])}catch(Ta){M("Integrator","Error sending Inspectlet data for "+Nb(b))}}if(z("kissmetrics")){e=S(b,a,100,100,15,j);d={};d[e.key]=e.value;try{x("Integrator","Calling _kmq.set"),
_kmq.push(["set",d])}catch(Be){M("Integrator","Error sending KISSmetrics data for "+Nb(b))}}if(O(b,"mixpanel")){e=S(b,a,100,100,15,o);d={};d[e.key]=e.value;try{x("Integrator","Calling mixpanel.push"),mixpanel.push(["register",d])}catch(Hh){M("Integrator","Error sending Mixpanel data for "+Nb(b))}}if(O(b,"moat")){e=S(b,a,100,100,15,o);e=e.key+": "+e.value;try{x("Integrator","Calling optimizelyMoat.push"),optimizelyMoat.push(e)}catch(Ih){M("Integrator","Error sending Moat data for "+Nb(b))}}O(b,"sessioncam")&&
(c=c.concat(bd(b,a)));O(b,"at_internet")&&(e=S(b,a,28,24,5,j),a=b+"["+encodeURIComponent(e.key)+"]-0-"+a+"["+encodeURIComponent(e.value)+"]",a in cd||(x("Integrator","Queueing AT Internet log call: %s",a),cd[a]=o))});if(0<c.length){a=c;try{M("Integrator","Calling sessioncamConfiguration object"),window.sessioncamConfiguration=window.sessioncamConfiguration||{},window.sessioncamConfiguration.customDataObjects=window.sessioncamConfiguration.customDataObjects||[],window.sessioncamConfiguration.customDataObjects=
window.sessioncamConfiguration.customDataObjects.concat(a)}catch(d){M("Integrator","Error sending sessioncam data "+a)}}0<L(cd).length&&("function"===typeof window.xt_mvt?dd():$(window).bind("load.ATInternet",dd));a=v("optimizelyChartbeat")||"";try{if(a&&$c!=a&&(x("Integrator","Calling _cbq.push for referral"),_cbq.push(["_optlyr",a])),$c!=a)x("Integrator","Set new Chartbeat referral cookie."),y("optimizelyChartbeat",$c)}catch(e){M("Integrator","Error sending Chartbeat referral for "+a)}Sc=j;ed&&
(fd(),ed=o);Vc&&(Qc(),Vc=o)}}
function gd(){if(window.ClickTaleContext){try{window.ClickTaleContext.getAggregationContextAsync("1",function(a){a.Location&&window.optimizely.push(["overrideUrl",a.Location]);for(var b in a.PageEvents){var e=a.PageEvents[b][2].match(/x[0-9]+=[0-9_]+/g);x("Integrator","Playback ClickTale Integration - %s",e);for(b=0;b<e.length;b++){x("Integrator","Playback ClickTale Integration - %s",e[b]);for(var f=e[b].split("=")[0].substr(1),g=e[b].split("=")[1].split("_"),l=0;l<g.length;l++)hd(g[l])?x("Integrator",
"Skip activation for redirect."):window.optimizely.push(["activate",f,g[l],{force:j}])}}})}catch(a){x("Integrator","Playback ClickTale Aggregation Integration failed.")}try{window.ClickTaleContext.getRecordingContextAsync("1.1",function(a){if(a.inSingleRecordingScope){a.location&&window.optimizely.push(["overrideUrl",a.location]);x("Integrator","Playback ClickTale getRecordingContextAsync callback");for(var b in a.fields)x("Integrator","Playback ClickTale Integration - %s=%s",b,a.fields[b]),hd(a.fields[b])?
x("Integrator","Skip activation for redirect."):window.optimizely.push(["activate",b,a.fields[b],{force:j}])}})}catch(b){x("Integrator","Playback ClickTale Recording Integration failed.")}}else x("Integrator","ClickTaleContext not defined.")}
function id(){x("Integrator","Tracking with ClickTale.");"function"==typeof window.ClickTaleField?w(Uc(),function(a){var b=Q(a),c=S(b,a,100,100,15,o),c=c.key+": "+c.value+" (x"+b+"="+a+")";x("Integrator","Setting ClickTale - %s",c);window.ClickTaleField(b,a);window.ClickTaleEvent(c)}):x("Integrator","ClickTaleField() not defined.")}function jd(a){Zc=a}function kd(a){Rc=a}function ld(a,b){return a.replace(/[^a-zA-Z0-9\.\~\!\*\(\)\']+/g,"_").substring(0,b)}
function Uc(){var a=md.concat(T),b=[];w(nd(),function(c){var e=Q(c),f=o;if(Fb(e)){var g=Wb(c);E(a,e)&&(x("Integrator",'"%s" relevant because experiment active',g),f=j);f&&b.push(c)}});var c=od;c&&b.push(c);return b}function hd(a){if(a=Tb(a))if(a=pd(a.toString()))return a[1];return k}
function fd(){if(qa)if(Sc){var a=window[window.GoogleAnalyticsObject||"ga"];if(a){var b=Tc;if(b!==k)try{x("Integrator","Fixing Universal Analytics set referrer with %s",b),(0,window[window.GoogleAnalyticsObject||"ga"])("set","referrer",b)}catch(c){x("Integrator","Error setting Universal Analytics referrer: %s",c)}x("Integrator","Tracking with Universal Analytics");w(Uc(),function(b){var c=Q(b);if(ac(c,"slot")){var f=ac(c,"slot"),g=ac(c,"tracker"),l=S(c,b,100,100,25,j),b=l.key+" ("+c+"): "+l.value;
150<b.length&&(b=l.key.substring(0,80)+" ("+c+"): "+l.value,b=b.substring(0,149));c=g?g+".":"";x("Integrator","Calling ua set dimension - ga(%sset, dimension%d, %s)",c,f,b);a(c+"set","dimension"+f,b)}})}else M("Integrator","Error with Universal Analytics integration: 'GoogleAnalyticsObject' not defined")}else ed=j}function bd(a,b){M("Integrator","Preparing to send data to Sessioncam");return[S(a,b,100,100,15,o),{key:"Optimizely Exp "+a,value:"Optimizely Var "+b}]}
function dd(){try{$(window).unbind("load.ATInternet"),window.xt_mvt&&w(cd,function(a,c){c||(x("Integrator","Sending AT Internet log call: %s",a),window.xt_mvt("","",a),cd[a]=j)})}catch(a){M("Integrator","Error sending AT Internet data: "+a.toString())}}function S(a,b,c,d,e,f){a=Zc+Mb(a);b=Xb(b);1<b.length?(b=$.map(b,function(a){return a.substr(0,e-1)}),b=b.join("~")):b=b[0];f?(a=ld(a,c),b=ld(b.replace("#",""),d)):(a=a.substring(0,c),b=b.substring(0,d));return{key:a,value:b}}
function qd(a,b,c){try{var d=N.get(rd)||{},e=d[a],f;if(c&&e){var c={},g;if(e)for(g in e)e.hasOwnProperty(g)&&(c[g]=e[g]);if(b)for(g in b)if(b.hasOwnProperty(g)){var e=c,l=g,m;if(c[g]){var n=c[g],r=b[g];F(n)||(n=[n]);F(r)||(r=[r]);for(var q=[].concat(n),G=i,G=0;G<r.length;G++)ra(r[G],q)||q.push(r[G]);m=q}else m=b[g];e[l]=m}f=c}else f=b;d[a]=f;N.set(rd,d)}catch(A){}}var ed=o,Vc=o,cd={},$c="",Xc=2,Sc=o,Zc="Optimizely ",Rc=k,rd="thirdParty";function sd(a,b,c,d){if(!B)return o;var e="number"===typeof c||"string"===typeof c?String(c):k,f=!!(c===j||c&&c.force===j||d&&d.force===j),d=("object"===typeof c?c:d)||{},c=d.skip===j,g=d.skipPageview===j,d=d.enabledStatus;if(e)try{td(b,e,j)}catch(l){M("Activator","Error while activating experiment "+b+" for variation "+e+" -- proceeding without bucketing user.")}var m=[];bb(b)?m.push(b):w(Eb(),function(a){Kb(a)&&m.push(a)});ud(a,m,{Ha:f,fb:j,Ga:d,ib:c,Aa:g})}
function vd(a,b,c){if(!B)return o;if(!("object"===typeof b&&"string"===typeof c))if("object"===typeof b&&!H(c))c=b.hasOwnProperty("lists")?"odds":"cdn3";else if(H(b)||H(c)){M("Activator","Unrecognized arguments to activateGeoDelayedExperiment: "+arguments);return}if("object"===typeof b&&"string"===typeof c){M("Activator","Saving async info from '"+c+"'");"cdn3"===c&&U("geoArrive");Ec(c,b);var d=(R[c]=b)&&b.lists||{},e={},f,g,l,m,n;for(n in d)d.hasOwnProperty(n)&&(0===n.indexOf("_")&&d[n])&&(f=n.substring(1).split("__"),
g=f.shift(),l=f.shift(),f=f.join("__"),g&&(l&&f)&&(m=e,m[g]||(m[g]={}),m=m[g],m[l]||(m[l]=[]),m=m[l],m.push(f)));for(g in e)qd(g,e[g],o);wd?(M("Activator","Post-timeout; too late to act on new async info."),geolocation.cdn3Requested&&U("geoFailed")):(d=xd.slice(),M("Activator","Trying to activate "+d.length+" delayed segments"),yd(d),d=zd.slice(),M("Activator","Trying to activate "+d.length+" experiments"),ud(a,d,{Aa:Sa}),Ad(),"object"===typeof b&&"string"===typeof c&&"cdn3"===c&&U("geoSuccess"))}else M("Activator",
"Timeout: will not act on future async info."),U("geoTimeout"),wd=j}
function ud(a,b,c){M("Activator","Triaging "+b.length+" experiments.");var d=[],e=[],f=[];w(b,function(b){c.Ha?(M("Activator","Force-ignoring conditions for experiment "+b),d.push(b)):Bd(b)?Cd(b,{manualActivation:c.fb,objectType:"experiment",enabledStatus:c.Ga,visitor:a})?(M("Activator","Passed conditions for experiment "+b),d.push(b)):(M("Activator","Failed conditions for experiment "+b),f.push(b)):(M("Activator","Can't test conditions for experiment "+b),e.push(b))});w(e,Dd);Ed(d);Ed(f);var g=[];
w(d,function(a){Fd(a,c.ib)&&g.push(a)});Gd(g,b);Hd();Yc();B&&!c.Aa&&Id()}
function yd(a){M("Activator","Triaging "+a.length+" segments.");var b=[],c=[],d=[],e=[];w(a,function(a){bc(a,"is_api_only")?(M("Activator","Ignoring API-only segment "+a),e.push(a)):Bd(a)?Cd(a,{objectType:"segment"})?(M("Activator","Passed conditions for segment "+a),b.push(a)):(M("Activator","Failed conditions for segment "+a),d.push(a)):(M("Activator","Can't test conditions for segment "+a),c.push(a))});w(c,Jd);Kd(b);Kd(d);Kd(e);w(b,Ld)}
function Dd(a){M("Activator","Deferring test for experiment "+a);E(zd,a)||zd.push(a)}function Jd(a){M("Activator","Deferring test for segment "+a);E(xd,a)||xd.push(a)}function Ed(a){zd=K(zd,function(b){return!ra(b,a)})}function Kd(a){xd=K(xd,function(b){return!ra(b,a)})}var zd=[],xd=[],wd=o;/*


 UAParser.js v0.7.9
 Lightweight JavaScript-based User-Agent string parser
 https://github.com/faisalman/ua-parser-js

 Copyright ? 2012-2015 Faisal Salman <fyzlman@gmail.com>
 Dual licensed under GPLv2 & MIT
*/
function Md(){}var Nd={extend:function(a,b){for(var c in b)-1!=="browser cpu device engine os".indexOf(c)&&0===b[c].length%2&&(a[c]=b[c].concat(a[c]));return a},has:function(a,b){return"string"===typeof a?-1!==b.toLowerCase().indexOf(a.toLowerCase()):o},N:function(a){return a.toLowerCase()},va:function(a){return"string"===typeof a?a.split(".")[0]:i}};
function Od(){for(var a,b=0,c,d,e,f,g,l,m=arguments;b<m.length&&!g;){var n=m[b],r=m[b+1];if("undefined"===typeof a)for(e in a={},r)f=r[e],"object"===typeof f?a[f[0]]=i:a[f]=i;for(c=d=0;c<n.length&&!g;)if(g=n[c++].exec(this.ra()))for(e=0;e<r.length;e++)l=g[++d],f=r[e],"object"===typeof f&&0<f.length?2==f.length?a[f[0]]="function"==typeof f[1]?f[1].call(this,l):f[1]:3==f.length?a[f[0]]="function"===typeof f[1]&&(!f[1].exec||!f[1].test)?l?f[1].call(this,l,f[2]):i:l?l.replace(f[1],f[2]):i:4==f.length&&
(a[f[0]]=l?f[3].call(this,l.replace(f[1],f[2])):i):a[f]=l?l:i;b+=2}return a}function Sd(a,b){for(var c in b)if("object"===typeof b[c]&&0<b[c].length)for(var d=0;d<b[c].length;d++){if(Nd.has(b[c][d],a))return"?"===c?i:c}else if(Nd.has(b[c],a))return"?"===c?i:c;return a}
var Td={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2E3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Ud={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],["name","version"],[/\s(opr)\/([\w\.]+)/i],[["name","Opera"],"version"],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,
/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium)\/([\w\.-]+)/i],["name","version"],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[["name","IE"],"version"],[/(edge)\/((\d+)?[\w\.]+)/i],["name","version"],[/(yabrowser)\/([\w\.]+)/i],[["name","Yandex"],"version"],[/(comodo_dragon)\/([\w\.]+)/i],[["name",/_/g," "],"version"],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],
["name","version"],[/(dolfin)\/([\w\.]+)/i],[["name","Dolphin"],"version"],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[["name","Chrome"],"version"],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],["version",["name","MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],["version",["name","Android Browser"]],[/FBAV\/([\w\.]+);/i],["version",["name","Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],["version",["name","Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],
["version","name"],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],["name",["version",Sd,{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],["name","version"],[/(navigator|netscape)\/([\w\.-]+)/i],[["name","Netscape"],"version"],[/fxios\/([\w\.-]+)/i],["version",["name","Firefox"]],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],["name","version"]],ca:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",Nd.N]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/windows\s(ce|mobile);\sppc;/i],
[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[["architecture",/ower/,"",Nd.N]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[["architecture",Nd.N]]],F:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],["model","vendor",["type","tablet"]],[/applecoremedia\/[\w\.]+ \((ipad)/],["model",["vendor","Apple"],["type","tablet"]],[/(apple\s{0,1}tv)/i],[["model","Apple TV"],["vendor",
"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],["vendor","model",["type","tablet"]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],["model",["vendor","Amazon"],["type","tablet"]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[["model",Sd,{"Fire Phone":["SD","KF"]}],["vendor","Amazon"],["type","mobile"]],[/\((ip[honed|\s\w*]+);.+(apple)/i],["model","vendor",["type","mobile"]],[/\((ip[honed|\s\w*]+);/i],
["model",["vendor","Apple"],["type","mobile"]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],["vendor","model",["type","mobile"]],[/\(bb10;\s(\w+)/i],["model",["vendor","BlackBerry"],["type","mobile"]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i],["model",["vendor","Asus"],["type","tablet"]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],
[["vendor","Sony"],["model","Xperia Tablet"],["type","tablet"]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[["vendor","Sony"],["model","Xperia Phone"],["type","mobile"]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],["vendor","model",["type","console"]],[/android.+;\s(shield)\sbuild/i],["model",["vendor","Nvidia"],["type","console"]],[/(playstation\s[3portablevi]+)/i],["model",["vendor","Sony"],["type","console"]],[/(sprint\s(\w+))/i],[["vendor",Sd,{HTC:"APA",Sprint:"Sprint"}],["model",
Sd,{"Evo Shift 4G":"7373KT"}],["type","mobile"]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],["vendor","model",["type","tablet"]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],["vendor",["model",/_/g," "],["type","mobile"]],[/(nexus\s9)/i],["model",["vendor","HTC"],["type","tablet"]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],["model",["vendor","Microsoft"],["type","console"]],[/(kin\.[onetw]{3})/i],[["model",/\./g,
" "],["vendor","Microsoft"],["type","mobile"]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i],["model",["vendor","Motorola"],["type","mobile"]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],["model",["vendor","Motorola"],["type","tablet"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[["vendor","Samsung"],"model",["type","tablet"]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-n900))/i,
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[["vendor","Samsung"],"model",["type","mobile"]],[/(samsung);smarttv/i],["vendor","model",["type","smarttv"]],[/\(dtv[\);].+(aquos)/i],["model",["vendor","Sharp"],["type","smarttv"]],[/sie-(\w+)*/i],["model",["vendor","Siemens"],["type","mobile"]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[["vendor","Nokia"],"model",["type","mobile"]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],["model",["vendor","Acer"],["type","tablet"]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],
[["vendor","LG"],"model",["type","tablet"]],[/(lg) netcast\.tv/i],["vendor","model",["type","smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],["model",["vendor","LG"],["type","mobile"]],[/android.+(ideatab[a-z0-9\-\s]+)/i],["model",["vendor","Lenovo"],["type","tablet"]],[/linux;.+((jolla));/i],["vendor","model",["type","mobile"]],[/((pebble))app\/[\d\.]+\s/i],["vendor","model",["type","wearable"]],[/android.+;\s(glass)\s\d/i],["model",["vendor","Google"],["type","wearable"]],[/android.+(\w+)\s+build\/hm\1/i,
/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i],[["model",/_/g," "],["vendor","Xiaomi"],["type","mobile"]],[/(mobile|tablet);.+rv\:.+gecko\//i],[["type",Nd.N],"vendor","model"]],ea:[[/windows.+\sedge\/([\w\.]+)/i],["version",["name","EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],["name","version"],
[/rv\:([\w\.]+).*(gecko)/i],["version","name"]],xa:[[/microsoft\s(windows)\s(vista|xp)/i],["name","version"],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],["name",["version",Sd,Td]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[["name","Windows"],["version",Sd,Td]],[/\((bb)(10);/i],[["name","BlackBerry"],"version"],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
/linux;.+(sailfish);/i],["name","version"],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[["name","Symbian"],"version"],[/\((series40);/i],["name"],[/mozilla.+\(mobile;.+gecko.+firefox/i],[["name","Firefox OS"],"version"],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,
/(gnu)\s?([\w\.]+)*/i],["name","version"],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[["name","Chromium OS"],"version"],[/(sunos)\s?([\w\.]+\d)*/i],[["name","Solaris"],"version"],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],["name","version"],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[["name","iOS"],["version",/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[["name","Mac OS"],["version",/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],["name","version"]]};
function Vd(a,b){if(!(this instanceof Vd))return(new Vd(a,b)).Ua();var c=a||(Md&&Md.navigator&&Md.navigator.userAgent?Md.navigator.userAgent:""),d=b?Nd.extend(Ud,b):Ud;this.u=function(){var a=Od.apply(this,d.browser);a.va=Nd.va(a.version);return a};this.La=function(){return Od.apply(this,d.ca)};this.K=function(){return Od.apply(this,d.F)};this.Qa=function(){return Od.apply(this,d.ea)};this.oa=function(){return Od.apply(this,d.xa)};this.Ua=function(){return{Ab:this.ra(),browser:this.u(),ea:this.Qa(),
xa:this.oa(),F:this.K(),ca:this.La()}};this.ra=function(){return c};this.hb=function(a){c=a};this.hb(c);return this}Vd.VERSION="0.7.9";Vd.kb={e:"name",qb:"major",VERSION:"version"};Vd.mb={jb:"architecture"};Vd.nb={sb:"model",VENDOR:"vendor",g:"type",lb:"console",rb:"mobile",vb:"smarttv",wb:"tablet",xb:"wearable",ob:"embedded"};Vd.pb={e:"name",VERSION:"version"};Vd.ub={e:"name",VERSION:"version"};Md.Ca=Vd;function ic(){var a=new Md.Ca(window.navigator.userAgent),b=a.u(),c=a.oa(),a=a.K(),d=a.model in Wd?Wd[a.model]:"unknown",e=(c.name||"unknown").toLowerCase(),f;a:if(E(["mobile","tablet"],a.type))f=j;else{if(d&&"unknown"!==d)for(f in Wd)if(d===Wd[f]){f=j;break a}f=E(["android","blackberry","ios","windows phone"],e)?j:o}return{aa:Xd(b.name),ba:b.version,platform:{id:e,version:c.version},F:{id:d,type:a.type||(f?"mobile":"desktop"),w:f}}}
function Xd(a){a=(a||"").toLowerCase();if(a in Yd)return a;for(var b in Yd)if(D(Yd[b]||[],function(b){return b.toLowerCase()===a}))return b;return"unknown"}var Yd={gc:["Chrome","chromium","silk","yandex","maxthon"],ie:["Internet Explorer","iemobile"],edge:["Edge"],ff:["Firefox","iceweasel"],opera:["Opera","opera mini","opera tablet"],safari:["Safari","mobile safari","webkit"],ucbrowser:["UC Browser"]},Wd={iPhone:"iphone",iPad:"ipad"};function pd(a){return a.match(/_optimizely_redirect(?:_no_cookie)?=(\S+)/)}function Zd(a){return-1!==a.indexOf("_optimizely_redirect_no_cookie")}function $d(a){var a=a||"",b=v("optimizelyRedirect");return Zd(a)||!b||b&&"true"===b.split("|")[1]?j:o}function ae(){var a;a=H(a)?a:document.referrer;y("optimizelyReferrer",a,5)}
var Tc=k,od="",be=/^\/\* _optimizely_redirect.+\*\/[ ]*\nwindow\.location\.replace\(_optly\.redir\.href.*\)[ ]*[;]?$/,ce=/^\/\* _optimizely_redirect.+\*\/[ ]*\nvar[ ]*_optly[ ]*=[ ]*\{[ ]*redir:document\.createElement\("a"\)\}[;]?\n_optly\.redir\.href=.*\n_optly\.cur=.+\nif \(_optly.cur\)[ ]?\{.+\}[ ]*\nwindow\.location\.replace\(_optly\.redir\.href.*\)[ ]*[;]?$/,de=/^\/\* _optimizely_redirect.+\*\/[ ]*[\n]+window\.location\.replace\([ ]*redirectFirst.*\)[ ]*[;]?$/;var ee,fe;function ge(){var a={disable:he,optOut:ie,setCookieDomain:Ca,setCookieExpiration:je,verifyPreviewProject:function(a){P()!==a&&M("API","Preview projectId ("+P()+") does not match expected ("+a+"), disabling.")}},b=window.optimizely,c=[];F(b)&&(w(b,function(b){var e=b;F(b)?e=b[0]:ab(b)&&(e=b.type);a[e]?ke([a],b,j):c.push(b)}),window.optimizely=c)}function le(a,b,c){qd(a,b,!!c);Ad()}
function me(a,b){var c=Hb(a)||a,d=Ib()[c];d?d.audience_id?V.D(d.audience_id):d.dimension_id?V.B(d.dimension_id,b||j,o):ne(c,b):M("API","Unable to find segment: "+c)}
function td(a,b,c){Ra=j;B&&c!==j&&Id();var a=String(a),b=String(b),d=k,e=b.split("_"),f=Ob(a),b=f&&0!==f.length;if("-1"===e[0]){c=a;oe[c]&&delete oe[c];pe[c]&&delete pe[c];for(e=0;e<W.length;e++)W[e].H===c&&W.splice(e,1);qe()}else if(b&&e.length==f.length)d=[],w(e,function(a,b){256>=Number(a)?d.push(Sb(f[b])[a]):d.push(a)}),d=d.join("_");else if(!b&&1==e.length&&256>=Number(e[0])){var c=String,e=e[0],g=Pb(a),l=k;try{l=g[e]}catch(m){}d=c(l)}else 1==e.length?d=e[0]:M("API","Error: could not bucket user. Unknown arguments.");
d&&(b&&Rb(a,d)?(b=d,c=Rb(a,b),re[a]=re[a]||{},re[a][c]=b,M("Distributor","Preferring variation partial "+b+" of section "+c+" of experiment "+a),a=se(a),1===a.length&&te(a[0],"api.bucketUser",j)):te(d,"api.bucketUser",j));Hd()}function he(a){a&&"tracking"===a||(M("API","Optimizely disabled"),Ha=B=o);qa=o}function ue(){M("API","Finalizing API.");Ad();ee=j}function ve(){if(z("slave"))return SLAVE_CLIENT.optimizely.get.apply(k,Array.prototype.slice.call(arguments))}var we=[];
function xe(a){we.push(a);Ad()}function ke(a,b,c){var d=[],e=b,c=H(c)?c:o,f=0;F(b)?(e=b[0],d=Za(b,1)):ab(b)&&(f=H(b.version)?b.version:1,e=b.type,d=[b]);var a=a[f],g;a&&(g=a[e]);g?(M("API",'Called function "'+e+'"'),g.apply(k,d),ye.R[0===f?e:"v"+f+"."+e]=j):c||M("API",'Error for unknown function "'+e+'"');z("slave")&&SLAVE_CLIENT.optimizely.push(b);yc()}
function ze(a,b){ee?M("API","Error: can't add custom tags after Optimizely loads"):(fe=fe||{},2==arguments.length?fe[a]=b:1==arguments.length&&$.extend(j,fe,a))}function Ae(a,b){var c=Hb(a)||a,b=H(b)?b:j,d=Ib()[c];d?d.audience_id?V.Y(d.audience_id):d.dimension_id?V.B(d.dimension_id,k):Ce(c,b):M("API","Unable find segment for: "+c)}function De(){var a=L(Ib());w(a,function(a){Ae(a,o)});Ee()}
function Ad(){Fe={};Ge={};He={};w(nd(),function(a){var b=Q(a);Fe[b]=a.split("_");Ge[b]=Vb(a);He[b]=Wb(a)});Ie={};var a=z("audiences");X(Ie,"audiences",a||i,"data.audiences");X(Ie,"customTags",fe,"data.customTags");X(Ie,"thirdParty",N.get(rd)||{},"data.thirdParty");for(var b={},c=Eb(),a=0;a<c.length;a++){var d=c[a],e={};e.code=O(d,"code")||"";e.name=Mb(d);e.conditional=Lb(d);e.manual=Kb(d);e.section_ids=Ob(d);e.variation_ids=Pb(d);b[d]=e}X(Ie,"experiments",b,"data.experiments");b={};c=L(Ib());for(a=
0;a<c.length;a++)d=c[a],e={name:bc(d,"name")||"Seg "+d},b[d]=e;X(Ie,"segments",b,"data.segments");b={};c=L(z("sections")||{});for(a=0;a<c.length;a++)d=c[a],e={},e.name=z("sections",d,"name")||"Sec "+d,e.variation_ids=Sb(d),b[d]=e;X(Ie,"sections",b,"data.sections");b={};c=L(z("variations")||{});for(a=0;a<c.length;a++)d=c[a],e={},e.name=Wb(d),e.code=Tb(d),b[d]=e;X(Ie,"variations",b,"data.variations");var a=jc(),a=Yd[a]?Yd[a][0]:a,b=kc(),c=lc().id,d=lc().type,e=nc(),f=rc(),g=qc(),l=nc().id,m={};w(Qb(),
function(a){m[a]=Kc(a)});var b={browser:a,browserVersion:b,device:c,deviceType:d,platform:e,mobile:f,mobileId:g,os:l,lists:m,location:Nc(),ip:Gc(),matchingRules:Pc(),referrer:String(document.referrer),segments:Je(),dimensions:V.t,audiences:V.p},n;for(n in b)X(b,n,b[n],"data.visitor."+n);n={};c=Ke();c.reverse();a=0;for(d=c.length;a<d;a++)try{n[ja(c[a][0])]=ja(c[a][1])}catch(r){M("API","Failed to decode parameter "+c[a][0]+"="+c[a][1])}X(b,"params",n,"data.visitor.params");Ie.visitor=b;n={};X(n,"activeExperiments",
md||[],"data.state.activeExperiments");a:{if(a=od)if(b=Q(a)){a={variationId:a,experimentId:b,referrer:Tc};break a}a=i}X(n,"redirectExperiment",a,"data.state.redirectExperiment");X(n,"variationIdsMap",Fe,"data.state.variationIdsMap");X(n,"variationMap",Ge,"data.state.variationMap");X(n,"variationNamesMap",He,"data.state.variationNamesMap");X(n,"enabled",B,"data.state.enabled");n.integrations={};X(n.integrations,"activeOAuthClientIds",we,"data.state.integrations.activeOAuthClientIds");Ie.state=n;n=
{activeExperiments:md,allExperiments:Jb(),all_experiments:Jb(),variationIdsMap:Fe,variationMap:Ge,variationNamesMap:He,variation_map:Ge};window.optimizely.data=Ie;w(n,function(a,b){X(window.optimizely,a,b)})}function X(a,b,c,d){try{var e="o.",e=d?e+d:e+b;Object.defineProperty(a,b,{configurable:j,enumerable:j,get:function(){ye.R[e]=j;return c},set:function(a){c=a}})}catch(f){a[b]=c}}function Le(a){if(!bb(a))return o;Fa=Number(a)}function Me(){La=j}
function je(a){var b="";"number"!==typeof a?(b="must be a number.",a=31536E4):a=Math.floor(86400*a);7776E3>a&&(b="less then minimum.",a=7776E3);M("API",(b&&"Days argument "+b)+" Cookie expiration set to "+a+" seconds.");Ua=a}function Ne(){Sa=j}function Oe(){v("optimizelyReportableFix")?M("API","skipping because cookie is set"):(w(z("audiences"),function(a){vb(a)&&(M("API","Removing from reportable audience: "+a),V.Y(a))}),y("optimizelyReportableFix","1",7776E3))}
function Pe(a){var b=Wa();!a&&0!==a?(M("API","Clearing PPID"),ya("optimizelyPPID",za())):"string"===typeof a||"number"===typeof a?(M("API","Setting PPID to "+a),a=String(a),y("optimizelyPPID",a,Ua)):M("API","Ignoring non-string, non-number PPID: "+a);Wa()!==b&&(M("API","Clearing plan because of PPID change"),M("Plan","Resetting visitor buckets"),Qe={},oe={},pe={},W=[],Hd())}
var Se={event:function(a){Re(a.eventName,a.tags)},user:function(a){a.userId&&Pe(a.userId);a.attributes&&w(a.attributes,function(a,c){V.B(a,c)})},integration:function(a){a.OAuthClientId&&xe(a.OAuthClientId)}},Ie={},Te={},Fe={},Ge={},He={},V=k;function Re(a,b){var c;a:{c={};var d,e=z("custom_revenue_goals");e&&(a in e&&bb(e[a]))&&(d=Number(e[a]));if(b)if(bb(b))d=Number(b);else if("object"===typeof b){if(c=J({},b),"revenue"in c)if(bb(c.revenue))d=Number(c.revenue),delete c.revenue;else{x("tracker","Revenue field %s not a number.",c.revenue);c=k;break a}}else{x("tracker","Revenue argument %s not a number.",b);c=k;break a}H(d)&&(c.Z=d)}if(c===k)x("tracker","Bad options. Will not track this event.");else{d=Cb();var f={};w(d,function(a){f[a]=
j});$.extend(c,{fa:f});Ue(a,"custom",c)}}function Ue(a,b,c,d){c=c||{};qa&&(Ve.push({name:a,type:b,da:d||+new Date/1E3,options:c}),We?(Xe(),M("Tracker","Tracking event '"+a+"'")):M("Tracker","Queued tracking event '"+a+"'"))}function Ye(){Ze();$("html").bind("mousedown",$e);$("html").bind("touchstart",af)}function Ze(){$("html").unbind("touchstart",af);$("html").unbind("mousedown touchend",$e);$("html").unbind("touchmove",Ye)}
function af(){$("html").bind("touchend",$e);$("html").bind("touchmove",Ye)}function Id(){var a=document.location.href,b=Gb(a);0<b.length?(Ue("optly_activate","activate"),w(b,function(b){Ue(a,"pageview",{sa:[b]},bf)})):Ue(a,"activate")}function cf(){var a=v("optimizelyPendingLogEvents")||"[]",b=[];try{b=ea(a)}catch(c){}if(F(b))for(var a=0,d=b.length;a<d;a++){var e=b[a];if("string"!==typeof e){b=[];break}else try{ea(e);b=[];break}catch(f){}}else b=[];return b}
function df(a){a=I(a.split("&"),function(a){return a.split("=")});a.sort(function(a,c){return a[0]<c[0]?-1:a[0]>c[0]?1:0});return I(a,function(a){return a.join("=")}).join("&")}
function ad(a,b){if(ef&&-1!==a.indexOf(ff))try{var c=new XMLHttpRequest;if("withCredentials"in c){c.onload=b;c.open("GET",a,j);c.withCredentials=j;c.send();return}ef=o;M("Tracker","Found that XHR with credentials is not supported in this browser.")}catch(d){M("Tracker","XHR not supported"),ef=o}var c=a,e=new Image;e.onload=b;c=c.replace("&"+ff,"");e.src=c;gf.push(e)}
function ie(a,b){a=!H(a)||"true"===String(a);H(b)||(b=window.alert);var c=a?"true":"false";a?(y("optimizelyOptOut",c,Ua),y("optimizelyBuckets",c,Ua),b("You have successfully opted out of Optimizely for this domain.")):(y("optimizelyOptOut",c,Ua),b("You are NOT opted out of Optimizely for this domain."))}function jf(){return"true"===v("optimizelyOptOut")}function $e(){Ze();Ue("engagement","engagement")}var Ve=[],We=o;
function Xe(){var a=["a="+P(),"d="+tb(),"y="+!!z("ip_anonymization"),"src=js"];Ra&&a.push("override=true");w(nd(),function(b){var c=Q(b);a.push("x"+c+"="+b)});w(Je(),function(b,c){c=encodeURIComponent(ja(c));a.push("s"+b+"="+c)});a.push("tsent="+ +new Date/1E3);var b=[],c=Va(),d=Wa();w(Ve,function(a){var e=[],f;if(a.options.sa)f=a.options.sa;else if("activate"===a.type){f=md.concat(T);var g=od;g&&(g=Q(g),f.push(g))}else f=a.name?Gb(a.name):[];a.name&&e.push("n="+encodeURIComponent(a.name));a.options.anonymous!==
j&&(e.push("u="+c),d&&e.push("p="+encodeURIComponent(d)));ef&&e.push(ff);a.da&&e.push("time="+a.da);La&&e.push("dtpc="+La);var l=!!a.options&&!!a.options.Z&&a.options.fa||{},g=L(l),Be=K(Cb(),function(a){return!l[a]});f=[{S:g,ta:f.concat([z("summary_revenue_goal_id")||k]),ga:["v="+encodeURIComponent(a.options.Z)]},{S:Be,ta:f,ga:[]}];w(f,function(a){(a.S.length||Ga)&&b.push(e.concat(a.ga).concat(["f="+a.S.join(","),"g="+a.ta.join(",")]).join("&"))});if("custom"===a.type)try{var m=a.name,n=Va(),q=N.get("customEvents")||
{},r=q[n]||(q[n]=[]),r=F(r)?r:[];-1!==$.inArray(m,r)&&r.splice($.inArray(m,r),1);r.push(m);100<r.length&&r.shift();q[n]=r;N.set("customEvents",q);ya("optimizelyCustomEvents",za())}catch(hf){}});var e=b.concat(cf());kf(e);var f=a.join("&"),e=lf?b:e;lf=j;for(var g=0,l=e.length;g<l;g++){var m=e[g],n=f+"&"+m;M("Tracker","Making a log request.");var n=n+("&cx2="+fc(df(n),65259)),r=P(),q=z("log_host");r&&(q=r.toString()+"."+q);ad("https://"+q+"/event?"+n,function(){for(var a=m,b=cf(),c=0,d=b.length;c<d;c++)if(b[c]===
a){b.splice(c,1);break}kf(b);M("Tracker","Removed a pending log event from the pending events cookie.")})}Ve=[];We=j}function kf(a){for(var b=u(a);1536<b.length;)a=a.slice(0,-1),b=u(a);y("optimizelyPendingLogEvents",b,15)}var gf=[],lf=o,ff="wxhr=true",ef=j,bf=+new Date/1E3;var Y={e:"n",b:"t",g:"y",l:"c",m:"r",o:"s",f:"o"};function mf(a,b,c,d,e){this[Y.e]=a;this[Y.g]=b;"string"===typeof c&&0<eb(c).length&&(this[Y.l]=eb(c));d&&0<L(d).length&&(this[Y.f]=d);H(e)&&(this[Y.m]=e)}
mf.prototype.hash=function(){if(this.v)return this.v;var a;a=[];a.push(encodeURIComponent(Y.e)+"="+encodeURIComponent(this[Y.e]));a.push(encodeURIComponent(Y.g)+"="+encodeURIComponent(this[Y.g]));this[Y.l]&&a.push(encodeURIComponent(Y.l)+"="+encodeURIComponent(this[Y.l]));this[Y.m]&&a.push(encodeURIComponent(Y.m)+"="+encodeURIComponent(this[Y.m]));if(this[Y.f])for(var b=this[Y.f]||{},c=K(L(b),function(a){return b.hasOwnProperty(a)}),c=c.sort(),d=0;d<c.length;d++)a.push(encodeURIComponent(c[d])+"="+
encodeURIComponent(b[c[d]]));a=a.join("&");var e=String.fromCharCode;a=a.replace(/[\S\s]/gi,function(a){var a=a.charCodeAt(0),b=e(a&255);255<a&&(b=e(a>>>8&255)+b);65535<a&&(b=e(a>>>16)+b);return b});return this.v=fc(a,2716770798)};
function nf(a,b){if(a.hash()!==b.hash()||a[Y.e]!==b[Y.e]||a[Y.g]!==b[Y.g]||a[Y.l]!==b[Y.l]||a[Y.m]!==b[Y.m])return o;if(!a[Y.f]&&!b[Y.f])return j;var c=a[Y.f]||{},d=b[Y.f]||{},e=K(L(c),function(a){return c.hasOwnProperty(a)}),f=K(L(d),function(a){return d.hasOwnProperty(a)});if(e.length!==f.length)return o;for(f=0;f<e.length;f++){var g=e[f];if(!d.hasOwnProperty(g)||c[g]!==d[g])return o}return j}mf.prototype.k=function(a,b){var c=$a(this,a);return H(c)?c:b};
mf.prototype.Q=function(a,b){if(a===Y.e||a===Y.g||a===Y.l||a===Y.m||a===Y.f)this[a]=b,this.v=k,this.hash()};function of(a,b,c){this.G=a;this[Y.b]=b;H(c)&&(this[Y.o]=c)}of.prototype.k=function(a,b){if(0===a.length)return this;var c={};c[Y.b]=this[Y.b];c[Y.o]=this[Y.o];c=$a(c,a);return H(c)?c:this.G.k(a,b)};of.prototype.Q=function(a,b){a===Y.b||a===Y.o?this[a]=b:this.G.Q(a,b)};var pf={},qf=[];function rf(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=sf(d);b[c]=new of(e,d[Y.b])}return b}function sf(a,b){var c=new mf(a[Y.e],a[Y.g],a[Y.l],a[Y.f],a[Y.m]);H(b)&&(c.v=b);return c}function tf(a){for(var b=[],c=0;c<a.length;c++)for(var d=a[c],e=sf(d.eb,d.h),f=d.tb,d=d.ts,g=0;g<d.length;g++){var l=d[g];b[l.i]=new of(e,f+l.d)}return b};function uf(){try{var a;if(z("is_behavior_enabled")){if(0===qf.length&&z("is_behavior_enabled")){var b=oc("events")||[],c=oc("event_queue")||[];if(0===b.length&&0===c.length)qf=[];else{"eb"in(b[0]||c[0])?(b=tf(b),c=tf(c)):(b=rf(b),c=rf(c));qf=b.concat(c);1E3<qf.length&&(qf=qf.slice(-1E3));c=qf;for(b=0;b<c.length;b++){var d=c[b],e;b:{var f=c[b].G,g=f.hash(),l=pf[g];if("undefined"===typeof l)pf[g]=[f];else{for(var m=0;m<l.length;m++)if(nf(f,l[m])){e=l[m];break b}l.push(f)}e=f}d.G=e}}var d=qf,n=d.length;
if(0!==n){d[0].Q(Y.o,d[0].k([Y.b]));for(e=1;e<n;e++){var r=d[e-1],q=d[e];q.Q(Y.o,18E5>Math.abs(r.k([Y.b],0)-q.k([Y.b],0))?r.k([Y.o]):q.k([Y.b]))}}}a=qf.slice(-1E3)}else a=[];return a}catch(G){x("Behavior","Error "+G.toString()+" getting events")}return[]};function vf(){return(new Date).getTime()-(wf||0)}var wf=vf();function xf(a,b,c){for(var a=a.slice(),d=a.length-1;0<d;d--){var e=Math.floor(Math.random()*(d+1)),f=a[d];a[d]=a[e];a[e]=f}for(d=a.join(b);d.length>c;)a.pop(),d=a.join(b);return d}function U(a){var b=ye;b.n[a]||(b.n[a]=vf())}var yf;try{yf=!document.getElementsByTagName("body")[0]}catch(zf){yf=k}var Af=k;try{window.requestAnimationFrame(function(){Af=vf()})}catch(Bf){}
var Cf=/\/\/[^.]+\.optimizely\.(com|test)\/(js|api\/client)\/[\d]+\.js/gi,ye=new function(){this.n={};this.R={};this.$a=Math.random()<cc();geolocation.cdn3Requested&&(this.n.geoRequest=geolocation.cdn3Requested-wf)};function Fd(a,b){var b=b===j,c,d=k;w(W,function(b){a==b.H&&(d=b.id)});if((c=d)&&0<c.length)return M("Distributor","Not distributing experiment "+a+" (already in plan)"),j;if(b||a in oe)return M("Distributor","Not distributing experiment "+a+" (is ignored)"),o;c=O(a,"enabled_variation_ids")||[];if(0===c.length)return M("Distributor","Permanently ignoring experiment "+a+" (no enabled variations)"),Df(a),o;var e=O(a,"ignore")||0,f=Ef();if(e>Math.floor(1E4*((dc(f+a,0)>>>0)/ec)))return M("Distributor",
"Permanently ignoring experiment "+a+"("+e/100+"% likelihood)"),Df(a),o;e=c;re[a]!==i&&(M("Distributor","Taking into account bucketUser variations for experiment "+a),e=se(a));var f=e,g=[],l=O(a,"variation_weights")||{};w(f,function(a){g.push(l[a])});f=Ff(a,g);e=e[f];M("Distributor","Picked variation "+e+" [index "+f+" of "+c.length+"]");te(e,"distributor");return j}
function Gf(a,b){b=b||{};M("Distributor","Configuring conditionally-activated experiment: "+a);Te[a]?M("Distributor","Not configuring conditionally-activated experiment (already done): "+a):!Fb(a)&&b.force!==j?M("Distributor","Not configuring conditionally-activated experiment (not enabled): "+a):(Hf(a,b),ee&&Ad())}
function Hf(a,b){function c(){sd(V,a,b);m.isActive=E(md.concat(T),a);M("Distributor","Activating conditionally activated experiment "+a)}var d=O(a,"conditional_code"),e=j,f,g;if("function"===typeof d)e=o,f=d;else try{g=eval("(function() {return "+("("+d+")")+";})()"),"function"===typeof g&&(e=o,f=g)}catch(l){}var m={isActive:o,experimentId:a};if(e){if(e={objectType:"experiment",enabledStatus:b.enabledStatus},b.force||!Bd(a)||Cd(a,e)){var n=function(){Bd(a)&&(If(0,{value:d})||g)?c():setTimeout(n,50)};
n();M("Distributor","Set up conditional polling for "+a);Te[a]=j}}else try{f(c,m),M("Distributor","Set up conditional callback for "+a),Te[a]=j}catch(r){M("Distributor","Error running conditional callback function for "+a)}}function Ef(){return Wa()||Va()}function Ff(a,b){var c=b.length;if(0===c)return k;if(1===c)return 0;for(var d=0,e=0;e<c;e++)d+=b[e];e=Ef();d*=(dc(e+a,1)>>>0)/ec;for(e=0;e<c;e++){if(d<b[e])return e;d-=b[e]}d=Ef();return Math.floor((dc(d+a,2)>>>0)/ec*c)}
function se(a){var b=[];w(O(a,"enabled_variation_ids")||[],function(c){var d=j,e;for(e in re[a])-1===c.indexOf(re[a][e])&&(d=o);d&&b.push(c)});return b}var re={};function Jf(){for(var a=z("dcp_keyfield_locators")||[],b=k,c=[],d=0;d<a.length;d++){var e=a[d],f=e.dcp_datasource_id||k,g=e.is_optimizely||o,l=e.type,e=e.name||"";if(f===k)M("DCP","No DCP datasource id specified");else{var m=k;l===Kf?m=Z.I(e):l===Lf?m=Z.la(e):l===Mf?m=Z.j(e):l===Nf&&(m=Of());if(bb(m)||"string"===typeof m)f={datasourceId:f,id:m},g?b=f:c.push(f)}}return{q:b,z:c}}var Of=Ef;function Pf(){var a=Jf(),b=Oc.get()||{};if(Qf(a.z,b.aliases||{}))return o;b.rulesResults=k;Oc.set(b);return j}
function Qf(a,b){b=b||{};return Xa(a,function(a){return b[a.datasourceId]===a.id})}var Kf="cookie",Lf="js_variable",Mf="query_param",Nf="uid";function Mc(a){if(!Lc(a))return M("Async Request","Can't determine a value for this list-targeted key: "+a),k;var b=a.split("_"),c=b[0],b=b.slice(1).join("_"),d=i;if("c"===c)d=Z.I(b);else if("j"===c)d=Z.la(b);else if("q"===c)d=Z.j(b);else return M("Async Request","Can't determine a value for this list-targeted key: "+a),k;if("string"===typeof d||"number"===typeof d||"boolean"===typeof d)d=d.toString();else return d===k||"undefined"===typeof d?M("Async Request","No value is set for this list-targeted key: "+
a):M("Async Request","Unacceptable value (must be string, number, or boolean) for this list-targeted key: "+a),k;if(100<d.length)return M("Async Request","Withholding the overlong value for this list-targeted key: "+a),k;M("Async Request","Returning a value for this list-targeted key: "+a);return d}function Lc(a){return-1!==a.indexOf("_")?E(["c","j","q"],a.split("_")[0]):o};function Rf(a){if(0===$("body").length)setTimeout(function(){Rf(a)},20);else{var b;b='<div id="optimizely-loading" style="position:absolute;top:0;right:0;left:0;bottom:0;background-color:white;opacity:0.9;z-index: 3271000;"><h2 style="color:#9a9a9a;top:40%;position:absolute;font-size:2.25em;text-align:center;width:100%;font-family:\'Lucida Grande\',sans-serif;">'+a+"</h2></div>";$("#optimizely-loading").remove();$("body").append(b)}}var Sf=z("preview_host");function Ke(){var a=window.location.search||"";0===a.indexOf("?")&&(a=a.substring(1));for(var a=a.split("&"),b=[],c=0;c<a.length;c++){var d="",e="",f=a[c].split("=");0<f.length&&(d=f[0]);1<f.length&&(e=f[1]);b.push([d,e])}return b}function Tf(){for(var a=window.location.search,b,c=/optimizely_([^=]+)=([^&]*)/g,d={};b=c.exec(a);)d[b[1]]=b[2];return d}var Uf=/x(\d+)/;function Vf(a){return a&&-1!==String(a).indexOf("[native code]")};function Wf(a){var b=a||Xf;M("Segmenter","Loading segments cookie.");if(a=v("optimizelySegments")){try{a=ea(a)}catch(c){a={}}w(a,function(a,c){var d=Ib()[a];M("Segmenter","Segments cookie contains segment id: "+a);d&&d.audience_id?b.D(d.audience_id):d&&d.dimension_id?b.B(d.dimension_id,c,o):Yf[a]=c})}yd(L(Ib()));Zf.push($f);Ee();M("Integrator","Loading third-party segments.");if(window.bk_results){a=window.bk_results;M("Integrator","Loading BlueKai segments.");try{w(a.campaigns,function(a){a=a.seg_id;
Ib()[a]?ne(a,j):ub(a)&&b.D(a)})}catch(d){M("Integrator","Error loading BlueKai segments.")}}}function $f(){var a={};w(Yf,function(b,c){c&&(a[b]=c)});y("optimizelySegments",u(a),Ua)}function ne(a,b){a&&!isNaN(parseInt(a,10))?(!b&&""!==b&&(b=j),Yf[a]=b,Ee()):M("Segmenter","Unable to find segment for ID: "+a)}function Ee(){w(Zf,function(a){a()})}function Ld(a){M("Segmenter","Evaluating Segment "+a);var b=ag(a);b!==k&&ne(a,b)}
function ag(a){if(bc(a,"is_api_only"))return k;var b=k,c=k;switch(bc(a,"segment_value_type")||""){case "browser":b=Z.ia();c="unknown";break;case "campaign":b=Z.Ma();c="none";break;case "country":b=Z.L().country;c="unknown";break;case "language":b=Z.T();c="none";break;case "mobile":b=Z.w();break;case "os":b=Z.pa().id;c="unknown";break;case "referrer":b=Z.Ta();c="none";break;case "source_type":b=Z.Va();c="direct";break;default:return"true"}if(b===k){if(Yf.hasOwnProperty(a))return k;b=c}return bg(b)}
function cg(){var a=Z.V();if(Z.j("utm_source")||Z.j("utm_campaign")||Z.j("gclid")||Z.j("otm_source"))return"campaign";for(var b=["google\\.\\w{2,3}(\\.\\w{2,3})?/(search|url)","https://(www\\.)?google\\..*?/$","http(s)?://www\\.bing\\.\\w{2,3}(\\.\\w{2,3})?/","r\\.search\\.yahoo\\.\\w{2,3}(\\.\\w{2,3})?/","baidu\\.\\w{2,3}(\\.\\w{2,3})?/"],c=0;c<b.length;c++){var d=b[c];try{if(a.match(d))return"search"}catch(e){x("Segmenter","%s: %s while matching %s",e.name,e.message,d)}}return a&&mc(a)!==mc(Z.J())?
"referral":k}function dg(){var a=[];w(Yf,function(b,c){c&&a.push(b)});return a}function Je(){var a={};w(Yf,function(b,c){c&&(a[String(b)]=c)});return a}function eg(a){return w(Yf,function(b,c){if((bc(b,"segment_value_type")||"")==a)return c})}function Ce(a,b){var c=Hb(a)||a;Yf[c]?(Yf[c]=o,("undefined"===typeof b||b)&&Ee()):M("Segmenter","Not removing "+a+", not found")}
function bg(a,b){var c,b=H(b)?b:j;c=c||fg;a=ja(a);a=String(a);b&&(a=a.toLowerCase());a=a.substring(0,c);return encodeURIComponent(a)}var Zf=[],Yf={},fg=20;function gg(){}
J(gg.prototype,{ia:jc,Ka:kc,Sa:qc,w:rc,u:function(){return{id:this.ia(),version:this.Ka(),mobileId:this.Sa()}},Ma:function(){return this.j("utm_campaign")},I:v,K:lc,U:Gc,la:function(a){try{return window[a]}catch(b){return k}},Ja:uf,T:function(){var a="";try{a=navigator.userLanguage||window.navigator.language,a=a.toLowerCase()}catch(b){a=""}return a},Oa:function(){return(oc("visitor_profile")||{}).defaultBehavior||{}},L:Nc,J:function(){return vc||window.location.href},na:sc,Ra:function(){return!tc?j:
!!ib.get("first_session")},Ia:Ke,pa:nc,V:function(){return v("optimizelyReferrer")||document.referrer||""},Wa:function(a){var a=a.split("."),b=a[0];a:{for(var a=a.slice(1),b=(N.get(rd)||{})[b],c=0,d=a.length;c<d;c++)if(ba(b)&&b.hasOwnProperty(a[c]))b=b[a[c]];else{a=i;break a}a=b}return a},Ya:function(){return Wa()!==k},Ta:function(){return mc(this.V())},qa:dg,Va:cg,Pa:function(){return document.referrer},j:function(a){a:{for(var b=this.Ia(),b=b||Ke(),c=0;c<b.length;c++){var d=b[c];if(d[0]===a){a=
d[1];a=a.replace(/\+/g," ");a=ja(a);break a}}a=k}return a},Na:function(){return fe},ja:function(a){return(this.Na()||{})[a]},Xa:function(){var a=(N.get("customEvents")||{})[Va()]||[];return F(a)?a:[]},Za:function(a){var b=this.qa();return E(b,a)},Ba:function(a){return E(this.Xa(),a)},getDate:function(){return new Date},ma:Kc,ka:Pc});var Z=new gg;function hg(a,b,c){if(a.k)return a.k(b,c);a=$a(a,b);"undefined"===typeof a&&(a=c);return a}function ig(a){return"string"===typeof a?eb(a).toLowerCase():a}
var jg=["*"],lg={eq:function(a){a=I(a,ig);return a[0]==a[1]},is:function(a){return a[0]===a[1]},gt:function(a){return a[0]>a[1]},lt:function(a){return a[0]<a[1]},gte:function(a){return a[0]>=a[1]},lte:function(a){return a[0]<=a[1]},"in":function(a){var b=I(a[1]||[],ig);return E(b,ig(a[0]))},between:function(a){return a[1]<=a[0]&&a[0]<=a[2]},contains:function(a){a=I(a,function(a){return"string"===typeof a?a.toLowerCase():a});return-1!==(a[0]||"").indexOf(a[1])},regex:function(a){try{var b,c;"string"===
typeof a[1]?(b=a[1],c="i"):(b=a[1][0]||"",c=a[1][1]||"");return RegExp(b,c).test(a[0])}catch(d){return x("Rules",'In operator "regex", error: '+(d.message||"invalid RegExp /"+[b,c].join("/"))),o}},exists:function(a){return"undefined"!==typeof a[0]},and:function(a){return Xa(a,aa())},or:function(a){return D(a,aa())},not:function(a){return!a[0]}},mg={"+":function(a){return(a[0]||0)+(a[1]||0)},"-":function(a){return(a[0]||0)-(a[1]||0)},"/":function(a){return(a[0]||0)/(a[1]||1)},"%":function(a){return(a[0]||
0)%(a[1]||1)}},ng={sum:function(a,b){for(var c=a[0]||jg,d=0,e=0;e<b.length;e++)d+=hg(b[e],c,0);return d},avg:function(a,b){if(0==b.length)return 0;for(var c=a[0]||jg,d=0,e=0;e<b.length;e++)d+=hg(b[e],c,0);return d/b.length},max:function(a,b){for(var c=a[0]||jg,d=Number.NEGATIVE_INFINITY,e=0;e<b.length;e++)d=Math.max(d,hg(b[e],c,Number.NEGATIVE_INFINITY));return d},min:function(a,b){for(var c=a[0]||jg,d=Number.POSITIVE_INFINITY,e=0;e<b.length;e++)d=Math.min(d,hg(b[e],c,Number.POSITIVE_INFINITY));return d},
count:function(a,b){return b.length}},og={now:function(){return+new Date}};
function pg(a,b){if(b.hasOwnProperty("value"))return b.value;if(b.hasOwnProperty("field"))return hg(a,b.field);if(b.hasOwnProperty("eval")){if(!(b.eval in og)){x("Rules","Unknown function: "+b.eval);return}return og[b.eval]()}if(b.op){var c=b.op in lg?lg[b.op]:b.op in mg?mg[b.op]:k;if(c){var d=t(pg,a),e=I(b.args||[],function(a){return d(a)});return c(e,a)}x("Rules","Unknown operator: "+b.op)}else x("Rules","No operator specified: "+u(b))}
function qg(a){function b(a,e){F(a)&&("and"!==a[0]&&("or"!==a[0]&&"not"!==a[0])&&x("Rules","Unexpected operation "+a[0]+". Continuing optimistically."),a={op:a[0],args:a.slice(1)});if(a.hasOwnProperty("field")||a.hasOwnProperty("value")||a.hasOwnProperty("eval"))return a;if(e&&a.op in ng){var f="_"+a.op+"_"+((a.args&&a.args[0]||{}).field||jg).join(".");f in d||(c.push({op:a.op,args:a.args}),d[f]=j);return{field:[f]}}for(var f=[],g=a.args||[],q=0;q<g.length;q++)f[q]=b(g[q],e);return{op:a.op,args:f}}
var c=[],d={},e={};a.hasOwnProperty("where")&&(e.where=b(a.where,o));a.hasOwnProperty("having")&&(e.having=b(a.having,j));if(a.hasOwnProperty("aggregate")||0<c.length)e.aggregate=(a.aggregate||[]).concat(c);for(var f=["groupBy","orderBy","select","limit"],g=0;g<f.length;g++)a.hasOwnProperty(f[g])&&(e[f[g]]=a[f[g]]);a.hasOwnProperty("from")&&(e.from=qg(a.from));return e}
function rg(a,b){var b=b||0,c=[];a.hasOwnProperty("where")?a.where.op?a.where.op in lg||c.push("Non-boolean WHERE clause operator"):c.push("Missing WHERE clause operator"):c.push("Missing WHERE clause");a.hasOwnProperty("having")&&(a.having.op?a.having.op in lg||c.push("Non-boolean HAVING clause operator"):c.push("Missing HAVING clause operator"));a.hasOwnProperty("groupBy")&&!a.hasOwnProperty("aggregate")&&c.push("No AGGREGATE clause specified with GROUP_BY clause");if(a.hasOwnProperty("select")){var d=
a.select;if(F(d))for(var e=0;e<d.length;e++)d[e].op&&d[e].op in ng&&c.push('In SELECT clause, aggregate operator "'+d[e].op+'" specified in selector at index '+e);else c.push("SELECT clause must be an array")}a.hasOwnProperty("limit")&&(d=a.limit,(!bb(d)||0>=Number(d)||Number(d)!=Math.floor(Number(d)))&&c.push("LIMIT must be a positive integer"));0<b&&(c=I(c,function(a){return"Sub-rule "+b+": "+a}));a.hasOwnProperty("from")&&(c=c.concat(rg(a.from,b+1)));return c}
function sg(a,b){var c=b;a.hasOwnProperty("from")&&(c=sg(a.from,c));c=K(c,function(b){return pg(b,a.where)});if(a.hasOwnProperty("aggregate")){var d=a.groupBy;if("undefined"===typeof d||!F(d)||0===d.length){var d={},e={};e[jg]="_";d[jg+"=_"]={ha:e,n:c};c=d}else{for(var d=I(d,function(a){return a.field}),e={},f=0;f<c.length;f++){for(var g=c[f],l=[],m={},n=0;n<d.length;n++){var r=d[n],q=hg(g,r,"_"),r=r.join(".");m[r]=q;l.push(encodeURIComponent(r)+"="+encodeURIComponent(String(q)))}l=l.join("&");e.hasOwnProperty(l)||
(e[l]={ha:m,n:[]});e[l].n.push(g)}c=e}var G=a.aggregate,A={};w(c,function(a,b){A[a]={};for(var c=0;c<G.length;c++){var d=G[c],e=d.op;if(e in ng){var f=(d.args&&d.args[0]||{}).field||jg,d="_"+e+"_"+f.join("."),e=ng[e]([f],b.n);A[a][d]=e}else x("Rules","Unknown aggregate operator "+e)}});var C=[];w(c,function(a,b){var c=J({},b.ha);J(c,A[a]||{});C.push(c)});c=C}a.hasOwnProperty("having")&&(c=K(c,function(b){return pg(b,a.having)}));if(a.hasOwnProperty("orderBy")){var pa=a.orderBy;F(pa)?c=0==pa.length?
c:c.sort(function(a,b){for(var c=0;c<pa.length;c++){var d=pa[c],e="ASC"===(d.direction||"ASC")?1:-1,f=d.field,d=hg(a,f,0),f=hg(b,f,0);if(d<f)return-e;if(d>f)return e}return 0}):x("Rules","groupBy rule must be an array")}a.hasOwnProperty("limit")&&(c=c.slice(0,Number(a.limit)));if(a.hasOwnProperty("select"))var Ta=a.select,c=I(c,function(a){return I(Ta,function(b){return pg(a,b)})});return c}
function tg(a,b){try{var c;c=qg(a);var d=rg(c);0<d.length&&h(Error("Rule "+u(c)+" has violations: "+d.join("\n")));return 0<sg(c,b).length}catch(e){return x("Rules","Error "+e.toString()+" while evaluating rule "+u(a)),o}};function ug(){this.p={};this.t={};this.A={};this.za={}}ug.prototype.bb=function(a){var b=this.A.hasOwnProperty(a)||this.za.hasOwnProperty(a);if(!this.p.hasOwnProperty(a)||!b)try{var c=this.p,d=ub(a);d||h(Error("Unable to find audience for id: "+a));var e=vg(this,d.conditions);M("Visitor","Checking if in audience "+a+": "+e);c[a]=e}catch(f){M("Visitor","Error: "+f.message)}return this.p[a]};
function wg(a,b,c,d){d=J({O:j,ya:j,C:j},d);if(ub(b)){a.p[b]=c;var e=vb(b);e?a.za[b]=c:d.O?a.A[b]=c:delete a.A[b];e&&d.C&&a.C(e,c);if(!e&&d.O&&d.ya){var f=[];w(a.A,p(function(a){this.p[a]&&f.push(a)},a));f.sort();y("optimizelyAudiences",f.join(","),31536E4)}}else M("Visitor","Unable to find audience "+b)}ug.prototype.D=function(a){wg(this,a,j)};ug.prototype.Y=function(a){wg(this,a,o)};ug.prototype.gb=function(){w(this.p,p(function(a){wg(this,a,o,{O:!!this.A.hasOwnProperty(a)})},this))};
function xg(a,b,c,d){d=!H(d)||d;H(c)&&c!==k&&String(c)?(d&&(c=bg(String(c),o)),a.t[b]=c):delete a.t[b];return a.t[b]}ug.prototype.B=function(a,b,c){var d;a:{for(d in z("dimensions")||{}){var e=a,f=yb(d,"api_name");if(e===(!f?k:f))break a}d=k}d=d||a;z("dimensions",d)?"custom_dimension"===zb(d)?(b=xg(this,d,b,c),a=yb(d,"segment_id"),(a=!a?k:a)&&this.C(a,b),M("Visitor",'Set dimension "'+d+'" to "'+b+'"')):M("Visitor",'Unknown dimension "'+d+'"'):M("Visitor","Unable to find dimension "+a)};
ug.prototype.C=function(a,b){b?ne(a,b):Ce(a)};var Xf=new ug;function yg(a,b){cb(b)&&(b=[b]);b=b||jg;return["_"+a+"_"+b.join(".")]}function zg(a){cb(a)&&(a=[a]);a=a||jg;return[a.join(".")]}var Ag={"<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","==":"eq"};function Bg(a){a=eb((a||"").toString());return Ag[a]||a}function Cg(a,b,c){cb(b)&&(b=[b]);return{op:Bg(a),args:[{field:b},{value:c}]}}function Dg(a){for(var b=[],c=0;c<a.length;c++)b[c]={field:a[c]};return b}function Eg(a,b){cb(b)&&(b=[b]);b=b||jg;return{op:a,args:[{field:b}]}}var Fg={};
w(Y,function(a,b){Fg[b]=j});function Gg(a,b){var c=[];cb(a)?(c=[a],"events"===(b||"events")&&!(a in Fg)&&(c=[Y.f,a])):c=a;return c};function Hg(a){var b=a.split(":");2!==b.length&&h(Error("optly.timeAndDayInterval.timeStringToMinutes: Invalid time string "+a));return 60*parseInt(b[0],10)+parseInt(b[1],10)};function Cd(a,b){var c=!!b.manualActivation,d=b.objectType?b.objectType:"experiment",e="experiment"===d,f=b.enabledStatus,g=b.visitor||Xf;M("Condition","Testing "+d+" "+a);var f=e&&(H(f)?!!f:Fb(a)),l=e&&Kb(a),m;a:switch(d){case "experiment":m=O(a,"conditions");break a;case "segment":m=bc(a,"add_condition");break a;default:m=[]}if(e&&!f)return M("Condition","Failed for "+d+" "+a+" (paused)"),o;if(e&&!c&&l)return M("Condition"," Failed for "+d+" "+a+" (manual activation mode)"),o;if(m){var n="experiment"===
(d||"experiment"),r=j;w(m,function(b){var c=b.type;if(n&&b.only_first_time&&Ig(a))M("Condition",c+" condition passed because it only gets checked when bucketing",j);else{var d=!b.not,b=(0,Jg[c])(b),e=b!==d;M("Condition","Found that "+("the visitor "+(b?"passed":"failed")+" a "+c+" targeting condition  when it needed to "+(d?"pass":"fail")),!e);if(e)return r=o}});if(!r)return M("Condition","Failed for "+d+" "+a+" (condition failed)"),o}else{a:{c=[];e=[];if("experiment"===d)c=O(a,"audiences")||[],e=
O(a,"urls")||[];else if("segment"===d)(f=bc(a,"audience_id"))&&(c=[f]);else{M("Condition","Not a valid objectType: "+d);d=o;break a}if(0<c.length&&(M("Condition","Testing audiences for "+d+" "+a+": "+c),!D(c,p(g.bb,g)))){M("Condition","Failed to match any audiences for "+d+" "+a);d=o;break a}if(0<e.length){M("Condition","Testing URLs for "+d+" "+a);var g=e,q=Z.J(),G=[],A=[];w(g,function(a){a.negate?A.push(a):G.push(a)});g=function(a){return D(a,function(a){return Kg(q,a)})};if(g(A)||!(0===G.length||
g(G))){M("Condition","Failed to match any URL for "+d+" "+a);d=o;break a}}d=j}if(!d)return o}return j}function Lg(a,b){if(!b)return 0;for(var c=b.toString().split("."),d=a.toString().split("."),e=0;e<c.length;e++)if(H(d[e]))if(isNaN(Number(d[e]))){if(d[e]!==c[e])return-1}else{if(Number(d[e])<Number(c[e]))return-1;if(Number(d[e])>Number(c[e]))return 1}else return-1;return 0}
function Mg(a,b){var c=b.value,d=a.id,e=a.version,f=a.mobileId;return f&&"unknown"!==f?(M("Condition",f,j),"mobile"===c||c===f):0===c.indexOf(d)?0===Lg(e,c.substr(d.length)):o}function If(a,b){var c=b.value;if(c===i)return j;try{return Boolean(Ng(c))}catch(d){return o}}function Og(a,b){return Pg(b.value,b.match,a)}function Qg(a,b){return Pg(b.value,b.match,a)}
function Rg(a,b){if(a===k)return o;var c=b.value;switch(b.match){case "exact":if(a==c&&""!=a)return j;break;case "prefix":if(0==a.indexOf(c))return j;break;case "regex":try{var d=RegExp(c)}catch(e){break}if(d.test(a))return j;break;case "cidr":try{var f;a:{var g=new Sg(c),l=Tg(a);l===k&&h(Error("Invalid ip: "+a));for(c=0;4>c;c++)if((l[c]&g.W[c])!==g.X[c]){f=o;break a}f=j}return f}catch(m){}}return o}function Ug(a,b){var c=b.value;return"any"===c||0===a.indexOf(c)}
function Vg(a,b){if(a===k)return o;var c=b.value.split("|"),d=$.trim(c[0]),e=$.trim(c[1]),f=$.trim(c[2]),g=$.trim(c[3]);switch(c.length){case 1:if(a.country===d)return j;break;case 2:if(a.region===e&&a.country===d)return j;break;case 3:if(a.city===f&&(a.region===e||""===e)&&a.country===d)return j;break;case 4:if(a.continent===g)return j}return o}function Wg(a,b){return Pg(b.value,b.match,a)}
function Xg(a,b){var c=b.value,d=b.match;M("Condition","Testing referrer "+a+" against  "+c+" ("+d+")",j);return Yg(a,c,d)}function Zg(a){return!!a}function $g(a){var b=Z.J();return D(a.values,t(Kg,b))}function Kg(a,b){var c=b.value,d=b.match;M("Condition","Testing URL "+a+" against  "+c+" ("+d+")",j);return Yg(a,c,d)}function ah(a,b){switch(b.value){case "new":if("returning"===a)return o;break;case "returning":return"returning"===a}return j}
function vg(a,b){var c={and:function(b){return Xa(b,t(vg,a))},or:function(b){return D(b,t(vg,a))},not:function(b){1!==b.length&&h(Error('"not" argument too long: '+u(b)));return!vg(a,b[0])}};if(F(b)){if(b[0]in c)return c[b[0]](b.slice(1));h(Error("Not an operator"))}var c=b.dimension_id,d=zb(c),e=b.value;d||h(Error("No dimension type for dimension: "+c));var f=bh[d];f||h(Error("Unknown dimension type: "+d));d=i;if(a.t.hasOwnProperty(c))d=a.t[c];else try{var g=zb(c)||"",l,m;z("dimensions",c)||h(Error("Unable to find dimension for id: "+
c));"custom_dimension"===g&&h(Error("calculateDimensionValue called on custom dimension "+c));(l={browser:p(Z.u,Z),browser_version:p(Z.u,Z),behavior:p(Z.Ja,Z),campaign:t(eg,"campaign"),cookies:p(Z.I,Z),custom_tag:p(Z.ja,Z),default_behavior:p(Z.Oa,Z),device:p(Z.K,Z),event:p(Z.Ba,Z),first_session:p(Z.Ra,Z),has_ppid:p(Z.Ya,Z),ip:p(Z.U,Z),language:p(Z.T,Z),list:p(Z.ma,Z),location:p(Z.L,Z),query:p(Z.j,Z),platform:p(Z.pa,Z),referrer:p(Z.V,Z),segment:p(Z.Za,Z),source_type:t(eg,"source_type"),third_party_dimension:p(Z.Wa,
Z),time_and_day:p(Z.getDate,Z),url:p(Z.J,Z),visitor:p(Z.na,Z),dynamic_customer_profile:p(Z.ka,Z)}[g])&&(m=l(Ab(c)));M("Visitor","Got dimension ("+g+") value "+c+": "+u(m));d=m}catch(n){M("Visitor","Error: "+n.message)}return f(d,{value:e,match:b.match||"exact"})}
function Bd(a){var b=j;!O(a,"conditions")&&!bc(a,"add_condition")?(b=[bc(a,"audience_id")],b[0]||(b=O(a,"audiences")||[]),b=Xa(b,function(a){a=ub(a);return!a.conditions?j:ch(a.conditions)})):(O(a,"uses_geotargeting")||bc(a,"uses_geotargeting"))&&(b=dh.ip(k)||dh.location(k));b||M("Condition","Not ready to test (geotargeting): "+a);return b}function ch(a){if(F(a))return Xa(a.slice(1),ch);var b=zb(a.dimension_id)||"";return(b=dh[b])?b(a):j}
var Jg={browser:function(a){var b=Z.u();return D(a.values,function(a){return Mg(b,{value:a})})},code:function(a){return If(0,a)},cookies:function(a){for(var b=a.names||[],a=a.values||[],c,d=0;d<b.length;d++)if(c=b[d],Og(Z.I(c),{value:a[d]||i}))return j;return o},custom_tag:function(a){return D(a.values,function(a){return Qg(Z.ja(a.key),{value:a.value})})},event:function(a){return D(a.values,function(a){return Z.Ba(a)})},ip:function(a){var b=Z.U();return D(a.values,t(Rg,b))},language:function(a){var b=
Z.T();return D(a.values,function(a){return Ug(b,{value:a})})},location:function(a){var b=Z.L();return D(a.values,function(a){return Vg(b,{value:a})})},query:function(a){return 0===a.values.length?j:D(a.values,function(a){return Wg(Z.j(a.key),{value:a.value})})},referrer:function(a){return D(a.values,t(Xg,Z.Pa()))},segment:function(a){var b=Z.qa();return D(a.values,function(a){return Zg(ra(a,b))})},url:$g,visitor:function(a){var b=Z.na();return ah(b,a)}},bh={browser:Mg,browser_version:function(a,b){var c=
b.value,d=a.id,e=a.version;return 0===c.indexOf(d)?0===Lg(e,c.substr(d.length)):o},behavior:function(a,b){try{var c=ea(b.value),d;if(H(c.version)){!c.action&&(!c.filters||0===c.filters.length)&&h(Error('Audience spec must have an "action" field or at least one "filter" '+u(c)));var e=Cg("gt",Y.b,0),f=[],g=[];c.action&&(g.push(Cg("eq",Y.e,c.action.value)),c.action.type&&g.push(Cg("eq",Y.g,c.action.type)));if(c.time)if("last_days"===c.time.type)g.push({op:Bg("lte"),args:[{op:"-",args:[{eval:"now"},
{field:[Y.b]}]},{value:864E5*c.time.days}]});else if("range"===c.time.type){var l;var m=[c.time.start,c.time.stop];F(m)?l={op:"between",args:[{field:[Y.b]},{value:m[0]||+new Date(0)},{value:m[1]||+new Date}]}:(M("Rule builder","rangeTimeComparison passed invalid range "+u(m)),l=k);l&&g.push(l)}else M("Rule builder",'Audience spec has bad "time" type',c.time.type);e={op:"and",args:g};c.count&&f.push({where:Cg(c.count.comparator,"0",c.count.value),from:{select:[{field:yg("count")}],where:e,aggregate:[Eg("count")]}});
c.filters&&w(c.filters,function(a){var b=Gg(a.name,c.source),d,l;if(a.modifier==="most_frequent"){d=Eg("count");l=yg("count")}else if(a.modifier==="most_recent"){d=Eg("max",Y.b);l=yg("max",Y.b)}if(d){var m=zg(b);f.push({where:Cg(a.comparator,"0",a.value),from:{select:[{field:m}],where:e,groupBy:Dg([b]),aggregate:[d],orderBy:[{field:l,direction:"DESC"}],limit:1}})}else g.push(Cg(a.comparator,b,a.value))});if(c.pick){0<f.length&&h(Error('A "pick" clause must not be specified with "count" or "most_recent", "most_frequent" modifiers'+
u(c)));var n;var r=c.pick,q=c.source;l={where:e};r.count&&(l.limit=r.count);if("most_frequent"===r.modifier){var G=Gg(r.name,q);n=J(l,{select:[{field:zg(G)}],groupBy:Dg([G]),aggregate:[Eg("count")],orderBy:[{field:yg("count"),direction:"DESC"}]})}else n=J(l,{orderBy:[{field:[Y.b],direction:"DESC"}]});d=[n]}else d=0<f.length?f:[{where:e}]}else d=[c];return Xa(d,function(b){return tg(b,a)})}catch(A){}return o},campaign:function(a,b){var c=b.value;"string"===typeof c&&("regex"===b.match?a=ja(a):c=bg(c));
"none"===a&&(a=k);return Pg(c,b.match,a)},code:If,cookies:Og,custom_dimension:function(a,b){var c=b.value;return!H(c)?H(a):c==a},custom_tag:Qg,default_behavior:function(a,b){try{var a=a||{},c=ea(b.value);return tg(c,[a])}catch(d){}return o},device:function(a,b){var c=b.value;return"unknown"!==a.id?a.id===c:"tablet"===c?"tablet"===a.type:"mobile"===c?a.w&&"tablet"!==a.type:"desktop"===c?!a.w:o},event:aa(),first_session:aa(),ip:Rg,language:Ug,list:function(a,b){if(a===k||!H(a))return o;var c=b.value;
return!H(c)?""===a||a!==o:a.toString()===c},location:Vg,query:Wg,platform:function(a,b){var c=b.value.split("_"),d=c[0],c=c.slice(1);return d===a.id?0===c.length?j:1<c.length?0<=Lg(a.version,c[0])&&0>=Lg(a.version,c[1]):0===Lg(a.version,c[0]):o},referrer:Xg,segment:Zg,source_type:function(a,b){return b.value===a},time_and_day:function(a,b){var c,d,e;c=b.value;e=c.split("_");3!==e.length&&h(Error("Invalid time and day string "+c));c=e[0];d=e[1];e=e[2].split(",");c=Hg(c);d=Hg(d);var f=60*a.getHours()+
a.getMinutes(),g="sunday monday tuesday wednesday thursday friday saturday".split(" ")[a.getDay()];return f>=c&&f<=d&&-1!==$.inArray(g,e)},third_party_dimension:function(a,b){return F(a)?D(a,t(Pg,b.value,b.match)):Pg(b.value,b.match,a)},url:Kg,visitor:ah,dynamic_customer_profile:function(a,b){return a===k?o:!!a[b.value]},has_ppid:aa()},dh={ip:function(){U("checkGeo");return Z.U()!==k},location:function(){U("checkGeo");return Z.L()!==k},list:function(a){return Z.ma(Ab(a.dimension_id)||"")!==k},dynamic_customer_profile:function(a){var b=
Z.ka();return ab(b)&&a.value in b}};function Pg(a,b,c){var d=H(c)&&c!==k,e=H(a)&&a!==k;switch(b||(e?"exact":"exists")){case "exists":return d;case "exact":return d&&String(c)===a;case "substring":return d&&-1!==String(c).indexOf(a);case "regex":try{return e&&d?Boolean(String(c).match(RegExp(a))):o}catch(f){return o}case "range":return a=a.split(":"),b=parseFloat(a[1]),c=parseFloat(c),c>=parseFloat(a[0])&&c<=b;default:return o}};var eh=[function(){var a=ic();if("ie"===a.aa){try{var b=Number(a.ba)}catch(c){return}7>b&&h(Error("IE is only supported on version 8+ (detected "+b+")"));8>b&&("windows"===a.platform.id&&a.platform.version&&E(["xp","vista"],a.platform.version.toLowerCase()))&&h(Error("IE7 is not supported"))}},function(){return ea(u({a:123}))}];function te(a,b,c){var d;d=o===j;var c=c===j,e=o,f=Q(a);if(f&&(c||!Ig(f))){e=j;if(c&&Ig(f))for(c=0;c<W.length;c++)W[c].H===f&&W.splice(c,1);W.push({H:f,id:a,source:b});d&&(T=T||[],T.push(f));pe[f]=j;qe();M("Plan","Added experiment "+f+" and variation id "+a+" to the plan, source is "+b,j)}return e}function Ig(a){return a in oe||a in pe}function nd(a){var b=[],c=!H(a),a=a||[];w(W,function(d){(c||E(a,d.H))&&b.push(d.id)});return b}function Df(a){var b;if(b===j||!Ig(a))oe[a]=j,qe()}
function Hd(){var a={};w(Qe,function(b,c){a[b]=c});w(W,function(b){var c=Q(b.id);a[c]=b.id});w(oe,function(b){a[b]="0"});w(z("blacklisted_experiments")||{},function(b){b in a&&delete a[b]});y("optimizelyBuckets",u(a),Ua)}function qe(){w(fh,function(a){a()})}
function gh(a,b,c,d){if(-1!==a.indexOf("_optimizely_redirect"))b.push({code:a,type:"code forced (redirect)",variationId:d});else{for(var a=a.split("\n"),e=o,f=o,g=[],l=[];0<a.length;){var m=eb(a.shift()),n=0<l.length;if(m)if(Boolean(m.match(/_optimizely_evaluate\s{0,9}=\s{0,9}force/i)))f=j;else if(Boolean(m.match(/_optimizely_evaluate\s{0,9}=\s{0,9}safe/i))||Boolean(m.match(/_optimizely_evaluate\s{0,9}=\s{0,9}end_force/i)))f=o;else if(Boolean(m.match(/_optimizely_evaluate\s{0,9}=\s{0,9}editor_only/i)))e=
j;else if(Boolean(m.match(/_optimizely_evaluate\s{0,9}=\s{0,9}end_editor_only/i)))e=o;else if(!hh.exec(m)&&!e)if(f)g.push(m);else{if(!n){var r=ih.exec(m),q=[];r?(q.push(r[1].replace(/^['"]|['"]$/g,"")),(r=jh.exec(m))&&4<r.length&&q.push(r[4]),c.push({code:m,selector:q,type:"safe jquery",waitUntilSelectorReady:j,variationId:d})):n=j}n&&l.push(m)}}0<g.length&&b.push({code:g.join("\n"),type:"forced evaluation",variationId:d});0<l.length&&c.push({code:l.join("\n"),type:"safe non-jquery",waitUntilDocumentReady:j,
variationId:d})}}function kh(a,b,c){for(var d={values:[]},e=0,f=a.length;e<f;e++)d.values.push({value:a[e],match:b[e]||c});return d}var fh=[],Qe={},oe={},jh=/^\$j?\(['"](.+?)['"]\)\.detach\(\)\.(appendTo|insertAfter|insertBefore|prependTo)\(['"](.+?)['"]\);(?:\s|(?:\/\/.*|\/\*(?:[^*]|\*(?!\/))*\*\/))*$/,hh=/^(?:\s|(?:\/\/.*|\/\*(?:[^*]|\*(?!\/))*\*\/))*$/,ih=/^\$j?\((['"].+?['"]|document)\)\..+;(?:\s|(?:\/\/.*|\/\*(?:[^*]|\*(?!\/))*\*\/))*$/,pe={},W=[];function lh(a){Yf={};Wf(a)};function mh(a,b){if(a&&b)if(nh)M("Evaluator","Bound event "+b+" to selector "+a),oh(a,b);else{var c={eventName:b,selector:a,type:"event '"+b+"' (click goal)",waitUntilSelectorReady:j};M("Evaluator","Add step to bind event "+c.eventName+" to selector "+c.selector);ph.push(c)}}
function Gd(a,b){if(B){F(a)?qh(a):(a=[],qh(b));a=a.concat(T);T=[];for(var c=0;c<a.length;c++)E(md,a[c])||md.push(a[c]);c=a;c===i?c=[]:bb(c)&&(c=[c]);for(var d=nd(c),e=[],f=[],g=[],l=[],m=K(wb(),function(a){return a.experiments?o:$g(a.url_conditions||[])}),n=0,r=m.length;n<r;n++){var q={eventName:m[n].event_name,selector:m[n].selector,type:"event '"+m[n].event_name+"' (click goal)",waitUntilSelectorReady:j};"revenue"in m[n]&&(q.revenue=m[n].revenue);e.push(q)}w(c,function(a){var b={},c=O(a,"events")||
{};w(c,function(a,c){b[a]=[c]});var c=K(wb(),function(b){return"experiments"in b?a in b.experiments:o}),d=0;for(;d<c.length;d++){var m=c[d];b[m.selector]||(b[m.selector]=[]);b[m.selector].push({eventName:m.event_name,revenue:m.revenue,experimentIds:m.experiments})}w(b,function(b,c){w(c,function(c){e.push({eventName:c.eventName,experimentIds:c.experimentIds,revenue:c.revenue,selector:b,type:"event '"+c.eventName+"' (experiment "+a+")",waitUntilSelectorReady:j})})});var n=O(a,"css")||"";n&&g.push({code:function(){$("body").append("<style>"+
n+"</style>")},selector:"body",type:"global css (experiment "+a+")",waitUntilSelectorReady:j});if(c=O(a,"steps")){w(c.forced,function(a){f.push(a)});w(c.safe,function(a){l.push(a)})}else(c=O(a,"code")||"")&&gh(c,f,l)});w(d,function(a){var b=z("variations",a,"pages");if(b)w(b,function(a){if(a.steps&&(!a.includes||$g({values:a.includes}))&&(!a.excludes||!$g({values:a.excludes}))){f.push.apply(f,a.steps.forced);l.push.apply(l,a.steps.safe)}});else{for(var b=Tb(a),b=b.split("\n"),c=[],d=j,e=0,g=b.length;e<
g;e++){var m=$.trim(b[e]);if(m==="/* _optimizely_variation_url_end */")d=j;else if(m!==""){var n=Ea.exec(m);if(n&&n.length===13){var q=n[2]?n[2].split(" "):[],m=n[4]?n[4].split(" "):[],r=n[6]?n[6]:"substring",hf=n[8]?n[8].split(" "):[],n=n[10]?n[10].split(" "):[];if(q.length>0){d=kh(q,hf,r);d=$g(d)}if(d&&m.length>0){d=kh(m,n,r);d=!$g(d)}}else d&&c.push(m)}}b=c.join("\n");gh(b,f,l,a)}});c=[];c.push.apply(c,f);c.push.apply(c,g);c.push.apply(c,l);c.push.apply(c,e);ph.push.apply(ph,c);rh()}}
function rh(){var a=o;sh=k;for(M("Evaluator",th+" times waited");!a&&0<ph.length;){M("Evaluator",ph.length+" steps remaining");var b=ph.shift(),c=b,a=o;if(c.waitUntilDocumentReady&&!nh)M("Evaluator","Document not ready yet"),a=j;else if(c.waitUntilSelectorReady&&!nh&&(c=c.selector))for(var c=F(c)?c:[c],d=0;d<c.length;d++){var e=c[d];if(!(e===k||e===i||!e.length))if(0===("document"==e?$(document):$(e)).length)M("Evaluator","'"+e+"' not found"),a=j}a?ph.unshift(b):b.eventName?(uh(),M("Evaluator","Bound event "+
b.eventName+" to selector "+b.selector),c={},b.revenue&&(c={Z:b.revenue,fa:b.experimentIds}),oh(b.selector,b.eventName,c)):b.code&&(M("Evaluator","Run code: "+b.code.toString()),vh(b.code,b.variationId))}a?(sh=setTimeout(rh,0===th?10:50),th++):(M("Evaluator",th+" total times waited"),uh())}function Ng(a){return"string"===typeof a?eval(a):a()}function uh(){U("flash");0<zd.length||U("flashGeo")}
function vh(a,b){if(a){var c=o,d;"string"===typeof a?(d=a,c=j):d=a.toString();if(pd(d))if(M("Evaluator","Redirect detected"),$d(d)){M("Evaluator","OK to redirect");var e=Zd(d);M("Evaluator","setting a redirect cookie"+(b?" for variation: "+b:""));y("optimizelyRedirect",(b||"unknown variation")+"|"+(e?"true":"false"),5);ae()}else{M("Evaluator","NOT OK to redirect");return}c&&eval("var $j = $;");try{if(pd(d)){$("head").append("<style type='text/css'>body{display:none;visibility:hidden;}</style>");M("Evaluator",
"Hiding body before redirect");var f=ce.test(d)||be.test(d)||de.test(d),g=/_keep_body_hidden=(\S+)/.test(d);f||g?M("Evaluator","Standard redirect detected - Will not unhide body."):setTimeout(function(){if(document.body){document.body.style.visibility="visible";document.body.style.display="block";M("Evaluator","Unhiding body -- did not redirect");U("bodyUnhidden")}},1700)}Ng(a)}catch(l){c=Pa,Pa=j,M("Evaluator","Error: "+l.message),M("Evaluator","Code: "+d),Pa=c,M("Evaluator","Failed to run code: "+
l.message)}}}
function oh(a,b,c){c=c||{};if(!wh[a]||!wh[a][b]){var d=function(){Ue(b,"custom",c)},e=$(a);if(0<e.length){var f=function(){e.unbind("touchend",d);e.unbind("touchmove",f);e.unbind("mousedown",d)},g=function(){f();e.bind("touchmove",f);e.bind("touchend",d)};e.bind("mousedown",d);e.bind("touchstart",g)}else e=$("html"),f=function(){e.undelegate(a,"touchend",d);e.undelegate(a,"touchmove",f);e.undelegate(a,"mousedown",d)},e.delegate(a,"touchstart",function(){f();e.delegate(a,"touchend",d);e.delegate(a,
"touchmove",f)}),e.delegate(a,"mousedown",d);wh[a]||(wh[a]={});wh[a][b]="mousedown touchstart"}}function xh(a){yh=a}function qh(a){a||(a=Eb());for(var b=0;b<a.length;b++)Nb(a[b])}var wh={},md=[],T=T||[],yh=0,nh=o,ph=[],sh=k,th=0;$(function(){setTimeout(function(){U("docReady");nh=j;sh!==k&&(M("Evaluator","Document is ready"),clearTimeout(sh),0<yh?setTimeout(rh,yh):rh())},50)});function Sg(a){this.Ea=$.trim(a);a=zh(this.Ea);a===k&&h(Error("Invalid CIDR specification"));this.X=a.X;this.W=a.W}function zh(a){a=a.split("/");if(2!=a.length)return k;var b=parseInt(a[1],10);if(isNaN(b)||0>b||32<b)return k;a=Tg(a[0]);if(a===k)return k;if(0>b||32<b)b=k;else{for(var c=[],d=0;4>d;d++)c[d]=0;for(var e=Math.floor(b/8),d=0;d<e;d++)c[d]=255;4>e&&(c[e]=Ah[b%8]);b=c}for(c=0;4>c;c++)a[c]&=b[c];return{X:a,W:b}}
function Tg(a){a=a.split(".");if(4!=a.length)return k;for(var b=[],c=0;4>c;c++){var d;d=a[c];if(3<d.length)d=k;else{var e=parseInt(d,10);d=isNaN(e)||d!==e.toString()||0>e||255<e?k:e}if(d===k)return k;b[c]=d}return b}var Ah=[0,128,192,224,240,248,252,254,255];function Yg(a,b,c){var d=a.split("?");if(d[1]){var e=[];$.each(d[1].split("&"),function(){0!==this.indexOf(Bh)&&e.push(this)});d[1]=e.join("&");a=d.join("?")}switch(c){case "exact":return a=Ch(a),a===Ch(b);case "regex":try{return Boolean(a.match(b))}catch(f){return o}case "simple":return a=Ch(Dh(a)),b=Ch(Dh(b)),a===b;case "substring":return a=Ch(a,j),b=Ch(b,j),-1!==a.indexOf(b);default:return o}}
function Dh(a){var b=a.indexOf("?");-1!==b&&(a=a.substring(0,b));b=a.indexOf("#");-1!==b&&(a=a.substring(0,b));return a}function Ch(a,b){var a=a.replace("/?","?"),a=a.toLowerCase().replace(/[/&?]+$/,""),c=Eh.slice(0);b||(c=c.concat(Fh));for(var d=c.length,e=0;e<d;e++)a=a.replace(RegExp("^"+c[e]),"");return a}
var Eh=["https?://.*?.?optimizelyedit.(com|test)/","https?://.*.?optimizelypreview.(com|test)/","https?://(edit|preview)(-hrd|-devel)?.optimizely.(com|test)/","https?://.*?.?optimizelyedit(-hrd)?.appspot.com/","https?://"],Fh=["www."],Bh="optimizely_";function Gh(a){return function(b){if("object"===typeof b&&Jh()){var c=k,d;for(d in b)b.hasOwnProperty(d)&&(c=a.call(this,d,b[d]));return c}return a.apply(this,arguments)}}function Jh(){for(var a in{})return j;return o};function Kh(){if(!Da){var a=$;a.fn.attr=Gh(a.fn.attr);a.fn.css=Gh(a.fn.css);a.fn.extend=Gh(a.fn.extend);var b=a.each;a.each=function(c,d,e){if(!(c.length===i||a.isFunction(c))||!Jh())b.apply(this,arguments);else if(e)for(var f in c){if(c.hasOwnProperty(f)&&d.apply(c[f],e)===o)break}else for(f in c)if(c.hasOwnProperty(f)&&!d.call(c[f],f,c[f])===o)break;return c};var c=a.fn.ab,d=function(a,b,d){return new c(a,b,d)},e,f=document.getElementsByClassName;if(!Vf(f))var f=(window.optimizely||{}).getElementsByClassName,
g=(window.optly||{}).getElementsByClassName,f=Vf(f)?f:Vf(g)?g:k;e=f;a.fn.ab=function(b,c,f){var g=d,l=document.getElementsByClassName;!Vf(l)&&e&&(g=function(a,b,c){document.getElementsByClassName=e;a=d(a,b,c);document.getElementsByClassName=l;return a});if(!("string"===typeof b&&c&&"object"===a.type(c)&&Jh()))return g(b,c,f);b=g(b,i,f);b.attr(c);return b}}M("Main","Started, revision "+z("revision"));try{var l=[];w(eh,function(a){try{a()}catch(b){l.push(b.message)}});0<l.length&&h(Error("Feature(s) not supported: "+
l.join("; ")))}catch(m){M("Main","Disabling: "+m.message);return}var f=Tf(),g=o,n;for(n in f)if(Uf.exec(n)){g=j;break}("true"===f.opt_out||"false"===f.opt_out)&&ie("true"===f.opt_out);Ga="true"===f.force_tracking;"true"===f.disable||"true"===f.opt_out||jf()?Ha=B=o:"classic"===f.disable?B=o:"new"===f.disable&&(Ha=o);Ia="true"===f.editor;Ja="true"===f.p13n;Oa="true"===f.show_preview;Ka=(n=window.optlyDesktop)&&H(n.p13nInner);(n=v("optimizelyToken"))&&y("optimizelyToken",n,15);n=f.token||n;z("insecure_preview")&&
n?Ma="public/"+P():/^[0-9a-f]{64}$/.test(n)?Ma=n:/^[0-9a-f]{32}$/.test(n)?(M("Query","Using legacy MD5 token"),Ma=n):(ya("optimizelyToken",za()),M("Query","Blocked request to load unsafe script: "+n));Pa="true"===f.log;Qa="true"===f.verbose;qa=!(Oa||g)||Ga;if(Ia||Ja)window.optimizelyDataApi={getProjectId:P};if(Ka)M("Main","Disabling because in desktop app editor.");else if(Ja)M("Main","Disabling because personalization editor flag is set."),db("https://"+Yb()+"/js/innie.js?_="+ +new Date);else if(ge(),
jf())M("Main","Disabling because opted out"),yc();else if(Ma){if(!window.optimizelyPreview){if(!window.optimizely||!window.optimizely.unshift)window.optimizely=[];window.optimizely.unshift(["verifyPreviewProject",P()]);db([Sf,"/js/preview/",Ma,".js"].join(""),j);Oa&&Rf('Loading Preview<br /><img alt="loading" src="//'+Yb()+'/static/img/loading-32.gif" style="padding-top:20px; width: 32px; margin: 0 auto;" />')}}else if(Oa&&!Ma)Rf("This preview link has expired. Please return to Optimizely and preview again to get a new link.");
else{if(B||Ha)if(f=z("project_js"))M("Evaluator","Running project level javascript."),vh(f);ge();if(B){f=v("optimizelyEndUserId");tc=f!==i&&f!==k;a:{f="googlebot;yahoo! slurp;bingbot;bingpreview;msnbot;keynote;ktxn;khte;gomezagent;alertsite;yottaamonitor;pingdom.com_bot;aihitbot;baiduspider;adsbot-google;mediapartners-google;applebot".split(";");g=navigator.userAgent;g=g.toLowerCase();for(n=0;n<f.length;n++)if(-1!==g.indexOf(f[n])){f=j;break a}f=o}f?qa=o:tc||ib.set("first_session",j)}if(f=N.get("asyncInfo"))oc("asyncInfo")||
pc(f),N.set("asyncInfo",k);(f=oc("asyncInfo"))&&w(f,Dc);if(z("uses_list_targeting")){var f="https://odds.optimizely.com/js/geo2.js",r={};w(Qb(),function(a,b){var c=Mc(b);typeof c==="string"&&(r[b]=c)});r.project=P().toString();var g=[],q;for(q in r)r.hasOwnProperty(q)&&g.push(encodeURIComponent(q)+"="+encodeURIComponent(r[q]));g.length&&(f+="?"+g.join("&"));db(f)}z("uses_dynamic_customer_profile_targeting")&&(Pf(),q=Jf(),!q.q||!q.q.datasourceId?(M("DCP","No Optimizely datasource found in data."),
q=k):(f=q.q.datasourceId,g=q.q.id,f=I([P().toString(),f,g],encodeURIComponent),f=["https://tapi.optimizely.com/api/targetingEmbed"].concat(f).join("/"),g=(Oc.get()||{}).aliases||{},Qf(q.z,g)||(q=I(q.z,function(a){return encodeURIComponent(a.datasourceId)+"="+encodeURIComponent(a.id)}),f+="?"+q.join("&")),q=f),q!==k&&db(q));(z("dcp_service_id")||k)!==k&&setTimeout(function(){var a=z("dcp_service_id")||k;if(a!==k){var b=Jf();if(b.q)if(b.z.length===0)M("DCP","Must specify at least one non-Optimizely datasource to alias");
else if(Pf()){var a=I([a,b.q.datasourceId,b.q.id],encodeURIComponent).join("/"),c=b.z;try{var d=new XMLHttpRequest;d.open("POST",["https://vis.optimizely.com/api/alias",a].join("/"));if("withCredentials"in d)d.withCredentials=j;d.setRequestHeader("Content-Type","application/json;charset=UTF-8");var e={};w(c,function(a){e[a.datasourceId]=a.id});d.onerror=function(){M("DCP","Failed to POST alias request")};d.onload=function(){if(d.status>=200&&d.status<300){var a=Oc.get()||{},b=a.aliases||{},b=b||{};
w(c,function(a){b[a.datasourceId]=a.id});a.aliases=b;Oc.set(a)}else M("DCP","Alias POST failed with",d.statusText)};d.send(u({data:e}))}catch(f){M("DCP","Exception %s trying to POST alias request",f)}}else M("DCP","Duplicate alias request; skipping.");else M("DCP","Must specify Optimizely datasource in alias")}},0);if(q=v("optimizelyBuckets")){try{q=ea(q)}catch(G){q={}}var A={};w(q,function(a,b){var b=String(b),c=Q(b);if(Ob(c).length>1&&b.indexOf("_")===-1){A[c]=A[c]||{};A[c][a]=b}else b!=="0"?te(b,
"cookie")||(Qe[a]=b):Df(a)});w(A,function(a,b){var c;a:{c=[];for(var d=Ob(a),e=0;e<d.length;e++){var f=b[d[e]];if(f==="0"){c="";break a}c.push(f)}c=c.join("_")}c.length>0?te(c,"cookie"):Df(a)})}Wf();od=(v("optimizelyRedirect")||"|").split("|")[0];q=v("optimizelyReferrer");q!==k&&(Tc=0==q.length?"":q,y("optimizelyReferrer",""));q=Xf;M("Visitor","Initializing");(f=v("optimizelyAudiences"))&&0<f.length&&w(f.split(","),p(function(a){wg(this,a,j,{O:j,ya:o})},q));w(dg(),p(function(a){M("Visitor","Found segment "+
a);var b=Ib()[a];if(b&&b.audience_id){M("Visitor","Adding to audience "+b.audience_id);wg(this,b.audience_id,j,{C:o})}else if(b&&b.dimension_id){M("Visitor","Setting dimension value "+b.dimension_id);xg(this,b.dimension_id,Yf[a],o)}},q));V=Xf;ee=o;Zf.push(Ad);fh.push(Ad);q={$:$,activeExperiments:md||[],allExperiments:Jb(),all_experiments:Jb(),allVariations:z("variations")||{},getElementsByClassName:document.getElementsByClassName,revision:z("revision"),variationIdsMap:Fe,variation_map:Ge,variationMap:Ge,
variationNamesMap:He};for(var C in q)X(q,C,q[C]);q.data=Ie;C={};var pa=Ya(ke,[C,Se]);J(C,{activate:t(sd,V),activateGeoDelayedExperiments:t(vd,V),activateSiteCatalyst:Qc,activateUniversalAnalytics:fd,addOAuthClientId:xe,addToAudience:p(V.D,V),addToSegment:me,bindTrackElement:mh,bucketUser:td,bucketVisitor:td,clickTaleRecord:id,clickTalePlayback:gd,customTag:ze,delayDomReadyEval:xh,delayPageviewTracking:Le,disable:he,log:zc,getAccountId:tb,getProjectId:P,googleAnalyticsCustomVariableScope:Wc,integrationPrefix:jd,
optOut:ie,overrideUrl:uc,push:pa,removeFromAllAudiences:p(V.gb,V),removeFromAllSegments:De,removeFromAudience:p(V.Y,V),removeFromSegment:Ae,sc_activate:Qc,sc_svar:kd,skipPageTracking:Ne,optOutThirdPartyCookies:Me,setDimensionValue:p(V.B,V),setUserId:Pe,storeThirdPartyData:le,timeout:he,trackEvent:Re,verbose:Ac});z("slave")&&J(C,{get:ve});C.removeFromReportableAudiences=Oe;J(q,C);C=window.optimizely;F(C)&&w(C,function(a){pa(a)});window.optimizely=q;U("apiInitialize");window.optimizely.iapi={evaluateSegments:t(lh,
i)};var Ta=!z("force_variation");C=Tf();w(C,function(a,b){var c=Uf.exec(a);if(c)if(Ta){Na=j;x("Query","Ignored parameter %s",a)}else{c=c[1];td(c,b,j);Lb(c)?Gf(c,{force:j,skipPageviewTracking:j}):Cd(c,{})||sd(V,c,{force:j,skipPageviewTracking:j})}});Na?Rf("Force parameters are disabled for this project. See Project Code Settings."):(Kh.log(),Ia&&db("https://"+Yb()+"/js/innie.js?_="+ +new Date),B&&(U("distributeExperiments"),w(Eb(),function(a){if(!ra(a,T))if(Lb(a))Gf(a);else if(Bd(a)){if(Cd(a,{objectType:"experiment"})){M("Distributor",
"Going to distribute "+Nb(a));if(Fd(a)){T=T||[];T.push(a)}}}else!Kb(a)&&!E(md,a)&&Dd(a)}),Hd(),Ye(),Sa||(0<Fa?setTimeout(function(){Id()},Fa):Id()),Xe(),Yc()),Pa&&(w(oe,function(a){var b=Mb(a);M("Plan","Ignore experiment '"+b+"' ("+a+")")}),w(W,function(a){var b=Q(a.id),c=Wb(a.id);M("Plan",Nb(b)+' in variation "'+c+'" ('+a.id+")")})),Ia?ue():B&&(U("beginEvaluate"),Gd(),ue(),yc(),!z("installation_verified")&&qa&&(C="https://"+Yb()+"/account/snippet_installed?project_id="+P()+"&wxhr=true",M("Tracker",
"Making snippet verification request."),ad(C,k))),setTimeout(function(){vd(V)},2E3),setTimeout(function(){if(qa){var a=ye;if(a.$a){var b=Va(),c=Wa(),d=P(),e=z("revision"),f=yf,g=wf,l=Af,m=cc(),n=md.concat(T).length,q=uf().length,r;r=oc("events")||[];var C=oc("event_queue")||[];r=u(r).length+u(C).length;var A;a:{try{A=window.optimizely.get("behavior").getEvents()[0].timestamp;break a}catch(G){}A=i}var b={user:b,ppid:c,project:d,revision:e,sync:f,timebase:g,render:l,sampleRate:m,numExps:n,numBehaviorEvents:q,
behaviorEventsSize:r,oldestBehaviorEventAge:!A?0:(new Date).getTime()-A.getTime(),integrationOAuthClientIds:xf(we,",",64),codeVersion:z("version"),hasSlave:!!z("slave"),docVisibilityState:document.Bb||document.webkitVisibilityState,wxhr:j,apis:xf(L(a.R),"!",1E3)},sa;a:{c=k;try{sa=K(window.performance.getEntries(),function(a){return!!Cf.test(a.name)})[0]}catch(pa){sa=c;break a}if(sa){var c={},Bb;for(Bb in sa)typeof sa[Bb]==="number"&&sa[Bb]!==0&&(c[Bb]=sa[Bb])}sa=c}J(b,sa||{});J(b,a.n);var Ta=["optimizelyAudiences",
"optimizelyBuckets","optimizelyCustomEvents","optimizelyPendingLogEvents","optimizelyReferrer","optimizelySegments"],Pd={},Qd=0,Rd=0;w(ia(),function(a){if(a.name.indexOf("optimizely")===0){if(E(Ta,a.name)){M("RUM","Cookie size for "+a.name+": "+a.P.length);Pd[a.name+"Len"]=a.P.length}Qd=Qd+a.P.length}Rd=Rd+a.P.length});J(Pd,{allOptimizelyCookiesLen:Qd,allCookiesLen:Rd});J(b,Pd||{});var kg={};w(N.wa()||{},function(a,b){kg["ls"+a]=b});J(b,kg);var a=[],Fc;for(Fc in b)Object.prototype.hasOwnProperty.call(b,
Fc)&&a.push(window.encodeURIComponent(Fc)+"="+window.encodeURIComponent(b[Fc]));ad("https://rum.optimizely.com/rum?"+a.join("&"),k)}}},3E3),M("Main","End of main"),U("mainEnd"))}}
Kh.log=function(){M("Info","Is Classic Optimizely enabled: "+B);M("Info","Diagnostic enabled: false");M("Info","Force variation enabled: "+!!z("force_variation"));M("Info","Browser type: "+jc());M("Info","Browser version: "+kc());var a=qc();"unknown"!==a&&M("Info","Mobile browser type: "+a);M("Info","New vs returning: "+sc());M("Info","Source type: "+cg());M("Info","User ID: "+Va())};Kh();
};
var SLAVE_CLIENT = {optimizely:[]};
optimizelyCode();
optly.Cleanse.finish();

}());
;
/*!
 * jQuery Cookie Plugin v1.3
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2011, Klaus Hartl
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.opensource.org/licenses/GPL-2.0
 *
 * Updated 28/11/2012 Ian Huntington (ian.huntington@lbi.com) : included a '!' at the start of the fitVids IIFE to prevent minification issue
 */
!(function ($, document, undefined) {

	var pluses = /\+/g;

	function raw(s) {
		return s;
	}

	function decoded(s) {
		return decodeURIComponent(s.replace(pluses, ' '));
	}

	var config = $.cookie = function (key, value, options) {

		// write
		if (value !== undefined) {
			options = $.extend({}, config.defaults, options);

			if (value === null) {
				options.expires = -1;
			}

			if (typeof options.expires === 'number') {
				var days = options.expires, t = options.expires = new Date();
				t.setDate(t.getDate() + days);
			}

			value = config.json ? JSON.stringify(value) : String(value);

			return (document.cookie = [
				encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
				options.path    ? '; path=' + options.path : '',
				options.domain  ? '; domain=' + options.domain : '',
				options.secure  ? '; secure' : ''
			].join(''));
		}

		// read
		var decode = config.raw ? raw : decoded;
		var cookies = document.cookie.split('; ');
		for (var i = 0, l = cookies.length; i < l; i++) {
			var parts = cookies[i].split('=');
			if (decode(parts.shift()) === key) {
				var cookie = decode(parts.join('='));
				return config.json ? JSON.parse(cookie) : cookie;
			}
		}

		return null;
	};

	config.defaults = {};

	$.removeCookie = function (key, options) {
		if ($.cookie(key) !== null) {
			$.cookie(key, null, options);
			return true;
		}
		return false;
	};

})(jQuery, document);
;
/*global jQuery */
/*jshint multistr:true browser:true */
/*!
* FitVids 1.0
*
* Copyright 2011, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
* Date: Thu Sept 01 18:00:00 2011 -0500
*
* Updated 09/11/2012 Will Howat (will.howat@lbi.com) : added www.youtube-nocookie.com to var selectors
* Updated 09/11/2012 Stephen Young (stephen.young@lbi.com) :  included a '!' at the start of the fitVids IIFE to prevent minification issue
*
*/

!(function( $ ){

  "use strict";

  $.fn.fitVids = function( options ) {
    var settings = {
      customSelector: null
    };

    var div = document.createElement('div'),
        ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0];

    div.className = 'fit-vids-style';
    div.innerHTML = '&shy;<style>         \
      .fluid-width-video-wrapper {        \
         width: 100%;                     \
         position: relative;              \
         padding: 0;                      \
      }                                   \
                                          \
      .fluid-width-video-wrapper iframe,  \
      .fluid-width-video-wrapper object,  \
      .fluid-width-video-wrapper embed {  \
         position: absolute;              \
         top: 0;                          \
         left: 0;                         \
         width: 100%;                     \
         height: 100%;                    \
      }                                   \
    </style>';

    ref.parentNode.insertBefore(div,ref);

    if ( options ) {
      $.extend( settings, options );
    }

    return this.each(function(){
      var selectors = [
        "iframe[src*='player.vimeo.com']",
        "iframe[src*='www.youtube.com']",
        "iframe[src*='www.youtube-nocookie.com']",
        "iframe[src*='www.kickstarter.com']",
        "object",
        "embed"
      ];

      if (settings.customSelector) {
        selectors.push(settings.customSelector);
      }

      var $allVideos = $(this).find(selectors.join(','));

      $allVideos.each(function(){
        var $this = $(this);
        if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
        var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
            width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
            aspectRatio = height / width;
        if(!$this.attr('id')){
          var videoID = 'fitvid' + Math.floor(Math.random()*999999);
          $this.attr('id', videoID);
        }
        $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
        $this.removeAttr('height').removeAttr('width');
      });
    });
  };
})( jQuery );
;
/*!
 * pickadate.js v3.5.4, 2014/09/11
 * By Amsul, http://amsul.ca
 * Hosted on http://amsul.github.io/pickadate.js
 * Licensed under MIT
 */

(function ( factory ) {

    // AMD.
    if ( typeof define == 'function' && define.amd )
        define( 'picker', ['jquery'], factory )

    // Node.js/browserify.
    else if ( typeof exports == 'object' )
        module.exports = factory( require('jquery') )

    // Browser globals.
    else this.Picker = factory( jQuery )

}(function( $ ) {

var $window = $( window )
var $document = $( document )
var $html = $( document.documentElement )


/**
 * The picker constructor that creates a blank picker.
 */
function PickerConstructor( ELEMENT, NAME, COMPONENT, OPTIONS ) {

    // If there’s no element, return the picker constructor.
    if ( !ELEMENT ) return PickerConstructor


    var
        IS_DEFAULT_THEME = false,


        // The state of the picker.
        STATE = {
            id: ELEMENT.id || 'P' + Math.abs( ~~(Math.random() * new Date()) )
        },


        // Merge the defaults and options passed.
        SETTINGS = COMPONENT ? $.extend( true, {}, COMPONENT.defaults, OPTIONS ) : OPTIONS || {},


        // Merge the default classes with the settings classes.
        CLASSES = $.extend( {}, PickerConstructor.klasses(), SETTINGS.klass ),


        // The element node wrapper into a jQuery object.
        $ELEMENT = $( ELEMENT ),


        // Pseudo picker constructor.
        PickerInstance = function() {
            return this.start()
        },


        // The picker prototype.
        P = PickerInstance.prototype = {

            constructor: PickerInstance,

            $node: $ELEMENT,


            /**
             * Initialize everything
             */
            start: function() {

                // If it’s already started, do nothing.
                if ( STATE && STATE.start ) return P


                // Update the picker states.
                STATE.methods = {}
                STATE.start = true
                STATE.open = false
                STATE.type = ELEMENT.type


                // Confirm focus state, convert into text input to remove UA stylings,
                // and set as readonly to prevent keyboard popup.
                ELEMENT.autofocus = ELEMENT == document.activeElement
                ELEMENT.readOnly = !SETTINGS.editable
                ELEMENT.id = ELEMENT.id || STATE.id
                if ( ELEMENT.type != 'text' ) {
                    ELEMENT.type = 'text'
                }


                // Create a new picker component with the settings.
                P.component = new COMPONENT(P, SETTINGS)


                // Create the picker root with a holder and then prepare it.
                P.$root = $( PickerConstructor._.node('div', createWrappedComponent(), CLASSES.picker, 'id="' + ELEMENT.id + '_root"') )
                prepareElementRoot()


                // If there’s a format for the hidden input element, create the element.
                if ( SETTINGS.formatSubmit ) {
                    prepareElementHidden()
                }


                // Prepare the input element.
                prepareElement()


                // Insert the root as specified in the settings.
                if ( SETTINGS.container ) $( SETTINGS.container ).append( P.$root )
                else $ELEMENT.after( P.$root )


                // Bind the default component and settings events.
                P.on({
                    start: P.component.onStart,
                    render: P.component.onRender,
                    stop: P.component.onStop,
                    open: P.component.onOpen,
                    close: P.component.onClose,
                    set: P.component.onSet
                }).on({
                    start: SETTINGS.onStart,
                    render: SETTINGS.onRender,
                    stop: SETTINGS.onStop,
                    open: SETTINGS.onOpen,
                    close: SETTINGS.onClose,
                    set: SETTINGS.onSet
                })


                // Once we’re all set, check the theme in use.
                IS_DEFAULT_THEME = isUsingDefaultTheme( P.$root.children()[ 0 ] )


                // If the element has autofocus, open the picker.
                if ( ELEMENT.autofocus ) {
                    P.open()
                }


                // Trigger queued the “start” and “render” events.
                return P.trigger( 'start' ).trigger( 'render' )
            }, //start


            /**
             * Render a new picker
             */
            render: function( entireComponent ) {

                // Insert a new component holder in the root or box.
                if ( entireComponent ) P.$root.html( createWrappedComponent() )
                else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )

                // Trigger the queued “render” events.
                return P.trigger( 'render' )
            }, //render


            /**
             * Destroy everything
             */
            stop: function() {

                // If it’s already stopped, do nothing.
                if ( !STATE.start ) return P

                // Then close the picker.
                P.close()

                // Remove the hidden field.
                if ( P._hidden ) {
                    P._hidden.parentNode.removeChild( P._hidden )
                }

                // Remove the root.
                P.$root.remove()

                // Remove the input class, remove the stored data, and unbind
                // the events (after a tick for IE - see `P.close`).
                $ELEMENT.removeClass( CLASSES.input ).removeData( NAME )
                setTimeout( function() {
                    $ELEMENT.off( '.' + STATE.id )
                }, 0)

                // Restore the element state
                ELEMENT.type = STATE.type
                ELEMENT.readOnly = false

                // Trigger the queued “stop” events.
                P.trigger( 'stop' )

                // Reset the picker states.
                STATE.methods = {}
                STATE.start = false

                return P
            }, //stop


            /**
             * Open up the picker
             */
            open: function( dontGiveFocus ) {

                // If it’s already open, do nothing.
                if ( STATE.open ) return P

                // Add the “active” class.
                $ELEMENT.addClass( CLASSES.active )
                aria( ELEMENT, 'expanded', true )

                // * A Firefox bug, when `html` has `overflow:hidden`, results in
                //   killing transitions :(. So add the “opened” state on the next tick.
                //   Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
                setTimeout( function() {

                    // Add the “opened” class to the picker root.
                    P.$root.addClass( CLASSES.opened )
                    aria( P.$root[0], 'hidden', false )

                }, 0 )

                // If we have to give focus, bind the element and doc events.
                if ( dontGiveFocus !== false ) {

                    // Set it as open.
                    STATE.open = true

                    // Prevent the page from scrolling.
                    if ( IS_DEFAULT_THEME ) {
                        $html.
                            css( 'overflow', 'hidden' ).
                            css( 'padding-right', '+=' + getScrollbarWidth() )
                    }

                    // Pass focus to the element’s jQuery object.
                    $ELEMENT.trigger( 'focus' )

                    // Bind the document events.
                    $document.on( 'click.' + STATE.id + ' focusin.' + STATE.id, function( event ) {

                        var target = event.target

                        // If the target of the event is not the element, close the picker picker.
                        // * Don’t worry about clicks or focusins on the root because those don’t bubble up.
                        //   Also, for Firefox, a click on an `option` element bubbles up directly
                        //   to the doc. So make sure the target wasn't the doc.
                        // * In Firefox stopPropagation() doesn’t prevent right-click events from bubbling,
                        //   which causes the picker to unexpectedly close when right-clicking it. So make
                        //   sure the event wasn’t a right-click.
                        if ( target != ELEMENT && target != document && event.which != 3 ) {

                            // If the target was the holder that covers the screen,
                            // keep the element focused to maintain tabindex.
                            P.close( target === P.$root.children()[0] )
                        }

                    }).on( 'keydown.' + STATE.id, function( event ) {

                        var
                            // Get the keycode.
                            keycode = event.keyCode,

                            // Translate that to a selection change.
                            keycodeToMove = P.component.key[ keycode ],

                            // Grab the target.
                            target = event.target


                        // On escape, close the picker and give focus.
                        if ( keycode == 27 ) {
                            P.close( true )
                        }


                        // Check if there is a key movement or “enter” keypress on the element.
                        else if ( target == ELEMENT && ( keycodeToMove || keycode == 13 ) ) {

                            // Prevent the default action to stop page movement.
                            event.preventDefault()

                            // Trigger the key movement action.
                            if ( keycodeToMove ) {
                                PickerConstructor._.trigger( P.component.key.go, P, [ PickerConstructor._.trigger( keycodeToMove ) ] )
                            }

                            // On “enter”, if the highlighted item isn’t disabled, set the value and close.
                            else if ( !P.$root.find( '.' + CLASSES.highlighted ).hasClass( CLASSES.disabled ) ) {
                                P.set( 'select', P.component.item.highlight ).close()
                            }
                        }


                        // If the target is within the root and “enter” is pressed,
                        // prevent the default action and trigger a click on the target instead.
                        else if ( $.contains( P.$root[0], target ) && keycode == 13 ) {
                            event.preventDefault()
                            target.click()
                        }
                    })
                }

                // Trigger the queued “open” events.
                return P.trigger( 'open' )
            }, //open


            /**
             * Close the picker
             */
            close: function( giveFocus ) {

                // If we need to give focus, do it before changing states.
                if ( giveFocus ) {
                    // ....ah yes! It would’ve been incomplete without a crazy workaround for IE :|
                    // The focus is triggered *after* the close has completed - causing it
                    // to open again. So unbind and rebind the event at the next tick.
                    $ELEMENT.off( 'focus.' + STATE.id ).trigger( 'focus' )
                    setTimeout( function() {
                        $ELEMENT.on( 'focus.' + STATE.id, focusToOpen )
                    }, 0 )
                }

                // Remove the “active” class.
                $ELEMENT.removeClass( CLASSES.active )
                aria( ELEMENT, 'expanded', false )

                // * A Firefox bug, when `html` has `overflow:hidden`, results in
                //   killing transitions :(. So remove the “opened” state on the next tick.
                //   Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=625289
                setTimeout( function() {

                    // Remove the “opened” and “focused” class from the picker root.
                    P.$root.removeClass( CLASSES.opened + ' ' + CLASSES.focused )
                    aria( P.$root[0], 'hidden', true )

                }, 0 )

                // If it’s already closed, do nothing more.
                if ( !STATE.open ) return P

                // Set it as closed.
                STATE.open = false

                // Allow the page to scroll.
                if ( IS_DEFAULT_THEME ) {
                    $html.
                        css( 'overflow', '' ).
                        css( 'padding-right', '-=' + getScrollbarWidth() )
                }

                // Unbind the document events.
                $document.off( '.' + STATE.id )

                // Trigger the queued “close” events.
                return P.trigger( 'close' )
            }, //close


            /**
             * Clear the values
             */
            clear: function( options ) {
                return P.set( 'clear', null, options )
            }, //clear


            /**
             * Set something
             */
            set: function( thing, value, options ) {

                var thingItem, thingValue,
                    thingIsObject = $.isPlainObject( thing ),
                    thingObject = thingIsObject ? thing : {}

                // Make sure we have usable options.
                options = thingIsObject && $.isPlainObject( value ) ? value : options || {}

                if ( thing ) {

                    // If the thing isn’t an object, make it one.
                    if ( !thingIsObject ) {
                        thingObject[ thing ] = value
                    }

                    // Go through the things of items to set.
                    for ( thingItem in thingObject ) {

                        // Grab the value of the thing.
                        thingValue = thingObject[ thingItem ]

                        // First, if the item exists and there’s a value, set it.
                        if ( thingItem in P.component.item ) {
                            if ( thingValue === undefined ) thingValue = null
                            P.component.set( thingItem, thingValue, options )
                        }

                        // Then, check to update the element value and broadcast a change.
                        if ( thingItem == 'select' || thingItem == 'clear' ) {
                            $ELEMENT.
                                val( thingItem == 'clear' ? '' : P.get( thingItem, SETTINGS.format ) ).
                                trigger( 'change' )
                        }
                    }

                    // Render a new picker.
                    P.render()
                }

                // When the method isn’t muted, trigger queued “set” events and pass the `thingObject`.
                return options.muted ? P : P.trigger( 'set', thingObject )
            }, //set


            /**
             * Get something
             */
            get: function( thing, format ) {

                // Make sure there’s something to get.
                thing = thing || 'value'

                // If a picker state exists, return that.
                if ( STATE[ thing ] != null ) {
                    return STATE[ thing ]
                }

                // Return the value, if that.
                if ( thing == 'value' ) {
                    return ELEMENT.value
                }

                // Check if a component item exists, return that.
                if ( thing in P.component.item ) {
                    if ( typeof format == 'string' ) {
                        var thingValue = P.component.get( thing )
                        return thingValue ?
                            PickerConstructor._.trigger(
                                P.component.formats.toString,
                                P.component,
                                [ format, thingValue ]
                            ) : ''
                    }
                    return P.component.get( thing )
                }
            }, //get



            /**
             * Bind events on the things.
             */
            on: function( thing, method, internal ) {

                var thingName, thingMethod,
                    thingIsObject = $.isPlainObject( thing ),
                    thingObject = thingIsObject ? thing : {}

                if ( thing ) {

                    // If the thing isn’t an object, make it one.
                    if ( !thingIsObject ) {
                        thingObject[ thing ] = method
                    }

                    // Go through the things to bind to.
                    for ( thingName in thingObject ) {

                        // Grab the method of the thing.
                        thingMethod = thingObject[ thingName ]

                        // If it was an internal binding, prefix it.
                        if ( internal ) {
                            thingName = '_' + thingName
                        }

                        // Make sure the thing methods collection exists.
                        STATE.methods[ thingName ] = STATE.methods[ thingName ] || []

                        // Add the method to the relative method collection.
                        STATE.methods[ thingName ].push( thingMethod )
                    }
                }

                return P
            }, //on



            /**
             * Unbind events on the things.
             */
            off: function() {
                var i, thingName,
                    names = arguments;
                for ( i = 0, namesCount = names.length; i < namesCount; i += 1 ) {
                    thingName = names[i]
                    if ( thingName in STATE.methods ) {
                        delete STATE.methods[thingName]
                    }
                }
                return P
            },


            /**
             * Fire off method events.
             */
            trigger: function( name, data ) {
                var _trigger = function( name ) {
                    var methodList = STATE.methods[ name ]
                    if ( methodList ) {
                        methodList.map( function( method ) {
                            PickerConstructor._.trigger( method, P, [ data ] )
                        })
                    }
                }
                _trigger( '_' + name )
                _trigger( name )
                return P
            } //trigger
        } //PickerInstance.prototype


    /**
     * Wrap the picker holder components together.
     */
    function createWrappedComponent() {

        // Create a picker wrapper holder
        return PickerConstructor._.node( 'div',

            // Create a picker wrapper node
            PickerConstructor._.node( 'div',

                // Create a picker frame
                PickerConstructor._.node( 'div',

                    // Create a picker box node
                    PickerConstructor._.node( 'div',

                        // Create the components nodes.
                        P.component.nodes( STATE.open ),

                        // The picker box class
                        CLASSES.box
                    ),

                    // Picker wrap class
                    CLASSES.wrap
                ),

                // Picker frame class
                CLASSES.frame
            ),

            // Picker holder class
            CLASSES.holder
        ) //endreturn
    } //createWrappedComponent



    /**
     * Prepare the input element with all bindings.
     */
    function prepareElement() {

        $ELEMENT.

            // Store the picker data by component name.
            data(NAME, P).

            // Add the “input” class name.
            addClass(CLASSES.input).

            // If there’s a `data-value`, update the value of the element.
            val( $ELEMENT.data('value') ?
                P.get('select', SETTINGS.format) :
                ELEMENT.value
            ).

            // On focus/click, open the picker and adjust the root “focused” state.
            on('focus.' + STATE.id + ' click.' + STATE.id, focusToOpen)


        // Only bind keydown events if the element isn’t editable.
        if ( !SETTINGS.editable ) {

            // Handle keyboard event based on the picker being opened or not.
            $ELEMENT.on('keydown.' + STATE.id, function(event) {

                var keycode = event.keyCode,

                    // Check if one of the delete keys was pressed.
                    isKeycodeDelete = /^(8|46)$/.test(keycode)

                // For some reason IE clears the input value on “escape”.
                if ( keycode == 27 ) {
                    P.close()
                    return false
                }

                // Check if `space` or `delete` was pressed or the picker is closed with a key movement.
                if ( keycode == 32 || isKeycodeDelete || !STATE.open && P.component.key[keycode] ) {

                    // Prevent it from moving the page and bubbling to doc.
                    event.preventDefault()
                    event.stopPropagation()

                    // If `delete` was pressed, clear the values and close the picker.
                    // Otherwise open the picker.
                    if ( isKeycodeDelete ) { P.clear().close() }
                    else { P.open() }
                }
            })
        }


        // Update the aria attributes.
        aria(ELEMENT, {
            haspopup: true,
            expanded: false,
            readonly: false,
            owns: ELEMENT.id + '_root' + (P._hidden ? ' ' + P._hidden.id : '')
        })
    }


    /**
     * Prepare the root picker element with all bindings.
     */
    function prepareElementRoot() {

        P.$root.

            on({

                // When something within the root is focused, stop from bubbling
                // to the doc and remove the “focused” state from the root.
                focusin: function( event ) {
                    P.$root.removeClass( CLASSES.focused )
                    event.stopPropagation()
                },

                // When something within the root holder is clicked, stop it
                // from bubbling to the doc.
                'mousedown click': function( event ) {

                    var target = event.target

                    // Make sure the target isn’t the root holder so it can bubble up.
                    if ( target != P.$root.children()[ 0 ] ) {

                        event.stopPropagation()

                        // * For mousedown events, cancel the default action in order to
                        //   prevent cases where focus is shifted onto external elements
                        //   when using things like jQuery mobile or MagnificPopup (ref: #249 & #120).
                        //   Also, for Firefox, don’t prevent action on the `option` element.
                        if ( event.type == 'mousedown' && !$( target ).is( ':input' ) && target.nodeName != 'OPTION' ) {

                            event.preventDefault()

                            // Re-focus onto the element so that users can click away
                            // from elements focused within the picker.
                            ELEMENT.focus()
                        }
                    }
                }
            }).

            // If there’s a click on an actionable element, carry out the actions.
            on( 'click', '[data-pick], [data-nav], [data-clear], [data-close]', function() {

                var $target = $( this ),
                    targetData = $target.data(),
                    targetDisabled = $target.hasClass( CLASSES.navDisabled ) || $target.hasClass( CLASSES.disabled ),

                    // * For IE, non-focusable elements can be active elements as well
                    //   (http://stackoverflow.com/a/2684561).
                    activeElement = document.activeElement
                    activeElement = activeElement && ( activeElement.type || activeElement.href ) && activeElement

                // If it’s disabled or nothing inside is actively focused, re-focus the element.
                if ( targetDisabled || activeElement && !$.contains( P.$root[0], activeElement ) ) {
                    ELEMENT.focus()
                }

                // If something is superficially changed, update the `highlight` based on the `nav`.
                if ( !targetDisabled && targetData.nav ) {
                    P.set( 'highlight', P.component.item.highlight, { nav: targetData.nav } )
                }

                // If something is picked, set `select` then close with focus.
                else if ( !targetDisabled && 'pick' in targetData ) {
                    P.set( 'select', targetData.pick ).close( true )
                }

                // If a “clear” button is pressed, empty the values and close with focus.
                else if ( targetData.clear ) {
                    P.clear().close( true )
                }

                else if ( targetData.close ) {
                    P.close( true )
                }

            }) //P.$root

        aria( P.$root[0], 'hidden', true )
    }


     /**
      * Prepare the hidden input element along with all bindings.
      */
    function prepareElementHidden() {

        var name

        if ( SETTINGS.hiddenName === true ) {
            name = ELEMENT.name
            ELEMENT.name = ''
        }
        else {
            name = [
                typeof SETTINGS.hiddenPrefix == 'string' ? SETTINGS.hiddenPrefix : '',
                typeof SETTINGS.hiddenSuffix == 'string' ? SETTINGS.hiddenSuffix : '_submit'
            ]
            name = name[0] + ELEMENT.name + name[1]
        }

        P._hidden = $(
            '<input ' +
            'type=hidden ' +

            // Create the name using the original input’s with a prefix and suffix.
            'name="' + name + '"' +

            // If the element has a value, set the hidden value as well.
            (
                $ELEMENT.data('value') || ELEMENT.value ?
                    ' value="' + P.get('select', SETTINGS.formatSubmit) + '"' :
                    ''
            ) +
            '>'
        )[0]

        $ELEMENT.

            // If the value changes, update the hidden input with the correct format.
            on('change.' + STATE.id, function() {
                P._hidden.value = ELEMENT.value ?
                    P.get('select', SETTINGS.formatSubmit) :
                    ''
            }).

            // Insert the hidden input after the element.
            after(P._hidden)
    }


    // Separated for IE
    function focusToOpen( event ) {

        // Stop the event from propagating to the doc.
        event.stopPropagation()

        // If it’s a focus event, add the “focused” class to the root.
        if ( event.type == 'focus' ) {
            P.$root.addClass( CLASSES.focused )
        }

        // And then finally open the picker.
        P.open()
    }


    // Return a new picker instance.
    return new PickerInstance()
} //PickerConstructor



/**
 * The default classes and prefix to use for the HTML classes.
 */
PickerConstructor.klasses = function( prefix ) {
    prefix = prefix || 'picker'
    return {

        picker: prefix,
        opened: prefix + '--opened',
        focused: prefix + '--focused',

        input: prefix + '__input',
        active: prefix + '__input--active',

        holder: prefix + '__holder',

        frame: prefix + '__frame',
        wrap: prefix + '__wrap',

        box: prefix + '__box'
    }
} //PickerConstructor.klasses



/**
 * Check if the default theme is being used.
 */
function isUsingDefaultTheme( element ) {

    var theme,
        prop = 'position'

    // For IE.
    if ( element.currentStyle ) {
        theme = element.currentStyle[prop]
    }

    // For normal browsers.
    else if ( window.getComputedStyle ) {
        theme = getComputedStyle( element )[prop]
    }

    return theme == 'fixed'
}



/**
 * Get the width of the browser’s scrollbar.
 * Taken from: https://github.com/VodkaBears/Remodal/blob/master/src/jquery.remodal.js
 */
function getScrollbarWidth() {

    if ( $html.height() <= $window.height() ) {
        return 0
    }

    var $outer = $( '<div style="visibility:hidden;width:100px" />' ).
        appendTo( 'body' )

    // Get the width without scrollbars.
    var widthWithoutScroll = $outer[0].offsetWidth

    // Force adding scrollbars.
    $outer.css( 'overflow', 'scroll' )

    // Add the inner div.
    var $inner = $( '<div style="width:100%" />' ).appendTo( $outer )

    // Get the width with scrollbars.
    var widthWithScroll = $inner[0].offsetWidth

    // Remove the divs.
    $outer.remove()

    // Return the difference between the widths.
    return widthWithoutScroll - widthWithScroll
}



/**
 * PickerConstructor helper methods.
 */
PickerConstructor._ = {

    /**
     * Create a group of nodes. Expects:
     * `
        {
            min:    {Integer},
            max:    {Integer},
            i:      {Integer},
            node:   {String},
            item:   {Function}
        }
     * `
     */
    group: function( groupObject ) {

        var
            // Scope for the looped object
            loopObjectScope,

            // Create the nodes list
            nodesList = '',

            // The counter starts from the `min`
            counter = PickerConstructor._.trigger( groupObject.min, groupObject )


        // Loop from the `min` to `max`, incrementing by `i`
        for ( ; counter <= PickerConstructor._.trigger( groupObject.max, groupObject, [ counter ] ); counter += groupObject.i ) {

            // Trigger the `item` function within scope of the object
            loopObjectScope = PickerConstructor._.trigger( groupObject.item, groupObject, [ counter ] )

            // Splice the subgroup and create nodes out of the sub nodes
            nodesList += PickerConstructor._.node(
                groupObject.node,
                loopObjectScope[ 0 ],   // the node
                loopObjectScope[ 1 ],   // the classes
                loopObjectScope[ 2 ]    // the attributes
            )
        }

        // Return the list of nodes
        return nodesList
    }, //group


    /**
     * Create a dom node string
     */
    node: function( wrapper, item, klass, attribute ) {

        // If the item is false-y, just return an empty string
        if ( !item ) return ''

        // If the item is an array, do a join
        item = $.isArray( item ) ? item.join( '' ) : item

        // Check for the class
        klass = klass ? ' class="' + klass + '"' : ''

        // Check for any attributes
        attribute = attribute ? ' ' + attribute : ''

        // Return the wrapped item
        return '<' + wrapper + klass + attribute + '>' + item + '</' + wrapper + '>'
    }, //node


    /**
     * Lead numbers below 10 with a zero.
     */
    lead: function( number ) {
        return ( number < 10 ? '0': '' ) + number
    },


    /**
     * Trigger a function otherwise return the value.
     */
    trigger: function( callback, scope, args ) {
        return typeof callback == 'function' ? callback.apply( scope, args || [] ) : callback
    },


    /**
     * If the second character is a digit, length is 2 otherwise 1.
     */
    digits: function( string ) {
        return ( /\d/ ).test( string[ 1 ] ) ? 2 : 1
    },


    /**
     * Tell if something is a date object.
     */
    isDate: function( value ) {
        return {}.toString.call( value ).indexOf( 'Date' ) > -1 && this.isInteger( value.getUTCDate() )
    },


    /**
     * Tell if something is an integer.
     */
    isInteger: function( value ) {
        return {}.toString.call( value ).indexOf( 'Number' ) > -1 && value % 1 === 0
    },


    /**
     * Create ARIA attribute strings.
     */
    ariaAttr: ariaAttr
} //PickerConstructor._



/**
 * Extend the picker with a component and defaults.
 */
PickerConstructor.extend = function( name, Component ) {

    // Extend jQuery.
    $.fn[ name ] = function( options, action ) {

        // Grab the component data.
        var componentData = this.data( name )

        // If the picker is requested, return the data object.
        if ( options == 'picker' ) {
            return componentData
        }

        // If the component data exists and `options` is a string, carry out the action.
        if ( componentData && typeof options == 'string' ) {
            return PickerConstructor._.trigger( componentData[ options ], componentData, [ action ] )
        }

        // Otherwise go through each matched element and if the component
        // doesn’t exist, create a new picker using `this` element
        // and merging the defaults and options with a deep copy.
        return this.each( function() {
            var $this = $( this )
            if ( !$this.data( name ) ) {
                new PickerConstructor( this, name, Component, options )
            }
        })
    }

    // Set the defaults.
    $.fn[ name ].defaults = Component.defaults
} //PickerConstructor.extend



function aria(element, attribute, value) {
    if ( $.isPlainObject(attribute) ) {
        for ( var key in attribute ) {
            ariaSet(element, key, attribute[key])
        }
    }
    else {
        ariaSet(element, attribute, value)
    }
}
function ariaSet(element, attribute, value) {
    element.setAttribute(
        (attribute == 'role' ? '' : 'aria-') + attribute,
        value
    )
}
function ariaAttr(attribute, data) {
    if ( !$.isPlainObject(attribute) ) {
        attribute = { attribute: data }
    }
    data = ''
    for ( var key in attribute ) {
        var attr = (key == 'role' ? '' : 'aria-') + key,
            attrVal = attribute[key]
        data += attrVal == null ? '' : attr + '="' + attribute[key] + '"'
    }
    return data
}



// Expose the picker constructor.
return PickerConstructor


}));



;

/*!
 * Date picker for pickadate.js v3.5.4
 * http://amsul.github.io/pickadate.js/date.htm
 */

(function ( factory ) {

    // AMD.
    if ( typeof define == 'function' && define.amd )
        define( ['picker','jquery'], factory )

    // Node.js/browserify.
    else if ( typeof exports == 'object' )
        module.exports = factory( require('./picker.js'), require('jquery') )

    // Browser globals.
    else factory( Picker, jQuery )

}(function( Picker, $ ) {


/**
 * Globals and constants
 */
var DAYS_IN_WEEK = 7,
    WEEKS_IN_CALENDAR = 6,
    _ = Picker._



/**
 * The date picker constructor
 */
function DatePicker( picker, settings ) {

    var calendar = this,
        element = picker.$node[ 0 ],
        elementValue = element.value,
        elementDataValue = picker.$node.data( 'value' ),
        valueString = elementDataValue || elementValue,
        formatString = elementDataValue ? settings.formatSubmit : settings.format,
        isRTL = function() {

            return element.currentStyle ?

                // For IE.
                element.currentStyle.direction == 'rtl' :

                // For normal browsers.
                getComputedStyle( picker.$root[0] ).direction == 'rtl'
        }

    calendar.settings = settings
    calendar.$node = picker.$node

    // The queue of methods that will be used to build item objects.
    calendar.queue = {
        min: 'measure create',
        max: 'measure create',
        now: 'now create',
        select: 'parse create validate',
        highlight: 'parse navigate create validate',
        view: 'parse create validate viewset',
        disable: 'deactivate',
        enable: 'activate'
    }

    // The component's item object.
    calendar.item = {}

    calendar.item.clear = null
    calendar.item.disable = ( settings.disable || [] ).slice( 0 )
    calendar.item.enable = -(function( collectionDisabled ) {
        return collectionDisabled[ 0 ] === true ? collectionDisabled.shift() : -1
    })( calendar.item.disable )

    calendar.
        set( 'min', settings.min ).
        set( 'max', settings.max ).
        set( 'now' )

    // When there’s a value, set the `select`, which in turn
    // also sets the `highlight` and `view`.
    if ( valueString ) {
        calendar.set( 'select', valueString, { format: formatString })
    }

    // If there’s no value, default to highlighting “today”.
    else {
        calendar.
            set( 'select', null ).
            set( 'highlight', calendar.item.now )
    }


    // The keycode to movement mapping.
    calendar.key = {
        40: 7, // Down
        38: -7, // Up
        39: function() { return isRTL() ? -1 : 1 }, // Right
        37: function() { return isRTL() ? 1 : -1 }, // Left
        go: function( timeChange ) {
            var highlightedObject = calendar.item.highlight,
                targetDate = new Date( Date.UTC(highlightedObject.year, highlightedObject.month, highlightedObject.date + timeChange) )
            calendar.set(
                'highlight',
                targetDate,
                { interval: timeChange }
            )
            this.render()
        }
    }


    // Bind some picker events.
    picker.
        on( 'render', function() {
            picker.$root.find( '.' + settings.klass.selectMonth ).on( 'change', function() {
                var value = this.value
                if ( value ) {
                    picker.set( 'highlight', [ picker.get( 'view' ).year, value, picker.get( 'highlight' ).date ] )
                    picker.$root.find( '.' + settings.klass.selectMonth ).trigger( 'focus' )
                }
            })
            picker.$root.find( '.' + settings.klass.selectYear ).on( 'change', function() {
                var value = this.value
                if ( value ) {
                    picker.set( 'highlight', [ value, picker.get( 'view' ).month, picker.get( 'highlight' ).date ] )
                    picker.$root.find( '.' + settings.klass.selectYear ).trigger( 'focus' )
                }
            })
        }, 1 ).
        on( 'open', function() {
            var includeToday = ''
            if ( calendar.disabled( calendar.get('now') ) ) {
                includeToday = ':not(.' + settings.klass.buttonToday + ')'
            }
            picker.$root.find( 'button' + includeToday + ', select' ).attr( 'disabled', false )
        }, 1 ).
        on( 'close', function() {
            picker.$root.find( 'button, select' ).attr( 'disabled', true )
        }, 1 )

} //DatePicker


/**
 * Set a datepicker item object.
 */
DatePicker.prototype.set = function( type, value, options ) {

    var calendar = this,
        calendarItem = calendar.item

    // If the value is `null` just set it immediately.
    if ( value === null ) {
        if ( type == 'clear' ) type = 'select'
        calendarItem[ type ] = value
        return calendar
    }

    // Otherwise go through the queue of methods, and invoke the functions.
    // Update this as the time unit, and set the final value as this item.
    // * In the case of `enable`, keep the queue but set `disable` instead.
    //   And in the case of `flip`, keep the queue but set `enable` instead.
    calendarItem[ ( type == 'enable' ? 'disable' : type == 'flip' ? 'enable' : type ) ] = calendar.queue[ type ].split( ' ' ).map( function( method ) {
        value = calendar[ method ]( type, value, options )
        return value
    }).pop()

    // Check if we need to cascade through more updates.
    if ( type == 'select' ) {
        calendar.set( 'highlight', calendarItem.select, options )
    }
    else if ( type == 'highlight' ) {
        calendar.set( 'view', calendarItem.highlight, options )
    }
    else if ( type.match( /^(flip|min|max|disable|enable)$/ ) ) {
        if ( calendarItem.select && calendar.disabled( calendarItem.select ) ) {
            calendar.set( 'select', calendarItem.select, options )
        }
        if ( calendarItem.highlight && calendar.disabled( calendarItem.highlight ) ) {
            calendar.set( 'highlight', calendarItem.highlight, options )
        }
    }

    return calendar
} //DatePicker.prototype.set


/**
 * Get a datepicker item object.
 */
DatePicker.prototype.get = function( type ) {
    return this.item[ type ]
} //DatePicker.prototype.get


/**
 * Create a picker date object.
 */
DatePicker.prototype.create = function( type, value, options ) {

    var isInfiniteValue,
        calendar = this

    // If there’s no value, use the type as the value.
    value = value === undefined ? type : value


    // If it’s infinity, update the value.
    if ( value == -Infinity || value == Infinity ) {
        isInfiniteValue = value
    }

    // If it’s an object, use the native date object.
    else if ( $.isPlainObject( value ) && _.isInteger( value.pick ) ) {
        value = value.obj
    }

    // If it’s an array, convert it into a date and make sure
    // that it’s a valid date – otherwise default to today.
    else if ( $.isArray( value ) ) {
        value = new Date(Date.UTC(value[ 0 ], value[ 1 ], value[ 2 ] ))
        value = _.isDate( value ) ? value : calendar.create().obj
    }

    // If it’s a number, make a normalized date.
    else if ( _.isInteger( value ) ) {
        value = calendar.normalize( new Date( value ), options )
    }

    // If it’s a date object, make a normalized date.
    else if ( _.isDate( value ) ) {
        value = calendar.normalize( value, options )
    }

    // If it’s a literal true or any other case, set it to now.
    else /*if ( value === true )*/ {
        value = calendar.now( type, value, options )
    }

    // Return the compiled object.
    return {
        year: isInfiniteValue || value.getUTCFullYear(),
        month: isInfiniteValue || value.getUTCMonth(),
        date: isInfiniteValue || value.getUTCDate(),
        day: isInfiniteValue || value.getUTCDay(),
        obj: isInfiniteValue || value,
        pick: isInfiniteValue || value.getTime()
    }
} //DatePicker.prototype.create


/**
 * Create a range limit object using an array, date object,
 * literal “true”, or integer relative to another time.
 */
DatePicker.prototype.createRange = function( from, to ) {

    var calendar = this,
        createDate = function( date ) {
            if ( date === true || $.isArray( date ) || _.isDate( date ) ) {
                return calendar.create( date )
            }
            return date
        }

    // Create objects if possible.
    if ( !_.isInteger( from ) ) {
        from = createDate( from )
    }
    if ( !_.isInteger( to ) ) {
        to = createDate( to )
    }

    // Create relative dates.
    if ( _.isInteger( from ) && $.isPlainObject( to ) ) {
        from = [ to.year, to.month, to.date + from ];
    }
    else if ( _.isInteger( to ) && $.isPlainObject( from ) ) {
        to = [ from.year, from.month, from.date + to ];
    }

    return {
        from: createDate( from ),
        to: createDate( to )
    }
} //DatePicker.prototype.createRange


/**
 * Check if a date unit falls within a date range object.
 */
DatePicker.prototype.withinRange = function( range, dateUnit ) {
    range = this.createRange(range.from, range.to)
    return dateUnit.pick >= range.from.pick && dateUnit.pick <= range.to.pick
}


/**
 * Check if two date range objects overlap.
 */
DatePicker.prototype.overlapRanges = function( one, two ) {

    var calendar = this

    // Convert the ranges into comparable dates.
    one = calendar.createRange( one.from, one.to )
    two = calendar.createRange( two.from, two.to )

    return calendar.withinRange( one, two.from ) || calendar.withinRange( one, two.to ) ||
        calendar.withinRange( two, one.from ) || calendar.withinRange( two, one.to )
}


/**
 * Get the date today.
 */
DatePicker.prototype.now = function( type, value, options ) {
    value = new Date()
    if ( options && options.rel ) {
        value.setUTCDate( value.getUTCDate() + options.rel )
    }
    return this.normalize( value, options )
}


/**
 * Navigate to next/prev month.
 */
DatePicker.prototype.navigate = function( type, value, options ) {

    var targetDateObject,
        targetYear,
        targetMonth,
        targetDate,
        isTargetArray = $.isArray( value ),
        isTargetObject = $.isPlainObject( value ),
        viewsetObject = this.item.view/*,
        safety = 100*/


    if ( isTargetArray || isTargetObject ) {

        if ( isTargetObject ) {
            targetYear = value.year
            targetMonth = value.month
            targetDate = value.date
        }
        else {
            targetYear = +value[0]
            targetMonth = +value[1]
            targetDate = +value[2]
        }

        // If we’re navigating months but the view is in a different
        // month, navigate to the view’s year and month.
        if ( options && options.nav && viewsetObject && viewsetObject.month !== targetMonth ) {
            targetYear = viewsetObject.year
            targetMonth = viewsetObject.month
        }

        // Figure out the expected target year and month.
        targetDateObject = new Date( Date.UTC( targetYear, targetMonth + ( options && options.nav ? options.nav : 0 ), 1 ) )
        targetYear = targetDateObject.getUTCFullYear()
        targetMonth = targetDateObject.getUTCMonth()

        // If the month we’re going to doesn’t have enough days,
        // keep decreasing the date until we reach the month’s last date.
        while ( /*safety &&*/ new Date( Date.UTC( targetYear, targetMonth, targetDate ) ).getUTCMonth() !== targetMonth ) {
            targetDate -= 1
            /*safety -= 1
            if ( !safety ) {
                throw 'Fell into an infinite loop while navigating to ' + new Date( targetYear, targetMonth, targetDate ) + '.'
            }*/
        }

        value = [ targetYear, targetMonth, targetDate ]
    }

    return value
} //DatePicker.prototype.navigate


/**
 * Normalize a date by setting the hours to midnight.
 */
DatePicker.prototype.normalize = function( value/*, options*/ ) {
    value.setUTCHours( 0, 0, 0, 0 )
    return value
}


/**
 * Measure the range of dates.
 */
DatePicker.prototype.measure = function( type, value/*, options*/ ) {

    var calendar = this

    // If it’s anything false-y, remove the limits.
    if ( !value ) {
        value = type == 'min' ? -Infinity : Infinity
    }

    // If it’s a string, parse it.
    else if ( typeof value == 'string' ) {
        value = calendar.parse( type, value )
    }

    // If it's an integer, get a date relative to today.
    else if ( _.isInteger( value ) ) {
        value = calendar.now( type, value, { rel: value } )
    }

    return value
} ///DatePicker.prototype.measure


/**
 * Create a viewset object based on navigation.
 */
DatePicker.prototype.viewset = function( type, dateObject/*, options*/ ) {
    return this.create([ dateObject.year, dateObject.month, 1 ])
}


/**
 * Validate a date as enabled and shift if needed.
 */
DatePicker.prototype.validate = function( type, dateObject, options ) {

    var calendar = this,

        // Keep a reference to the original date.
        originalDateObject = dateObject,

        // Make sure we have an interval.
        interval = options && options.interval ? options.interval : 1,

        // Check if the calendar enabled dates are inverted.
        isFlippedBase = calendar.item.enable === -1,

        // Check if we have any enabled dates after/before now.
        hasEnabledBeforeTarget, hasEnabledAfterTarget,

        // The min & max limits.
        minLimitObject = calendar.item.min,
        maxLimitObject = calendar.item.max,

        // Check if we’ve reached the limit during shifting.
        reachedMin, reachedMax,

        // Check if the calendar is inverted and at least one weekday is enabled.
        hasEnabledWeekdays = isFlippedBase && calendar.item.disable.filter( function( value ) {

            // If there’s a date, check where it is relative to the target.
            if ( $.isArray( value ) ) {
                var dateTime = calendar.create( value ).pick
                if ( dateTime < dateObject.pick ) hasEnabledBeforeTarget = true
                else if ( dateTime > dateObject.pick ) hasEnabledAfterTarget = true
            }

            // Return only integers for enabled weekdays.
            return _.isInteger( value )
        }).length/*,

        safety = 100*/



    // Cases to validate for:
    // [1] Not inverted and date disabled.
    // [2] Inverted and some dates enabled.
    // [3] Not inverted and out of range.
    //
    // Cases to **not** validate for:
    // • Navigating months.
    // • Not inverted and date enabled.
    // • Inverted and all dates disabled.
    // • ..and anything else.
    if ( !options || !options.nav ) if (
        /* 1 */ ( !isFlippedBase && calendar.disabled( dateObject ) ) ||
        /* 2 */ ( isFlippedBase && calendar.disabled( dateObject ) && ( hasEnabledWeekdays || hasEnabledBeforeTarget || hasEnabledAfterTarget ) ) ||
        /* 3 */ ( !isFlippedBase && (dateObject.pick <= minLimitObject.pick || dateObject.pick >= maxLimitObject.pick) )
    ) {


        // When inverted, flip the direction if there aren’t any enabled weekdays
        // and there are no enabled dates in the direction of the interval.
        if ( isFlippedBase && !hasEnabledWeekdays && ( ( !hasEnabledAfterTarget && interval > 0 ) || ( !hasEnabledBeforeTarget && interval < 0 ) ) ) {
            interval *= -1
        }


        // Keep looping until we reach an enabled date.
        while ( /*safety &&*/ calendar.disabled( dateObject ) ) {

            /*safety -= 1
            if ( !safety ) {
                throw 'Fell into an infinite loop while validating ' + dateObject.obj + '.'
            }*/


            // If we’ve looped into the next/prev month with a large interval, return to the original date and flatten the interval.
            if ( Math.abs( interval ) > 1 && ( dateObject.month < originalDateObject.month || dateObject.month > originalDateObject.month ) ) {
                dateObject = originalDateObject
                interval = interval > 0 ? 1 : -1
            }


            // If we’ve reached the min/max limit, reverse the direction, flatten the interval and set it to the limit.
            if ( dateObject.pick <= minLimitObject.pick ) {
                reachedMin = true
                interval = 1
                dateObject = calendar.create([
                    minLimitObject.year,
                    minLimitObject.month,
                    minLimitObject.date + (dateObject.pick === minLimitObject.pick ? 0 : -1)
                ])
            }
            else if ( dateObject.pick >= maxLimitObject.pick ) {
                reachedMax = true
                interval = -1
                dateObject = calendar.create([
                    maxLimitObject.year,
                    maxLimitObject.month,
                    maxLimitObject.date + (dateObject.pick === maxLimitObject.pick ? 0 : 1)
                ])
            }


            // If we’ve reached both limits, just break out of the loop.
            if ( reachedMin && reachedMax ) {
                break
            }


            // Finally, create the shifted date using the interval and keep looping.
            dateObject = calendar.create([ dateObject.year, dateObject.month, dateObject.date + interval ])
        }

    } //endif


    // Return the date object settled on.
    return dateObject
} //DatePicker.prototype.validate


/**
 * Check if a date is disabled.
 */
DatePicker.prototype.disabled = function( dateToVerify ) {

    var
        calendar = this,

        // Filter through the disabled dates to check if this is one.
        isDisabledMatch = calendar.item.disable.filter( function( dateToDisable ) {

            // If the date is a number, match the weekday with 0index and `firstDay` check.
            if ( _.isInteger( dateToDisable ) ) {
                return dateToVerify.day === ( calendar.settings.firstDay ? dateToDisable : dateToDisable - 1 ) % 7
            }

            // If it’s an array or a native JS date, create and match the exact date.
            if ( $.isArray( dateToDisable ) || _.isDate( dateToDisable ) ) {
                return dateToVerify.pick === calendar.create( dateToDisable ).pick
            }

            // If it’s an object, match a date within the “from” and “to” range.
            if ( $.isPlainObject( dateToDisable ) ) {
                return calendar.withinRange( dateToDisable, dateToVerify )
            }
        })

    // If this date matches a disabled date, confirm it’s not inverted.
    isDisabledMatch = isDisabledMatch.length && !isDisabledMatch.filter(function( dateToDisable ) {
        return $.isArray( dateToDisable ) && dateToDisable[3] == 'inverted' ||
            $.isPlainObject( dateToDisable ) && dateToDisable.inverted
    }).length

    // Check the calendar “enabled” flag and respectively flip the
    // disabled state. Then also check if it’s beyond the min/max limits.
    return calendar.item.enable === -1 ? !isDisabledMatch : isDisabledMatch ||
        dateToVerify.pick < calendar.item.min.pick ||
        dateToVerify.pick > calendar.item.max.pick

} //DatePicker.prototype.disabled


/**
 * Parse a string into a usable type.
 */
DatePicker.prototype.parse = function( type, value, options ) {

    var calendar = this,
        parsingObject = {}

    // If it’s already parsed, we’re good.
    if ( !value || typeof value != 'string' ) {
        return value
    }

    // We need a `.format` to parse the value with.
    if ( !( options && options.format ) ) {
        options = options || {}
        options.format = calendar.settings.format
    }

    // Convert the format into an array and then map through it.
    calendar.formats.toArray( options.format ).map( function( label ) {

        var
            // Grab the formatting label.
            formattingLabel = calendar.formats[ label ],

            // The format length is from the formatting label function or the
            // label length without the escaping exclamation (!) mark.
            formatLength = formattingLabel ? _.trigger( formattingLabel, calendar, [ value, parsingObject ] ) : label.replace( /^!/, '' ).length

        // If there's a format label, split the value up to the format length.
        // Then add it to the parsing object with appropriate label.
        if ( formattingLabel ) {
            parsingObject[ label ] = value.substr( 0, formatLength )
        }

        // Update the value as the substring from format length to end.
        value = value.substr( formatLength )
    })

    // Compensate for month 0index.
    return [
        parsingObject.yyyy || parsingObject.yy,
        +( parsingObject.mm || parsingObject.m ) - 1,
        parsingObject.dd || parsingObject.d
    ]
} //DatePicker.prototype.parse


/**
 * Various formats to display the object in.
 */
DatePicker.prototype.formats = (function() {

    // Return the length of the first word in a collection.
    function getWordLengthFromCollection( string, collection, dateObject ) {

        // Grab the first word from the string.
        var word = string.match( /\w+/ )[ 0 ]

        // If there's no month index, add it to the date object
        if ( !dateObject.mm && !dateObject.m ) {
            dateObject.m = collection.indexOf( word ) + 1
        }

        // Return the length of the word.
        return word.length
    }

    // Get the length of the first word in a string.
    function getFirstWordLength( string ) {
        return string.match( /\w+/ )[ 0 ].length
    }

    return {

        d: function( string, dateObject ) {

            // If there's string, then get the digits length.
            // Otherwise return the selected date.
            return string ? _.digits( string ) : dateObject.date
        },
        dd: function( string, dateObject ) {

            // If there's a string, then the length is always 2.
            // Otherwise return the selected date with a leading zero.
            return string ? 2 : _.lead( dateObject.date )
        },
        ddd: function( string, dateObject ) {

            // If there's a string, then get the length of the first word.
            // Otherwise return the short selected weekday.
            return string ? getFirstWordLength( string ) : this.settings.weekdaysShort[ dateObject.day ]
        },
        dddd: function( string, dateObject ) {

            // If there's a string, then get the length of the first word.
            // Otherwise return the full selected weekday.
            return string ? getFirstWordLength( string ) : this.settings.weekdaysFull[ dateObject.day ]
        },
        m: function( string, dateObject ) {

            // If there's a string, then get the length of the digits
            // Otherwise return the selected month with 0index compensation.
            return string ? _.digits( string ) : dateObject.month + 1
        },
        mm: function( string, dateObject ) {

            // If there's a string, then the length is always 2.
            // Otherwise return the selected month with 0index and leading zero.
            return string ? 2 : _.lead( dateObject.month + 1 )
        },
        mmm: function( string, dateObject ) {

            var collection = this.settings.monthsShort

            // If there's a string, get length of the relevant month from the short
            // months collection. Otherwise return the selected month from that collection.
            return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
        },
        mmmm: function( string, dateObject ) {

            var collection = this.settings.monthsFull

            // If there's a string, get length of the relevant month from the full
            // months collection. Otherwise return the selected month from that collection.
            return string ? getWordLengthFromCollection( string, collection, dateObject ) : collection[ dateObject.month ]
        },
        yy: function( string, dateObject ) {

            // If there's a string, then the length is always 2.
            // Otherwise return the selected year by slicing out the first 2 digits.
            return string ? 2 : ( '' + dateObject.year ).slice( 2 )
        },
        yyyy: function( string, dateObject ) {

            // If there's a string, then the length is always 4.
            // Otherwise return the selected year.
            return string ? 4 : dateObject.year
        },

        // Create an array by splitting the formatting string passed.
        toArray: function( formatString ) { return formatString.split( /(d{1,4}|m{1,4}|y{4}|yy|!.)/g ) },

        // Format an object into a string using the formatting options.
        toString: function ( formatString, itemObject ) {
            var calendar = this
            return calendar.formats.toArray( formatString ).map( function( label ) {
                return _.trigger( calendar.formats[ label ], calendar, [ 0, itemObject ] ) || label.replace( /^!/, '' )
            }).join( '' )
        }
    }
})() //DatePicker.prototype.formats




/**
 * Check if two date units are the exact.
 */
DatePicker.prototype.isDateExact = function( one, two ) {

    var calendar = this

    // When we’re working with weekdays, do a direct comparison.
    if (
        ( _.isInteger( one ) && _.isInteger( two ) ) ||
        ( typeof one == 'boolean' && typeof two == 'boolean' )
     ) {
        return one === two
    }

    // When we’re working with date representations, compare the “pick” value.
    if (
        ( _.isDate( one ) || $.isArray( one ) ) &&
        ( _.isDate( two ) || $.isArray( two ) )
    ) {
        return calendar.create( one ).pick === calendar.create( two ).pick
    }

    // When we’re working with range objects, compare the “from” and “to”.
    if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
        return calendar.isDateExact( one.from, two.from ) && calendar.isDateExact( one.to, two.to )
    }

    return false
}


/**
 * Check if two date units overlap.
 */
DatePicker.prototype.isDateOverlap = function( one, two ) {

    var calendar = this,
        firstDay = calendar.settings.firstDay ? 1 : 0

    // When we’re working with a weekday index, compare the days.
    if ( _.isInteger( one ) && ( _.isDate( two ) || $.isArray( two ) ) ) {
        one = one % 7 + firstDay
        return one === calendar.create( two ).day + 1
    }
    if ( _.isInteger( two ) && ( _.isDate( one ) || $.isArray( one ) ) ) {
        two = two % 7 + firstDay
        return two === calendar.create( one ).day + 1
    }

    // When we’re working with range objects, check if the ranges overlap.
    if ( $.isPlainObject( one ) && $.isPlainObject( two ) ) {
        return calendar.overlapRanges( one, two )
    }

    return false
}


/**
 * Flip the “enabled” state.
 */
DatePicker.prototype.flipEnable = function(val) {
    var itemObject = this.item
    itemObject.enable = val || (itemObject.enable == -1 ? 1 : -1)
}


/**
 * Mark a collection of dates as “disabled”.
 */
DatePicker.prototype.deactivate = function( type, datesToDisable ) {

    var calendar = this,
        disabledItems = calendar.item.disable.slice(0)


    // If we’re flipping, that’s all we need to do.
    if ( datesToDisable == 'flip' ) {
        calendar.flipEnable()
    }

    else if ( datesToDisable === false ) {
        calendar.flipEnable(1)
        disabledItems = []
    }

    else if ( datesToDisable === true ) {
        calendar.flipEnable(-1)
        disabledItems = []
    }

    // Otherwise go through the dates to disable.
    else {

        datesToDisable.map(function( unitToDisable ) {

            var matchFound

            // When we have disabled items, check for matches.
            // If something is matched, immediately break out.
            for ( var index = 0; index < disabledItems.length; index += 1 ) {
                if ( calendar.isDateExact( unitToDisable, disabledItems[index] ) ) {
                    matchFound = true
                    break
                }
            }

            // If nothing was found, add the validated unit to the collection.
            if ( !matchFound ) {
                if (
                    _.isInteger( unitToDisable ) ||
                    _.isDate( unitToDisable ) ||
                    $.isArray( unitToDisable ) ||
                    ( $.isPlainObject( unitToDisable ) && unitToDisable.from && unitToDisable.to )
                ) {
                    disabledItems.push( unitToDisable )
                }
            }
        })
    }

    // Return the updated collection.
    return disabledItems
} //DatePicker.prototype.deactivate


/**
 * Mark a collection of dates as “enabled”.
 */
DatePicker.prototype.activate = function( type, datesToEnable ) {

    var calendar = this,
        disabledItems = calendar.item.disable,
        disabledItemsCount = disabledItems.length

    // If we’re flipping, that’s all we need to do.
    if ( datesToEnable == 'flip' ) {
        calendar.flipEnable()
    }

    else if ( datesToEnable === true ) {
        calendar.flipEnable(1)
        disabledItems = []
    }

    else if ( datesToEnable === false ) {
        calendar.flipEnable(-1)
        disabledItems = []
    }

    // Otherwise go through the disabled dates.
    else {

        datesToEnable.map(function( unitToEnable ) {

            var matchFound,
                disabledUnit,
                index,
                isExactRange

            // Go through the disabled items and try to find a match.
            for ( index = 0; index < disabledItemsCount; index += 1 ) {

                disabledUnit = disabledItems[index]

                // When an exact match is found, remove it from the collection.
                if ( calendar.isDateExact( disabledUnit, unitToEnable ) ) {
                    matchFound = disabledItems[index] = null
                    isExactRange = true
                    break
                }

                // When an overlapped match is found, add the “inverted” state to it.
                else if ( calendar.isDateOverlap( disabledUnit, unitToEnable ) ) {
                    if ( $.isPlainObject( unitToEnable ) ) {
                        unitToEnable.inverted = true
                        matchFound = unitToEnable
                    }
                    else if ( $.isArray( unitToEnable ) ) {
                        matchFound = unitToEnable
                        if ( !matchFound[3] ) matchFound.push( 'inverted' )
                    }
                    else if ( _.isDate( unitToEnable ) ) {
                        matchFound = [ unitToEnable.getUTCFullYear(), unitToEnable.getUTCMonth(), unitToEnable.getUTCDate(), 'inverted' ]
                    }
                    break
                }
            }

            // If a match was found, remove a previous duplicate entry.
            if ( matchFound ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
                if ( calendar.isDateExact( disabledItems[index], unitToEnable ) ) {
                    disabledItems[index] = null
                    break
                }
            }

            // In the event that we’re dealing with an exact range of dates,
            // make sure there are no “inverted” dates because of it.
            if ( isExactRange ) for ( index = 0; index < disabledItemsCount; index += 1 ) {
                if ( calendar.isDateOverlap( disabledItems[index], unitToEnable ) ) {
                    disabledItems[index] = null
                    break
                }
            }

            // If something is still matched, add it into the collection.
            if ( matchFound ) {
                disabledItems.push( matchFound )
            }
        })
    }

    // Return the updated collection.
    return disabledItems.filter(function( val ) { return val != null })
} //DatePicker.prototype.activate


/**
 * Create a string for the nodes in the picker.
 */
DatePicker.prototype.nodes = function( isOpen ) {

    var
        calendar = this,
        settings = calendar.settings,
        calendarItem = calendar.item,
        nowObject = calendarItem.now,
        selectedObject = calendarItem.select,
        highlightedObject = calendarItem.highlight,
        viewsetObject = calendarItem.view,
        disabledCollection = calendarItem.disable,
        minLimitObject = calendarItem.min,
        maxLimitObject = calendarItem.max,


        // Create the calendar table head using a copy of weekday labels collection.
        // * We do a copy so we don't mutate the original array.
        tableHead = (function( collection, fullCollection ) {

            // If the first day should be Monday, move Sunday to the end.
            if ( settings.firstDay ) {
                collection.push( collection.shift() )
                fullCollection.push( fullCollection.shift() )
            }

            // Create and return the table head group.
            return _.node(
                'thead',
                _.node(
                    'tr',
                    _.group({
                        min: 0,
                        max: DAYS_IN_WEEK - 1,
                        i: 1,
                        node: 'th',
                        item: function( counter ) {
                            return [
                                collection[ counter ],
                                settings.klass.weekdays,
                                'scope=col title="' + fullCollection[ counter ] + '"'
                            ]
                        }
                    })
                )
            ) //endreturn
        })( ( settings.showWeekdaysFull ? settings.weekdaysFull : settings.weekdaysShort ).slice( 0 ), settings.weekdaysFull.slice( 0 ) ), //tableHead


        // Create the nav for next/prev month.
        createMonthNav = function( next ) {

            // Otherwise, return the created month tag.
            return _.node(
                'div',
                ' ',
                settings.klass[ 'nav' + ( next ? 'Next' : 'Prev' ) ] + (

                    // If the focused month is outside the range, disabled the button.
                    ( next && viewsetObject.year >= maxLimitObject.year && viewsetObject.month >= maxLimitObject.month ) ||
                    ( !next && viewsetObject.year <= minLimitObject.year && viewsetObject.month <= minLimitObject.month ) ?
                    ' ' + settings.klass.navDisabled : ''
                ),
                'data-nav=' + ( next || -1 ) + ' ' +
                _.ariaAttr({
                    role: 'button',
                    controls: calendar.$node[0].id + '_table'
                }) + ' ' +
                'title="' + (next ? settings.labelMonthNext : settings.labelMonthPrev ) + '"'
            ) //endreturn
        }, //createMonthNav


        // Create the month label.
        createMonthLabel = function() {

            var monthsCollection = settings.showMonthsShort ? settings.monthsShort : settings.monthsFull

            // If there are months to select, add a dropdown menu.
            if ( settings.selectMonths ) {

                return _.node( 'select',
                    _.group({
                        min: 0,
                        max: 11,
                        i: 1,
                        node: 'option',
                        item: function( loopedMonth ) {

                            return [

                                // The looped month and no classes.
                                monthsCollection[ loopedMonth ], 0,

                                // Set the value and selected index.
                                'value=' + loopedMonth +
                                ( viewsetObject.month == loopedMonth ? ' selected' : '' ) +
                                (
                                    (
                                        ( viewsetObject.year == minLimitObject.year && loopedMonth < minLimitObject.month ) ||
                                        ( viewsetObject.year == maxLimitObject.year && loopedMonth > maxLimitObject.month )
                                    ) ?
                                    ' disabled' : ''
                                )
                            ]
                        }
                    }),
                    settings.klass.selectMonth,
                    ( isOpen ? '' : 'disabled' ) + ' ' +
                    _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
                    'title="' + settings.labelMonthSelect + '"'
                )
            }

            // If there's a need for a month selector
            return _.node( 'div', monthsCollection[ viewsetObject.month ], settings.klass.month )
        }, //createMonthLabel


        // Create the year label.
        createYearLabel = function() {

            var focusedYear = viewsetObject.year,

            // If years selector is set to a literal "true", set it to 5. Otherwise
            // divide in half to get half before and half after focused year.
            numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )

            // If there are years to select, add a dropdown menu.
            if ( numberYears ) {

                var
                    minYear = minLimitObject.year,
                    maxYear = maxLimitObject.year,
                    lowestYear = focusedYear - numberYears,
                    highestYear = focusedYear + numberYears

                // If the min year is greater than the lowest year, increase the highest year
                // by the difference and set the lowest year to the min year.
                if ( minYear > lowestYear ) {
                    highestYear += minYear - lowestYear
                    lowestYear = minYear
                }

                // If the max year is less than the highest year, decrease the lowest year
                // by the lower of the two: available and needed years. Then set the
                // highest year to the max year.
                if ( maxYear < highestYear ) {

                    var availableYears = lowestYear - minYear,
                        neededYears = highestYear - maxYear

                    lowestYear -= availableYears > neededYears ? neededYears : availableYears
                    highestYear = maxYear
                }

                return _.node( 'select',
                    _.group({
                        min: lowestYear,
                        max: highestYear,
                        i: 1,
                        node: 'option',
                        item: function( loopedYear ) {
                            return [

                                // The looped year and no classes.
                                loopedYear, 0,

                                // Set the value and selected index.
                                'value=' + loopedYear + ( focusedYear == loopedYear ? ' selected' : '' )
                            ]
                        }
                    }),
                    settings.klass.selectYear,
                    ( isOpen ? '' : 'disabled' ) + ' ' + _.ariaAttr({ controls: calendar.$node[0].id + '_table' }) + ' ' +
                    'title="' + settings.labelYearSelect + '"'
                )
            }

            // Otherwise just return the year focused
            return _.node( 'div', focusedYear, settings.klass.year )
        } //createYearLabel


    // Create and return the entire calendar.
    return _.node(
        'div',
        ( settings.selectYears ? createYearLabel() + createMonthLabel() : createMonthLabel() + createYearLabel() ) +
        createMonthNav() + createMonthNav( 1 ),
        settings.klass.header
    ) + _.node(
        'table',
        tableHead +
        _.node(
            'tbody',
            _.group({
                min: 0,
                max: WEEKS_IN_CALENDAR - 1,
                i: 1,
                node: 'tr',
                item: function( rowCounter ) {

                    // If Monday is the first day and the month starts on Sunday, shift the date back a week.
                    var shiftDateBy = settings.firstDay && calendar.create([ viewsetObject.year, viewsetObject.month, 1 ]).day === 0 ? -7 : 0

                    return [
                        _.group({
                            min: DAYS_IN_WEEK * rowCounter - viewsetObject.day + shiftDateBy + 1, // Add 1 for weekday 0index
                            max: function() {
                                return this.min + DAYS_IN_WEEK - 1
                            },
                            i: 1,
                            node: 'td',
                            item: function( targetDate ) {

                                // Convert the time date from a relative date to a target date.
                                targetDate = calendar.create([ viewsetObject.year, viewsetObject.month, targetDate + ( settings.firstDay ? 1 : 0 ) ])

                                var isSelected = selectedObject && selectedObject.pick == targetDate.pick,
                                    isHighlighted = highlightedObject && highlightedObject.pick == targetDate.pick,
                                    isDisabled = disabledCollection && calendar.disabled( targetDate ) || targetDate.pick < minLimitObject.pick || targetDate.pick > maxLimitObject.pick

                                return [
                                    _.node(
                                        'div',
                                        targetDate.date,
                                        (function( klasses ) {

                                            // Add the `infocus` or `outfocus` classes based on month in view.
                                            klasses.push( viewsetObject.month == targetDate.month ? settings.klass.infocus : settings.klass.outfocus )

                                            // Add the `today` class if needed.
                                            if ( nowObject.pick == targetDate.pick ) {
                                                klasses.push( settings.klass.now )
                                            }

                                            // Add the `selected` class if something's selected and the time matches.
                                            if ( isSelected ) {
                                                klasses.push( settings.klass.selected )
                                            }

                                            // Add the `highlighted` class if something's highlighted and the time matches.
                                            if ( isHighlighted ) {
                                                klasses.push( settings.klass.highlighted )
                                            }

                                            // Add the `disabled` class if something's disabled and the object matches.
                                            if ( isDisabled ) {
                                                klasses.push( settings.klass.disabled )
                                            }

                                            return klasses.join( ' ' )
                                        })([ settings.klass.day ]),
                                        'data-pick=' + targetDate.pick + ' ' + _.ariaAttr({
                                            role: 'gridcell',
                                            selected: isSelected && calendar.$node.val() === _.trigger(
                                                    calendar.formats.toString,
                                                    calendar,
                                                    [ settings.format, targetDate ]
                                                ) ? true : null,
                                            activedescendant: isHighlighted ? true : null,
                                            disabled: isDisabled ? true : null
                                        })
                                    ),
                                    '',
                                    _.ariaAttr({ role: 'presentation' })
                                ] //endreturn
                            }
                        })
                    ] //endreturn
                }
            })
        ),
        settings.klass.table,
        'id="' + calendar.$node[0].id + '_table' + '" ' + _.ariaAttr({
            role: 'grid',
            controls: calendar.$node[0].id,
            readonly: true
        })
    ) +

    // * For Firefox forms to submit, make sure to set the buttons’ `type` attributes as “button”.
    _.node(
        'div',
        _.node( 'button', settings.today, settings.klass.buttonToday,
            'type=button data-pick=' + nowObject.pick +
            ( isOpen && !calendar.disabled(nowObject) ? '' : ' disabled' ) + ' ' +
            _.ariaAttr({ controls: calendar.$node[0].id }) ) +
        _.node( 'button', settings.clear, settings.klass.buttonClear,
            'type=button data-clear=1' +
            ( isOpen ? '' : ' disabled' ) + ' ' +
            _.ariaAttr({ controls: calendar.$node[0].id }) ) +
        _.node('button', settings.close, settings.klass.buttonClose,
            'type=button data-close=true ' +
            ( isOpen ? '' : ' disabled' ) + ' ' +
            _.ariaAttr({ controls: calendar.$node[0].id }) ),
        settings.klass.footer
    ) //endreturn
} //DatePicker.prototype.nodes




/**
 * The date picker defaults.
 */
DatePicker.defaults = (function( prefix ) {

    return {

        // The title label to use for the month nav buttons
        labelMonthNext: 'Next month',
        labelMonthPrev: 'Previous month',

        // The title label to use for the dropdown selectors
        labelMonthSelect: 'Select a month',
        labelYearSelect: 'Select a year',

        // Months and weekdays
        monthsFull: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
        monthsShort: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
        weekdaysFull: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ],
        weekdaysShort: [ 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ],

        // Today and clear
        today: 'Today',
        clear: 'Clear',
        close: 'Close',

        // The format to show on the `input` element
        format: 'd mmmm, yyyy',

        // Classes
        klass: {

            table: prefix + 'table',

            header: prefix + 'header',

            navPrev: prefix + 'nav--prev',
            navNext: prefix + 'nav--next',
            navDisabled: prefix + 'nav--disabled',

            month: prefix + 'month',
            year: prefix + 'year',

            selectMonth: prefix + 'select--month',
            selectYear: prefix + 'select--year',

            weekdays: prefix + 'weekday',

            day: prefix + 'day',
            disabled: prefix + 'day--disabled',
            selected: prefix + 'day--selected',
            highlighted: prefix + 'day--highlighted',
            now: prefix + 'day--today',
            infocus: prefix + 'day--infocus',
            outfocus: prefix + 'day--outfocus',

            footer: prefix + 'footer',

            buttonClear: prefix + 'button--clear',
            buttonToday: prefix + 'button--today',
            buttonClose: prefix + 'button--close'
        }
    }
})( Picker.klasses().picker + '__' )





/**
 * Extend the picker to add the date picker.
 */
Picker.extend( 'pickadate', DatePicker )


}));



;

/*jshint
   asi: true,
   unused: true,
   boss: true,
   loopfunc: true,
   eqnull: true
 */


/*!
 * Legacy browser support
 */


// Map array support
if ( ![].map ) {
    Array.prototype.map = function ( callback, self ) {
        var array = this, len = array.length, newArray = new Array( len )
        for ( var i = 0; i < len; i++ ) {
            if ( i in array ) {
                newArray[ i ] = callback.call( self, array[ i ], i, array )
            }
        }
        return newArray
    }
}


// Filter array support
if ( ![].filter ) {
    Array.prototype.filter = function( callback ) {
        if ( this == null ) throw new TypeError()
        var t = Object( this ), len = t.length >>> 0
        if ( typeof callback != 'function' ) throw new TypeError()
        var newArray = [], thisp = arguments[ 1 ]
        for ( var i = 0; i < len; i++ ) {
          if ( i in t ) {
            var val = t[ i ]
            if ( callback.call( thisp, val, i, t ) ) newArray.push( val )
          }
        }
        return newArray
    }
}


// Index of array support
if ( ![].indexOf ) {
    Array.prototype.indexOf = function( searchElement ) {
        if ( this == null ) throw new TypeError()
        var t = Object( this ), len = t.length >>> 0
        if ( len === 0 ) return -1
        var n = 0
        if ( arguments.length > 1 ) {
            n = Number( arguments[ 1 ] )
            if ( n != n ) {
                n = 0
            }
            else if ( n !== 0 && n != Infinity && n != -Infinity ) {
                n = ( n > 0 || -1 ) * Math.floor( Math.abs( n ) )
            }
        }
        if ( n >= len ) return -1
        var k = n >= 0 ? n : Math.max( len - Math.abs( n ), 0 )
        for ( ; k < len; k++ ) {
            if ( k in t && t[ k ] === searchElement ) return k
        }
        return -1
    }
}


/*!
 * Cross-Browser Split 1.1.1
 * Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
 * Available under the MIT License
 * http://blog.stevenlevithan.com/archives/cross-browser-split
 */
var nativeSplit = String.prototype.split, compliantExecNpcg = /()??/.exec('')[1] === undefined
String.prototype.split = function(separator, limit) {
    var str = this
    if (Object.prototype.toString.call(separator) !== '[object RegExp]') {
        return nativeSplit.call(str, separator, limit)
    }
    var output = [],
        flags = (separator.ignoreCase ? 'i' : '') +
                (separator.multiline  ? 'm' : '') +
                (separator.extended   ? 'x' : '') +
                (separator.sticky     ? 'y' : ''),
        lastLastIndex = 0,
        separator2, match, lastIndex, lastLength
    separator = new RegExp(separator.source, flags + 'g')
    str += ''
    if (!compliantExecNpcg) {
        separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags)
    }
    limit = limit === undefined ? -1 >>> 0 : limit >>> 0
    while (match = separator.exec(str)) {
        lastIndex = match.index + match[0].length
        if (lastIndex > lastLastIndex) {
            output.push(str.slice(lastLastIndex, match.index))
            if (!compliantExecNpcg && match.length > 1) {
                match[0].replace(separator2, function () {
                    for (var i = 1; i < arguments.length - 2; i++) {
                        if (arguments[i] === undefined) {
                            match[i] = undefined
                        }
                    }
                })
            }
            if (match.length > 1 && match.index < str.length) {
                Array.prototype.push.apply(output, match.slice(1))
            }
            lastLength = match[0].length
            lastLastIndex = lastIndex
            if (output.length >= limit) {
                break
            }
        }
        if (separator.lastIndex === match.index) {
            separator.lastIndex++
        }
    }
    if (lastLastIndex === str.length) {
        if (lastLength || !separator.test('')) {
            output.push('')
        }
    } else {
        output.push(str.slice(lastLastIndex))
    }
    return output.length > limit ? output.slice(0, limit) : output
};
;
$(document).ready(function () {
    $("#searchForm").unbind("submit").on("submit", function (evt) {
        evt.stopPropagation();
        evt.preventDefault();

        var inputVal = $('#findDealerSearchField').val();
        var currentLocationVal = $('#findDealerCurrentLocation').val();
        var itemID = $('input[name=findADealerItemID]').val();
        var servicesChecked = getCheckedServices();

        $.ajax({
                url: "/api/Honda/FindADealer/Search",
                type: "GET",
                data: {
                    searchText: currentLocationVal || inputVal,
                    findADealerItemID: itemID,
                    servicesFilter: servicesChecked
                },
                traditional: true
            })
            .done(function(partialViewResult) {
                $("#dealerResults").html(partialViewResult);
                $('#findDealerSearchField').toggleClass("error", false);
                HONDA.tabs.init();
                HONDA.findDealer.init();
                HONDA.resultsListMap.init();
            })
            .fail(function (error) {
                var inputField = $('#findDealerSearchField');
                inputField.attr("placeholder", inputField.attr("data-error"));
                inputField.val("");
                inputField.toggleClass("error", true);
            });
    });
});


function getCheckedServices() {
    var checkServices = [];

    $('input[name=dealerTypes]').each(function () {
        if ($(this).prop("checked")) {
            checkServices.push($(this)[0].id);
        }
    });
    return checkServices;
}
;

$(document).ready(function () {
    $("#cookiesConfirm").click(function (event) {
        event.preventDefault();
        $.ajax({
            url: "/api/Honda/CookieAlert/SetCookie",
            type: "GET",
            error: function () {
                alert("An error occured when adding cookie");
            },
            success: function () {
                $(".cookiesAlert").slideToggle();
            }
        });
    });
});
;
var $j = jQuery.noConflict();
var $ = jQuery.noConflict();;
(function (a) {
    a.extend(a.fn, {
        validate: function (b) {
            if (!this.length) {
                b && b.debug && window.console && console.warn("nothing selected, can't validate, returning nothing");
                return false;
            }
            var c = a.data(this[0], "validator");
            return c ? c : (this.attr("novalidate", "novalidate"), c = new a.validator(b, this[0]), a.data(this[0], "validator", c), c.settings.onsubmit && (this.validateDelegate(":submit", "click", function (b) {
                c.settings.submitHandler && (c.submitButton = b.target), a(b.target).hasClass("cancel") && (c.cancelSubmit = !0);
            }), this.submit(function (b) {

                function d() {
                    var d;
                    return c.settings.submitHandler ? (c.submitButton && (d = a("<input type='hidden'/>").attr("name", c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)), c.settings.submitHandler.call(c, c.currentForm, b), c.submitButton && d.remove(), !1) : !0;
                }

                return c.settings.debug && b.preventDefault(), c.cancelSubmit ? (c.cancelSubmit = !1, d()) : c.form() ? c.pendingRequest ? (c.formSubmitted = !0, !1) : d() : (c.focusInvalid(), !1);
            })), c);
        },
        valid: function () {
            if (a(this[0]).is("form")) return this.validate().form();
            var b = !0,
                c = a(this[0].form).validate();
            return this.each(function () {
                b &= c.element(this);
            }), b;
        },
        removeAttrs: function (b) {
            var c = {},
                d = this;
            return a.each(b.split(/\s/), function (a, b) {
                c[b] = d.attr(b), d.removeAttr(b);
            }), c;
        },
        rules: function (b, c) {
            var d = this[0];
            if (b) {
                var e = a.data(d.form, "validator").settings,
                    f = e.rules,
                    g = a.validator.staticRules(d);
                switch (b) {
                    case "add":
                        a.extend(g, a.validator.normalizeRule(c)), f[d.name] = g, c.messages && (e.messages[d.name] = a.extend(e.messages[d.name], c.messages));
                        break;
                    case "remove":
                        if (!c) return delete f[d.name], g;
                        var h = {};
                        return a.each(c.split(/\s/), function (a, b) {
                            h[b] = g[b], delete g[b];
                        }), h;
                }
            }
            var i = a.validator.normalizeRules(a.extend({}, a.validator.metadataRules(d), a.validator.classRules(d), a.validator.attributeRules(d), a.validator.staticRules(d)), d);
            if (i.required) {
                var j = i.required;
                delete i.required, i = a.extend({
                    required: j
                }, i);
            }
            return i;
        }
    }), a.extend(a.expr[":"], {
        blank: function (b) {
            return !a.trim("" + b.value);
        },
        filled: function (b) {
            return !!a.trim("" + b.value);
        },
        unchecked: function (a) {
            return !a.checked;
        }
    }), a.validator = function (b, c) {
        this.settings = a.extend(!0, {}, a.validator.defaults, b), this.currentForm = c, this.init();
    }, a.validator.format = function (b, c) {
        return arguments.length === 1 ? function () {
            var c = a.makeArray(arguments);
            return c.unshift(b), a.validator.format.apply(this, c);
        } : (arguments.length > 2 && c.constructor !== Array && (c = a.makeArray(arguments).slice(1)), c.constructor !== Array && (c = [c]), a.each(c, function (a, c) {
            b = b.replace(new RegExp("\\{" + a + "\\}", "g"), c);
        }), b);
    }, a.extend(a.validator, {
        defaults: {
            messages: {},
            groups: {},
            rules: {},
            errorClass: "error",
            validClass: "valid",
            errorElement: "label",
            focusInvalid: !0,
            errorContainer: a([]),
            errorLabelContainer: a([]),
            onsubmit: !0,
            ignore: ":hidden",
            ignoreTitle: !1,
            onfocusin: function (a, b) {
                this.lastActive = a, this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, a, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(a)).hide());
            },
            onfocusout: function (a, b) {
                !this.checkable(a) && (a.name in this.submitted || !this.optional(a)) && this.element(a);
            },
            onkeyup: function (a, b) {
                if (b.which === 9 && this.elementValue(a) === "") return;
                (a.name in this.submitted || a === this.lastActive) && this.element(a);
            },
            onclick: function (a, b) {
                a.name in this.submitted ? this.element(a) : a.parentNode.name in this.submitted && this.element(a.parentNode);
            },
            highlight: function (b, c, d) {
                b.type === "radio" ? this.findByName(b.name).addClass(c).removeClass(d) : a(b).addClass(c).removeClass(d);
            },
            unhighlight: function (b, c, d) {
                b.type === "radio" ? this.findByName(b.name).removeClass(c).addClass(d) : a(b).removeClass(c).addClass(d);
            }
        },
        setDefaults: function (b) {
            a.extend(a.validator.defaults, b);
        },
        messages: {
            required: "This field is required.",
            remote: "Please fix this field.",
            email: "Please enter a valid email address.",
            url: "Please enter a valid URL.",
            date: "Please enter a valid date.",
            dateISO: "Please enter a valid date (ISO).",
            number: "Please enter a valid number.",
            digits: "Please enter only digits.",
            creditcard: "Please enter a valid credit card number.",
            equalTo: "Please enter the same value again.",
            maxlength: a.validator.format("Please enter no more than {0} characters."),
            minlength: a.validator.format("Please enter at least {0} characters."),
            rangelength: a.validator.format("Please enter a value between {0} and {1} characters long."),
            range: a.validator.format("Please enter a value between {0} and {1}."),
            max: a.validator.format("Please enter a value less than or equal to {0}."),
            min: a.validator.format("Please enter a value greater than or equal to {0}.")
        },
        autoCreateRanges: !1,
        prototype: {
            init: function () {

                function d(b) {
                    var c = a.data(this[0].form, "validator"),
                        d = "on" + b.type.replace(/^validate/, "");
                    c.settings[d] && c.settings[d].call(c, this[0], b);
                }

                this.labelContainer = a(this.settings.errorLabelContainer), this.errorContext = this.labelContainer.length && this.labelContainer || a(this.currentForm), this.containers = a(this.settings.errorContainer).add(this.settings.errorLabelContainer), this.submitted = {}, this.valueCache = {}, this.pendingRequest = 0, this.pending = {}, this.invalid = {}, this.reset();
                var b = this.groups = {};
                a.each(this.settings.groups, function (c, d) {
                    a.each(d.split(/\s/), function (a, d) {
                        b[d] = c;
                    });
                });
                var c = this.settings.rules;
                a.each(c, function (b, d) {
                    c[b] = a.validator.normalizeRule(d);
                }), a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", d).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", d), this.settings.invalidHandler && a(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler);
            },
            form: function () {
                return this.checkForm(), a.extend(this.submitted, this.errorMap), this.invalid = a.extend({}, this.errorMap), this.valid() || a(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid();
            },
            checkForm: function () {
                this.prepareForm();
                for (var a = 0, b = this.currentElements = this.elements() ; b[a]; a++) this.check(b[a]);
                return this.valid();
            },
            element: function (b) {
                b = this.validationTargetFor(this.clean(b)), this.lastElement = b, this.prepareElement(b), this.currentElements = a(b);
                var c = this.check(b) !== !1;
                return c ? delete this.invalid[b.name] : this.invalid[b.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), c;
            },
            showErrors: function (b) {
                if (b) {
                    a.extend(this.errorMap, b), this.errorList = [];
                    for (var c in b)
                        this.errorList.push({
                            message: b[c],
                            element: this.findByName(c)[0]
                        });
                    this.successList = a.grep(this.successList, function (a) {
                        return !(a.name in b);
                    });
                }
                this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors();
            },
            resetForm: function () {
                a.fn.resetForm && a(this.currentForm).resetForm(), this.submitted = {}, this.lastElement = null, this.prepareForm(), this.hideErrors(), this.elements().removeClass(this.settings.errorClass).removeData("previousValue");
            },
            numberOfInvalids: function () {
                return this.objectLength(this.invalid);
            },
            objectLength: function (a) {
                var b = 0;
                for (var c in a) b++;
                return b;
            },
            hideErrors: function () {
                this.addWrapper(this.toHide).hide();
            },
            valid: function () {
                return this.size() === 0;
            },
            size: function () {
                return this.errorList.length;
            },
            focusInvalid: function () {
                if (this.settings.focusInvalid)
                    try {
                        a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin");
                    } catch (b) {
                    }
            },
            findLastActive: function () {
                var b = this.lastActive;
                return b && a.grep(this.errorList, function (a) {
                    return a.element.name === b.name;
                }).length === 1 && b;
            },
            elements: function () {
                var b = this;
                var names = {};
                var filter = function () {
                    var $this = a(this);
                    var isNameInvalid = !this.name && b.settings.debug && window.console && console.error("%o has no name assigned", this);
                    return isNameInvalid, this.name in names || !b.objectLength($this.rules()) ? !1 : (names[this.name] = !0, !0);
                };
                var currentForm = this.currentForm;
                var $currentForm = a(currentForm);
                var $elements = $currentForm
                    .find("input, select, textarea")
                    .not(":submit, :reset, :image, [disabled]")
                    .not(this.settings.ignore)
                    .filter(filter)
                    ;
                return $elements;
            },
            clean: function (b) {
                return a(b)[0];
            },
            errors: function () {
                var b = this.settings.errorClass.replace(" ", ".");
                return a(this.settings.errorElement + "." + b, this.errorContext);
            },
            reset: function () {
                this.successList = [], this.errorList = [], this.errorMap = {}, this.toShow = a([]), this.toHide = a([]), this.currentElements = a([]);
            },
            prepareForm: function () {
                this.reset(), this.toHide = this.errors().add(this.containers);
            },
            prepareElement: function (a) {
                this.reset(), this.toHide = this.errorsFor(a);
            },
            elementValue: function (b) {
                var c = a(b).attr("type"),
                    d = a(b).val();
                return c === "radio" || c === "checkbox" ? a('input[name="' + a(b).attr("name") + '"]:checked').val() : typeof d == "string" ? d.replace(/\r/g, "") : d;
            },
            check: function (b) {
                b = this.validationTargetFor(this.clean(b));
                var c = a(b).rules(),
                    d = !1,
                    e = this.elementValue(b),
                    f;
                for (var g in c) {
                    var h = {
                        method: g,
                        parameters: c[g]
                    };
                    try {
                        f = a.validator.methods[g].call(this, e, b, h.parameters);
                        if (f === "dependency-mismatch") {
                            d = !0;
                            continue;
                        }
                        d = !1;
                        if (f === "pending") {
                            this.toHide = this.toHide.not(this.errorsFor(b));
                            return;
                        }
                        if (!f) return this.formatAndAdd(b, h), !1;
                    } catch (i) {
                        throw this.settings.debug && window.console && console.log("exception occured when checking element " + b.id + ", check the '" + h.method + "' method", i), i;
                    }
                }
                if (d) return;
                return this.objectLength(c) && this.successList.push(b), !0;
            },
            customMetaMessage: function (b, c) {
                if (!a.metadata) return;
                var d = this.settings.meta ? a(b).metadata()[this.settings.meta] : a(b).metadata();
                return d && d.messages && d.messages[c];
            },
            customDataMessage: function (b, c) {
                return a(b).data("msg-" + c.toLowerCase()) || b.attributes && a(b).attr("data-msg-" + c.toLowerCase());
            },
            customMessage: function (a, b) {
                var c = this.settings.messages[a];
                return c && (c.constructor === String ? c : c[b]);
            },
            findDefined: function () {
                for (var a = 0; a < arguments.length; a++)
                    if (arguments[a] !== undefined) return arguments[a];
                return undefined;
            },
            defaultMessage: function (b, c) {
                return this.findDefined(this.customMessage(b.name, c), this.customDataMessage(b, c), this.customMetaMessage(b, c), !this.settings.ignoreTitle && b.title || undefined, a.validator.messages[c], "<strong>Warning: No message defined for " + b.name + "</strong>");
            },
            formatAndAdd: function (b, c) {
                var d = this.defaultMessage(b, c.method),
                    e = /\$?\{(\d+)\}/g;
                typeof d == "function" ? d = d.call(this, c.parameters, b) : e.test(d) && (d = a.validator.format(d.replace(e, "{$1}"), c.parameters)), this.errorList.push({
                    message: d,
                    element: b
                }), this.errorMap[b.name] = d, this.submitted[b.name] = d;
            },
            addWrapper: function (a) {
                return this.settings.wrapper && (a = a.add(a.parent(this.settings.wrapper))), a;
            },
            defaultShowErrors: function () {
                var a, b;
                for (a = 0; this.errorList[a]; a++) {
                    var c = this.errorList[a];
                    this.settings.highlight && this.settings.highlight.call(this, c.element, this.settings.errorClass, this.settings.validClass), this.showLabel(c.element, c.message);
                }
                this.errorList.length && (this.toShow = this.toShow.add(this.containers));
                if (this.settings.success)
                    for (a = 0; this.successList[a]; a++) this.showLabel(this.successList[a]);
                if (this.settings.unhighlight)
                    for (a = 0, b = this.validElements() ; b[a]; a++) this.settings.unhighlight.call(this, b[a], this.settings.errorClass, this.settings.validClass);
                this.toHide = this.toHide.not(this.toShow), this.hideErrors(), this.addWrapper(this.toShow).show();
            },
            validElements: function () {
                return this.currentElements.not(this.invalidElements());
            },
            invalidElements: function () {
                return a(this.errorList).map(function () {
                    return this.element;
                });
            },
            showLabel: function (b, c) {
                var d = this.errorsFor(b);
                d.length ? (d.removeClass(this.settings.validClass).addClass(this.settings.errorClass), d.attr("generated") && d.html(c)) : (d = a("<" + this.settings.errorElement + "/>").attr({
                    "for": this.idOrName(b),
                    generated: !0
                }).addClass(this.settings.errorClass).html(c || ""), this.settings.wrapper && (d = d.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.append(d).length || (this.settings.errorPlacement ? this.settings.errorPlacement(d, a(b)) : d.insertAfter(b))), !c && this.settings.success && (d.text(""), typeof this.settings.success == "string" ? d.addClass(this.settings.success) : this.settings.success(d, b)), this.toShow = this.toShow.add(d);
            },
            errorsFor: function (b) {
                var c = this.idOrName(b);
                return this.errors().filter(function () {
                    return a(this).attr("for") === c;
                });
            },
            idOrName: function (a) {
                return this.groups[a.name] || (this.checkable(a) ? a.name : a.id || a.name);
            },
            validationTargetFor: function (a) {
                return this.checkable(a) && (a = this.findByName(a.name).not(this.settings.ignore)[0]), a;
            },
            checkable: function (a) {
                return /radio|checkbox/i.test(a.type);
            },
            findByName: function (b) {
                return a(this.currentForm).find('[name="' + b + '"]');
            },
            getLength: function (b, c) {
                switch (c.nodeName.toLowerCase()) {
                    case "select":
                        return a("option:selected", c).length;
                    case "input":
                        if (this.checkable(c)) return this.findByName(c.name).filter(":checked").length;
                }
                return b.length;
            },
            depend: function (a, b) {
                return this.dependTypes[typeof a] ? this.dependTypes[typeof a](a, b) : !0;
            },
            dependTypes: {
                "boolean": function (a, b) {
                    return a;
                },
                string: function (b, c) {
                    return !!a(b, c.form).length;
                },
                "function": function (a, b) {
                    return a(b);
                }
            },
            optional: function (b) {
                var c = this.elementValue(b);
                return !a.validator.methods.required.call(this, c, b) && "dependency-mismatch";
            },
            startRequest: function (a) {
                this.pending[a.name] || (this.pendingRequest++, this.pending[a.name] = !0);
            },
            stopRequest: function (b, c) {
                this.pendingRequest--, this.pendingRequest < 0 && (this.pendingRequest = 0), delete this.pending[b.name], c && this.pendingRequest === 0 && this.formSubmitted && this.form() ? (a(this.currentForm).submit(), this.formSubmitted = !1) : !c && this.pendingRequest === 0 && this.formSubmitted && (a(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1);
            },
            previousValue: function (b) {
                return a.data(b, "previousValue") || a.data(b, "previousValue", {
                    old: null,
                    valid: !0,
                    message: this.defaultMessage(b, "remote")
                });
            }
        },
        classRuleSettings: {
            required: {
                required: !0
            },
            email: {
                email: !0
            },
            url: {
                url: !0
            },
            date: {
                date: !0
            },
            dateISO: {
                dateISO: !0
            },
            number: {
                number: !0
            },
            digits: {
                digits: !0
            },
            creditcard: {
                creditcard: !0
            }
        },
        addClassRules: function (b, c) {
            b.constructor === String ? this.classRuleSettings[b] = c : a.extend(this.classRuleSettings, b);
        },
        classRules: function (b) {
            var c = {},
                d = a(b).attr("class");
            return d && a.each(d.split(" "), function () {
                this in a.validator.classRuleSettings && a.extend(c, a.validator.classRuleSettings[this]);
            }), c;
        },
        attributeRules: function (b) {
            var c = {},
                d = a(b);
            for (var e in a.validator.methods) {
                var f;
                e === "required" ? (f = d.get(0).getAttribute(e), f === "" && (f = !0), f = !!f) : f = d.attr(e), f ? c[e] = f : d[0].getAttribute("type") === e && (c[e] = !0);
            }
            return c.maxlength && /-1|2147483647|524288/.test(c.maxlength) && delete c.maxlength, c;
        },
        metadataRules: function (b) {
            if (!a.metadata) return {};
            var c = a.data(b.form, "validator").settings.meta;
            return c ? a(b).metadata()[c] : a(b).metadata();
        },
        staticRules: function (b) {
            var c = {},
                d = a.data(b.form, "validator");
            return d.settings.rules && (c = a.validator.normalizeRule(d.settings.rules[b.name]) || {}), c;
        },
        normalizeRules: function (b, c) {
            return a.each(b, function (d, e) {
                if (e === !1) {
                    delete b[d];
                    return;
                }
                if (e.param || e.depends) {
                    var f = !0;
                    switch (typeof e.depends) {
                        case "string":
                            f = !!a(e.depends, c.form).length;
                            break;
                        case "function":
                            f = e.depends.call(c, c);
                    }
                    f ? b[d] = e.param !== undefined ? e.param : !0 : delete b[d];
                }
            }), a.each(b, function (d, e) {
                b[d] = a.isFunction(e) ? e(c) : e;
            }), a.each(["minlength", "maxlength", "min", "max"], function () {
                b[this] && (b[this] = Number(b[this]));
            }), a.each(["rangelength", "range"], function () {
                b[this] && (b[this] = [Number(b[this][0]), Number(b[this][1])]);
            }), a.validator.autoCreateRanges && (b.min && b.max && (b.range = [b.min, b.max], delete b.min, delete b.max), b.minlength && b.maxlength && (b.rangelength = [b.minlength, b.maxlength], delete b.minlength, delete b.maxlength)), b.messages && delete b.messages, b;
        },
        normalizeRule: function (b) {
            if (typeof b == "string") {
                var c = {};
                a.each(b.split(/\s/), function () {
                    c[this] = !0;
                }), b = c;
            }
            return b;
        },
        addMethod: function (b, c, d) {
            a.validator.methods[b] = c, a.validator.messages[b] = d !== undefined ? d : a.validator.messages[b], c.length < 3 && a.validator.addClassRules(b, a.validator.normalizeRule(b));
        },
        methods: {
            required: function (b, c, d) {
                if (!this.depend(d, c)) return "dependency-mismatch";
                if (c.nodeName.toLowerCase() === "select") {
                    var e = a(c).val();
                    return e && e.length > 0;
                }
                return this.checkable(c) ? this.getLength(b, c) > 0 : a.trim(b).length > 0;
            },
            remote: function (b, c, d) {
                if (this.optional(c)) return "dependency-mismatch";
                var e = this.previousValue(c);
                this.settings.messages[c.name] || (this.settings.messages[c.name] = {}), e.originalMessage = this.settings.messages[c.name].remote, this.settings.messages[c.name].remote = e.message, d = typeof d == "string" && {
                    url: d
                } || d;
                if (this.pending[c.name]) return "pending";
                if (e.old === b) return e.valid;
                e.old = b;
                var f = this;
                this.startRequest(c);
                var g = {};
                return g[c.name] = b, a.ajax(a.extend(!0, {
                    url: d,
                    mode: "abort",
                    port: "validate" + c.name,
                    dataType: "json",
                    data: g,
                    success: function (d) {
                        f.settings.messages[c.name].remote = e.originalMessage;
                        var g = d === !0 || d === "true";
                        if (g) {
                            var h = f.formSubmitted;
                            f.prepareElement(c), f.formSubmitted = h, f.successList.push(c), delete f.invalid[c.name], f.showErrors();
                        } else {
                            var i = {},
                                j = d || f.defaultMessage(c, "remote");
                            i[c.name] = e.message = a.isFunction(j) ? j(b) : j, f.invalid[c.name] = !0, f.showErrors(i);
                        }
                        e.valid = g, f.stopRequest(c, g);
                    }
                }, d)), "pending";
            },
            minlength: function (b, c, d) {
                var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c);
                return this.optional(c) || e >= d;
            },
            maxlength: function (b, c, d) {
                var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c);
                return this.optional(c) || e <= d;
            },
            rangelength: function (b, c, d) {
                var e = a.isArray(b) ? b.length : this.getLength(a.trim(b), c);
                return this.optional(c) || e >= d[0] && e <= d[1];
            },
            min: function (a, b, c) {
                return this.optional(b) || a >= c;
            },
            max: function (a, b, c) {
                return this.optional(b) || a <= c;
            },
            range: function (a, b, c) {
                return this.optional(b) || a >= c[0] && a <= c[1];
            },
            email: function (a, b) {
                return this.optional(b) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a);
            },
            url: function (a, b) {
                return this.optional(b) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a);
            },
            date: function (a, b) {
                return this.optional(b) || !/Invalid|NaN/.test(new Date(a));
            },
            dateISO: function (a, b) {
                return this.optional(b) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a);
            },
            number: function (a, b) {
                return this.optional(b) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a);
            },
            digits: function (a, b) {
                return this.optional(b) || /^\d+$/.test(a);
            },
            creditcard: function (a, b) {
                if (this.optional(b)) return "dependency-mismatch";
                if (/[^0-9 \-]+/.test(a)) return !1;
                var c = 0,
                    d = 0,
                    e = !1;
                a = a.replace(/\D/g, "");
                for (var f = a.length - 1; f >= 0; f--) {
                    var g = a.charAt(f);
                    d = parseInt(g, 10), e && (d *= 2) > 9 && (d -= 9), c += d, e = !e;
                }
                return c % 10 === 0;
            },
            equalTo: function (b, c, d) {
                var e = a(d);
                return this.settings.onfocusout && e.unbind(".validate-equalTo").bind("blur.validate-equalTo", function () {
                    a(c).valid();
                }), b === e.val();
            }
        }
    }), a.format = a.validator.format;
}(window.$j),
 (function (a) {
     !jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && a.each({
         focus: "focusin",
         blur: "focusout"
     }, function (b, c) {
         function d(b) {
             return b = a.event.fix(b), b.type = c, a.event.handle.call(this, b);
         }
         a.event.special[c] = {
             setup: function () {
                 this.addEventListener(b, d, !0);
             },
             teardown: function () {
                 this.removeEventListener(b, d, !0);
             },
             handler: function (b) {
                 var d = arguments;
                 return d[0] = a.event.fix(b), d[0].type = c, a.event.handle.apply(this, d);
             }
         };
     }), a.extend(a.fn, {
         validateDelegate: function (b, c, d) {
             return this.bind(c, function (c) {
                 var e = a(c.target);
                 if (e.is(b)) return d.apply(e, arguments);
             });
         }
     });
 }(window.$j)
));;
/*
 RequireJS 1.0.2 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details
*/
var requirejs, require, define;
(function () {
    function J(a) { return M.call(a) === "[object Function]" } function E(a) { return M.call(a) === "[object Array]" } function Z(a, c, h) { for (var k in c) if (!(k in K) && (!(k in a) || h)) a[k] = c[k]; return d } function N(a, c, d) { a = Error(c + "\nhttp://requirejs.org/docs/errors.html#" + a); if (d) a.originalError = d; return a } function $(a, c, d) {
        var k, j, q; for (k = 0; q = c[k]; k++) {
            q = typeof q === "string" ? { name: q } : q; j = q.location; if (d && (!j || j.indexOf("/") !== 0 && j.indexOf(":") === -1)) j = d + "/" + (j || q.name); a[q.name] = {
                name: q.name, location: j ||
                    q.name, main: (q.main || "main").replace(ea, "").replace(aa, "")
            }
        }
    } function V(a, c) { a.holdReady ? a.holdReady(c) : c ? a.readyWait += 1 : a.ready(!0) } function fa(a) {
        function c(b, l) {
            var f, a; if (b && b.charAt(0) === ".") if (l) { p.pkgs[l] ? l = [l] : (l = l.split("/"), l = l.slice(0, l.length - 1)); f = b = l.concat(b.split("/")); var c; for (a = 0; c = f[a]; a++)if (c === ".") f.splice(a, 1), a -= 1; else if (c === "..") if (a === 1 && (f[2] === ".." || f[0] === "..")) break; else a > 0 && (f.splice(a - 1, 2), a -= 2); a = p.pkgs[f = b[0]]; b = b.join("/"); a && b === f + "/" + a.main && (b = f) } else b.indexOf("./") ===
                0 && (b = b.substring(2)); return b
        } function h(b, l) { var f = b ? b.indexOf("!") : -1, a = null, d = l ? l.name : null, i = b, e, h; f !== -1 && (a = b.substring(0, f), b = b.substring(f + 1, b.length)); a && (a = c(a, d)); b && (a ? e = (f = m[a]) && f.normalize ? f.normalize(b, function (b) { return c(b, d) }) : c(b, d) : (e = c(b, d), h = E[e], h || (h = g.nameToUrl(e, null, l), E[e] = h))); return { prefix: a, name: e, parentMap: l, url: h, originalName: i, fullName: a ? a + "!" + (e || "") : e } } function k() { var b = !0, l = p.priorityWait, f, a; if (l) { for (a = 0; f = l[a]; a++)if (!s[f]) { b = !1; break } b && delete p.priorityWait } return b }
        function j(b, l, f) { return function () { var a = ga.call(arguments, 0), c; if (f && J(c = a[a.length - 1])) c.__requireJsBuild = !0; a.push(l); return b.apply(null, a) } } function q(b, l) { var a = j(g.require, b, l); Z(a, { nameToUrl: j(g.nameToUrl, b), toUrl: j(g.toUrl, b), defined: j(g.requireDefined, b), specified: j(g.requireSpecified, b), isBrowser: d.isBrowser }); return a } function o(b) {
            var l, a, c, C = b.callback, i = b.map, e = i.fullName, ba = b.deps; c = b.listeners; if (C && J(C)) {
                if (p.catchError.define) try { a = d.execCb(e, b.callback, ba, m[e]) } catch (k) { l = k } else a =
                    d.execCb(e, b.callback, ba, m[e]); if (e) (C = b.cjsModule) && C.exports !== void 0 && C.exports !== m[e] ? a = m[e] = b.cjsModule.exports : a === void 0 && b.usingExports ? a = m[e] : (m[e] = a, F[e] && (Q[e] = !0))
            } else e && (a = m[e] = C, F[e] && (Q[e] = !0)); if (D[b.id]) delete D[b.id], b.isDone = !0, g.waitCount -= 1, g.waitCount === 0 && (I = []); delete R[e]; if (d.onResourceLoad && !b.placeholder) d.onResourceLoad(g, i, b.depArray); if (l) return a = (e ? h(e).url : "") || l.fileName || l.sourceURL, c = l.moduleTree, l = N("defineerror", 'Error evaluating module "' + e + '" at location "' +
                a + '":\n' + l + "\nfileName:" + a + "\nlineNumber: " + (l.lineNumber || l.line), l), l.moduleName = e, l.moduleTree = c, d.onError(l); for (l = 0; C = c[l]; l++)C(a)
        } function r(b, a) { return function (f) { b.depDone[a] || (b.depDone[a] = !0, b.deps[a] = f, b.depCount -= 1, b.depCount || o(b)) } } function u(b, a) {
            var f = a.map, c = f.fullName, h = f.name, i = L[b] || (L[b] = m[b]), e; if (!a.loading) a.loading = !0, e = function (b) { a.callback = function () { return b }; o(a); s[a.id] = !0; w() }, e.fromText = function (b, a) {
                var l = O; s[b] = !1; g.scriptCount += 1; g.fake[b] = !0; l && (O = !1); d.exec(a);
                l && (O = !0); g.completeLoad(b)
            }, c in m ? e(m[c]) : i.load(h, q(f.parentMap, !0), e, p)
        } function v(b) { D[b.id] || (D[b.id] = b, I.push(b), g.waitCount += 1) } function B(b) { this.listeners.push(b) } function t(b, a) {
            var f = b.fullName, c = b.prefix, d = c ? L[c] || (L[c] = m[c]) : null, i, e; f && (i = R[f]); if (!i && (e = !0, i = { id: (c && !d ? M++ + "__p@:" : "") + (f || "__r@" + M++), map: b, depCount: 0, depDone: [], depCallbacks: [], deps: [], listeners: [], add: B }, y[i.id] = !0, f && (!c || L[c]))) R[f] = i; c && !d ? (f = t(h(c), !0), f.add(function () {
                var a = h(b.originalName, b.parentMap), a = t(a,
                                                            !0); i.placeholder = !0; a.add(function (b) { i.callback = function () { return b }; o(i) })
            })) : e && a && (s[i.id] = !1, g.paused.push(i), v(i)); return i
        } function x(b, a, f, c) {
            var b = h(b, c), d = b.name, i = b.fullName, e = t(b), k = e.id, j = e.deps, n; if (i) { if (i in m || s[k] === !0 || i === "jquery" && p.jQuery && p.jQuery !== f().fn.jquery) return; y[k] = !0; s[k] = !0; i === "jquery" && f && S(f()) } e.depArray = a; e.callback = f; for (f = 0; f < a.length; f++)if (k = a[f]) k = h(k, d ? b : c), n = k.fullName, a[f] = n, n === "require" ? j[f] = q(b) : n === "exports" ? (j[f] = m[i] = {}, e.usingExports = !0) : n ===
                "module" ? e.cjsModule = j[f] = { id: d, uri: d ? g.nameToUrl(d, null, c) : void 0, exports: m[i] } : n in m && !(n in D) && (!(i in F) || i in F && Q[n]) ? j[f] = m[n] : (i in F && (F[n] = !0, delete m[n], T[k.url] = !1), e.depCount += 1, e.depCallbacks[f] = r(e, f), t(k, !0).add(e.depCallbacks[f])); e.depCount ? v(e) : o(e)
        } function n(b) { x.apply(null, b) } function z(b, a) {
            if (!b.isDone) {
                var c = b.map.fullName, d = b.depArray, g, i, e, k; if (c) { if (a[c]) return m[c]; a[c] = !0 } if (d) for (g = 0; g < d.length; g++)if (i = d[g]) if ((e = h(i).prefix) && (k = D[e]) && z(k, a), (e = D[i]) && !e.isDone &&
                    s[i]) i = z(e, a), b.depCallbacks[g](i); return c ? m[c] : void 0
            }
        } function A() {
            var b = p.waitSeconds * 1E3, a = b && g.startTime + b < (new Date).getTime(), b = "", c = !1, h = !1, j; if (!(g.pausedCount > 0)) {
                if (p.priorityWait) if (k()) w(); else return; for (j in s) if (!(j in K) && (c = !0, !s[j])) if (a) b += j + " "; else { h = !0; break } if (c || g.waitCount) {
                    if (a && b) return j = N("timeout", "Load timeout for modules: " + b), j.requireType = "timeout", j.requireModules = b, d.onError(j); if (h || g.scriptCount) { if ((G || ca) && !W) W = setTimeout(function () { W = 0; A() }, 50) } else {
                        if (g.waitCount) {
                            for (H =
                                0; b = I[H]; H++)z(b, {}); g.paused.length && w(); X < 5 && (X += 1, A())
                        } X = 0; d.checkReadyState()
                    }
                }
            }
        } var g, w, p = { waitSeconds: 7, baseUrl: "./", paths: {}, pkgs: {}, catchError: {} }, P = [], y = { require: !0, exports: !0, module: !0 }, E = {}, m = {}, s = {}, D = {}, I = [], T = {}, M = 0, R = {}, L = {}, F = {}, Q = {}, Y = 0; S = function (b) {
            if (!g.jQuery && (b = b || (typeof jQuery !== "undefined" ? jQuery : null)) && !(p.jQuery && b.fn.jquery !== p.jQuery) && ("holdReady" in b || "readyWait" in b)) if (g.jQuery = b, n(["jquery", [], function () { return jQuery }]), g.scriptCount) V(b, !0), g.jQueryIncremented =
                !0
        }; w = function () {
            var b, a, c, h, j, i; Y += 1; if (g.scriptCount <= 0) g.scriptCount = 0; for (; P.length;)if (b = P.shift(), b[0] === null) return d.onError(N("mismatch", "Mismatched anonymous define() module: " + b[b.length - 1])); else n(b); if (!p.priorityWait || k()) for (; g.paused.length;) { j = g.paused; g.pausedCount += j.length; g.paused = []; for (h = 0; b = j[h]; h++)a = b.map, c = a.url, i = a.fullName, a.prefix ? u(a.prefix, b) : !T[c] && !s[i] && (d.load(g, i, c), c.indexOf("empty:") !== 0 && (T[c] = !0)); g.startTime = (new Date).getTime(); g.pausedCount -= j.length } Y ===
                1 && A(); Y -= 1
        }; g = {
            contextName: a, config: p, defQueue: P, waiting: D, waitCount: 0, specified: y, loaded: s, urlMap: E, urlFetched: T, scriptCount: 0, defined: m, paused: [], pausedCount: 0, plugins: L, needFullExec: F, fake: {}, fullExec: Q, managerCallbacks: R, makeModuleMap: h, normalize: c, configure: function (b) {
                var a, c, d; b.baseUrl && b.baseUrl.charAt(b.baseUrl.length - 1) !== "/" && (b.baseUrl += "/"); a = p.paths; d = p.pkgs; Z(p, b, !0); if (b.paths) { for (c in b.paths) c in K || (a[c] = b.paths[c]); p.paths = a } if ((a = b.packagePaths) || b.packages) {
                    if (a) for (c in a) c in
                        K || $(d, a[c], c); b.packages && $(d, b.packages); p.pkgs = d
                } if (b.priority) c = g.requireWait, g.requireWait = !1, g.takeGlobalQueue(), w(), g.require(b.priority), w(), g.requireWait = c, p.priorityWait = b.priority; if (b.deps || b.callback) g.require(b.deps || [], b.callback)
            }, requireDefined: function (b, a) { return h(b, a).fullName in m }, requireSpecified: function (b, a) { return h(b, a).fullName in y }, require: function (b, c, f) {
                if (typeof b === "string") {
                    if (J(c)) return d.onError(N("requireargs", "Invalid require call")); if (d.get) return d.get(g,
                        b, c); c = h(b, c); b = c.fullName; return !(b in m) ? d.onError(N("notloaded", "Module name '" + c.fullName + "' has not been loaded yet for context: " + a)) : m[b]
                } (b && b.length || c) && x(null, b, c, f); if (!g.requireWait) for (; !g.scriptCount && g.paused.length;)g.takeGlobalQueue(), w(); return g.require
            }, takeGlobalQueue: function () { U.length && (ha.apply(g.defQueue, [g.defQueue.length - 1, 0].concat(U)), U = []) }, completeLoad: function (b) {
                var a; for (g.takeGlobalQueue(); P.length;)if (a = P.shift(), a[0] === null) { a[0] = b; break } else if (a[0] === b) break;
                    else n(a), a = null; a ? n(a) : n([b, [], b === "jquery" && typeof jQuery !== "undefined" ? function () { return jQuery } : null]); S(); d.isAsync && (g.scriptCount -= 1); w(); d.isAsync || (g.scriptCount -= 1)
            }, toUrl: function (a, c) { var d = a.lastIndexOf("."), h = null; d !== -1 && (h = a.substring(d, a.length), a = a.substring(0, d)); return g.nameToUrl(a, h, c) }, nameToUrl: function (a, h, f) {
                var j, k, i, e, m = g.config, a = c(a, f && f.fullName); if (d.jsExtRegExp.test(a)) h = a + (h ? h : ""); else {
                    j = m.paths; k = m.pkgs; f = a.split("/"); for (e = f.length; e > 0; e--)if (i = f.slice(0, e).join("/"),
                        j[i]) { f.splice(0, e, j[i]); break } else if (i = k[i]) { a = a === i.name ? i.location + "/" + i.main : i.location; f.splice(0, e, a); break } h = f.join("/") + (h || ".js"); h = (h.charAt(0) === "/" || h.match(/^\w+:/) ? "" : m.baseUrl) + h
                } return m.urlArgs ? h + ((h.indexOf("?") === -1 ? "?" : "&") + m.urlArgs) : h
            }
        }; g.jQueryCheck = S; g.resume = w; return g
    } function ia() { var a, c, d; if (n && n.readyState === "interactive") return n; a = document.getElementsByTagName("script"); for (c = a.length - 1; c > -1 && (d = a[c]); c--)if (d.readyState === "interactive") return n = d; return null } var ja =
                                                                                                                                                                                                                                                            /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, ka = /require\(\s*["']([^'"\s]+)["']\s*\)/g, ea = /^\.\//, aa = /\.js$/, M = Object.prototype.toString, r = Array.prototype, ga = r.slice, ha = r.splice, G = !!(typeof window !== "undefined" && navigator && document), ca = !G && typeof importScripts !== "undefined", la = G && navigator.platform === "PLAYSTATION 3" ? /^complete$/ : /^(complete|loaded)$/, da = typeof opera !== "undefined" && opera.toString() === "[object Opera]", K = {}, t = {}, U = [], n = null, X = 0, O = !1, d, r = {}, I, v, x, y, u, z, A, H, B, S, W; if (typeof define === "undefined") {
        if (typeof requirejs !==
            "undefined") if (J(requirejs)) return; else r = requirejs, requirejs = void 0; typeof require !== "undefined" && !J(require) && (r = require, require = void 0); d = requirejs = function (a, c, d) { var k = "_", j; !E(a) && typeof a !== "string" && (j = a, E(c) ? (a = c, c = d) : a = []); if (j && j.context) k = j.context; d = t[k] || (t[k] = fa(k)); j && d.configure(j); return d.require(a, c) }; d.config = function (a) { return d(a) }; require || (require = d); d.toUrl = function (a) { return t._.toUrl(a) }; d.version = "1.0.2"; d.jsExtRegExp = /^\/|:|\?|\.js$/; v = d.s = { contexts: t, skipAsync: {} }; if (d.isAsync =
            d.isBrowser = G) if (x = v.head = document.getElementsByTagName("head")[0], y = document.getElementsByTagName("base")[0]) x = v.head = y.parentNode; d.onError = function (a) { throw a; }; d.load = function (a, c, h) { d.resourcesReady(!1); a.scriptCount += 1; d.attach(h, a, c); if (a.jQuery && !a.jQueryIncremented) V(a.jQuery, !0), a.jQueryIncremented = !0 }; define = function (a, c, d) {
            var k, j; typeof a !== "string" && (d = c, c = a, a = null); E(c) || (d = c, c = []); !c.length && J(d) && d.length && (d.toString().replace(ja, "").replace(ka, function (a, d) { c.push(d) }), c = (d.length ===
                1 ? ["require"] : ["require", "exports", "module"]).concat(c)); if (O && (k = I || ia())) a || (a = k.getAttribute("data-requiremodule")), j = t[k.getAttribute("data-requirecontext")]; (j ? j.defQueue : U).push([a, c, d])
        }; define.amd = { multiversion: !0, plugins: !0, jQuery: !0 }; d.exec = function (a) { return eval(a) }; d.execCb = function (a, c, d, k) { return c.apply(k, d) }; d.addScriptToDom = function (a) { I = a; y ? x.insertBefore(a, y) : x.appendChild(a); I = null }; d.onScriptLoad = function (a) {
            var c = a.currentTarget || a.srcElement, h; if (a.type === "load" || c && la.test(c.readyState)) n =
                null, a = c.getAttribute("data-requirecontext"), h = c.getAttribute("data-requiremodule"), t[a].completeLoad(h), c.detachEvent && !da ? c.detachEvent("onreadystatechange", d.onScriptLoad) : c.removeEventListener("load", d.onScriptLoad, !1)
        }; d.attach = function (a, c, h, k, j, n) {
            var o; if (G) return k = k || d.onScriptLoad, o = c && c.config && c.config.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script"), o.type = j || "text/javascript", o.charset = "utf-8", o.async = !v.skipAsync[a], c && o.setAttribute("data-requirecontext",
                c.contextName), o.setAttribute("data-requiremodule", h), o.attachEvent && !da ? (O = !0, n ? o.onreadystatechange = function () { if (o.readyState === "loaded") o.onreadystatechange = null, o.attachEvent("onreadystatechange", k), n(o) } : o.attachEvent("onreadystatechange", k)) : o.addEventListener("load", k, !1), o.src = a, n || d.addScriptToDom(o), o; else ca && (importScripts(a), c.completeLoad(h)); return null
        }; if (G) {
            u = document.getElementsByTagName("script"); for (H = u.length - 1; H > -1 && (z = u[H]); H--) {
                if (!x) x = z.parentNode; if (A = z.getAttribute("data-main")) {
                    if (!r.baseUrl) u =
                        A.split("/"), z = u.pop(), u = u.length ? u.join("/") + "/" : "./", r.baseUrl = u, A = z.replace(aa, ""); r.deps = r.deps ? r.deps.concat(A) : [A]; break
                }
            }
        } d.checkReadyState = function () { var a = v.contexts, c; for (c in a) if (!(c in K) && a[c].waitCount) return; d.resourcesReady(!0) }; d.resourcesReady = function (a) { var c, h; d.resourcesDone = a; if (d.resourcesDone) for (h in a = v.contexts, a) if (!(h in K) && (c = a[h], c.jQueryIncremented)) V(c.jQuery, !1), c.jQueryIncremented = !1 }; d.pageLoaded = function () {
            if (document.readyState !== "complete") document.readyState =
                "complete"
        }; if (G && document.addEventListener && !document.readyState) document.readyState = "loading", window.addEventListener("load", d.pageLoaded, !1); d(r); if (d.isAsync && typeof setTimeout !== "undefined") B = v.contexts[r.context || "_"], B.requireWait = !0, setTimeout(function () { B.requireWait = !1; B.takeGlobalQueue(); B.jQueryCheck(); B.scriptCount || B.resume(); d.checkReadyState() }, 0)
    }
})();
;

(function (a, b) {
    if (typeof exports !== "undefined") {
        b(a, exports, require("underscore"))
    } else {
        if (typeof define === "function" && define.amd) {
            define("backbone", ["underscore", "jquery", "exports"], function (d, e, c) {
                a.Backbone = b(a, c, d, e)
            })
        } else {
            a.Backbone = b(a, {}, a._, (a.jQuery || a.Zepto || a.ender))
        }
    }
}(this, function (q, c, A, g) {
    var o = q.Backbone;
    var p = Array.prototype.slice;
    var y = Array.prototype.splice;
    c.VERSION = "0.9.2";
    c.setDomLibrary = function (C) {
            g = C
        }
        ;
    c.noConflict = function () {
            q.Backbone = o;
            return c
        }
        ;
    c.emulateHTTP = false;
    c.emulateJSON = false;
    var a = /\s+/;
    var n = c.Events = {
        on: function (F, J, E) {
            var D, H, G, C, I;
            if (!J) {
                return this
            }
            F = F.split(a);
            D = this._callbacks || (this._callbacks = {});
            while (H = F.shift()) {
                I = D[H];
                G = I ? I.tail : {};
                G.next = C = {};
                G.context = E;
                G.callback = J;
                D[H] = {
                    tail: C,
                    next: I ? I.next : G
                }
            }
            return this
        },
        off: function (J, H, D) {
            var C, K, E, G, F, I;
            if (!(K = this._callbacks)) {
                return
            }
            if (!(J || H || D)) {
                delete this._callbacks;
                return this
            }
            J = J ? J.split(a) : A.keys(K);
            while (C = J.shift()) {
                E = K[C];
                delete K[C];
                if (!E || !(H || D)) {
                    continue
                }
                G = E.tail;
                while ((E = E.next) !== G) {
                    F = E.callback;
                    I = E.context;
                    if ((H && F !== H) || (D && I !== D)) {
                        this.on(C, F, I)
                    }
                }
            }
            return this
        },
        trigger: function (F) {
            var J, I, E, D, C, H, G;
            if (!(E = this._callbacks)) {
                return this
            }
            H = E.all;
            F = F.split(a);
            G = p.call(arguments, 1);
            while (J = F.shift()) {
                if (I = E[J]) {
                    D = I.tail;
                    while ((I = I.next) !== D) {
                        I.callback.apply(I.context || this, G)
                    }
                }
                if (I = H) {
                    D = I.tail;
                    C = [J].concat(G);
                    while ((I = I.next) !== D) {
                        I.callback.apply(I.context || this, C)
                    }
                }
            }
            return this
        }
    };
    n.bind = n.on;
    n.unbind = n.off;
    var k = c.Model = function (C, D) {
            var E;
            C || (C = {});
            if (D && D.parse) {
                C = this.parse(C)
            }
            if (E = d(this, "defaults")) {
                C = A.extend({}, E, C)
            }
            if (D && D.collection) {
                this.collection = D.collection
            }
            this.attributes = {};
            this._escapedAttributes = {};
            this.cid = A.uniqueId("c");
            this.changed = {};
            this._silent = {};
            this._pending = {};
            this.set(C, {
                silent: true
            });
            this.changed = {};
            this._silent = {};
            this._pending = {};
            this._previousAttributes = A.clone(this.attributes);
            this.initialize.apply(this, arguments)
        }
        ;
    A.extend(k.prototype, n, {
        changed: null,
        _silent: null,
        _pending: null,
        idAttribute: "id",
        initialize: function () { },
        toJSON: function (C) {
            return A.clone(this.attributes)
        },
        get: function (C) {
            return this.attributes[C]
        },
        escape: function (C) {
            var D;
            if (D = this._escapedAttributes[C]) {
                return D
            }
            var E = this.get(C);
            return this._escapedAttributes[C] = A.escape(E == null ? "" : "" + E)
        },
        has: function (C) {
            return this.get(C) != null
        },
        set: function (J, I, L) {
            var K, G, E;
            if (A.isObject(J) || J == null) {
                K = J;
                L = I
            } else {
                K = {};
                K[J] = I
            }
            L || (L = {});
            if (!K) {
                return this
            }
            if (K instanceof k) {
                K = K.attributes
            }
            if (L.unset) {
                for (G in K) {
                    K[G] = void 0
                }
            }
            if (!this._validate(K, L)) {
                return false
            }
            if (this.idAttribute in K) {
                this.id = K[this.idAttribute]
            }
            var H = L.changes = {};
            var D = this.attributes;
            var C = this._escapedAttributes;
            var F = this._previousAttributes || {};
            for (G in K) {
                E = K[G];
                if (!A.isEqual(D[G], E) || (L.unset && A.has(D, G))) {
                    delete C[G];
                    (L.silent ? this._silent : H)[G] = true
                }
                L.unset ? delete D[G] : D[G] = E;
                if (!A.isEqual(F[G], E) || (A.has(D, G) != A.has(F, G))) {
                    this.changed[G] = E;
                    if (!L.silent) {
                        this._pending[G] = true
                    }
                } else {
                    delete this.changed[G];
                    delete this._pending[G]
                }
            }
            if (!L.silent) {
                this.change(L)
            }
            return this
        },
        unset: function (C, D) {
            (D || (D = {})).unset = true;
            return this.set(C, null, D)
        },
        clear: function (C) {
            (C || (C = {})).unset = true;
            return this.set(A.clone(this.attributes), C)
        },
        fetch: function (D) {
            D = D ? A.clone(D) : {};
            var C = this;
            var E = D.success;
            D.success = function (H, F, G) {
                    if (!C.set(C.parse(H, G), D)) {
                        return false
                    }
                    if (E) {
                        E(C, H)
                    }
                }
                ;
            D.error = c.wrapError(D.error, C, D);
            return (this.sync || c.sync).call(this, "read", this, D)
        },
        save: function (H, G, L) {
            var I, F;
            if (A.isObject(H) || H == null) {
                I = H;
                L = G
            } else {
                I = {};
                I[H] = G
            }
            L = L ? A.clone(L) : {};
            if (L.wait) {
                if (!this._validate(I, L)) {
                    return false
                }
                F = A.clone(this.attributes)
            }
            var D = A.extend({}, L, {
                silent: true
            });
            if (I && !this.set(I, L.wait ? D : L)) {
                return false
            }
            var E = this;
            var J = L.success;
            L.success = function (P, M, O) {
                    var N = E.parse(P, O);
                    if (L.wait) {
                        delete L.wait;
                        N = A.extend(I || {}, N)
                    }
                    if (!E.set(N, L)) {
                        return false
                    }
                    if (J) {
                        J(E, P)
                    } else {
                        E.trigger("sync", E, P, L)
                    }
                }
                ;
            L.error = c.wrapError(L.error, E, L);
            var C = this.isNew() ? "create" : "update";
            var K = (this.sync || c.sync).call(this, C, this, L);
            if (L.wait) {
                this.set(F, D)
            }
            return K
        },
        destroy: function (D) {
            D = D ? A.clone(D) : {};
            var C = this;
            var G = D.success;
            var F = function () {
                C.trigger("destroy", C, C.collection, D)
            };
            if (this.isNew()) {
                F();
                return false
            }
            D.success = function (H) {
                    if (D.wait) {
                        F()
                    }
                    if (G) {
                        G(C, H)
                    } else {
                        C.trigger("sync", C, H, D)
                    }
                }
                ;
            D.error = c.wrapError(D.error, C, D);
            var E = (this.sync || c.sync).call(this, "delete", this, D);
            if (!D.wait) {
                F()
            }
            return E
        },
        url: function () {
            var C = d(this, "urlRoot") || d(this.collection, "url") || t();
            if (this.isNew()) {
                return C
            }
            return C + (C.charAt(C.length - 1) == "/" ? "" : "/") + encodeURIComponent(this.id)
        },
        parse: function (D, C) {
            return D
        },
        clone: function () {
            return new this.constructor(this.attributes)
        },
        isNew: function () {
            return this.id == null
        },
        change: function (D) {
            D || (D = {});
            var F = this._changing;
            this._changing = true;
            for (var C in this._silent) {
                this._pending[C] = true
            }
            var E = A.extend({}, D.changes, this._silent);
            this._silent = {};
            for (var C in E) {
                this.trigger("change:" + C, this, this.get(C), D)
            }
            if (F) {
                return this
            }
            while (!A.isEmpty(this._pending)) {
                this._pending = {};
                this.trigger("change", this, D);
                for (var C in this.changed) {
                    if (this._pending[C] || this._silent[C]) {
                        continue
                    }
                    delete this.changed[C]
                }
                this._previousAttributes = A.clone(this.attributes)
            }
            this._changing = false;
            return this
        },
        hasChanged: function (C) {
            if (!arguments.length) {
                return !A.isEmpty(this.changed)
            }
            return A.has(this.changed, C)
        },
        changedAttributes: function (E) {
            if (!E) {
                return this.hasChanged() ? A.clone(this.changed) : false
            }
            var G, F = false, D = this._previousAttributes;
            for (var C in E) {
                if (A.isEqual(D[C], (G = E[C]))) {
                    continue
                }
                (F || (F = {}))[C] = G
            }
            return F
        },
        previous: function (C) {
            if (!arguments.length || !this._previousAttributes) {
                return null
            }
            return this._previousAttributes[C]
        },
        previousAttributes: function () {
            return A.clone(this._previousAttributes)
        },
        isValid: function () {
            return !this.validate(this.attributes)
        },
        _validate: function (E, D) {
            if (D.silent || !this.validate) {
                return true
            }
            E = A.extend({}, this.attributes, E);
            var C = this.validate(E, D);
            if (!C) {
                return true
            }
            if (D && D.error) {
                D.error(this, C, D)
            } else {
                this.trigger("error", this, C, D)
            }
            return false
        }
    });
    var B = c.Collection = function (D, C) {
            C || (C = {});
            if (C.model) {
                this.model = C.model
            }
            if (C.comparator) {
                this.comparator = C.comparator
            }
            this._reset();
            this.initialize.apply(this, arguments);
            if (D) {
                this.reset(D, {
                    silent: true,
                    parse: C.parse
                })
            }
        }
        ;
    A.extend(B.prototype, n, {
        model: k,
        initialize: function () { },
        toJSON: function (C) {
            return this.map(function (D) {
                return D.toJSON(C)
            })
        },
        add: function (D, M) {
            var I, K, F, J, L, E, G = {}, C = {}, H = [];
            M || (M = {});
            D = A.isArray(D) ? D.slice() : [D];
            for (I = 0,
                F = D.length; I < F; I++) {
                if (!(J = D[I] = this._prepareModel(D[I], M))) {
                    throw new Error("Can't add an invalid model to a collection")
                }
                L = J.cid;
                E = J.id;
                if (G[L] || this._byCid[L] || ((E != null) && (C[E] || this._byId[E]))) {
                    H.push(I);
                    continue
                }
                G[L] = C[E] = J
            }
            I = H.length;
            while (I--) {
                D.splice(H[I], 1)
            }
            for (I = 0,
                F = D.length; I < F; I++) {
                (J = D[I]).on("all", this._onModelEvent, this);
                this._byCid[J.cid] = J;
                if (J.id != null) {
                    this._byId[J.id] = J
                }
            }
            this.length += F;
            K = M.at != null ? M.at : this.models.length;
            y.apply(this.models, [K, 0].concat(D));
            if (this.comparator) {
                this.sort({
                    silent: true
                })
            }
            if (M.silent) {
                return this
            }
            for (I = 0,
                F = this.models.length; I < F; I++) {
                if (!G[(J = this.models[I]).cid]) {
                    continue
                }
                M.index = I;
                J.trigger("add", J, this, M)
            }
            return this
        },
        remove: function (H, F) {
            var G, C, E, D;
            F || (F = {});
            H = A.isArray(H) ? H.slice() : [H];
            for (G = 0,
                C = H.length; G < C; G++) {
                D = this.getByCid(H[G]) || this.get(H[G]);
                if (!D) {
                    continue
                }
                delete this._byId[D.id];
                delete this._byCid[D.cid];
                E = this.indexOf(D);
                this.models.splice(E, 1);
                this.length--;
                if (!F.silent) {
                    F.index = E;
                    D.trigger("remove", D, this, F)
                }
                this._removeReference(D)
            }
            return this
        },
        push: function (D, C) {
            D = this._prepareModel(D, C);
            this.add(D, C);
            return D
        },
        pop: function (D) {
            var C = this.at(this.length - 1);
            this.remove(C, D);
            return C
        },
        unshift: function (D, C) {
            D = this._prepareModel(D, C);
            this.add(D, A.extend({
                at: 0
            }, C));
            return D
        },
        shift: function (D) {
            var C = this.at(0);
            this.remove(C, D);
            return C
        },
        get: function (C) {
            if (C == null) {
                return void 0
            }
            return this._byId[C.id != null ? C.id : C]
        },
        getByCid: function (C) {
            return C && this._byCid[C.cid || C]
        },
        at: function (C) {
            return this.models[C]
        },
        where: function (C) {
            if (A.isEmpty(C)) {
                return []
            }
            return this.filter(function (D) {
                for (var E in C) {
                    if (C[E] !== D.get(E)) {
                        return false
                    }
                }
                return true
            })
        },
        sort: function (D) {
            D || (D = {});
            if (!this.comparator) {
                throw new Error("Cannot sort a set without a comparator")
            }
            var C = A.bind(this.comparator, this);
            if (this.comparator.length == 1) {
                this.models = this.sortBy(C)
            } else {
                this.models.sort(C)
            }
            if (!D.silent) {
                this.trigger("reset", this, D)
            }
            return this
        },
        pluck: function (C) {
            return A.map(this.models, function (D) {
                return D.get(C)
            })
        },
        reset: function (F, D) {
            F || (F = []);
            D || (D = {});
            for (var E = 0, C = this.models.length; E < C; E++) {
                this._removeReference(this.models[E])
            }
            this._reset();
            this.add(F, A.extend({
                silent: true
            }, D));
            if (!D.silent) {
                this.trigger("reset", this, D)
            }
            return this
        },
        fetch: function (C) {
            C = C ? A.clone(C) : {};
            if (C.parse === undefined) {
                C.parse = true
            }
            var E = this;
            var D = C.success;
            C.success = function (H, F, G) {
                    E[C.add ? "add" : "reset"](E.parse(H, G), C);
                    if (D) {
                        D(E, H)
                    }
                }
                ;
            C.error = c.wrapError(C.error, E, C);
            return (this.sync || c.sync).call(this, "read", this, C)
        },
        create: function (D, C) {
            var E = this;
            C = C ? A.clone(C) : {};
            D = this._prepareModel(D, C);
            if (!D) {
                return false
            }
            if (!C.wait) {
                E.add(D, C)
            }
            var F = C.success;
            C.success = function (G, I, H) {
                    if (C.wait) {
                        E.add(G, C)
                    }
                    if (F) {
                        F(G, I)
                    } else {
                        G.trigger("sync", D, I, C)
                    }
                }
                ;
            D.save(null, C);
            return D
        },
        parse: function (D, C) {
            return D
        },
        chain: function () {
            return A(this.models).chain()
        },
        _reset: function (C) {
            this.length = 0;
            this.models = [];
            this._byId = {};
            this._byCid = {}
        },
        _prepareModel: function (E, D) {
            D || (D = {});
            if (!(E instanceof k)) {
                var C = E;
                D.collection = this;
                E = new this.model(C, D);
                if (!E._validate(E.attributes, D)) {
                    E = false
                }
            } else {
                if (!E.collection) {
                    E.collection = this
                }
            }
            return E
        },
        _removeReference: function (C) {
            if (this == C.collection) {
                delete C.collection
            }
            C.off("all", this._onModelEvent, this)
        },
        _onModelEvent: function (E, D, F, C) {
            if ((E == "add" || E == "remove") && F != this) {
                return
            }
            if (E == "destroy") {
                this.remove(D, C)
            }
            if (D && E === "change:" + D.idAttribute) {
                delete this._byId[D.previous(D.idAttribute)];
                this._byId[D.id] = D
            }
            this.trigger.apply(this, arguments)
        }
    });
    var w = ["forEach", "each", "map", "reduce", "reduceRight", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "sortBy", "sortedIndex", "toArray", "size", "first", "initial", "rest", "last", "without", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "groupBy"];
    A.each(w, function (C) {
        B.prototype[C] = function () {
            return A[C].apply(A, [this.models].concat(A.toArray(arguments)))
        }
    });
    var z = c.Router = function (C) {
            C || (C = {});
            if (C.routes) {
                this.routes = C.routes
            }
            this._bindRoutes();
            this.initialize.apply(this, arguments)
        }
        ;
    var i = /:\w+/g;
    var x = /\*\w+/g;
    var e = /[-[\]{}()+?.,\\^$|#\s]/g;
    A.extend(z.prototype, n, {
        initialize: function () { },
        route: function (C, D, E) {
            c.history || (c.history = new b);
            if (!A.isRegExp(C)) {
                C = this._routeToRegExp(C)
            }
            if (!E) {
                E = this[D]
            }
            c.history.route(C, A.bind(function (G) {
                var F = this._extractParameters(C, G);
                E && E.apply(this, F);
                this.trigger.apply(this, ["route:" + D].concat(F));
                c.history.trigger("route", this, D, F)
            }, this));
            return this
        },
        navigate: function (D, C) {
            c.history.navigate(D, C)
        },
        _bindRoutes: function () {
            if (!this.routes) {
                return
            }
            var D = [];
            for (var E in this.routes) {
                D.unshift([E, this.routes[E]])
            }
            for (var F = 0, C = D.length; F < C; F++) {
                this.route(D[F][0], D[F][1], this[D[F][1]])
            }
        },
        _routeToRegExp: function (C) {
            C = C.replace(e, "\\$&").replace(i, "([^/]+)").replace(x, "(.*?)");
            return new RegExp("^" + C + "$")
        },
        _extractParameters: function (C, D) {
            return C.exec(D).slice(1)
        }
    });
    var b = c.History = function () {
            this.handlers = [];
            A.bindAll(this, "checkUrl")
        }
        ;
    var m = /^[#\/]/;
    var j = /msie [\w.]+/;
    b.started = false;
    A.extend(b.prototype, n, {
        interval: 50,
        getHash: function (E) {
            var D = E ? E.location : window.location;
            var C = D.href.match(/#(.*)$/);
            return C ? C[1] : ""
        },
        getFragment: function (D, C) {
            if (D == null) {
                if (this._hasPushState || C) {
                    D = window.location.pathname;
                    var E = window.location.search;
                    if (E) {
                        D += E
                    }
                } else {
                    D = this.getHash()
                }
            }
            if (!D.indexOf(this.options.root)) {
                D = D.substr(this.options.root.length)
            }
            return D.replace(m, "")
        },
        start: function (E) {
            if (b.started) {
                throw new Error("Backbone.history has already been started")
            }
            b.started = true;
            this.options = A.extend({}, {
                root: "/"
            }, this.options, E);
            this._wantsHashChange = this.options.hashChange !== false;
            this._wantsPushState = !!this.options.pushState;
            this._hasPushState = !!(this.options.pushState && window.history && window.history.pushState);
            var D = this.getFragment();
            var C = document.documentMode;
            var G = (j.exec(navigator.userAgent.toLowerCase()) && (!C || C <= 7));
            if (G) {
                this.iframe = g('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;
                this.navigate(D)
            }
            if (this._hasPushState) {
                g(window).bind("popstate", this.checkUrl)
            } else {
                if (this._wantsHashChange && ("onhashchange" in window) && !G) {
                    g(window).bind("hashchange", this.checkUrl)
                } else {
                    if (this._wantsHashChange) {
                        this._checkUrlInterval = setInterval(this.checkUrl, this.interval)
                    }
                }
            }
            this.fragment = D;
            var H = window.location;
            var F = H.pathname == this.options.root;
            if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !F) {
                this.fragment = this.getFragment(null, true);
                window.location.replace(this.options.root + "#" + this.fragment);
                return true
            } else {
                if (this._wantsPushState && this._hasPushState && F && H.hash) {
                    this.fragment = this.getHash().replace(m, "");
                    window.history.replaceState({}, document.title, H.protocol + "//" + H.host + this.options.root + this.fragment)
                }
            }
            if (!this.options.silent) {
                return this.loadUrl()
            }
        },
        stop: function () {
            g(window).unbind("popstate", this.checkUrl).unbind("hashchange", this.checkUrl);
            clearInterval(this._checkUrlInterval);
            b.started = false
        },
        route: function (C, D) {
            this.handlers.unshift({
                route: C,
                callback: D
            })
        },
        checkUrl: function (D) {
            var C = this.getFragment();
            if (C == this.fragment && this.iframe) {
                C = this.getFragment(this.getHash(this.iframe))
            }
            if (C == this.fragment) {
                return false
            }
            if (this.iframe) {
                this.navigate(C)
            }
            this.loadUrl() || this.loadUrl(this.getHash())
        },
        loadUrl: function (E) {
            var D = this.fragment = this.getFragment(E);
            var C = A.any(this.handlers, function (F) {
                if (F.route.test(D)) {
                    F.callback(D);
                    return true
                }
            });
            return C
        },
        navigate: function (D, C) {
            if (!b.started) {
                return false
            }
            if (!C || C === true) {
                C = {
                    trigger: C
                }
            }
            var E = (D || "").replace(m, "");
            if (this.fragment == E) {
                return
            }
            if (this._hasPushState) {
                if (E.indexOf(this.options.root) != 0) {
                    E = this.options.root + E
                }
                this.fragment = E;
                window.history[C.replace ? "replaceState" : "pushState"]({}, document.title, E)
            } else {
                if (this._wantsHashChange) {
                    this.fragment = E;
                    this._updateHash(window.location, E, C.replace);
                    if (this.iframe && (E != this.getFragment(this.getHash(this.iframe)))) {
                        if (!C.replace) {
                            this.iframe.document.open().close()
                        }
                        this._updateHash(this.iframe.location, E, C.replace)
                    }
                } else {
                    window.location.assign(this.options.root + D)
                }
            }
            if (C.trigger) {
                this.loadUrl(D)
            }
        },
        _updateHash: function (C, D, E) {
            if (E) {
                C.replace(C.toString().replace(/(javascript:|#).*$/, "") + "#" + D)
            } else {
                C.hash = D
            }
        }
    });
    var s = c.View = function (C) {
            this.cid = A.uniqueId("view");
            this._configure(C || {});
            this._ensureElement();
            this.initialize.apply(this, arguments);
            this.delegateEvents()
        }
        ;
    var f = /^(\S+)\s*(.*)$/;
    var u = ["model", "collection", "el", "id", "attributes", "className", "tagName"];
    A.extend(s.prototype, n, {
        tagName: "div",
        $: function (C) {
            return this.$el.find(C)
        },
        initialize: function () { },
        render: function () {
            return this
        },
        remove: function () {
            this.$el.remove();
            return this
        },
        make: function (D, C, F) {
            var E = document.createElement(D);
            if (C) {
                g(E).attr(C)
            }
            if (F != null) {
                g(E).html(F)
            }
            return E
        },
        setElement: function (C, D) {
            if (this.$el) {
                this.undelegateEvents()
            }
            this.$el = (C instanceof g) ? C : g(C);
            this.el = this.$el[0];
            if (D !== false) {
                this.delegateEvents()
            }
            return this
        },
        delegateEvents: function (G) {
            if (!(G || (G = d(this, "events")))) {
                return
            }
            this.undelegateEvents();
            for (var F in G) {
                var H = G[F];
                if (!A.isFunction(H)) {
                    H = this[G[F]]
                }
                if (!H) {
                    throw new Error('Method "' + G[F] + '" does not exist')
                }
                var E = F.match(f);
                var D = E[1]
                    , C = E[2];
                H = A.bind(H, this);
                D += ".delegateEvents" + this.cid;
                if (C === "") {
                    this.$el.bind(D, H)
                } else {
                    this.$el.delegate(C, D, H)
                }
            }
        },
        undelegateEvents: function () {
            this.$el.unbind(".delegateEvents" + this.cid)
        },
        _configure: function (E) {
            if (this.options) {
                E = A.extend({}, this.options, E)
            }
            for (var F = 0, D = u.length; F < D; F++) {
                var C = u[F];
                if (E[C]) {
                    this[C] = E[C]
                }
            }
            this.options = E
        },
        _ensureElement: function () {
            if (!this.el) {
                var C = d(this, "attributes") || {};
                if (this.id) {
                    C.id = this.id
                }
                if (this.className) {
                    C["class"] = this.className
                }
                this.setElement(this.make(this.tagName, C), false)
            } else {
                this.setElement(this.el, false)
            }
        }
    });
    var v = function (C, D) {
        var E = l(this, C, D);
        E.extend = this.extend;
        return E
    };
    k.extend = B.extend = z.extend = s.extend = v;
    var r = {
        create: "POST",
        update: "PUT",
        "delete": "DELETE",
        read: "GET"
    };
    c.sync = function (G, D, C) {
            var E = r[G];
            C || (C = {});
            var F = {
                type: E,
                dataType: "json"
            };
            if (!C.url) {
                F.url = d(D, "url") || t()
            }
            if (!C.data && D && (G == "create" || G == "update")) {
                F.contentType = "application/json";
                F.data = JSON.stringify(D.toJSON())
            }
            if (c.emulateJSON) {
                F.contentType = "application/x-www-form-urlencoded";
                F.data = F.data ? {
                    model: F.data
                } : {}
            }
            if (c.emulateHTTP) {
                if (E === "PUT" || E === "DELETE") {
                    if (c.emulateJSON) {
                        F.data._method = E
                    }
                    F.type = "POST";
                    F.beforeSend = function (H) {
                        H.setRequestHeader("X-HTTP-Method-Override", E)
                    }
                }
            }
            if (F.type !== "GET" && !c.emulateJSON) {
                F.processData = false
            }
            return g.ajax(A.extend(F, C))
        }
        ;
    c.wrapError = function (D, E, C) {
            return function (F, G) {
                G = F === E ? G : F;
                if (D) {
                    D(E, G, C)
                } else {
                    E.trigger("error", E, G, C)
                }
            }
        }
        ;
    var h = function () { };
    var l = function (D, C, E) {
        var F;
        if (C && C.hasOwnProperty("constructor")) {
            F = C.constructor
        } else {
            F = function () {
                D.apply(this, arguments)
            }
        }
        A.extend(F, D);
        h.prototype = D.prototype;
        F.prototype = new h();
        if (C) {
            A.extend(F.prototype, C)
        }
        if (E) {
            A.extend(F, E)
        }
        F.prototype.constructor = F;
        F.__super__ = D.prototype;
        return F
    };
    var d = function (C, D) {
        if (!(C && C[D])) {
            return null
        }
        return A.isFunction(C[D]) ? C[D]() : C[D]
    };
    var t = function () {
        throw new Error('A "url" property or function must be specified')
    };
    return c
}));
define("app_router", ["backbone", "underscore"], function (b, a) {
    b.ApplicationRouter = a.extend(b.Router.extend({
        routes: {
            "*any": "any"
        },
        route: function (e, f, g) {
            var d = this;
            if (!g) {
                g = this[f]
            }
            var c = function () {
                var h = b.history.getFragment();
                b.ApplicationRouter.trigger("beforeRoute", h);
                b.ApplicationRouter.previous.push(h);
                if (g) {
                    g.apply(d, arguments)
                }
                b.ApplicationRouter.trigger("afterRoute", h)
            };
            return b.Router.prototype.route.call(this, e, f, c)
        }
    }), b.Events);
    b.ApplicationRouter.previous = [];
    b.ApplicationRouter.getLastRoute = function () {
            if (b.ApplicationRouter.previous.length) {
                return b.ApplicationRouter.previous[b.ApplicationRouter.previous.length - 1]
            } else {
                return null
            }
        }
        ;
    return b.ApplicationRouter
});
(function (a, b) {
    if (typeof define === "function" && define.amd) {
        define("crossdomain", ["underscore", "backbone"], function (c, d) {
            return b(c || a._, d || a.Backbone)
        })
    } else {
        if (typeof module === "object" && typeof exports === "object") {
            module.exports = b(require("underscore"), require("backbone"))
        } else {
            b(_, Backbone)
        }
    }
}(this, function (a, e) {
    function b(h, g) {
        var i = null;
        try {
            i = g.url
        } catch (f) { }
        if (!i) {
            try {
                i = a.result(h, "url")
            } catch (f) { }
        }
        return i
    }
    function d(g, f) {
        if (g === ":" || f === ":") {
            return false
        } else {
            if (g === f) {
                return false
            }
        }
        return true
    }
    var c = {
        create: "POST",
        update: "PUT",
        patch: "PATCH",
        "delete": "DELETE",
        read: "GET"
    };
    e.vanillaSync = e.sync;
    e.sync = function (f, j, s) {
            if (s.dataType === "jsonp") {
                return e.vanillaSync.apply(this, arguments)
            }
            var g = false;
            var l = document.createElement("a");
            l.href = document.URL;
            var n = document.createElement("a");
            n.href = b(j, s);
            if (n.host !== "" && (l.host !== n.host)) {
                g = true
            }
            if (g && !e.$.support.cors) {
                var m = c[f];
                a.defaults(s || (s = {}), {
                    emulateHTTP: e.emulateHTTP,
                    emulateJSON: e.emulateJSON
                });
                if (!s.emulateHTTP && (f === "update" || f === "patch" || f === "delete")) {
                    throw new Error("Backbone.CrossDomain cannot use PUT, PATCH, DELETE with XDomainRequest (IE) and emulateHTTP=false")
                }
                var i = {
                    type: m,
                    dataType: "json",
                    url: b(j, s)
                };
                if (!i.url) {
                    throw new Error("No URL!")
                }
                if (d(l.protocol, n.protocol)) {
                    i.url = i.url.replace(new RegExp(n.protocol), l.protocol)
                }
                if (s.data == null && j && (f === "create" || f === "update" || f === "patch")) {
                    i.data = JSON.stringify(s.attrs || j.toJSON(s))
                }
                if (s.emulateJSON) {
                    i.data = i.data ? {
                        model: i.data
                    } : {}
                }
                if (s.emulateHTTP && (m === "PUT" || m === "DELETE" || m === "PATCH")) {
                    i.type = "POST";
                    if (s.emulateJSON) {
                        i.data._method = m
                    }
                    var o = s.beforeSend;
                    s.beforeSend = function (t) {
                        if (o) {
                            return o.apply(this, arguments)
                        }
                    }
                }
                if (i.type !== "GET" && !s.emulateJSON) {
                    i.processData = false
                }
                if (i.type === "POST") {
                    i.data = e.$.param(e.$.parseJSON(i.data))
                }
                if (i.type === "GET" && !a.include(i.url, "?") && s.data) {
                    i.url += "?" + e.$.param(s.data)
                }
                var h = s.xhr = new XDomainRequest()
                    , q = s.success
                    , k = s.error;
                if (e.$.fn.jquery) {
                    var r = e.$.Deferred()
                        , p = e.$.Callbacks("once memory");
                    r.promise(h).complete = p.add
                }
                h.onload = function () {
                        var t = {};
                        if (h.responseText) {
                            t = e.$.parseJSON(h.responseText)
                        }
                        if (t) {
                            q(t);
                            if (r) {
                                r.resolveWith(this, [t, "success", h])
                            }
                        }
                    }
                    ;
                h.onerror = function () {
                        if (k) {
                            k(j, h, s);
                            if (r) {
                                r.rejectWith(this, [h, "error", k])
                            }
                        }
                        j.trigger("error", j, h, s)
                    }
                    ;
                h.open(i.type, i.url);
                h.onprogress = function () { }
                    ;
                h.ontimeout = function () { }
                    ;
                setTimeout(function () {
                    h.send(i.data)
                }, 0);
                j.trigger("request", j, h, s);
                return h
            } else {
                return e.vanillaSync.apply(this, arguments)
            }
        }
        ;
    return e
}));


// the following config is mostly used for local environment
// the prod versions are run through the r.js optimizer and will
// include the dependancies in the main require call below

requirejs.config({
	baseUrl: '/js/Honda/main/theme_inclusive/script/',
	paths: {
		'backbone'		: '../../lib/backbone/backbone-0.9.10',
		'cookie'		: '../../lib/jquery/jquery.cookie_2013',
		'crossdomain'	: '../../lib/backbone/Backbone.CrossDomain',
		'hammer'		: '../../lib/hammer/jquery.hammer',
		'handlebars'	: '../../lib/handlebars-v3.0.3',
		'masonry'		: '../../lib/masonry/masonry.pkgd.min',
		'picturefill'	: '../../lib/picturefill',
		'react'			: '../../lib/react/react-0.13.3.min',
        'text'          : '../../lib/require/text',
        'underscore'    : '../../lib/underscore/underscore'
	},
	shim: {
		underscore: {
			exports: '_'
		},
		backbone: {
			deps: ['underscore','jquery'],
			exports: 'Backbone'
		},
		jquery: {
			exports: '$'
		},
		cookie: {
			deps: ['jquery']
		},
		hammer: {
			deps: ['jquery'],
			exports: 'hammer'
		},
		react: {
			exports: 'React'
		}
	},
	callback: function() {
		define('HONDA', [], function() {
			return window.HONDA;
		});

		define('jquery', [], function() {
			return window.jQuery;
		});

		define('underscore', [], function() {
			return window._;
		});

	}
});

require([
	'jquery',
	'underscore',
	'backbone',
	'./app_router',
	'crossdomain' // for IE9
], function($, _, Backbone, ApplicationRouter) {

	// added reference to the jquery '$' var - needed for the 'crossdomain' script
	// the code exists in the initial setup for the latest version of Backbone (v1.3.3)
	// we're using Backbone v0.9.2 :(
	if (!Backbone.$) {
		Backbone.$ = window.$;
	}

	function isConfiguratorRequested() {
		return window.location.hash.indexOf('#configurator/') >= 0;
	}

	var isIE8               = $('html').hasClass('ie8');
	var router              = new ApplicationRouter();
	var requireDependencies = [];
	var initialRoute        = isConfiguratorRequested() ? '' : window.location.hash;
	var animationIteration  = 'webkitAnimationIteration mozAnimationIteration animationiteration';

	function startHistory() {
		if (Backbone.History.started) {
			Backbone.history.loadUrl();
		}
		else {
			Backbone.history.start();
		}
	}

	function restoreInitialRoute() {
		window.location.hash = initialRoute;
	}

	var configurator = {
		isApp: function( obj ) {
			return _.isObject( obj ) && _.isFunction( obj.initialize );
		},

		getInPageApp: function() {
			var self = this;

			require(['configurator_inpage/app'], function( app ) {
				if (self.isApp( app )) {
					app.initialize();
				}
			});
		},

		getMainApp: function() {
			var self         = this;
			var app          = null;
			var timer        = null;
			var hasStarted   = false;
			var $window      = $( window );
			var $html        = $('html');
			var $hub         = $('.configurator_hub_wrapper');
			var $loader      = $('.configurator_hub_loader');
			var $back        = $loader.find('.back');
			var $progressBar = $loader.find('.progress .bar');

			function showLoader() {
				$loader.addClass('visible').redrawDOM().addClass('show');
				$back.on('click', onBackToSite );

				if (Modernizr.cssanimations) {
					$progressBar.on( animationIteration, onAnimationIteration );
				}
				else {
					timer = window.setInterval( onAnimationIteration, 1400 );
				}
			}

			function hideLoader() {
				$loader.removeClass('show').onPropertyTransitionEnd('transform', function() {
					$loader.removeClass('visible');
				});

				$back.off('click', onBackToSite );
				$progressBar.off( animationIteration, onAnimationIteration );
			}

			function removeLoader() {
				$loader.addClass('remove').onPropertyTransitionEnd('opacity', function() {
					$loader.remove();
				});

				if (!Modernizr.cssanimations) {
					window.clearInterval( timer );
				}

				$back.off('click');
				$window.off('hashchange.configurator');
				$progressBar.off( animationIteration, onAnimationIteration );
			}

			function isAppReady() {
				return $hub.attr('data-is-enabled') === 'true';
			}

			function startApp() {
				hasStarted = true;

				app.initialize();
				startHistory();
			}

			function onAnimationIteration() {
				if (hasStarted) {
					if (isAppReady()) {
						removeLoader();
					}
				}
				else {
					if (isConfiguratorRequested() && self.isApp( app )) {
						startApp();
					}
				}
			}

			function onBackToSite( e ) {
				e.preventDefault();

				hideLoader();
				restoreInitialRoute();

				// check to ensure backbone history is started for the requested app
				// as the configurator app now comes in at a deferred point
				if (requireDependencies.length) {
					startHistory();
				}
			}

			function request() {
				var validConfiguratorURL = new RegExp('^#configurator\/(hub(\/)?$|((hub)\/(grade-engine|summary)|modal\/financecalculator))', 'gi');

				if (!validConfiguratorURL.test( window.location.hash )) {
					window.location.hash = '#configurator/hub';
				}

				if (self.isApp( app )) {
					startApp();
				}
				else {
					showLoader();
					require(['configurator/app'], function( obj ) {
						app = obj;
					});
				}
			}

			$window.on('hashchange.configurator', function() {
				if (isConfiguratorRequested()) {
					request();
				}
				else {
					hideLoader();
				}
			});

			if (isConfiguratorRequested()) {
				request();
			}
		}
	};

	if ($('.helpMeChoose').length) {
		requireDependencies.push('hmc/hmc');
	}

	if ($('.specificationsPage').length) {
		requireDependencies.push('specifications/main');
	}

	if ($('#modelEngineSelector, .productComparison').length) {
		requireDependencies.push('mes/mes');
	}

	if ($('.contractHireCalculator').length) {
		requireDependencies.push('react_apps/build/contract_hire_calculator/main');
	}

	if ($('.accessoriesListing').length) {
		if ($('#template_accessories_results').length) {
			requireDependencies.push('hace_amc/main');
		} else {
			requireDependencies.push('amc/main');
		}
	}

	if (HONDA.CarConfigurator && HONDA.currency && !isIE8) {
		if ($('.gradeSelector, .engineSelector').length) {
			configurator.getInPageApp();
		}

		if ($('.configurator_hub_wrapper').length) {
			configurator.getMainApp();
		}
	}

	require( requireDependencies, function() {
		if (arguments.length) {
			_.each( arguments, function( obj ) {
				if (_.isFunction( obj.initialize )) {
					obj.initialize();
				}
			});

			// check to ensure backbone history is started for the requested app
			// as the configurator app now comes in at a deferred point
			if (!isConfiguratorRequested()) {
				startHistory();
			}
		}
	});

	return router;

    });
define("require_config", function () { });;
