var XDate,AVL,jss,EventRecorder,EventPlayer;(function(){function nt(t){function r(n,i,r,u,f,e){for(;f>=0&&e>f;f+=t){var o=u?u[f]:f;r=i(r,n[o],o,n)}return r}return function(u,f,o,s){f=e(f,s,4);var h=!i(u)&&n.keys(u),l=(h||u).length,c=t>0?0:l-1;return arguments.length<3&&(o=u[h?h[c]:c],c+=t),r(u,f,o,h,c,l)}}function tt(n){return function(i,r,f){r=t(r,f);for(var o=u(i),e=n>0?0:o-1;e>=0&&o>e;e+=n)if(r(i[e],e,i))return e;return-1}}function it(t,i,f){return function(e,o,s){var c=0,h=u(e);if("number"==typeof s)t>0?c=s>=0?s:Math.max(s+h,c):h=s>=0?Math.min(s+1,h):s+h+1;else if(f&&s&&h)return s=f(e,o),e[s]===o?s:-1;if(o!==o)return s=i(r.call(e,c,h),n.isNaN),s>=0?s+c:-1;for(s=t>0?c:h-1;s>=0&&h>s;s+=t)if(e[s]===o)return s;return-1}}function rt(t,i){var u=d.length,f=t.constructor,e=n.isFunction(f)&&f.prototype||v,r="constructor";for(n.has(t,r)&&!n.contains(i,r)&&i.push(r);u--;)r=d[u],r in t&&t[r]!==e[r]&&!n.contains(i,r)&&i.push(r)}var a=this,lt=a._,s=Array.prototype,v=Object.prototype,at=Function.prototype,vt=s.push,r=s.slice,o=v.toString,yt=v.hasOwnProperty,pt=Array.isArray,ut=Object.keys,y=at.bind,ft=Object.create,p=function(){},n=function(t){return t instanceof n?t:this instanceof n?void(this._wrapped=t):new n(t)},e,t,h,f,b,k,d,c,ct,l;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports._=n):a._=n;n.VERSION="1.8.3";e=function(n,t,i){if(t===void 0)return n;switch(null==i?3:i){case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)}}return function(){return n.apply(t,arguments)}};t=function(t,i,r){return null==t?n.identity:n.isFunction(t)?e(t,i,r):n.isObject(t)?n.matcher(t):n.property(t)};n.iteratee=function(n,i){return t(n,i,1/0)};var w=function(n,t){return function(i){var e=arguments.length,r,u;if(2>e||null==i)return i;for(r=1;e>r;r++)for(var o=arguments[r],s=n(o),h=s.length,f=0;h>f;f++)u=s[f],t&&i[u]!==void 0||(i[u]=o[u]);return i}},et=function(t){if(!n.isObject(t))return{};if(ft)return ft(t);p.prototype=t;var i=new p;return p.prototype=null,i},ot=function(n){return function(t){if(null!=t)return t[n]}},wt=Math.pow(2,53)-1,u=ot("length"),i=function(n){var t=u(n);return"number"==typeof t&&t>=0&&wt>=t};n.each=n.forEach=function(t,r,u){var f,o,s;if(r=e(r,u),i(t))for(f=0,o=t.length;o>f;f++)r(t[f],f,t);else for(s=n.keys(t),f=0,o=s.length;o>f;f++)r(t[s[f]],s[f],t);return t};n.map=n.collect=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,c=Array(h),e=0;h>e;e++)s=o?o[e]:e,c[e]=u(r[s],s,r);return c};n.reduce=n.foldl=n.inject=nt(1);n.reduceRight=n.foldr=nt(-1);n.find=n.detect=function(t,r,u){var f;return f=i(t)?n.findIndex(t,r,u):n.findKey(t,r,u),f!==void 0&&f!==-1?t[f]:void 0};n.filter=n.select=function(i,r,u){var f=[];return r=t(r,u),n.each(i,function(n,t,i){r(n,t,i)&&f.push(n)}),f};n.reject=function(i,r,u){return n.filter(i,n.negate(t(r)),u)};n.every=n.all=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;h>e;e++)if(s=o?o[e]:e,!u(r[s],s,r))return!1;return!0};n.some=n.any=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;h>e;e++)if(s=o?o[e]:e,u(r[s],s,r))return!0;return!1};n.contains=n.includes=n.include=function(t,r,u,f){return i(t)||(t=n.values(t)),("number"!=typeof u||f)&&(u=0),n.indexOf(t,r,u)>=0};n.invoke=function(t,i){var u=r.call(arguments,2),f=n.isFunction(i);return n.map(t,function(n){var t=f?i:n[i];return null==t?t:t.apply(n,u)})};n.pluck=function(t,i){return n.map(t,n.property(i))};n.where=function(t,i){return n.filter(t,n.matcher(i))};n.findWhere=function(t,i){return n.find(t,n.matcher(i))};n.max=function(r,u,f){var h,o,e=-1/0,c=-1/0,s,l;if(null==u&&null!=r)for(r=i(r)?r:n.values(r),s=0,l=r.length;l>s;s++)h=r[s],h>e&&(e=h);else u=t(u,f),n.each(r,function(n,t,i){o=u(n,t,i);(o>c||o===-1/0&&e===-1/0)&&(e=n,c=o)});return e};n.min=function(r,u,f){var h,o,e=1/0,c=1/0,s,l;if(null==u&&null!=r)for(r=i(r)?r:n.values(r),s=0,l=r.length;l>s;s++)h=r[s],e>h&&(e=h);else u=t(u,f),n.each(r,function(n,t,i){o=u(n,t,i);(c>o||1/0===o&&1/0===e)&&(e=n,c=o)});return e};n.shuffle=function(t){for(var u,e=i(t)?t:n.values(t),o=e.length,f=Array(o),r=0;o>r;r++)u=n.random(0,r),u!==r&&(f[r]=f[u]),f[u]=e[r];return f};n.sample=function(t,r,u){return null==r||u?(i(t)||(t=n.values(t)),t[n.random(t.length-1)]):n.shuffle(t).slice(0,Math.max(0,r))};n.sortBy=function(i,r,u){return r=t(r,u),n.pluck(n.map(i,function(n,t,i){return{value:n,index:t,criteria:r(n,t,i)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(i>r||i===void 0)return 1;if(r>i||r===void 0)return-1}return n.index-t.index}),"value")};h=function(i){return function(r,u,f){var e={};return u=t(u,f),n.each(r,function(n,t){var f=u(n,t,r);i(e,n,f)}),e}};n.groupBy=h(function(t,i,r){n.has(t,r)?t[r].push(i):t[r]=[i]});n.indexBy=h(function(n,t,i){n[i]=t});n.countBy=h(function(t,i,r){n.has(t,r)?t[r]++:t[r]=1});n.toArray=function(t){return t?n.isArray(t)?r.call(t):i(t)?n.map(t,n.identity):n.values(t):[]};n.size=function(t){return null==t?0:i(t)?t.length:n.keys(t).length};n.partition=function(i,r,u){r=t(r,u);var f=[],e=[];return n.each(i,function(n,t,i){(r(n,t,i)?f:e).push(n)}),[f,e]};n.first=n.head=n.take=function(t,i,r){if(null!=t)return null==i||r?t[0]:n.initial(t,t.length-i)};n.initial=function(n,t,i){return r.call(n,0,Math.max(0,n.length-(null==t||i?1:t)))};n.last=function(t,i,r){if(null!=t)return null==i||r?t[t.length-1]:n.rest(t,Math.max(0,t.length-i))};n.rest=n.tail=n.drop=function(n,t,i){return r.call(n,null==t||i?1:t)};n.compact=function(t){return n.filter(t,n.identity)};f=function(t,r,e,o){for(var s,l,a,h=[],v=0,c=o||0,y=u(t);y>c;c++)if(s=t[c],i(s)&&(n.isArray(s)||n.isArguments(s)))for(r||(s=f(s,r,e)),l=0,a=s.length,h.length+=a;a>l;)h[v++]=s[l++];else e||(h[v++]=s);return h};n.flatten=function(n,t){return f(n,t,!1)};n.without=function(t){return n.difference(t,r.call(arguments,1))};n.uniq=n.unique=function(i,r,f,e){var o,c;n.isBoolean(r)||(e=f,f=r,r=!1);null!=f&&(f=t(f,e));for(var s=[],l=[],h=0,a=u(i);a>h;h++)o=i[h],c=f?f(o,h,i):o,r?(h&&l===c||s.push(o),l=c):f?n.contains(l,c)||(l.push(c),s.push(o)):n.contains(s,o)||s.push(o);return s};n.union=function(){return n.uniq(f(arguments,!0,!0))};n.intersection=function(t){for(var r,i,f=[],o=arguments.length,e=0,s=u(t);s>e;e++)if(r=t[e],!n.contains(f,r)){for(i=1;o>i&&n.contains(arguments[i],r);i++);i===o&&f.push(r)}return f};n.difference=function(t){var i=f(arguments,!0,!0,1);return n.filter(t,function(t){return!n.contains(i,t)})};n.zip=function(){return n.unzip(arguments)};n.unzip=function(t){for(var r=t&&n.max(t,u).length||0,f=Array(r),i=0;r>i;i++)f[i]=n.pluck(t,i);return f};n.object=function(n,t){for(var r={},i=0,f=u(n);f>i;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r};n.findIndex=tt(1);n.findLastIndex=tt(-1);n.sortedIndex=function(n,i,r,f){var o;r=t(r,f,1);for(var h=r(i),e=0,s=u(n);s>e;)o=Math.floor((e+s)/2),r(n[o])<h?e=o+1:s=o;return e};n.indexOf=it(1,n.findIndex,n.sortedIndex);n.lastIndexOf=it(-1,n.findLastIndex);n.range=function(n,t,i){null==t&&(t=n||0,n=0);i=i||1;for(var u=Math.max(Math.ceil((t-n)/i),0),f=Array(u),r=0;u>r;r++,n+=i)f[r]=n;return f};b=function(t,i,r,u,f){if(!(u instanceof i))return t.apply(r,f);var e=et(t.prototype),o=t.apply(e,f);return n.isObject(o)?o:e};n.bind=function(t,i){if(y&&t.bind===y)return y.apply(t,r.call(arguments,1));if(!n.isFunction(t))throw new TypeError("Bind must be called on a function");var f=r.call(arguments,2),u=function(){return b(t,u,i,this,f.concat(r.call(arguments)))};return u};n.partial=function(t){var i=r.call(arguments,1),u=function(){for(var f=0,o=i.length,e=Array(o),r=0;o>r;r++)e[r]=i[r]===n?arguments[f++]:i[r];for(;f<arguments.length;)e.push(arguments[f++]);return b(t,u,this,this,e)};return u};n.bindAll=function(t){var i,r,u=arguments.length;if(1>=u)throw new Error("bindAll must be passed function names");for(i=1;u>i;i++)r=arguments[i],t[r]=n.bind(t[r],t);return t};n.memoize=function(t,i){var r=function(u){var f=r.cache,e=""+(i?i.apply(this,arguments):u);return n.has(f,e)||(f[e]=t.apply(this,arguments)),f[e]};return r.cache={},r};n.delay=function(n,t){var i=r.call(arguments,2);return setTimeout(function(){return n.apply(null,i)},t)};n.defer=n.partial(n.delay,n,1);n.throttle=function(t,i,r){var f,e,s,u=null,o=0,h;return r||(r={}),h=function(){o=r.leading===!1?0:n.now();u=null;s=t.apply(f,e);u||(f=e=null)},function(){var l=n.now(),c;return o||r.leading!==!1||(o=l),c=i-(l-o),f=this,e=arguments,0>=c||c>i?(u&&(clearTimeout(u),u=null),o=l,s=t.apply(f,e),u||(f=e=null)):u||r.trailing===!1||(u=setTimeout(h,c)),s}};n.debounce=function(t,i,r){var u,f,e,s,o,h=function(){var c=n.now()-s;i>c&&c>=0?u=setTimeout(h,i-c):(u=null,r||(o=t.apply(e,f),u||(e=f=null)))};return function(){e=this;f=arguments;s=n.now();var c=r&&!u;return u||(u=setTimeout(h,i)),c&&(o=t.apply(e,f),e=f=null),o}};n.wrap=function(t,i){return n.partial(i,t)};n.negate=function(n){return function(){return!n.apply(this,arguments)}};n.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,i=n[t].apply(this,arguments);r--;)i=n[r].call(this,i);return i}};n.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}};n.before=function(n,t){var i;return function(){return--n>0&&(i=t.apply(this,arguments)),1>=n&&(t=null),i}};n.once=n.partial(n.before,2);k=!{toString:null}.propertyIsEnumerable("toString");d=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];n.keys=function(t){var i,r;if(!n.isObject(t))return[];if(ut)return ut(t);i=[];for(r in t)n.has(t,r)&&i.push(r);return k&&rt(t,i),i};n.allKeys=function(t){var i,r;if(!n.isObject(t))return[];i=[];for(r in t)i.push(r);return k&&rt(t,i),i};n.values=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;u>i;i++)f[i]=t[r[i]];return f};n.mapObject=function(i,r,u){r=t(r,u);for(var f,o=n.keys(i),h=o.length,s={},e=0;h>e;e++)f=o[e],s[f]=r(i[f],f,i);return s};n.pairs=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;u>i;i++)f[i]=[r[i],t[r[i]]];return f};n.invert=function(t){for(var u={},r=n.keys(t),i=0,f=r.length;f>i;i++)u[t[r[i]]]=r[i];return u};n.functions=n.methods=function(t){var r=[],i;for(i in t)n.isFunction(t[i])&&r.push(i);return r.sort()};n.extend=w(n.allKeys);n.extendOwn=n.assign=w(n.keys);n.findKey=function(i,r,u){r=t(r,u);for(var f,o=n.keys(i),e=0,s=o.length;s>e;e++)if(f=o[e],r(i[f],f,i))return f};n.pick=function(t,i,r){var c,o,l={},u=t,s,v,h,a;if(null==u)return l;for(n.isFunction(i)?(o=n.allKeys(u),c=e(i,r)):(o=f(arguments,!1,!1,1),c=function(n,t,i){return t in i},u=Object(u)),s=0,v=o.length;v>s;s++)h=o[s],a=u[h],c(a,h,u)&&(l[h]=a);return l};n.omit=function(t,i,r){if(n.isFunction(i))i=n.negate(i);else{var u=n.map(f(arguments,!1,!1,1),String);i=function(t,i){return!n.contains(u,i)}}return n.pick(t,i,r)};n.defaults=w(n.allKeys,!0);n.create=function(t,i){var r=et(t);return i&&n.extendOwn(r,i),r};n.clone=function(t){return n.isObject(t)?n.isArray(t)?t.slice():n.extend({},t):t};n.tap=function(n,t){return t(n),n};n.isMatch=function(t,i){var e=n.keys(i),o=e.length,f,r,u;if(null==t)return!o;for(f=Object(t),r=0;o>r;r++)if(u=e[r],i[u]!==f[u]||!(u in f))return!1;return!0};c=function(t,i,r,u){var h,a,e,s,f,l,v;if(t===i)return 0!==t||1/t==1/i;if(null==t||null==i)return t===i;if(t instanceof n&&(t=t._wrapped),i instanceof n&&(i=i._wrapped),h=o.call(t),h!==o.call(i))return!1;switch(h){case"[object RegExp]":case"[object String]":return""+t==""+i;case"[object Number]":return+t!=+t?+i!=+i:0==+t?1/+t==1/i:+t==+i;case"[object Date]":case"[object Boolean]":return+t==+i}if(a="[object Array]"===h,!a&&("object"!=typeof t||"object"!=typeof i||(e=t.constructor,s=i.constructor,e!==s&&!(n.isFunction(e)&&e instanceof e&&n.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in i)))return!1;for(r=r||[],u=u||[],f=r.length;f--;)if(r[f]===t)return u[f]===i;if(r.push(t),u.push(i),a){if(f=t.length,f!==i.length)return!1;for(;f--;)if(!c(t[f],i[f],r,u))return!1}else{if(v=n.keys(t),f=v.length,n.keys(i).length!==f)return!1;for(;f--;)if(l=v[f],!n.has(i,l)||!c(t[l],i[l],r,u))return!1}return r.pop(),u.pop(),!0};n.isEqual=function(n,t){return c(n,t)};n.isEmpty=function(t){return null==t?!0:i(t)&&(n.isArray(t)||n.isString(t)||n.isArguments(t))?0===t.length:0===n.keys(t).length};n.isElement=function(n){return!(!n||1!==n.nodeType)};n.isArray=pt||function(n){return"[object Array]"===o.call(n)};n.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n};n.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){n["is"+t]=function(n){return o.call(n)==="[object "+t+"]"}});n.isArguments(arguments)||(n.isArguments=function(t){return n.has(t,"callee")});"function"!=typeof/./&&"object"!=typeof Int8Array&&(n.isFunction=function(n){return"function"==typeof n||!1});n.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))};n.isNaN=function(t){return n.isNumber(t)&&t!==+t};n.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===o.call(n)};n.isNull=function(n){return null===n};n.isUndefined=function(n){return n===void 0};n.has=function(n,t){return null!=n&&yt.call(n,t)};n.noConflict=function(){return a._=lt,this};n.identity=function(n){return n};n.constant=function(n){return function(){return n}};n.noop=function(){};n.property=ot;n.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}};n.matcher=n.matches=function(t){return t=n.extendOwn({},t),function(i){return n.isMatch(i,t)}};n.times=function(n,t,i){var u=Array(Math.max(0,n)),r;for(t=e(t,i,1),r=0;n>r;r++)u[r]=t(r);return u};n.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};n.now=Date.now||function(){return(new Date).getTime()};var st={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},bt=n.invert(st),ht=function(t){var r=function(n){return t[n]},i="(?:"+n.keys(t).join("|")+")",u=RegExp(i),f=RegExp(i,"g");return function(n){return n=null==n?"":""+n,u.test(n)?n.replace(f,r):n}};n.escape=ht(st);n.unescape=ht(bt);n.result=function(t,i,r){var u=null==t?void 0:t[i];return u===void 0&&(u=r),n.isFunction(u)?u.call(t):u};ct=0;n.uniqueId=function(n){var t=++ct+"";return n?n+t:t};n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var g=/(.)^/,kt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g,gt=function(n){return"\\"+kt[n]};n.template=function(t,i,r){var o,f,h;!i&&r&&(i=r);i=n.defaults({},i,n.templateSettings);var c=RegExp([(i.escape||g).source,(i.interpolate||g).source,(i.evaluate||g).source].join("|")+"|$","g"),e=0,u="__p+='";t.replace(c,function(n,i,r,f,o){return u+=t.slice(e,o).replace(dt,gt),e=o+n.length,i?u+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":f&&(u+="';\n"+f+"\n__p+='"),n});u+="';\n";i.variable||(u="with(obj||{}){\n"+u+"}\n");u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{o=new Function(i.variable||"obj","_",u)}catch(s){throw s.source=u,s;}return f=function(t){return o.call(this,t,n)},h=i.variable||"obj",f.source="function("+h+"){\n"+u+"}",f};n.chain=function(t){var i=n(t);return i._chain=!0,i};l=function(t,i){return t._chain?n(i).chain():i};n.mixin=function(t){n.each(n.functions(t),function(i){var r=n[i]=t[i];n.prototype[i]=function(){var t=[this._wrapped];return vt.apply(t,arguments),l(this,r.apply(n,t))}})};n.mixin(n);n.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var i=s[t];n.prototype[t]=function(){var n=this._wrapped;return i.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],l(this,n)}});n.each(["concat","join","slice"],function(t){var i=s[t];n.prototype[t]=function(){return l(this,i.apply(this._wrapped,arguments))}});n.prototype.value=function(){return this._wrapped};n.prototype.valueOf=n.prototype.toJSON=n.prototype.value;n.prototype.toString=function(){return""+this._wrapped};"function"==typeof define&&define.amd&&define("underscore",[],function(){return n})}).call(this);XDate=function(n,t,i,r){function f(){var r=this instanceof f?this:new f,i=arguments,t=i.length,e,u;if(typeof i[t-1]=="boolean"&&(e=i[--t],i=w(i,0,t)),t)if(t==1){if(t=i[0],t instanceof n||typeof t=="number")r[0]=new n(+t);else if(t instanceof f)i=r,u=new n(+t[0]),s(t)&&(u.toString=g),i[0]=u;else if(typeof t=="string"){r[0]=new n(0);n:{for(var i=t,t=e||!1,u=f.parsers,o=0,c;o<u.length;o++)if(c=u[o](i,t,r)){r=c;break n}r[0]=new n(i)}}}else r[0]=new n(h.apply(n,i)),e||(r[0]=p(r[0]));else r[0]=new n;return typeof e=="boolean"&&nt(r,e),r}function s(n){return n[0].toString===g}function nt(t,i,r){return i?s(t)||(r&&(t[0]=new n(h(t[0].getFullYear(),t[0].getMonth(),t[0].getDate(),t[0].getHours(),t[0].getMinutes(),t[0].getSeconds(),t[0].getMilliseconds()))),t[0].toString=g):s(t)&&(t[0]=r?p(t[0]):new n(+t[0])),t}function tt(n,t,i,r,u){var f=c(o,n[0],u),n=c(ot,n[0],u),u=!1;r.length==2&&typeof r[1]=="boolean"&&(u=r[1],r=[i]);i=t==1?(i%12+12)%12:f(1);n(t,r);u&&f(1)!=i&&(n(1,[f(1)-1]),n(2,[st(f(0),f(1))]))}function it(n,i,r,u){var r=Number(r),f=t.floor(r);n["set"+l[i]](n["get"+l[i]]()+f,u||!1);f!=r&&i<6&&it(n,i+1,(r-f)*lt[i],u)}function rt(n,i,r){var n=n.clone().setUTCMode(!0,!0),i=f(i).setUTCMode(!0,!0),u=0,e;if(r==0||r==1){for(e=6;e>=r;e--)u/=lt[e],u+=o(i,!1,e)-o(n,!1,e);r==1&&(u+=(i.getFullYear()-n.getFullYear())*12)}else r==2?(r=n.toDate().setUTCHours(0,0,0,0),u=i.toDate().setUTCHours(0,0,0,0),u=t.round((u-r)/864e5)+(i-u-(n-r))/864e5):u=(i-n)/[36e5,6e4,1e3,1][r-3];return u}function a(i){var r=i(0),u=i(1),f=i(2),i=new n(h(r,u,f)),r=v(ut(r,u,f));return t.floor(t.round((i-r)/864e5)/7)+1}function ut(t,i,r){return(i=new n(h(t,i,r)),i<v(t))?t-1:i>=v(t+1)?t+1:t}function v(t){return t=new n(h(t,0,4)),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+6)%7),t}function ft(n,t,i,u){var f=c(o,n,u),e=c(ot,n,u);i===r&&(i=ut(f(0),f(1),f(2)));i=v(i);u||(i=p(i));n.setTime(+i);e(2,[f(2)+(t-1)*7])}function et(n,t,i,r,u){var e=f.locales,h=e[f.defaultLocale]||{},s=c(o,n,u),i=(typeof i=="string"?e[i]:i)||{};return b(n,t,function(n){if(r)for(var t=(n==7?2:n)-1;t>=0;t--)r.push(s(t));return s(n)},function(n){return i[n]||h[n]},u)}function b(n,t,i,u,f){for(var e,h,o="";e=t.match(vt);){if(o+=t.substr(0,e.index),e[1]){h=o;for(var o=n,s=e[1],v=i,y=u,p=f,c=s.length,l=void 0,a="";c>0;)l=at(o,s.substr(0,c),v,y,p),l!==r?(a+=l,s=s.substr(c),c=s.length):c--;o=h+(a+s)}else e[3]?(h=b(n,e[4],i,u,f),parseInt(h.replace(/\D/g,""),10)&&(o+=h)):o+=e[7]||"'";t=t.substr(e.index+e[0].length)}return o+t}function at(n,i,r,u,o){var s=f.formatters[i];if(typeof s=="string")return b(n,s,r,u,o);if(typeof s=="function")return s(n,o||!1,u);switch(i){case"fff":return e(r(6),3);case"s":return r(5);case"ss":return e(r(5));case"m":return r(4);case"mm":return e(r(4));case"h":return r(3)%12||12;case"hh":return e(r(3)%12||12);case"H":return r(3);case"HH":return e(r(3));case"d":return r(2);case"dd":return e(r(2));case"ddd":return u("dayNamesShort")[r(7)]||"";case"dddd":return u("dayNames")[r(7)]||"";case"M":return r(1)+1;case"MM":return e(r(1)+1);case"MMM":return u("monthNamesShort")[r(1)]||"";case"MMMM":return u("monthNames")[r(1)]||"";case"yy":return(r(0)+"").substring(2);case"yyyy":return r(0);case"t":return y(r,u).substr(0,1).toLowerCase();case"tt":return y(r,u).toLowerCase();case"T":return y(r,u).substr(0,1);case"TT":return y(r,u);case"z":case"zz":case"zzz":return o?i="Z":(u=n.getTimezoneOffset(),n=u<0?"+":"-",r=t.floor(t.abs(u)/60),u=t.abs(u)%60,o=r,i=="zz"?o=e(r):i=="zzz"&&(o=e(r)+":"+e(u)),i=n+o),i;case"w":return a(r);case"ww":return e(a(r));case"S":return i=r(2),i>10&&i<20?"th":["st","nd","rd"][i%10-1]||"th"}}function y(n,t){return n(3)<12?t("amDesignator"):t("pmDesignator")}function k(n){return!isNaN(+n[0])}function o(n,t,i){return n["get"+(t?"UTC":"")+l[i]]()}function ot(n,t,i,r){n["set"+(t?"UTC":"")+l[i]].apply(n,r)}function p(t){return new n(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds())}function st(t,i){return 32-new n(h(t,i,32)).getUTCDate()}function d(n){return function(){return n.apply(r,[this].concat(w(arguments)))}}function c(n){var t=w(arguments,1);return function(){return n.apply(r,t.concat(w(arguments)))}}function w(n,t,u){return i.prototype.slice.call(n,t||0,u===r?n.length:u)}function ht(n,t){for(var i=0;i<n.length;i++)t(n[i],i)}function e(n,t){for(t=t||2,n+="";n.length<t;)n="0"+n;return n}var l="FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds,Day,Year".split(","),ct=["Years","Months","Days"],lt=[12,31,24,60,60,1e3,1],vt=/(([a-zA-Z])\2*)|(\((('.*?'|\(.*?\)|.)*?)\))|('(.*?)')/,h=n.UTC,g=n.prototype.toUTCString,u=f.prototype;return u.length=1,u.splice=i.prototype.splice,u.getUTCMode=d(s),u.setUTCMode=d(nt),u.getTimezoneOffset=function(){return s(this)?0:this[0].getTimezoneOffset()},ht(l,function(n,t){u["get"+n]=function(){return o(this[0],s(this),t)};t!=8&&(u["getUTC"+n]=function(){return o(this[0],!0,t)});t!=7&&(u["set"+n]=function(n){return tt(this,t,n,arguments,s(this)),this},t!=8&&(u["setUTC"+n]=function(n){return tt(this,t,n,arguments,!0),this},u["add"+(ct[t]||n)]=function(n,i){return it(this,t,n,i),this},u["diff"+(ct[t]||n)]=function(n){return rt(this,n,t)}))}),u.getWeek=function(){return a(c(o,this,!1))},u.getUTCWeek=function(){return a(c(o,this,!0))},u.setWeek=function(n,t){return ft(this,n,t,!1),this},u.setUTCWeek=function(n,t){return ft(this,n,t,!0),this},u.addWeeks=function(n){return this.addDays(Number(n)*7)},u.diffWeeks=function(n){return rt(this,n,2)/7},f.parsers=[function(t,i,r){if(t=t.match(/^(\d{4})(-(\d{2})(-(\d{2})([T ](\d{2}):(\d{2})(:(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/)){var u=new n(h(t[1],t[3]?t[3]-1:0,t[5]||1,t[7]||0,t[8]||0,t[10]||0,t[12]?Number("0."+t[12])*1e3:0));return t[13]?t[14]&&u.setUTCMinutes(u.getUTCMinutes()+(t[15]=="-"?1:-1)*(Number(t[16])*60+(t[18]?Number(t[18]):0))):i||(u=p(u)),r.setTime(+u)}}],f.parse=function(n){return+f(""+n)},u.toString=function(n,t,i){return n===r||!k(this)?this[0].toString():et(this,n,t,i,s(this))},u.toUTCString=u.toGMTString=function(n,t,i){return n===r||!k(this)?this[0].toUTCString():et(this,n,t,i,!0)},u.toISOString=function(){return this.toUTCString("yyyy-MM-dd'T'HH:mm:ss(.fff)zzz")},f.defaultLocale="",f.locales={"":{monthNames:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthNamesShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),dayNames:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),dayNamesShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),amDesignator:"AM",pmDesignator:"PM"}},f.formatters={i:"yyyy-MM-dd'T'HH:mm:ss(.fff)",u:"yyyy-MM-dd'T'HH:mm:ss(.fff)zzz"},ht("getTime,valueOf,toDateString,toTimeString,toLocaleString,toLocaleDateString,toLocaleTimeString,toJSON".split(","),function(n){u[n]=function(){return this[0][n]()}}),u.setTime=function(n){return this[0].setTime(n),this},u.valid=d(k),u.clone=function(){return new f(this)},u.clearTime=function(){return this.setHours(0,0,0,0)},u.toDate=function(){return new n(+this[0])},f.now=function(){return+new n},f.today=function(){return(new f).clearTime()},f.UTC=h,f.getDaysInMonth=st,typeof module!="undefined"&&module.exports&&(module.exports=f),typeof define=="function"&&define.amd&&define([],function(){return f}),f}(Date,Math,Array),function(n){function t(n,t){if(!(n.originalEvent.touches.length>1)){n.preventDefault();var i=n.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null);n.target.dispatchEvent(r)}}if(n.support.touch="ontouchend"in document,n.support.touch){var i=n.ui.mouse.prototype,u=i._mouseInit,r;i._touchStart=function(n){var i=this;!r&&i._mouseCapture(n.originalEvent.changedTouches[0])&&(r=!0,i._touchMoved=!1,t(n,"mouseover"),t(n,"mousemove"),t(n,"mousedown"))};i._touchMove=function(n){r&&(this._touchMoved=!0,t(n,"mousemove"))};i._touchEnd=function(n){r&&(t(n,"mouseup"),t(n,"mouseout"),this._touchMoved||t(n,"click"),r=!1)};i._mouseInit=function(){var t=this;t.element.bind("touchstart",n.proxy(t,"_touchStart")).bind("touchmove",n.proxy(t,"_touchMove")).bind("touchend",n.proxy(t,"_touchEnd"));u.call(t)}}}(jQuery),function(n){typeof define=="function"&&define.amd?define(["jquery"],function(t){return n(t)}):typeof module=="object"&&typeof module.exports=="object"?exports=n(require("jquery")):n(jQuery)}(function(n){function o(n){var i=7.5625,t=2.75;return n<1/t?i*n*n:n<2/t?i*(n-=1.5/t)*n+.75:n<2.5/t?i*(n-=2.25/t)*n+.9375:i*(n-=2.625/t)*n+.984375}n.easing.jswing=n.easing.swing;var t=Math.pow,u=Math.sqrt,i=Math.sin,s=Math.cos,r=Math.PI,f=1.70158,e=f*1.525,h=f+1,c=2*r/3,l=2*r/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(t){return n.easing[n.easing.def](t)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-s(n*r/2)},easeOutSine:function(n){return i(n*r/2)},easeInOutSine:function(n){return-(s(r*n)-1)/2},easeInExpo:function(n){return n===0?0:t(2,10*n-10)},easeOutExpo:function(n){return n===1?1:1-t(2,-10*n)},easeInOutExpo:function(n){return n===0?0:n===1?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return n===0?0:n===1?1:-t(2,10*n-10)*i((n*10-10.75)*c)},easeOutElastic:function(n){return n===0?0:n===1?1:t(2,-10*n)*i((n*10-.75)*c)+1},easeInOutElastic:function(n){return n===0?0:n===1?1:n<.5?-(t(2,20*n-10)*i((20*n-11.125)*l))/2:t(2,-20*n+10)*i((20*n-11.125)*l)/2+1},easeInBack:function(n){return h*n*n*n-f*n*n},easeOutBack:function(n){return 1+h*t(n-1,3)+f*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*((e+1)*2*n-e)/2:(t(2*n-2,2)*((e+1)*(n*2-2)+e)+2)/2},easeInBounce:function(n){return 1-o(1-n)},easeOutBounce:o,easeInOutBounce:function(n){return n<.5?(1-o(1-2*n))/2:(1+o(2*n-1))/2}})}),function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";function r(t){return!t.nodeName||-1!==n.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function i(t){return n.isFunction(t)||n.isPlainObject(t)?t:{top:t,left:t}}var t=n.scrollTo=function(t,i,r){return n(window).scrollTo(t,i,r)};return t.defaults={axis:"xy",duration:0,limit:!0},n.fn.scrollTo=function(u,f,e){"object"==typeof f&&(e=f,f=0);"function"==typeof e&&(e={onAfter:e});"max"===u&&(u=9e9);e=n.extend({},t.defaults,e);f=f||e.duration;var o=e.queue&&1<e.axis.length;return o&&(f/=2),e.offset=i(e.offset),e.over=i(e.over),this.each(function(){function y(t){var i=n.extend({},e,{queue:!0,duration:f,complete:t&&function(){t.call(c,s,e)}});a.animate(h,i)}var p;if(null!==u){var l=r(this),c=l?this.contentWindow||window:this,a=n(c),s=u,h={},v;switch(typeof s){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(s)){s=i(s);break}s=l?n(s):n(s,c);case"object":if(s.length===0)return;(s.is||s.style)&&(v=(s=n(s)).offset())}p=n.isFunction(e.offset)&&e.offset(c,s)||e.offset;n.each(e.axis.split(""),function(n,i){var u="x"===i?"Left":"Top",f=u.toLowerCase(),r="scroll"+u,w=a[r](),b=t.max(c,i);v?(h[r]=v[f]+(l?0:w-a.offset()[f]),e.margin&&(h[r]-=parseInt(s.css("margin"+u),10)||0,h[r]-=parseInt(s.css("border"+u+"Width"),10)||0),h[r]+=p[f]||0,e.over[f]&&(h[r]+=s["x"===i?"width":"height"]()*e.over[f])):(u=s[f],h[r]=u.slice&&"%"===u.slice(-1)?parseFloat(u)/100*b:u);e.limit&&/^\d+$/.test(h[r])&&(h[r]=0>=h[r]?0:Math.min(h[r],b));!n&&1<e.axis.length&&(w===h[r]?h={}:o&&(y(e.onAfterFirst),h={}))});y(e.onAfter)}})},t.max=function(t,i){var u="x"===i?"Width":"Height",e="scroll"+u;if(!r(t))return t[e]-n(t)[u.toLowerCase()]();var u="client"+u,f=t.ownerDocument||t.document,o=f.documentElement,f=f.body;return Math.max(o[e],f[e])-Math.min(o[u],f[u])},n.Tween.propHooks.scrollLeft=n.Tween.propHooks.scrollTop={get:function(t){return n(t.elem)[t.prop]()},set:function(t){var r=this.get(t),i;if(t.options.interrupt&&t._last&&t._last!==r)return n(t.elem).stop();i=Math.round(t.now);r!==i&&(n(t.elem)[t.prop](i),t._last=this.get(t))}},t}),function(){function t(){var t="",n;for(n in this)typeof this[n]!="function"&&(t+=n+'="'+this[n]+'" ');return t}function i(){var t="",n;for(n in this)typeof this[n]!="function"&&(t+=n+"="+encodeURIComponent(this[n])+"&");return t.replace(/&$/,"")}var n;n=jQuery.fn.flash=function(t,i,r,u){var f=r||n.replace,e;if(i=n.copy(n.pluginOptions,i),!n.hasFlash(i.version))if(i.expressInstall&&n.hasFlash(6,0,65))e={flashvars:{MMredirectURL:location,MMplayerType:"PlugIn",MMdoctitle:jQuery("title").text()}};else if(i.update)f=u||n.update;else return this;return t=n.copy(n.htmlOptions,e,t),this.each(function(){f.call(this,n.copy(t))})};n.copy=function(){for(var i={},r={},n,t=0;t<arguments.length;t++)(n=arguments[t],n!=undefined)&&(jQuery.extend(i,n),n.flashvars!=undefined)&&jQuery.extend(r,n.flashvars);return i.flashvars=r,i};n.hasFlash=function(){function u(){var n=!1,t;try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");t&&(n=!0)}catch(i){navigator.mimeTypes["application/x-shockwave-flash"]!=undefined&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(n=!0)}return n}var i,r,t;if(/hasFlash\=true/.test(location))return navigator.appName!="Microsoft Internet Explorer"||u()?!0:!1;if(/hasFlash\=false/.test(location))return!1;for(i=n.hasFlash.playerVersion().match(/\d+/g),r=String([arguments[0],arguments[1],arguments[2]]).match(/\d+/g)||String(n.pluginOptions.version).match(/\d+/g),t=0;t<3;t++){if(i[t]=parseInt(i[t]||0),r[t]=parseInt(r[t]||0),i[t]<r[t])return!1;if(i[t]>r[t])return!0}return!0};n.hasFlash.playerVersion=function(){try{try{var n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");try{n.AllowScriptAccess="always"}catch(t){return"6,0,0"}}catch(t){}return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){try{if(navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin)return(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g,",").match(/^,?(.+),?$/)[1]}catch(t){}}return"0,0,0"};n.htmlOptions={height:240,flashvars:{},pluginspage:"http://www.adobe.com/go/getflashplayer",src:"#",type:"application/x-shockwave-flash",width:320};n.pluginOptions={expressInstall:!1,update:!0,version:"6.0.65"};n.replace=function(t){jQuery(this).addClass("flash-replaced").append(n.transform(t))};n.update=function(){var n=String(location).split("?"),t;n.splice(1,0,"?hasFlash=true&");n=n.join("");t='<p>This content requires the Flash Player. <a href="http://www.adobe.com/go/getflashplayer">Download Flash Player<\/a>. Already have Flash Player? <a class="lnk-hasflash" href="'+n+'">Click here.<\/a><\/p>';this.innerHTML='<span class="alt">'+this.innerHTML+"<\/span>";jQuery(this).addClass("flash-update").prepend(t)};n.transform=function(n){return n.toString=t,n.flashvars&&(n.flashvars.toString=i),'<embed id="flashContent"'+String(n)+"/>"};window.attachEvent&&window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}(),function(n){"use strict";var o=function(n,t){typeof t=="undefined"&&(t={});this.init(n,t)},t=o.prototype,f,e=["canvas","vml"],i=["oval","spiral","square","rect","roundRect"],v=/^\#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,c=navigator.appVersion.indexOf("MSIE")!==-1&&parseFloat(navigator.appVersion.split("MSIE")[1])===8?!0:!1,y=!!document.createElement("canvas").getContext,l=40,a=!0,u=function(n,t,i){var r=document.createElement(n),u;for(u in i)r[u]=i[u];return typeof t!="undefined"&&t.appendChild(r),r},r=function(n,t){for(var i in t)n.style[i]=t[i];return n},s=function(n,t){for(var i in t)n.setAttribute(i,t[i]);return n},h=function(n,t,i,r){n.save();n.translate(t,i);n.rotate(r);n.translate(-t,-i);n.beginPath()};t.init=function(n,t){var s,i;typeof t.safeVML=="boolean"&&(a=t.safeVML);try{this.mum=document.getElementById(n)!==undefined?document.getElementById(n):document.body}catch(h){this.mum=document.body}if(t.id=typeof t.id!="undefined"?t.id:"canvasLoader",this.cont=u("div",this.mum,{id:t.id}),y)f=e[0],this.can=u("canvas",this.cont),this.con=this.can.getContext("2d"),this.cCan=r(u("canvas",this.cont),{display:"none"}),this.cCon=this.cCan.getContext("2d");else{if(f=e[1],typeof o.vmlSheet=="undefined")for(document.getElementsByTagName("head")[0].appendChild(u("style")),o.vmlSheet=document.styleSheets[document.styleSheets.length-1],s=["group","oval","roundrect","fill"],i=0;i<s.length;++i)o.vmlSheet.addRule(s[i],"behavior:url(#default#VML); position:absolute;");this.vml=u("group",this.cont)}this.setColor(this.color);this.draw();r(this.cont,{display:"none"})};t.cont={};t.can={};t.con={};t.cCan={};t.cCon={};t.timer={};t.activeId=0;t.diameter=40;t.setDiameter=function(n){this.diameter=Math.round(Math.abs(n));this.redraw()};t.getDiameter=function(){return this.diameter};t.cRGB={};t.color="#000000";t.setColor=function(n){this.color=v.test(n)?n:"#000000";this.cRGB=this.getRGB(this.color);this.redraw()};t.getColor=function(){return this.color};t.shape=i[0];t.setShape=function(n){var t;for(t in i)if(n===i[t]){this.shape=n;this.redraw();break}};t.getShape=function(){return this.shape};t.density=40;t.setDensity=function(n){this.density=a&&f===e[1]?Math.round(Math.abs(n))<=l?Math.round(Math.abs(n)):l:Math.round(Math.abs(n));this.density>360&&(this.density=360);this.activeId=0;this.redraw()};t.getDensity=function(){return this.density};t.range=1.3;t.setRange=function(n){this.range=Math.abs(n);this.redraw()};t.getRange=function(){return this.range};t.speed=2;t.setSpeed=function(n){this.speed=Math.round(Math.abs(n))};t.getSpeed=function(){return this.speed};t.fps=24;t.setFPS=function(n){this.fps=Math.round(Math.abs(n));this.reset()};t.getFPS=function(){return this.fps};t.getRGB=function(n){return n=n.charAt(0)==="#"?n.substring(1,7):n,{r:parseInt(n.substring(0,2),16),g:parseInt(n.substring(2,4),16),b:parseInt(n.substring(4,6),16)}};t.draw=function(){var w=0,a,p,n,o,l,tt,d,b,nt=this.density,it=Math.round(nt*this.range),k,rt=0,ft,et,ut,st,y=1e3,ot=0,v=this.cCon,t=this.diameter,g=.47;if(f===e[0])for(v.clearRect(0,0,y,y),s(this.can,{width:t,height:t}),s(this.cCan,{width:t,height:t});w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;d=tt/180*Math.PI;v.fillStyle="rgba("+this.cRGB.r+","+this.cRGB.g+","+this.cRGB.b+","+k.toString()+")";switch(this.shape){case i[0]:case i[1]:a=t*.07;o=t*g+Math.cos(d)*(t*g-a)-t*g;l=t*g+Math.sin(d)*(t*g-a)-t*g;v.beginPath();this.shape===i[1]?v.arc(t*.5+o,t*.5+l,a*k,0,Math.PI*2,!1):v.arc(t*.5+o,t*.5+l,a,0,Math.PI*2,!1);break;case i[2]:a=t*.12;o=Math.cos(d)*(t*g-a)+t*.5;l=Math.sin(d)*(t*g-a)+t*.5;h(v,o,l,d);v.fillRect(o,l-a*.5,a,a);break;case i[3]:case i[4]:p=t*.3;n=p*.27;o=Math.cos(d)*(n+(t-n)*.13)+t*.5;l=Math.sin(d)*(n+(t-n)*.13)+t*.5;h(v,o,l,d);this.shape===i[3]?v.fillRect(o,l-n*.5,p,n):(b=n*.55,v.moveTo(o+b,l-n*.5),v.lineTo(o+p-b,l-n*.5),v.quadraticCurveTo(o+p,l-n*.5,o+p,l-n*.5+b),v.lineTo(o+p,l-n*.5+n-b),v.quadraticCurveTo(o+p,l-n*.5+n,o+p-b,l-n*.5+n),v.lineTo(o+b,l-n*.5+n),v.quadraticCurveTo(o,l-n*.5+n,o,l-n*.5+n-b),v.lineTo(o,l-n*.5+b),v.quadraticCurveTo(o,l-n*.5,o+b,l-n*.5))}v.closePath();v.fill();v.restore();++w}else{r(this.cont,{width:t,height:t});r(this.vml,{width:t,height:t});switch(this.shape){case i[0]:case i[1]:ut="oval";a=y*.14;break;case i[2]:ut="roundrect";a=y*.12;break;case i[3]:case i[4]:ut="roundrect";a=y*.3}for(p=n=a,o=y*.5-n,l=-n*.5;w<nt;){k=w<=it?1-(1-rt)/it*w:k=rt;tt=270-360/nt*w;switch(this.shape){case i[1]:p=n=a*k;o=y*.5-a*.5-a*k*.5;l=(a-a*k)*.5;break;case i[0]:case i[2]:c&&(l=0,this.shape===i[2]&&(o=y*.5-n*.5));break;case i[3]:case i[4]:p=a*.95;n=p*.28;c?(o=0,l=y*.5-n*.5):(o=y*.5-p,l=-n*.5);ot=this.shape===i[4]?.6:0}et=s(r(u("group",this.vml),{width:y,height:y,rotation:tt}),{coordsize:y+","+y,coordorigin:-y*.5+","+-y*.5});ft=r(u(ut,et,{stroked:!1,arcSize:ot}),{width:p,height:n,top:l,left:o});st=u("fill",ft,{color:this.color,opacity:k});++w}}this.tick(!0)};t.clean=function(){if(f===e[0])this.con.clearRect(0,0,1e3,1e3);else{var n=this.vml;if(n.hasChildNodes())while(n.childNodes.length>=1)n.removeChild(n.firstChild)}};t.redraw=function(){this.clean();this.draw()};t.reset=function(){typeof this.timer=="number"&&(this.hide(),this.show())};t.tick=function(n){var i=this.con,t=this.diameter;n||(this.activeId+=360/this.density*this.speed);f===e[0]?(i.clearRect(0,0,t,t),h(i,t*.5,t*.5,this.activeId/180*Math.PI),i.drawImage(this.cCan,0,0,t,t),i.restore()):(this.activeId>=360&&(this.activeId-=360),r(this.vml,{rotation:this.activeId}))};t.show=function(){if(typeof this.timer!="number"){var n=this;this.timer=self.setInterval(function(){n.tick()},Math.round(1e3/this.fps));r(this.cont,{display:"block"})}};t.hide=function(){typeof this.timer=="number"&&(clearInterval(this.timer),delete this.timer,r(this.cont,{display:"none"}))};t.kill=function(){var n=this.cont,t;typeof this.timer=="number"&&this.hide();f===e[0]?(n.removeChild(this.can),n.removeChild(this.cCan)):n.removeChild(this.vml);for(t in this)delete this[t]};n.CanvasLoader=o}(window),function(n,t,i){if(jQuery.fn.cssAnimate=function(t,i,r,u){return typeof i!="number"&&(u=r,r=i,i=400),typeof r=="function"&&(u=r,r=""),this.each(function(){var o;if(jQuery.fn.cssAnimate.hasTransitions){var e="transitionend",f="";e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",transition:"transitionend"}[Modernizr.prefixed("transition")];this.addEventListener(e,function(){this.removeEventListener(e,arguments.callee,!1);n(this).css({"-webkit-transition":"","-moz-transition":"","-o-transition":"","-ms-transition":"",transition:""});typeof u=="function"&&u()},!1);(typeof r=="undefined"||r=="swing")&&(r="ease");for(o in t)f!=""&&(f+=", "),f+=o+" "+i+"ms "+r;n(this).css({"-webkit-transition":f,"-moz-transition":f,"-o-transition":f,"-ms-transition":f,transition:f});n(this).css(t)}else r!="linear"&&(r="swing"),typeof u!="function"&&(onAnimationComplete=function(){}),n(this).animate(t,i,r,u)})},jQuery.fn.cssAnimate.hasTransitions=!1,typeof Modernizr!="undefined"&&typeof Modernizr.csstransitions!="undefined")jQuery.fn.cssAnimate.hasTransitions=Modernizr.csstransitions;else{var r=i.createElement("p").style;jQuery.fn.cssAnimate.hasTransitions="transition"in r||"WebkitTransition"in r||"MozTransition"in r||"msTransition"in r||"OTransition"in r}}(jQuery,window,document),function(n){function t(t,i){i||(n("#site-container").removeClass("overlay-helper"),n("#avlOverlay").fadeOut(t.overlayHideSpeed,function(){s(t)}))}function s(t){n("#avlOverlay").remove();t.onHide()}function i(t,i){n(t.target).parent().hasClass("avlModal")&&n(t.target).unwrap();i&&n(".avlModal").css("zIndex","10000");(n("object embed[type]").length>0&&n("object embed[type]").attr("type").match("java")||n("object[codeBase]").length>0&&n("object[codeBase]").attr("codeBase").match("java"))&&n("object").parent().css({width:"100%",height:"",position:"static",right:"",bottom:"",overflow:"show"});n(t.target).find(".avlModal-content").css({"max-height":"",height:""})}function h(t){return t.target!=""&&n(t.target).length||t.url!=""?!0:!1}function c(t){t.target!=""?r(t,n(t.target)):n.ajax({url:t.url,data:t.parameters,cache:t.cache,dataType:"html",method:"GET",success:function(n){t.onSuccess();r(t,n)}})}function r(t,i){n("#avlOverlay").length?f(t,i):(n(i).parent().append("<div id='avlOverlay'><!-- --><\/div>"),n("#avlOverlay").css({position:"absolute",zIndex:"9999",left:"0",top:"0",opacity:t.overlayOpacity,display:"none"}),t.overlayImage!=""?n("#avlOverlay").css({backgroundImage:"url("+t.overlayImage+")"}):n("#avlOverlay").css({backgroundColor:t.overlayColor}),u(),n("#site-container").addClass("overlay-helper"),n("#avlOverlay").fadeIn(t.overlayShowSpeed,function(){}),f(t,i))}function u(){n("#avlOverlay").css({position:"fixed",top:"0px",left:"0px",height:"100%",width:"100%",transform:"translateZ(1px)"})}function l(n){return!isNaN(parseFloat(n))&&isFinite(n)}function f(t,i){var u,f,r;n(".avlModal").length>0&&n(".avlModal").css("zIndex","9998");n(i).wrap("<div class='avlModal' />").removeClass("avlModal-container");r=n(i).parent();n(i).find(".avlModal-content-wrapper").length==0&&(n(i).find(".avlModal-content").wrapInner("<div class='avlModal-content-wrapper' />"),n(i).data("initialHeight",r.height()).data("initialWidth",parseInt(t.width)).data("modalShowSpeed",t.modalShowSpeed).data("initialContentHeight",n(i).find(".avlModal-content").height()).data("windowBuffer",t.windowBuffer));f=n(i).find(".avlModal-content-wrapper")[0];t.showCloseButton&&n(t.target).find(".avlModal-close").length==0&&n(i).find(".avlModal-wrapper").find(".avlModal-close").length<1&&(n(i).find(".avlModal-wrapper").append("<a href='#close' class='avlModal-close' title='Close this modal window'><i id='closeModalIcon' class='icon-cancel'><\/i><\/a>"),n(i).find(".avlModal-close").attr("onclick","return $.closeModal({ target: '#"+n(i).attr("id")+"', onClose:"+t.closeButtonFunction+"});"));u=parseInt(i.find(".avlModal-wrapper").css("padding"));l(u)||(u=0);r.css({zIndex:"10000",transform:"translateZ(1px)",width:parseInt(t.width)+u,height:"auto"});setModalPosition("show",r,t);OpenModals.push({modal:r[0],modalContent:f,previousHeight:f.scrollHeight});OpenModals.length==1&&e();(n("object embed[type]").length>0&&n("object embed[type]").attr("type").match("java")||n("object[codeBase]").length>0&&n("object[codeBase]").attr("codeBase").match("java"))&&n("object").parent().css({width:"1px",top:"99%",height:"1px",right:"0px",bottom:"0px",position:"absolute",overflow:"hidden"})}function e(){OpenModals.length>0&&(requestAnimFrame(e),CheckModalContentSize())}var o;n.openModal=function(t){if(t=jQuery.extend({width:"700px",height:null,windowBuffer:null,overlayOpacity:"0.5",overlayImage:"",overlayColor:"#000",overlayShowSpeed:500,modalShowSpeed:400,useTransitions:!0,showCloseButton:!0,enableTabKeyInModalOnly:!1,closeButtonFunction:function(){},target:"",url:"",parameters:{},cache:!1,onShow:function(){},onComplete:function(){},onSuccess:function(){},onError:function(){}},t),n(t.target).parent().hasClass("avlModal"))return!1;n(t.target).find(".avlModal-close").removeAttr("onclick").off("click").on("click",function(){return n.closeModal({target:"#"+n(t.target).attr("id"),onClose:t.closeButtonFunction})});return t.onShow(),o=t,h(t)&&c(t),t.enableTabKeyInModalOnly&&n(t.target).modalTabbing(),!1};n.closeModal=function(r){r=jQuery.extend({overlayHideSpeed:500,modalHideSpeed:400,target:"",useTransitions:!0,onClose:function(){},onHide:function(){}},r);var f=n(".avlModal").length>1?!0:!1,u,e;r.onClose(r);for(u=0,e=OpenModals.length;u<e;u++)if(n(r.target).parent()[0]==OpenModals[u].modal){OpenModals.splice(u,1);break}return AVL.UTILITIES.FUNCTIONS.GoForTransitions(r.useTransitions)?(n(r.target).find(".avlModal-wrapper").addClass("hide"),t(r,f),n(r.target).find(".avlModal-wrapper").removeClass("hide").removeClass("show"),n(r.target).addClass("avlModal-container"),i(r,f)):(t(r,f),n(r.target).addClass("avlModal-container"),i(r,f)),!1};setModalPosition=function(t,i,r){var f,e,u;i.each(function(){var i=n(this),a=i.children()[0],p=i.find(".avlModal-header"),v=i.find(".avlModal-content"),c=i.find(".avlModal-close"),ut=i.find(".avlModal-wrapper"),o=6,w=5,nt=p.length>0?p.outerHeight(!0):0,b=c.length>0?c.height()/3-w:0,y=c.length>0?c.width()/3-w:0,s=n(a).data("windowBuffer")||30,tt=i.find(".avlModal-wrapper").css("padding-left").replace("px","")*2,k=n(window).height(),it=n(window).width(),d="auto",l=it-s,h=n(a).data("initialWidth"),rt=i.css({"max-width":l}).find(".avlModal-content-wrapper")[0].scrollHeight,g=rt-v.height()+i.height();isNaN(o)&&(o=0);g+b+s+o>=k?(f=k-s-b,d=f+v.height()-i.height()+"px"):f=g;e=(n(window).height()+y+o-f-s/2)/2;u=h>l?(n(window).width()+y+o-l-s/2)/2:(n(window).width()+y+o-h-s/2)/2;v.css("height",d);t==="show"&&(i.css({position:"fixed",top:Math.round(e),left:Math.round(u),height:"auto",width:h,display:"block"}),AVL.UTILITIES.FUNCTIONS.GoForTransitions(r.useTransitions)?(i.find(".avlModal-wrapper").addClass("show"),r!=undefined&&r.onComplete()):(i.find(".avlModal-wrapper").addClass("no-trans").css({opacity:1}),i.animate({left:Math.round(u),width:h},n(a).data("modalShowSpeed"),"easeInOutExpo",function(){i.animate({top:Math.round(e),height:"auto"},400,"easeInOutExpo",function(){n(this).parent().parent().css({minHeight:nt+tt/2});r!=undefined&&r.onComplete()})})));t==="resize"&&i.css({top:Math.round(e),left:Math.round(u),height:"auto",width:h,"max-width":l,display:"block"})})};n(window).on("resize onorientationchange",function(){n(".avlModal").is(":visible")&&(u(),setModalPosition("resize",n(".avlModal:visible")))});OpenModals=[];CheckModalContentSize=function(){var i=0,r=0,t=0,u=OpenModals.length,f=document.getElementsByTagName("HTML")[0].scrollHeight;if(u)for(t=0;t<u;t++)i=OpenModals[t].modalContent.scrollHeight,r=OpenModals[t].modal.scrollHeight,(OpenModals[t].previousHeight!=i||r>f)&&setModalPosition("resize",n(OpenModals[t].modal)),OpenModals[t].previousHeight=i};window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}();n.fn.modalTabbing=function(){var t=function(t){var i=n(t).find("select, input, textarea, button, a[href]").filter(":visible").not(":disabled");i.first().trigger("focus");n(t).on("keydown",function(i){if(i.which===9){var r=n(t).find("select, input, textarea, button, a[href]").filter(":visible").not(":disabled");i.shiftKey?r[0]===i.target&&(i.preventDefault(),r.last().trigger("focus")):r[r.length-1]===i.target&&(i.preventDefault(),r.first().trigger("focus"))}})};return this.each(function(){t(this)})}}(jQuery),function(n){"use strict";n.fn.extend({customSelect:function(t){if(typeof document.body.style.maxHeight=="undefined")return this;var t=n.extend({customClass:"customSelect",mapClass:!0,mapStyle:!0},t),u=t.customClass,r=function(t,r){var u=t.find(":selected"),f=r.children(":first"),e=u.html()||"&nbsp;";f.html(e);u.attr("disabled")?r.addClass(i("DisabledOption")):r.removeClass(i("DisabledOption"));setTimeout(function(){r.removeClass(i("Open"));n(document).off("mouseup."+i("Open"))},60)},i=function(n){return u+n};return this.each(function(){var e=n(this),o=n("<span />").addClass(i("Inner")),f=n("<span />");e.hasClass("hasCustomSelect")||(e.after(f.append(o)),f.addClass(u),t.mapClass&&f.addClass(e.attr("class")),t.mapStyle&&f.attr("style",e.attr("style")),e.addClass("hasCustomSelect").on("update",function(){var n,t;r(e,f);n=parseInt(e.outerWidth(),10)-(parseInt(f.outerWidth(),10)-parseInt(f.width(),10));f.css({display:"inline-block"});t=f.outerHeight();e.attr("disabled")?f.addClass(i("Disabled")):f.removeClass(i("Disabled"));o.css({"padding-right":"30px",display:"inline-block"});e.css({"-webkit-appearance":"menulist-button",width:"100%",position:"absolute",opacity:0,zIndex:"3",height:e.closest("p").height()===0?"25px":e.closest("p").height(),fontSize:f.css("font-size")})}).on("change",function(){f.addClass(i("Changed"));r(e,f)}).on("keyup",function(n){f.hasClass(i("Open"))?(n.which==13||n.which==27)&&r(e,f):(e.trigger("blur"),e.trigger("focus"))}).on("mousedown",function(){f.removeClass(i("Changed"))}).on("mouseup",function(t){if(!f.hasClass(i("Open")))if(n("."+i("Open")).not(f).length>0&&typeof InstallTrigger!="undefined")e.trigger("focus");else{f.addClass(i("Open"));t.stopPropagation();n(document).one("mouseup."+i("Open"),function(t){t.target!=e.get(0)&&n.inArray(t.target,e.find("*").get())<0?e.trigger("blur"):r(e,f)})}}).on("focus",function(){f.removeClass(i("Changed")).addClass(i("Focus"))}).on("blur",function(){f.removeClass(i("Focus")+" "+i("Open"))}).on("mouseenter",function(){f.addClass(i("Hover"))}).on("mouseleave",function(){f.removeClass(i("Hover"))}).trigger("update"))})}})}(jQuery);typeof JSON!="object"&&(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return e.lastIndex=0,e.test(n)?'"'+n.replace(e,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function u(i,f){var s,l,h,a,v=n,c,e=f[i];e&&typeof e=="object"&&typeof e.toJSON=="function"&&(e=e.toJSON(i));typeof t=="function"&&(e=t.call(f,i,e));switch(typeof e){case"string":return o(e);case"number":return isFinite(e)?String(e):"null";case"boolean":case"null":return String(e);case"object":if(!e)return"null";if(n+=r,c=[],Object.prototype.toString.apply(e)==="[object Array]"){for(a=e.length,s=0;s<a;s+=1)c[s]=u(s,e)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));else for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&(h=u(l,e),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var f=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,r,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(n="",r="",typeof e=="number")for(o=0;o<e;o+=1)r+=" ";else typeof e=="string"&&(r=e);if(t=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return u("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),f.lastIndex=0,f.test(text)&&(text=text.replace(f,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}();AVL=AVL||{};AVL.RESPONSIVEFORM=AVL.RESPONSIVEFORM||{};AVL.RESPONSIVEFORM.CORE={NewFormContent:!0,BypassPhoneCountryCode:typeof phoneOptional!="undefined"?phoneOptional:!1,UseSisyphus:typeof bypassLocalStorage=="undefined"||typeof bypassLocalStorage!="undefined"&&!bypassLocalStorage,INIT:{Init:function(){var n=$(".responsive-form");AVL.RESPONSIVEFORM.CORE.INIT.InitResponsiveForms(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAutoFillCatches(n)},InitAutoFillCatches:function(n){setTimeout(function(){AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n)},100)},InitResponsiveForms:function(n){AVL.RESPONSIVEFORM.CORE.INIT.InitSisyphus(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormWarningContainers(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormMasks(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormStatusIcons(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormInstantValidation(n);AVL.RESPONSIVEFORM.CORE.INIT.InitUSPhoneInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAddressInputs(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAddressModal();AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n);AVL.RESPONSIVEFORM.CORE.INIT.InitFormButtons(n);AVL.RESPONSIVEFORM.CORE.INIT.InitAlertBoxIcons();$(".txt-state").find(".textbox").attr("maxlength","30")},InitSisyphus:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&($("#phustrigger").length===0&&$("#address-container").append("<input id='phustrigger' type='checkbox' style='display:none;' aria-hidden='true'/>"),n.is("fieldset")?n.sisyphus({excludeFields:$(".no-sisy, input[type='hidden'], .no-sisy input[type='radio'], .no-sisy input[type='checkbox']"),includeFields:$("input.has-sisy"),customKeySuffix:document.domain+window.location.pathname.replace(/\//g,"_")+"_"}):(n.find("fieldset").each(function(){$(this).sisyphus({excludeFields:$(".no-sisy, input[type='hidden'], .no-sisy input[type='radio'], .no-sisy input[type='checkbox']"),includeFields:$("input.has-sisy"),customKeySuffix:document.domain+window.location.pathname.replace(/\//g,"_")+"_"})}),AVL.RESPONSIVEFORM.CORE.UTILITIES.RemoveInputScriptTags(n)))},InitAddressInputs:function(n){var t=n.find(".dd-country .dropdown").length>0&&typeof n.find(".dd-country .dropdown option[selected='selected']").val()!="undefined"?n.find(".dd-country .dropdown option[selected='selected']").val().toLowerCase():"";AVL.RESPONSIVEFORM.CORE.DOM.SetCountryRelatedInputStates(n,t,!1);AVL.RESPONSIVEFORM.CORE.UTILITIES.PrefixPhoneWithCountryCode(n,t,AVL.RESPONSIVEFORM.CORE.NewFormContent,AVL.RESPONSIVEFORM.CORE.BypassPhoneCountryCode);n.find(".dd-country .dropdown").on("change",function(){$("#update-action").text("country-updated")});n.find(".dd-opt-states .dropdown, .txt-opt-state .textbox").on("change",function(){$("#update-action").text("states-updated")});n.find(".txt-address1 .textbox").each(function(){var n=$(this).closest(".responsive-form");$(this).on("keydown",function(n){n.keyCode===$.ui.keyCode.TAB&&$(this).data("ui-autocomplete").menu.active&&n.preventDefault()}).autocomplete({position:{my:"left top",at:"left bottom-1",of:n.find(".txt-address1")},delay:0,source:function(t,i){var f=n.find(".txt-address1 .textbox"),r=$.trim(f.val()),e=n.find(".dd-country .dropdown").val(),u;r!==""&&r.length>1&&e==="US"&&(u={testing:!1,companyname:n.find(".txt-company .textbox").val(),addressline1:n.find(".txt-address1 .textbox").val(),addressline2:n.find(".txt-address2 .textbox").val(),addressline3:n.find(".txt-address3 .textbox").val(),city:n.find(".txt-city .textbox").val(),state:n.find(".dd-states .dropdown").val(),zipCode:n.find(".txt-zipcode .textbox").val(),country:n.find(".dd-country .dropdown").val()},$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationStreetLevel.ashx",type:"POST",data:JSON.stringify(u),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){var t=n.AddressKeyFormats;if(t.length>0){var r=[],u=[],f=[];AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(t);$.each(t,function(n){r.push(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PoliticalDivision2)+" "+t[n].PoliticalDivision1+" "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PostcodePrimaryLow))});$.each(r,function(n,i){$.inArray(i,u)===-1&&(u.push(i),f.push(t[n]))});i($.map(f,function(n){return{data:{address1:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1),city:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.PoliticalDivision2),state:n.PoliticalDivision1,zip:n.PostcodePrimaryLow},value:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1),label:AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(n.PoliticalDivision2)+" "+n.PoliticalDivision1+" "+n.PostcodePrimaryLow}}))}}}))},minLength:2,select:function(t,i){var s,r;AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-address1"),n.find(".txt-address1 .textbox"),i.item.data.address1,!0);AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-zipcode"),n.find(".txt-zipcode .textbox"),i.item.data.zip,!0);AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-city"),n.find(".txt-city .textbox"),i.item.data.city,!0);AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(n.find(".txt-address1"),n.find(".txt-address1 .textbox"),!1,!1);n.find(".dd-states .dropdown").trigger("focus").val(i.item.data.state).trigger("blur").trigger("update");var u=n.find(".txt-address1 .textbox").val(),h=n.find(".txt-address2 .textbox").val(),f=n.find(".txt-city .textbox").val(),e=n.find(".dd-states .dropdown").val(),o=n.find(".txt-zipcode .textbox").val();u!==""&&f!==""&&e!==""&&o!==""&&(s="<address><addressline1>"+u+"<\/addressline1><addressline2>"+h+"<\/addressline2><city>"+f+"<\/city><state>"+e+"<\/state><zip>"+o+"<\/zip><\/address>",r=!1,$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:s,success:function(t){var u=$.parseXML(t),f=$(u),i=f.find("ismissingaptnumber");i!=null&&i!==""?(r=i.text().toLowerCase()==="true",r?(n.find(".txt-address2").attr("title","Please enter your Apt, Suite, Bldg. (required)."),n.find(".txt-address2 .textbox").trigger("focus"),n.find(".txt-address2 label em").text("(required)")):(n.find(".txt-address2").attr("title","Please enter your Apt, Suite, Bldg. (if applicable)."),n.find(".txt-address2 label em").text("(if applicable)"),AVL.RESPONSIVEFORM.CORE.UTILITIES.FocusNextFocusableEmptyInput(n,n.find(".dd-states .dropdown")))):(n.find(".txt-address2 label em").text("(if applicable)"),AVL.RESPONSIVEFORM.CORE.UTILITIES.FocusNextFocusableEmptyInput(n,n.find(".dd-states .dropdown")))},fail:function(){n.find(".txt-address2 label em").text("(if applicable)");n.find(".txt-address2 .textbox").trigger("focus")}}))},open:function(){$(this).removeClass("ui-corner-all").addClass("ui-corner-top")},close:function(){$(this).removeClass("ui-corner-top").addClass("ui-corner-all");n.find(".txt-address1 .textbox").trigger("change")}})})},InitUSPhoneInputs:function(){if($("input[data-validation='req-phone-us']").length>0){AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber($("input[data-validation='req-phone-us']"),$("input[data-validation='req-phone-us']").val(),!0);$("input[data-validation='req-phone-us']").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)})}if($("input[data-validation='opt-phone-us']").length>0){AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber($("input[data-validation='opt-phone-us']"),$("input[data-validation='opt-phone-us']").val(),!0);$("input[data-validation='opt-phone-us']").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)})}},InitAddressModal:function(){$("body").on("click","#ar-change",function(){var n="#"+$(this).attr("data-address1ID"),t=$(n).closest(".responsive-form");return t.find(".txt-address1 .textbox").trigger("focus"),$(this).attr("data-showDeliveryModal")==="true",$.closeModal({target:"#address-results"})});$("body").on("click","#ar-certify",function(){var n="#"+$(this).attr("data-address1ID"),t=$(n).closest(".responsive-form");return $("#address-results").find("#addressCertified").val("true"),AVL.RESPONSIVEFORM.VALIDATION.AddressCertified=!0,t.find(".txt-address1 .textbox").trigger("change"),$.closeModal({target:"#address-results"})});$("body").on("click",".ar-choice",function(){var r="#"+$(this).attr("data-address1ID"),n=$(r).closest(".responsive-form"),t=$("#address-results").data("addresses"),i=$(this).prop("rel");return t!=null&&t.length>0&&(AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-address1"),n.find(".txt-address1 .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].AddressLine1),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-address2"),n.find(".txt-address2 .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].AddressLine2),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-city"),n.find(".txt-city .textbox"),AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[i].PoliticalDivision2),!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".dd-states"),n.find(".dd-states .dropdown"),t[i].PoliticalDivision1,!0),AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-zipcode"),n.find(".txt-zipcode .textbox"),t[i].PostcodePrimaryLow,!0),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(n.find(".txt-address1"),n.find(".txt-address1 .textbox"),!1,!1)),$.closeModal({target:"#address-results"})})},InitAlertBoxIcons:function(){$(".success-message").each(function(){AVL.RESPONSIVEFORM.CORE.DOM.AddAlertBoxIcon($(this),"icon-ok")})},InitFormWarningContainers:function(n){var t=n.is("fieldset")?n:n.find("fieldset");t.each(function(){var n=$(this),t="<div class='warning-messages'><\/div>";n.find("div.warning-messages").length||(n.find("legend").length===0?n.find("ul:first").before(t):n.find("legend").after(t))});$(".responsive-form").on("click",".bypass-field-link",function(){var n="bypassed-"+$(this).attr("data-element-id");return $("#"+n).length===0&&$("body").append("<div id='"+n+"'><\/div>"),AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput($("#"+$(this).attr("data-element-id"))),!1})},InitFormMasks:function(n){var t=n.find("ul li p, ul li div");t.on("click",function(){$(this).hasClass("focused")||$(this).find(".textbox, .textarea, .dropdown").trigger("focus")})},InitFormInputs:function(n){var t=n.find("ul li p"),i=t.find("select");i.customSelect();t.find(".textbox, .dropdown, .textarea").not(":disabled").on("focus",function(){if(!$(this).closest("p").hasClass("focused")){var n=$(this),i=n.closest("p"),t=i.find("label");$(".focused").removeClass("focused");i.addClass("focused");n.val()!=null&&n.val().length>0&&(t.hasClass("inputted")?t.addClass("inputting-notrans"):t.addClass("inputting"));localStorage.focus=n.not(".no-focus").attr("id")}}).on("blur",function(){var t=$(this),i=t.closest("p"),r=i.find("label");i.hasClass("focused")&&(i.removeClass("focused"),AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n));t.val()!=null&&t.val().length===0||t.val()==null?r.removeClass("inputting inputted inputting-notrans"):r.removeClass("inputting inputting-notrans").addClass("inputted")});t.find(".textarea").not(":disabled").on("focus",function(){$(this).closest("li").find("label.outter-label").addClass("focused")}).on("blur",function(){$(this).closest("li").find("label.outter-label").removeClass("focused")});t.find(".textbox, .textarea").on("keydown",function(){var n=$(this).parent().find("label");n.hasClass("inputting-notrans")||n.addClass("inputting")}).on("keyup",function(){var i=$(this),t=$(this).parent().find("label");i.val().length===0?t.removeClass("inputted inputting inputting-notrans"):t.hasClass("inputting-notrans")||t.addClass("inputting");AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n)});t.find("select").not(".no-reset").each(function(){var n=$(this),t=n.parent().find("label"),i=n.parent().find(".dropdown option:selected").index();(i===-1||n.val()==="")&&t.removeClass("inputted")}).on("change",function(){var n=$(this),t=$(this).parent().find("label");n.val()!=null&&n.val().length===0?t.removeClass("inputted inputting inputting-notrans"):t.addClass("inputted")});t.find("select.dropdown").on("keypress",function(n){n.which===13&&n.stopPropagation()});n.hasClass("skip-focus")||AVL.RESPONSIVEFORM.CORE.UTILITIES.SetFocusToCorrectInput(n)},InitFormStatusIcons:function(n){var t=n.find("ul li");t.find(".textbox, .textarea, .dropdown").each(function(){var n=$(this).closest("p"),t=n.prop("title");n.find("i.input-warning").length||n.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return AVL.RESPONSIVEFORM.CORE.DOM.ShowValidationMessage(event, $(this));'><\/i>")});t.find(".radiobutton, .checkbox").each(function(){var n=$(this).closest(".radio-mask, .checkbox-mask"),t=n.prop("title");!n.find("i.input-warning").length&&n.find("label").length&&n.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return AVL.RESPONSIVEFORM.CORE.DOM.ShowValidationMessage(event, $(this));'><\/i>")});t.find("[data-loader='true']").each(function(){var n=$(this).closest("p");n.append("<img class='input-loading' src='/CommonControls/ResponsiveForms/IMG/async-loader-1.gif' alt='Loading' />")})},InitFormLabels:function(n){var t=n.find("ul li p, ul li div");t.find(".textbox, .textarea").each(function(){var n=$(this),t=n.parent().find("label");n.val().length===0?t.removeClass("inputting inputted"):t.addClass("inputted")});t.find("select").each(function(){var n=$(this),t=n.parent().find("label"),i=n.prop("selectedIndex");i===-1||n.val()===""?t.removeClass("inputting inputted"):t.addClass("inputted")})},InitFormInstantValidation:function(n){var t=n.find("ul li p, ul li div");t.find("input.textbox, textarea.textarea, select.dropdown, input.checkbox, input.radiobutton, .radiobutton input, .checkbox input").on("change",function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n)});n.find("input.radiobutton, .radiobutton input").on("click",function(){var n=$(this).closest(".radiobutton");AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(n)})},InitFormButtons:function(n){n.find(".button-container .clear-button").on("click",function(){return AVL.RESPONSIVEFORM.CORE.UTILITIES.ClearLocalStorage(n),$(":input",n).each(function(){if(!($(this).hasClass("no-reset")||$(this).parent().hasClass("no-reset"))){var n=this.type,t=this.tagName.toLowerCase();n==="text"||n==="password"||t==="textarea"?this.value="":n==="checkbox"||n==="radio"?this.checked=!1:t==="select"&&(this.selectedIndex=0,$(this).trigger("update"))}}),AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels(n),!1})}},DOM:{AddAlertBoxIcon:function(n,t){var i=n.find("i."+t).length>0,r="<i class='"+t+"'><\/i>";i||n.prepend(r)},ShowValidationMessage:function(n,t){if(n.preventDefault?n.preventDefault():n.returnValue=!1,n.stopPropagation?n.stopPropagation():null,$("#responsive-form-message").length===0){var i="<div id='responsive-form-message' class='avlModal-container'><div class='avlModal-wrapper'><div class='avlModal-content'><p class='warning-message'><\/p><\/div><\/div><\/div>";$("form").length===1?$("form").append(i):$("body").append(i)}return $(".error-override").is(":visible")?$("#responsive-form-message").find(".avlModal-content p.warning-message").text($(".error-override").text()):$("#responsive-form-message").find(".avlModal-content p.warning-message").text(t.attr("title")),$.openModal({target:"#responsive-form-message",width:"300px"}),setTimeout(function(){$(":focus").trigger("blur")}),!1},SetCountryRelatedInputStates:function(n,t,i){i?n.find(".dropdown").trigger("change"):(t=t.toLowerCase(),n.find(".dd-states").hide(),n.find(".txt-state").show(),n.find(".txt-state label").text("State / Province / Region"),n.find(".txt-city label").text("City / Town"),n.find(".txt-zipcode label").text("ZIP / Postal Code"),n.find(".txt-phone").find("[data-validation^='req-phone']").attr("title","Please enter your phone number."),n.find(".txt-phone").find("[data-validation^='opt-phone']").attr("title","Please enter an alternate phone number (optional)."),n.find(".phone-format").text(""),t==="us"?(n.find(".dd-states").show(),n.find(".txt-state").hide(),n.find(".txt-zipcode label").text("ZIP Code"),n.find(".txt-phone").find("[data-validation^='req-phone']").each(function(){var n=$(this);n.attr("title","Please enter your phone number with area code.");n.val()!==""&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)}),n.find(".txt-phone").find("[data-validation^='opt-phone']").each(function(){var n=$(this);n.attr("title","Please enter an alternate phone number (optional).");n.val()!==""&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(n,n.val(),!0)}),n.find(".phone-format").text("(xxx) xxx-xxxx")):t==="au"?(n.find(".dd-states").show(),n.find(".txt-state").hide(),n.find(".dd-states label").text("State/Territory"),n.find(".txt-zipcode label").text("Postal Code")):n.find(".dd-states option").length>0&&(n.find(".dd-states").show(),n.find(".txt-state").hide()))}},UTILITIES:{RemoveInputScriptTags:function(n){$(n.find("fieldset input[type='text']")).each(function(){$(this).val($(this).val().replace(/<|>/g,""))})},CapitalizeFirstLetter:function(n){for(var u=n.toLowerCase(),i=u.split(" "),t=0,r=i.length;t<r;t++)i[t]=i[t].charAt(0).toUpperCase()+i[t].slice(1);return i.join(" ")},FocusNextFocusableEmptyInput:function(n,t){var i=n.find(":focusable"),u=i.filter(function(){return $(this).val()===""}),r=!1;u.each(function(){!r&&i.index($(this))>i.index(t)&&($(this).trigger("focus"),r=!0)})},SetFocusToCorrectInput:function(n){var t,i=!1;localStorage.focus!=null&&localStorage.focus.length>0?(t=$("#"+localStorage.focus),i&&console.log("focus to: localStorage")):n.find(".focus").length>0?(t=n.find(".focus"),i&&console.log("focus to: .focus")):$(".avlModal").is(":visible")?(t=$(".avlModal:visible").find("fieldset ul li p:first").find(".textbox, .textarea, .dropdown"),i&&console.log("focus to: visible modal")):(t=n.find(".responsive-form fieldset ul li p").first().find(".textbox, .textarea, .dropdown").not(".no-focus"),i&&console.log("focus to: first input"));setTimeout(function(){t.trigger("focus").val(t.val())},10)},ProcessInputChange:function(n,t,i,r){var f=t.val(),u=i;t.val(u);r&&f!==u&&t.trigger("change");u===""?n.find("label").removeClass("inputted"):n.find("label").addClass("inputted")},PopulateCountryStateByIP:function(){$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/IPLocation.ashx",type:"POST",contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){n!=null&&n.status==="success"&&$(".dd-country .dropdown").trigger("focus").val(n.countryCode).trigger("blur").trigger("update")}})},VerifyAddress:function(n,t,i,r,u){var f="<address><addressline1>"+$("[id$='"+n+"']").val()+"<\/addressline1><addressline2>"+$("[id$='"+t+"']").val()+"<\/addressline2><city>"+$("[id$='"+i+"']").val()+"<\/city><state>"+$("[id$='"+r+"']").val()+"<\/state><zip>"+$("[id$='"+u+"']").val()+"<\/zip><\/address>",e=$("[id$='"+n+"']").closest(".responsive-form");$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:f,success:function(n){var r=$.parseXML(n),u=$(r),t=u.find("ismissingaptnumber"),i;t!=null&&t!==""&&(i=t.text().toLowerCase()==="true",e.find(".txt-address2 label em").text(i?"(required)":"(if applicable)"))}})},PrefixPhoneWithCountryCode:function(n,t,i,r){if(t!==""&&!r){var u="";$.ajax({type:"GET",url:"/MyAccount/CommonControls/ResponsiveForms/XML/country-codes.xml",dataType:"xml",success:function(r){$(r).find("country").each(function(){var f=$(this).attr("code"),r;return u=$(this).attr("phoneCode"),t.toUpperCase()===f?(r=u==="1"?n.find(".txt-phone .textbox").val():"+"+u,n.find(".txt-phone .textbox").data("phonecode",u),i||AVL.RESPONSIVEFORM.CORE.UTILITIES.ProcessInputChange(n.find(".txt-phone"),n.find(".txt-phone .textbox"),r,!1),AVL.RESPONSIVEFORM.CORE.UTILITIES.UpdateAddressLocalStorage(),!1):void 0})}})}AVL.RESPONSIVEFORM.CORE.NewFormContent=!1;AVL.RESPONSIVEFORM.CORE.BypassPhoneCountryCode=typeof phoneOptional!="undefined"?phoneOptional:!1},ReleaseLocalStorage:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&(n.is("fieldset")?n.sisyphus().manuallyReleaseData():n.find("fieldset").each(function(){$(this).sisyphus().manuallyReleaseData()}))},ClearLocalStorage:function(n){AVL.RESPONSIVEFORM.CORE.UseSisyphus&&n.find("fieldset").each(function(){$(this).sisyphus().manuallyReleaseData()});localStorage.removeItem("focus");AVL.RESPONSIVEFORM.CORE.UTILITIES.SetFocusToCorrectInput(n);AVL.RESPONSIVEFORM.VALIDATION.DOM.HideAllValidationResults(n)},UpdateAddressLocalStorage:function(){$("#phustrigger").prop("checked",!$("#phustrigger").prop("checked"))}}};$(document).ready(function(){AVL.RESPONSIVEFORM.CORE.INIT.Init()}),function(n){n.fn.sisyphus=function(t){var r=n.map(this,function(t){return n(t).attr("id")+n(t).attr("name")}).join(),i=Sisyphus.getInstance(r);return t!==undefined&&i.protect(this,t),i};var t={};t.isAvailable=function(){if(typeof n.jStorage=="object")return!0;try{return localStorage.getItem}catch(t){return!1}};t.set=function(t,i){if(typeof n.jStorage=="object")n.jStorage.set(t,i+"");else try{localStorage.setItem(t,i+"")}catch(r){}};t.get=function(t){if(typeof n.jStorage=="object"){var i=n.jStorage.get(t);return i?i.toString():i}return localStorage.getItem(t)};t.remove=function(t){typeof n.jStorage=="object"?n.jStorage.deleteKey(t):localStorage.removeItem(t)};Sisyphus=function(){function r(){return{setInstanceIdentifier:function(n){this.identifier=n},getInstanceIdentifier:function(){return this.identifier},setInitialOptions:function(i){var r={excludeFields:[],includeFields:[],customKeySuffix:"",locationBased:!1,timeout:0,autoRelease:!0,onSave:function(){},onBeforeRestore:function(){},onRestore:function(){},onRelease:function(){}};this.options=this.options||n.extend(r,i);this.browserStorage=t},setOptions:function(t){this.options=this.options||this.setInitialOptions(t);this.options=n.extend(this.options,t)},protect:function(t,r){var u,f,e;if(this.setOptions(r),t=t||{},u=this,this.targets=this.targets||[],this.href=location.hostname+location.pathname+location.search+location.hash,this.targets=n.merge(this.targets,t),this.targets=n.unique(this.targets),this.targets=n(this.targets),!this.browserStorage.isAvailable())return!1;f=u.options.onBeforeRestore.call(u);(f===undefined||f)&&u.restoreAllData();this.options.autoRelease&&u.bindReleaseData();i.started[this.getInstanceIdentifier()]||(u.isCKEditorPresent()?e=setInterval(function(){CKEDITOR.isLoaded&&(clearInterval(e),u.bindSaveData(),i.started[u.getInstanceIdentifier()]=!0)},100):(u.bindSaveData(),i.started[u.getInstanceIdentifier()]=!0))},isCKEditorPresent:function(){if(this.isCKEditorExists()){CKEDITOR.isLoaded=!1;CKEDITOR.on("instanceReady",function(){CKEDITOR.isLoaded=!0});return!0}return!1},isCKEditorExists:function(){return typeof CKEDITOR!="undefined"},findFieldsToProtect:function(n){return n.find(":input").not(":submit").not(":reset").not(":button").not(":file").not(":password").not(":disabled").not("[readonly]")},bindSaveData:function(){var t=this;t.options.timeout&&t.saveDataByTimeout();t.targets.each(function(){var i=n(this).attr("id")+n(this).attr("name");t.findFieldsToProtect(n(this)).each(function(){if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1)return!0;var i=n(this),r=t.options.customKeySuffix+i.attr("name");(i.is(":text")||i.is("textarea"))&&(t.options.timeout||t.bindSaveDataImmediately(i,r));t.bindSaveDataOnChange(i)})})},saveAllData:function(){var t=this;t.targets.each(function(){var r=n(this).attr("id")+n(this).attr("name"),i={};t.findFieldsToProtect(n(this)).each(function(){var r=n(this),f,u,e;if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1||r.attr("name")===undefined)return!0;if(f=t.options.customKeySuffix+r.attr("name"),u=r.val(),r.is(":checkbox")){if(r.attr("name").indexOf("[")!==-1){if(i[r.attr("name")]===!0)return;u=[];n("[name='"+r.attr("name")+"']:checked").each(function(){u.push(n(this).val())});i[r.attr("name")]=!0}else u=r.is(":checked");t.saveToBrowserStorage(f,u,!1)}else r.is(":radio")?r.is(":checked")&&(u=r.val(),t.saveToBrowserStorage(f,u,!1)):t.isCKEditorExists()?(e=CKEDITOR.instances[r.attr("name")]||CKEDITOR.instances[r.attr("id")])?(e.updateElement(),t.saveToBrowserStorage(f,r.val(),!1)):t.saveToBrowserStorage(f,u,!1):t.saveToBrowserStorage(f,u,!1)})});t.options.onSave.call(t)},restoreAllData:function(){var t=this,i=!1;t.targets.each(function(){var r=n(this),u=n(this).attr("id")+n(this).attr("name");t.findFieldsToProtect(r).each(function(){if(n.inArray(this,t.options.excludeFields)!==-1&&n.inArray(this,t.options.includeFields)===-1)return!0;var r=n(this),f=t.options.customKeySuffix+r.attr("name"),u=t.browserStorage.get(f);u!==null&&(t.restoreFieldsData(r,u),i=!0)})});i&&t.options.onRestore.call(t)},restoreFieldsData:function(n,t){if(n.attr("name")===undefined)return!1;n.is(":checkbox")&&t!=="false"&&n.attr("name").indexOf("[")===-1?n.prop("checked",!0):n.is(":checkbox")&&t==="false"&&n.attr("name").indexOf("[")===-1?n.prop("checked",!1):n.is(":radio")?n.val()===t&&n.prop("checked",!0):n.attr("name").indexOf("[")===-1?(n.val()===""||n.attr("data-override-server")==="true")&&n.val(t):(t=t.split(","),n.val(t))},bindSaveDataImmediately:function(n,t){var i=this,r;if("onpropertychange"in n?n.get(0).onpropertychange=function(){i.saveToBrowserStorage(t,n.val())}:n.get(0).oninput=function(){i.saveToBrowserStorage(t,n.val())},this.isCKEditorExists()&&(r=CKEDITOR.instances[n.attr("name")]||CKEDITOR.instances[n.attr("id")]))r.document.on("keyup",function(){r.updateElement();i.saveToBrowserStorage(t,n.val())})},saveToBrowserStorage:function(n,t,i){i=i===undefined?!0:i;this.browserStorage.set(n,t);i&&t!==""&&this.options.onSave.call(this)},bindSaveDataOnChange:function(n){var t=this;n.on("change",function(){})},saveDataByTimeout:function(){var n=this,t=n.targets;setTimeout(function(){function t(){n.saveAllData();setTimeout(t,n.options.timeout*1e3)}return t}(t),n.options.timeout*1e3)},bindReleaseData:function(){var t=this;t.targets.each(function(){var i=n(this),r=i.attr("id")+i.attr("name");n(this).on("submit reset",function(){t.releaseData(r,t.findFieldsToProtect(i))})})},manuallyReleaseData:function(){var t=this;!t.targets||t.targets.each(function(){var i=n(this),r=i.attr("id")+i.attr("name");t.releaseData(r,t.findFieldsToProtect(i))})},releaseData:function(t,r){var f=!1,u=this;i.started[u.getInstanceIdentifier()]=!1;r.each(function(){if(n.inArray(this,u.options.excludeFields)!==-1&&n.inArray(this,u.options.includeFields)===-1)return!0;var t=n(this),i=u.options.customKeySuffix+t.attr("name");u.browserStorage.remove(i);f=!0});f&&u.options.onRelease.call(u)}}}var i={instantiated:[],started:[]};return{getInstance:function(n){return i.instantiated[n]||(i.instantiated[n]=r(),i.instantiated[n].setInstanceIdentifier(n),i.instantiated[n].setInitialOptions()),n,i.instantiated[n]},free:function(){return i={instantiated:[],started:[]},null},version:"1.1.107"}}()}(jQuery);window.console||(console={log:function(){}});AVL=AVL||{};AVL.RESPONSIVEFORM=AVL.RESPONSIVEFORM||{};AVL.RESPONSIVEFORM.VALIDATION={InstantValidationDebug:!1,SubmitValidationDebug:!1,ShowJSONAddressData:!1,AddressCertified:!1,HasInvalidTextWarning:!1,IsZipCodeValid:!0,IsZipCodeError:!1,UnselectedCardType:"transparent",JsonCertifiedAddress:{addressline1:"",city:"",state:"",zipCode:"",country:""},DOM:{BuildAddressResultsModal:function(n,t,i,r){var f,u;$("#address-results").remove();$("form").append("<div id='address-results' class='avlModal-container'><div class='avlModal-wrapper'><div class='avlModal-header'><\/div><div class='avlModal-content'><\/div><\/div><input type='hidden' name='addressCertified' id='addressCertified' value='false'/><\/div>");switch(t){case"none":u="We were unable to verify your address. Please choose one of the following options below to proceed:";$("#address-results").find(".avlModal-header").text("Address Not Found");$("#address-results").find(".avlModal-content").html("<h6>"+u+"<\/h6><p><a id='ar-change' data-address1ID='"+n+"' href='#' title='Change the address'>Change the address<\/a><\/p><p><a id='ar-certify' data-address1ID='"+n+"' href='#' title='Certify that the address you entered is the correct address'>Certify that the address is correct ( <em> "+i+" <\/em> )<\/a><\/p>");break;case"multiple":f="";u="We were unable to verify your address. Please choose one of the following options below to proceed:";$.each(r,function(t){f+="<p><a class='ar-choice' data-address1ID='"+n+"' href='#' rel='"+t+"' title='Use this address'>"+r[t].fullAddress+"<\/a><\/p>"});$("#address-results").find(".avlModal-header").text("Choose Correct Address");$("#address-results").find(".avlModal-content").html("<h6>"+u+"<\/h6>"+f+"<p><a id='ar-change' data-address1ID='"+n+"' href='#' title='Change the address'>Change the address<\/a><\/p><p><a id='ar-certify' data-address1ID='"+n+"' href='#' title='Certify that the address you entered is the correct address'>Certify the address is correct - <em> "+i+" <\/em><\/a><\/p>");$("#address-results").data("addresses",r)}$.openModal({target:"#address-results",width:"650px"})},ShowLoadingImage:function(n,t,i){i.show();n.removeClass("failed-validation")},MoveToFirstFailedInput:function(){$(".failed-validation").length>0&&$(".failed-validation:first").closest("fieldset").length>0&&($("#slideout-content").animate({scrollTop:$("#slideout-content").scrollTop()+$(".failed-validation:first").closest("fieldset").offset().top-10},500)||$("html, body").animate({scrollTop:$(".failed-validation:first").closest("fieldset").offset().top-10},500),$(".failed-validation:first input:not(.hasDatepicker), .failed-validation:first textarea, .failed-validation:first select").trigger("focus"))},HideAllValidationResults:function(n){var t=n.find("ul li p, ul li div");t.each(function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationClass(n,!1);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationMessage(n,n.find("input.textbox:visible, textarea.textarea:visible, select.dropdown:visible, input.checkbox:visible, input.radiobutton:visible"),!1,!1)})},DisplayValidationResult:function(n,t,i,r){t.val()===""?n.find("label").removeClass("inputted"):n.find("label").addClass("inputted");AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationClass(n,i);AVL.RESPONSIVEFORM.VALIDATION.DOM.SetValidationMessage(n,t,i,r)},SetValidationClass:function(n,t){t?n.addClass("failed-validation"):n.removeClass("failed-validation")},SetValidationMessage:function(n,t,i,r){var o,e,h;typeof t.attr("id")!=typeof undefined?(e=t.attr("id").split("_"),o=e[e.length-2]+"_"+e[e.length-1]+"_warning"):o=t.attr("id")+"_warning";var u=n.attr("data-warning-override"),f="",s=$('[id$="'+o+'"]');f=t.attr("data-validation")==="opt-address2"?AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning?"Please provide valid apartment,suite or building number":typeof u!="undefined"&&u!==!1?u:n.attr("title")||!1:typeof u!="undefined"&&u!==!1?u:n.attr("title")||!1;n.find(".input-warning").attr("title",f);i&&f?(h="",t.attr("data-validation")!=="opt-address2"||AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning||(h=" <a href='#bypass-field' class='bypass-field-link' data-element-id='"+t.attr("id")+"'>Click here if the value is correct.<\/a>"),f+=h,s.length===0&&(r||AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning&&t.attr("data-validation")==="opt-address2")?n.closest("fieldset").find(".warning-messages:first").append("<div id='"+o+"'>"+f+"<\/div>"):s.length>0&&s.html(f)):s.slideUp(200,function(){$(this).remove()})},SetIconWarningMessage:function(n){var t=n.prop("title");n.find("i.input-warning").length?$(n.find("i.input-warning")).attr("title",t):$parent.append("<i class='input-status input-warning icon-attention' title='"+t+"' onclick='return ShowValidationMessage(event, $(this));'><\/i>")}},FUNCTIONS:{CheckInputValue:function(n,t,i,r,u,f){var e=t.closest(".responsive-form"),ni,k,ot,ii,st,ri,p,s,si,hi,ct,g,ci,li,y,v,nt,lt,at,wt,wi,bi,i,ki,di,bt,rt,kt,gi,nr,n,ut,o,ir;switch(r){case"req-field":t.is(":password")||(i=i.replace(/<|>/g,""),t.val(i));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-selection":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNoSelection(i));break;case"req-checked":u.resolve(!t.is(":checked"));break;case"req-checked-list":u.resolve(!t.find("input:checked").length);break;case"req-price":t.hasClass("format-price")&&(i=i.replace(/[^.0-9]/g,""),t.val("$"+parseFloat(i).toFixed(2)));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPrice(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i));break;case"req-price-min":var rr=i.replace(/[^.0-9]/g,""),a=parseFloat(rr),ur=t.attr("data-minprice");AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(a)&&t.val("$"+a);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(a)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(a)||a<ur);break;case"req-price-range":ni="$";t.hasClass("format-price")&&(i=i.replace(/[^.0-9]/g,""),t.val("$"+parseFloat(i).toFixed(2)));case"req-number-range":var fr=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i),er=t.closest(":has(.req-price-top)").find(".req-price-top").text().replace(/[^.0-9]/g,""),ft=parseFloat(er),or=t.closest(":has(.req-price-bottom)").find(".req-price-bottom").text().replace(/[^.0-9]/g,""),et=parseFloat(or),a=parseFloat(i),ti=ni||"",b=!1;i!=="N/A"&&(!fr||i<=0)?(b=!0,n.attr("data-warning-override","Please enter a valid amount.")):!isNaN(ft)&&ft<a?(b=!0,n.attr("data-warning-override","Please enter an amount less than or equal to "+ti+ft+".")):!isNaN(et)&&et>a&&(b=!0,n.attr("data-warning-override","Please enter an amount more than "+ti+et+"."));u.resolve(b);break;case"req-customwidth-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,0,299,2,"custom trim width"));break;case"req-customheight-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,0,299,2,"custom trim height"));break;case"req-spinewidth-range":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.ValidateRange(n,i,.25,2,3,"spine width"));break;case"req-number":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?n.attr("data-warning-override",n.attr("title")+" (Must be a valid number)"):n.removeAttr("data-warning-override");k=t.attr("minLength");k!==null&&t.val().length<k&&(n.attr("data-warning-override",n.attr("title")+" (Must be a "+k+"-digit number)"),u.resolve(!0));t.hasClass("req-route")&&(ot=i,ot!==""&&$.ajax({type:"POST",url:"/MyAccount/PaymentInformation.aspx/ValidateBankRoutingNumber",async:!1,data:"{'routingNumber':'"+ot+"'}",contentType:"application/json; charset=utf-8",dataType:"json",beforeSend:function(n){n.setRequestHeader("content-type","application/json; charset=utf-8")},success:function(t){var i=t.d;i==="Not Found"&&(n.attr("data-warning-override","Invalid routing number."),u.resolve(!0))}}));u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i));break;case"req-three":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||parseInt(i)<0||parseInt(i)>3);break;case"opt-number":u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)));break;case"req-upc":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||i.length!==11&&i.length!==12);break;case"opt-isbn":i===""&&u.resolve(!1);case"req-isbn":case"req-isbn-design":i=i.replace("-","");u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsISBN(i));r==="req-isbn-design"&&n.attr("data-warning-override","Please enter a valid 13 digit ISBN code.");break;case"req-phone":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumber(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsInternationalPhoneNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-phone":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumber(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsInternationalPhoneNumber(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-phone-us":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!0);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-phone-us":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-phone-bycountry":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumberByCountry(i,e.find(".dd-country select").val().toLowerCase())||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-phone-bycountry":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.FormatUSPhoneNumber(t,i,!1);u.resolve(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumberByCountry(i,e.find(".dd-country select").val().toLowerCase())&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&i!=="+"+t.data("phonecode"));break;case"req-address1":case"opt-address1":ii={addressline1:e.find(".txt-address1 .textbox").val(),city:e.find(".txt-city .textbox").val(),state:e.find(".dd-states .dropdown").val(),zipCode:e.find(".txt-zipcode .textbox").val(),country:e.find(".dd-country .dropdown").val()};r!=="opt-address1"||AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckCertifiedAddressMatch(ii)?u.resolve(!1):(p=e.find(".dd-country .dropdown").val(),p==="US"&&AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeValid&&f?(s={testing:!1,companyname:e.find(".txt-company .textbox").val(),addressline1:e.find(".txt-address1 .textbox").val(),addressline2:e.find(".txt-address2 .textbox").val(),city:e.find(".txt-city .textbox").val(),state:e.find(".dd-states .dropdown").val(),zipCode:e.find(".txt-zipcode .textbox").val(),country:e.find(".dd-country .dropdown").val()},st=e.find(".txt-address1 .textbox").val()+" "+e.find(".txt-address2 .textbox").val()+" "+e.find(".txt-city .textbox").val()+" "+e.find(".dd-states .dropdown").val()+" "+e.find(".txt-zipcode .textbox").val(),AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(s),$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationStreetLevel.ashx",type:"POST",data:JSON.stringify(s),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){var i,r,f;if(n!=undefined&&n.Response!=undefined){var l=n.Response,a=n.AddressClassification,t=n.AddressKeyFormats,v=n.AddressIndicator;if(AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(n),l.ResponseStatusDescription==="Failure")u.resolve(!1);else if(i=typeof APPLICATION!="undefined"&&typeof APPLICATION.CHECKOUTPROCESS!="undefined"&&typeof APPLICATION.CHECKOUTPROCESS.CORE.BypassModal!="undefined"&&APPLICATION.CHECKOUTPROCESS.CORE.BypassModal,t.length===0)i||$.trim(s.addressline1)===""||$.trim(s.city)===""||$.trim(s.state)===""||$.trim(s.zipCode)===""||AVL.RESPONSIVEFORM.VALIDATION.DOM.BuildAddressResultsModal(e.find(".txt-address1 .textbox").attr("id"),"none",st),u.resolve(!0);else if(t.length!==1||/\d-\d/.test(t[0].AddressLine1)){var o=[],h=[],c=[];$.each(t,function(n){o.push(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].AddressLine1)+", "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PoliticalDivision2)+" "+t[n].PoliticalDivision1+" "+AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].PostcodePrimaryLow))});$.each(o,function(n,i){$.inArray(i,h)===-1&&(h.push(i),t[n].fullAddress=o[n],c.push(t[n]))});i||AVL.RESPONSIVEFORM.VALIDATION.DOM.BuildAddressResultsModal(e.find(".txt-address1 .textbox").attr("id"),"multiple",st,c);u.resolve(!0)}else e.find(".txt-address1 .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].AddressLine1)).trigger("change"),t[0].AddressLine2!==""&&e.find(".txt-address2 .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].AddressLine2)).trigger("change"),e.find(".txt-city .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].PoliticalDivision2)).trigger("change"),r=e.find(".dd-states .dropdown"),f=t[0].PoliticalDivision1,r.val()!==f&&r.val(f).trigger("change"),AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeError||e.find(".txt-zipcode .textbox").val(t[0].PostcodePrimaryLow),e.find(".txt-zipcode label").addClass("inputted"),e.find(".txt-city label").addClass("inputted"),u.resolve(!1)}},fail:function(){e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide();u.resolve(!1)}})):u.resolve(!1)):u.resolve(!0):u.resolve(!1);break;case"opt-address2":if(ri=$.trim(e.find(".txt-address2 .textbox").val()),/^[a-zA-Z0-9-#&. ]*$/.test(ri)===!1)AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning=!0,u.resolve(!0);else{if(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNonUSCountry(t)||$("#bypassed-"+t.attr("id")).length!==0)u.resolve(!1);else{var ui=$.trim(e.find(".txt-address1 .textbox").val()),sr=$.trim(e.find(".txt-address2 .textbox").val()),fi=$.trim(e.find(".txt-city .textbox").val()),hr=e.find(".dd-states").css("display")!=="none",ei=hr?e.find(".dd-states .dropdown").val():$.trim(e.find(".txt-state .textbox").val()),oi=$.trim(e.find(".txt-zipcode .textbox").val());if(ui!==""&&fi!==""&&ei!==""&&oi!==""){var cr="<address><addressline1>"+ui+"<\/addressline1><addressline2>"+sr+"<\/addressline2><city>"+fi+"<\/city><state>"+ei+"<\/state><zip>"+oi+"<\/zip><\/address>",ht=t.parent().find(".input-loading"),d=!1;AVL.RESPONSIVEFORM.VALIDATION.DOM.ShowLoadingImage(n,t,ht);$.ajax({type:"POST",url:"/SiteUtilities/AddressVerification.aspx",contentType:"text/xml",dataType:"text",data:cr,success:function(n){ht.fadeOut(100,function(){var i=$.parseXML(n),r=$(i),t=r.find("ismissingaptnumber");t!=null&&t!==""?(d=t.text().toLowerCase()==="true",e.find(".txt-address2 label em").text(d?"(required)":"(if applicable)"),d&&(address2Flagged=!0),u.resolve(d)):u.resolve(!1)})},error:function(){ht.hide();u.resolve(!1)}})}else u.resolve(!1)}AVL.RESPONSIVEFORM.VALIDATION.HasInvalidTextWarning=!1}break;case"req-zipcode":case"opt-zipcode":r!=="opt-zipcode"||AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||/[\/\\\"?&.*:<>|@#%,]/g.test(i)?u.resolve(!0):(p=e.find(".dd-country .dropdown").val(),p==="US"?(f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").show(),s={testing:!1,country:e.find(".dd-country .dropdown").val(),zipCode:i},AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(s),$.ajax({url:"/MyAccount/CommonControls/ResponsiveForms/Handlers/UPSAddressValidationCityStateZIP.ashx",type:"POST",data:JSON.stringify(s),contentType:"application/json; charset=utf-8",dataType:"json",success:function(n){if(n!=undefined&&n.Response!=undefined){var i=n.Response,t=n.AddressValidationResults;AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(i);i.ResponseStatusDescription==="Failure"?(f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide(),i.ErrorCode==="101112"||i.ErrorCode==="20008"?(AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeValid=!1,AVL.RESPONSIVEFORM.VALIDATION.IsZipCodeError=!0,u.resolve(!0)):u.resolve(!1)):(AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&$.each(t,function(n){console.log(t[n])}),f?u.resolve(!1):(e.find(".txt-state .input-loading, .dd-states .input-loading").fadeOut(100),e.find(".txt-city .input-loading").fadeOut(100,function(){var n,i,r;if(t.length>0){if(n=t[0].StateProvinceCode,AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".dd-states"),e.find(".dd-states .dropdown"),!1,f),t[0].City!=="")if(t.length===1)e.find(".txt-city .textbox").val(AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[0].City)),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-city"),e.find(".txt-city .textbox"),!1,f),e.find(".txt-city .textbox").autocomplete({source:[]});else{i=[];r=!1;$.each(t,function(n){i[n]=AVL.RESPONSIVEFORM.CORE.UTILITIES.CapitalizeFirstLetter(t[n].City);t[n].City.toLowerCase()===$.trim(e.find(".txt-city .textbox").val()).toLowerCase()&&(r=!0)});r||(e.find(".txt-city .textbox").val(""),e.find(".txt-city").find("label").removeClass("inputted"));e.find(".txt-city .textbox").autocomplete({position:{my:"left top",at:"left bottom-1",of:e.find(".txt-city")},delay:0,source:i,minLength:0,select:function(){var n=e.find(".txt-city .textbox");n.parent().find("label").addClass("inputted");AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-city"),e.find(".txt-city .textbox"),!1,f)},close:function(){e.find(".txt-city .textbox").trigger("change")}}).on("focus",function(){$(this).hasClass("ui-autocomplete-input")&&$(this).autocomplete("search","")})}e.find(".txt-state").length>0&&e.find(".txt-state").css("display")!=="none"?(e.find(".txt-state .textbox").val(n),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".txt-state"),e.find(".txt-state .textbox"),!1,f)):(e.find(".dd-states select").val(n).trigger("change"),AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(e.find(".dd-states"),e.find(".dd-states .dropdown"),!1,f));AVL.RESPONSIVEFORM.CORE.INIT.InitFormLabels($("#address-container"));u.resolve(!1)}else u.resolve(!0)})))}else AVL.RESPONSIVEFORM.VALIDATION.ShowJSONAddressData&&console.log(n),f||e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide(),u.resolve(!1)},fail:function(){e.find(".txt-city, .txt-state, .dd-states").find(".input-loading").hide();u.resolve(!1)}})):u.resolve(!1)):u.resolve(!1);break;case"req-cvv":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||i.length<3||i.length>4);break;case"req-cvv2":var lr=!$("#amex").hasClass(AVL.RESPONSIVEFORM.VALIDATION.UnselectedCardType),ar=!$("#visa").hasClass(AVL.RESPONSIVEFORM.VALIDATION.UnselectedCardType),vr=!$("#mastercard").hasClass(AVL.RESPONSIVEFORM.VALIDATION.UnselectedCardType),yr=!$("#discover").hasClass(AVL.RESPONSIVEFORM.VALIDATION.UnselectedCardType);lr?(u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||i.length!==4),AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i)&&n.attr("title","Please enter a valid cvv number.")):(ar||vr||yr)&&(u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||i.length!==3),AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i)&&n.attr("title","Please enter a valid cvv number."));break;case"req-cvv3":si=$("#ccPaymentMode").val();hi=si=="AMEX"?"4":"3";u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(i)||!(hi==i.length));break;case"req-creditcard":i=i.replace(/ /g,"");u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsLuhnPass(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i));AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotZero(i)&&n.attr("title","Please enter a valid credit card number.");break;case"req-email":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-multi-email":if(i===""){u.resolve(!1);break}if(ct=!1,g=i.split(","),AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(g))for(ci in g){li=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(g[ci]);li||(ct=!0);break}u.resolve(ct);break;case"req-email-newaccount":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsEmailAddress(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-ssn":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsSSN(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-url":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsURL(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"opt-date-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)&&!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(n.attr("title","Please enter the Publish Date in this format (MM/DD/YYYY)."),u.resolve(!0)):(new Date).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","Publish date must be today's date or a date in the future."),u.resolve(!0)):u.resolve(!1);break;case"req-date":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsDate(i)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;case"req-date-mm-dd-yy":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i));break;case"req-pod-availabledate-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?new Date((new Date).setDate((new Date).getDate()+56)).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","We require that you make your book release date at least 8 weeks after you upload your book file to BookBaby.com."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Available Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-available-date-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(i)?(n.attr("title","Available date must be today's date or a date in the future."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Available Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-CouponEndDate-mm-dd-yy":v=$("#coupon-modal [id$='txtStartDate'] ").val();y=i;AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(y)||Date.parse(v)>Date.parse(y)?(n.attr("title","Expiration date must be after the Start Date."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Expiration Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-CouponStartDate-mm-dd-yy":y=$("#coupon-modal [id$='txtEndDate'] ").val();v=i;AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(new Date).setHours(0,0,0,0)>Date.parse(v)?(n.attr("title","Start date should be today's date or a date in the future."),u.resolve(!0)):Date.parse(v)>Date.parse(y)?(n.attr("title","Expiration date must be after the Start Date."),u.resolve(!0)):u.resolve(!1):(n.attr("title","Please enter the Start Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-StartDateAddSeven-mm-dd-yy":AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsValidDate(i)?(nt=new Date,nt.setDate((new Date).getDate()+7),nt.setHours(0,0,0),Date.parse(nt)>Date.parse(i)?(n.attr("title","Start date must be at least 7 days from today’s date."),u.resolve(!0)):u.resolve(!1)):(n.attr("title","Please enter the Start Date in this format (MM/DD/YYYY)."),u.resolve(!0));break;case"req-expmonth":lt=e.find("select[data-validation=req-expyear]");at=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i);at&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(lt.val())&&AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(lt);u.resolve(!at);break;case"req-expyear":var ai=new Date,pr=ai.getMonth()+1,vi=ai.getFullYear(),vt=$(e.find("select[data-validation=req-expmonth]")[0]).val()||"12",yi=0,pi=parseInt(i)||0;yi=vt[0]==="0"?parseInt(vt[1]):parseInt(vt);u.resolve(pi<vi||pi===vi&&yi<pr);break;case"req-dateddl-gt":var tt=new Date,yt=i.split("/"),it=new Date,pt=e.find("select[data-validation=req-dateddl-lt]").val().split("/");tt.setDate(parseInt(yt[0]));tt.setMonth(parseInt(yt[1])-1);tt.setYear(parseInt(yt[2]));it.setDate(parseInt(pt[0]));it.setMonth(parseInt(pt[1])-1);it.setYear(parseInt(pt[2]));u.resolve(tt.getTime()<it.getTime());break;case"req-password":case"req-password1":i.length===0?n.attr("title","Please enter a password."):i.length<8?n.attr("title","Your password must be at least 8 characters."):i.length>20&&n.attr("title","Your password must be 20 characters or less.");wt=e.find("input[data-validation=req-password2]");wi=wt.val();wi!==""&&AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateInput(wt);u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||i.length<8||i.length>20);break;case"req-password2":bi=e.find("input[data-validation=req-password1]").val();AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?i!==bi?(n.attr("title","The password and confirmation don't match."),u.resolve(!0)):i.length<8?(n.attr("title","Your confirming password must be at least 8 characters."),u.resolve(!0)):i.length>20?(n.attr("title","Your confirming password must be 20 characters or less."),u.resolve(!0)):u.resolve(!1):u.resolve(!0);break;case"req-coupon":i=t.val();ki=$("#coupon-modal [id$='rbCouponType'] input:checked").val();ki==="1"?u.resolve(!1):AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsAlphNumeric(i)&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)?(di=/The coupon code you entered has already been used. Please enter a different code/i,$("[id$='btnValidateCoupon']").show(),bt=t.attr("id")+"_warning",di.test($("#"+bt).html())?(n.attr("title","The coupon code you entered has already been used. Please enter a different code."),/./i.test($("#"+bt).html())?u.resolve(!1):u.resolve(!0)):u.resolve(!1)):(i!==""?n.attr("title","Special characters are not allowed."):n.attr("title","Please enter coupon code."),$("[id$='lblCouponCodeAvailable']").hide(),u.resolve(!0));break;case"req-coupon-discount":rt=$("#coupon-modal [id$='rbDiscountType'] input:checked").val();kt=rt==="1"?t.val().replace(/[$]/g,""):t.val().replace(/[%]/g,"");isValid=!0;$.isNumeric(kt)?(gi=parseFloat($("#coupon-modal [id$='hfModalBookPrice']").val()),nr=$("#coupon-modal [id$='hfModalBookType']").val(),u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ValidateCoupondiscount(rt,nr,kt,gi,n))):(n.attr("title",rt===undefined?"Please select the discount type first.":"Please enter a valid discount amount."),u.resolve(!0));break;case"req-budget":var c=i.replace(/[^.0-9]/g,""),h=$('[id$="txtNumWeeks"]').val().replace(/[^.0-9]/g,""),tr=$('[id$="spEnteredBudget"]'),wr=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(c)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(c)||c<100,l=AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetRoundDownBudget(c),w=l/100;wr?(n.attr("title",l===0?"The budget you have entered does not meet the minimum of $100 per week.":"Please enter an integer that meets the minimum budget."),tr.text(c!==""?"The budget you have entered does not meet the minimum of $100 per week.":""),u.resolve(!0)):($('[id$="txtBudget"]').val("$"+c),n=$('[id$="txtNumWeeks"]').parent("p"),ut=$('[id$="txtNumWeeks_warning"]'),h!==""&&(h>w||h==="0")?(o=w===1?"Please enter 1 week":"Please enter number of weeks between 1 – "+w,o+=" or increase your budget.",n.attr("title",o),n.find("i.input-warning").length?n.find("i.input-warning").attr("title",o):n.append("<i class='input-status input-warning icon-attention' title='"+o+"' onclick='ShowValidationMessage(event, $(this));'><\/i>"),n.addClass("failed-validation"),ut.text(o)):h!==""&&(n.attr("title",""),n.removeClass("failed-validation"),ut.length>0&&ut.text("")),AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.ShowBudgetLabel(l,w,w,tr),u.resolve(!1));break;case"req-budget-per-week":var h=i.replace(/[^.0-9]/g,""),c=$('[id$="txtBudget"]').val().replace(/[^.0-9]/g,""),dt=!1,o="",l=AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetRoundDownBudget(c),gt=$.isNumeric(h)&&$.isNumeric(c)&&l!=="0",br=l/100;if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsWholeNumber(h)){o="Please enter a valid integer.";n.attr("title",o);$('[id$="input-warning"]').attr("title",o);gt=!1;u.resolve(!0);break}if(h!==""&&h!=="0"&&c===""||l===0){u.resolve(!1);break}gt?(dt=parseInt(h)>=1?l/h>=100:!1,dt?n.attr("title",""):(o=br===1?"Please enter 1 week":"Please enter number of weeks between 1 – "+l/100,o+=" or increase your budget.",n.attr("title",o),$('[id$="input-warning"]').attr("title",o))):n.attr("title","Please enter the week in the correct format.");u.resolve(!gt||!dt);break;case"req-albumname":case"req-artistname":case"req-volumename":case"req-tracktitle":case"req-urlpage":case"req-cdtext":ir=r==="req-volumename"||r==="req-urlpage"?/[\[\]\/\\\"~'&^$!}{\;()?.*+=:<>| @#%,]/g:/[\/\\\*:<>|@#%]/g;i=t.val().replace(/[^\x00-\x7F]/g,"");i=i.replace(ir,"");t.val(i);t.closest("fieldset").sisyphus().saveAllData();f?u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i.trim())):u.resolve(!1);break;case"opt-isrc":if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)){u.resolve(!1);break}case"req-isrc":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/^[a-zA-Z]{2}(-?)[0-9a-zA-Z]{3}(-?)\d{2}(-?)\d{5}$/.test(i));break;case"req-search":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||i.trim().toLowerCase()==="search");break;case"req-youtubelink":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/^(http(s?)\:\/\/)?(www\.)?((youtube\.com\/watch\?v=)|(youtu.be\/))([a-zA-Z0-9\-_]){11}/.test(i.toLowerCase()));break;case"req-youtubechannel":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i)||!/((http|https):\/\/|)(www\.|)youtube\.com\/(channel\/|user\/|c\/)[a-zA-Z0-9_\-]{1,}$/.test(i.toLowerCase()));break;case"req-partnerlink":u.resolve(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(i));break;default:u.resolve(!1)}return u.promise()},CheckCertifiedAddressMatch:function(n){return!AVL.RESPONSIVEFORM.VALIDATION.AddressCertified||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.addressline1!==$.trim(n.addressline1)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.city!==$.trim(n.city)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.zipCode!==$.trim(n.zipCode)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.state!==$.trim(n.state)||AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.country!==$.trim(n.country)?(AVL.RESPONSIVEFORM.VALIDATION.AddressCertified=!1,$("#address-results").find("#addressCertified").val("false"),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.addressline1=$.trim(n.addressline1),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.city=$.trim(n.city),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.zipCode=$.trim(n.zipCode),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.state=$.trim(n.state),AVL.RESPONSIVEFORM.VALIDATION.JsonCertifiedAddress.country=$.trim(n.country),!1):!0},ValidateInput:function(n){var t=n.closest("p, div.radio-mask, div.textbox-mask"),i=$.trim(n.val()),r=n.attr("data-validation")||n.parent().attr("data-validation"),u=new $.Deferred;$.when(AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckInputValue(t,n,i,r,u,!1)).done(function(r){AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(t,n,r,!1);AVL.RESPONSIVEFORM.VALIDATION.InstantValidationDebug&&console.log("input: "+n.attr("id")+"\r\nvalue: '"+i+"'\r\nfail: "+r)})},GetProjectedProceed:function(n,t,i,r){var u,f=r==="1"?t:t*n/100,e=i==="Print"?n/2:15*n/100;return u=n-f,u=u-e,u>0?u.toFixed(2):0..toFixed(2)},ValidateCoupondiscount:function(n,t,i,r,u){var f=!0;if(u.attr("title",""),$.isNumeric(i)){$("#coupon-modal [id$='projected-amount']").text("");switch(n){case"1":t==="eBook"?i>r*85/100&&i!=r&&(u.attr("title","The maximum allowable discount for an eBook is up to 85% or 100% of the book price [$"+r+"]."),f=!1):i>r/2&&(u.attr("title","The maximum allowable discount for a print book is half of the book price [$"+r+"]."),f=!1);break;case"2":t==="eBook"?parseFloat(i)!==100&&parseFloat(i)>85&&(u.attr("title","The maximum allowable discount for an eBook is up to 85% or 100% of the book price [$"+r+"]."),f=!1):r*i/100>r/2&&(u.attr("title","The maximum allowable discount for a print book is 50% of the price [$"+r+"]."),f=!1);break;case undefined:u.attr("title","Please select the discount type first.");f=!1}$("#coupon-modal [id$='projected-amount']").text(f?"Projected Proceeds: $"+AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.GetProjectedProceed(r,i,t,n):"")}else u.attr("title","Please enter a valid discount amount."),f=!1;return f||AVL.RESPONSIVEFORM.VALIDATION.DOM.SetIconWarningMessage(u),f},ShowBudgetLabel:function(n,t,i,r){var u=n/t>=100;r.text(u?"The budget you have entered will allow for 1 "+(i===1?"week":"- "+i+" weeks")+" of advertising":"")},GetRoundDownBudget:function(n){return n%100!=0?n-n%100:n}},POSTBACKS:{ValidateInputs:function(n,t,i){var f=n.target||n.srcElement,r=$(f),e=[],u=!0,o=r.attr("data-submit-text")==undefined?"Submitting...":r.attr("data-submit-text"),s=r.attr("data-submit-scrollform")==undefined?!0:r.attr("data-submit-scrollform");return r.data("validated")==="true"?!0:(r.data("original")==undefined&&r.data("original",r.val()),r.val(o),t.each(function(){var n=$(this);AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.RemoveHazardousStrings(t);$(n).find("input.textbox:visible, textarea.textarea:visible, select.dropdown:visible, input.checkbox:visible, .checkbox input:visible, .radiobutton:visible").each(function(){var n=$(this),t=n.closest("p, div.radio-mask, div.textbox-mask"),r=$.trim(n.val()),f=n.attr("data-validation")||n.parent().attr("data-validation"),i=new $.Deferred;e.push(i);$.when(AVL.RESPONSIVEFORM.VALIDATION.FUNCTIONS.CheckInputValue(t,n,r,f,i,!0)).done(function(i){i&&(u=!1);AVL.RESPONSIVEFORM.VALIDATION.DOM.DisplayValidationResult(t,n,i,!0);AVL.RESPONSIVEFORM.VALIDATION.SubmitValidationDebug&&console.log(n.attr("id").split("_").pop()+"("+n.val()+") - fail: "+i)})})}),$.when.apply(null,e).done(function(){r.val(r.data("original"));u?i!=null?(AVL.RESPONSIVEFORM.CORE.UTILITIES.ReleaseLocalStorage($(".responsive-form")),localStorage.removeItem("focus"),i.apply(r[0])):(r.val(o).data("validated","true"),AVL.RESPONSIVEFORM.CORE.UTILITIES.ReleaseLocalStorage($(".responsive-form")),localStorage.removeItem("focus"),f.onclick=null,setTimeout(function(){r.trigger("click");r.attr("data-submit-disable")=="true"&&r.prop("disabled",!0)},1)):s===!0&&AVL.RESPONSIVEFORM.VALIDATION.DOM.MoveToFirstFailedInput();AVL.RESPONSIVEFORM.VALIDATION.SubmitValidationDebug&&console.log("Form sumbit validated: "+u)}),!1)}},UTILITIES:{FormatUSPhoneNumber:function(n,t,i){t=t.replace(/["'()-]/g,"");t=t.replace(/ /g,"");t=t.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3");(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNonUSCountry(n)||i)&&n.val(t)},GetCountryCode:function(n){var i="",t=n.closest(".responsive-form").find(".dd-country select");return t.length>0&&t.val()&&(i=t.val().toLowerCase()),i},ValidateRange:function(n,t,i,r,u,f){var c=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNumber(t),l=t.replace(/[^.0-9]/g,""),s=parseFloat(l),e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/),h,o=!1;return h=Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)),t===""||!c||s<=0?(o=!0,n.attr("data-warning-override","Please enter a valid "+f+".")):s<i||s>r?(o=!0,n.attr("data-warning-override","Please enter a valid "+f+".")):h>u&&(o=!0,n.attr("data-warning-override","Please enter a "+f+" of up to "+u+" decimal places.")),o},RemoveHazardousStrings:function(n){n.find("input.textbox, textarea.textarea").each(function(){$(this).val(AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.SanitizeValue($(this).val()))})},SanitizeValue:function(n){return n.replace(/\< /g,"<").replace(/\</g,"< ").replace(/\&\#/g,"& #")},IsAlphNumeric:function(n){return!/[^A-Za-z0-9]/.test(n)},IsNoSelection:function(n){return n!=="0"&&AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n)},IsNotZero:function(n){return n>0},IsNotEmpty:function(n){return n!==""},IsNotAvailable:function(n){return n!=="N/A"},IsNumber:function(n){return!isNaN(n)},IsWholeNumber:function(n){return/^\d+$/.test(n)},IsPrice:function(n){return/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(n)},IsISBN:function(n){return/^(979|978)\d{10}$/i.test(n)},IsPhoneNumber:function(n){return/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/i.test(n)},IsUSPhoneNumber:function(n){var t=n.replace(/["'()-]/g,"");return t=t.replace(/ /g,""),/^[0-9]{1,11}$/.test(+t)&&(t.length===10||t.length===11)},IsPhoneNumberByCountry:function(n,t){var i=!1;switch(t){case"us":i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsUSPhoneNumber(n)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n);break;case"ca":case"ant":case"bar":case"bah":case"angu":case"brv":case"cay":case"ber":case"gren":case"tc":case"mons":case"guam":case"stm":case"stl":case"domi":case"stv":case"pr":case"do":case"tri":case"stk":case"jam":i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsPhoneNumber(n);break;default:i=!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsInternationalPhoneNumber(n)}return i},IsInternationalPhoneNumber:function(n){return/^(\+)?[0-9\-().\s]{7,15}$/i.test(n)},IsNonUSCountry:function(n){var t=AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.GetCountryCode(n);return t!=="us"},IsEmailAddress:function(n){return/^([\w-\.+]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/i.test(n)},IsLuhnPass:function(t){var e=!0,f,i;if(/[^0-9-]+/.test(t))e=!1;else{var u=0,i=0,r=!1;for(t=t.replace(/\D/g,""),n=t.length-1;n>=0;n--)f=t.charAt(n),i=parseInt(f,10),r&&(i*=2)>9&&(i-=9),u+=i,r=!r;return u%10==0?!0:!1}},IsSSN:function(n){return/^(?!000)([0-9]\d{2}|7([0-9]\d|7[012]))([ -]?)(?!00)\d\d\3(?!0000)\d{4}$/i.test(n)},IsURL:function(n){return/^(https?):\/\/(((([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(n)},IsDate:function(n){return!/Invalid|NaN/.test(new Date(n))},IsValidDate:function(n){if(!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsNotEmpty(n)||!AVL.RESPONSIVEFORM.VALIDATION.UTILITIES.IsDateMMDDYY(n))return!1;var t=n.split("/"),r=parseInt(t[2],10),u=parseInt(t[0],10)-1,f=parseInt(t[1],10),i=new Date(r,u,f);return i.getFullYear()===r&&i.getMonth()===u&&i.getDate()===f},IsDateMMDDYY:function(n){return/^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$/i.test(n)}}},function(n){var t=function(){var i=function(n){var t={data:[],heatmap:n};this.max=1;this.get=function(n){return t[n]};this.set=function(n,i){t[n]=i}},n,t;return i.prototype={addDataPoint:function(n,t){if(!(n<0)&&!(t<0)){var r=this,u=r.get("heatmap"),i=r.get("data");if(i[n]||(i[n]=[]),i[n][t]||(i[n][t]=0),i[n][t]+=arguments.length<3?1:arguments[2],r.set("data",i),r.max<i[n][t]){u.get("actx").clearRect(0,0,u.get("width"),u.get("height"));r.setDataSet({max:i[n][t],data:i},!0);return}u.drawAlpha(n,t,i[n][t],!0)}},setDataSet:function(n,t){var h=this,r=h.get("heatmap"),f=[],u=n.data,s=u.length,e,o,i;if(r.clear(),this.max=n.max,r.get("legend")&&r.get("legend").update(n.max),t!=null&&t){for(e in u)if(e!==undefined)for(o in u[e])o!==undefined&&r.drawAlpha(e,o,u[e][o],!1)}else while(s--)i=u[s],r.drawAlpha(i.x,i.y,i.count,!1),f[i.x]||(f[i.x]=[]),f[i.x][i.y]||(f[i.x][i.y]=0),f[i.x][i.y]=i.count;r.colorize();this.set("data",u)},exportDataSet:function(){var r=this,i=r.get("data"),u=[],n,t;for(n in i)if(n!==undefined)for(t in i[n])t!==undefined&&u.push({x:parseInt(n,10),y:parseInt(t,10),count:i[n][t]});return{max:r.max,data:u}},generateRandomDataSet:function(n){var r=this.get("heatmap"),f=r.get("width"),e=r.get("height"),t={},u=Math.floor(Math.random()*1e3+1),i;for(t.max=u,i=[];n--;)i.push({x:Math.floor(Math.random()*f+1),y:Math.floor(Math.random()*e+1),count:Math.floor(Math.random()*u+1)});t.data=i;this.setDataSet(t)}},n=function(n){this.config=n;var t={element:null,labelsEl:null,gradientCfg:null,ctx:null};this.get=function(n){return t[n]};this.set=function(n,i){t[n]=i};this.init()},n.prototype={init:function(){var n=this,i=n.config,s=i.title||"Legend",o=i.position,r=i.offset||10,h=i.gradient,u=document.createElement("ul"),t,f,e="";n.processGradientObject();e+=o.indexOf("t")>-1?"top:"+r+"px;":"bottom:"+r+"px;";e+=o.indexOf("l")>-1?"left:"+r+"px;":"right:"+r+"px;";t=document.createElement("div");t.style.cssText="border-radius:5px;position:absolute;"+e+"font-family:Helvetica; width:256px;z-index:10000000000; background:rgba(255,255,255,1);padding:10px;border:1px solid black;margin:0;";t.innerHTML="<h3 style='padding:0;margin:0;text-align:center;font-size:16px;'>"+s+"<\/h3>";u.style.cssText="position:relative;font-size:12px;display:block;list-style:none;list-style-type:none;margin:0;height:15px;";f=document.createElement("div");f.style.cssText=["position:relative;display:block;width:256px;height:15px;border-bottom:1px solid black; background-image:url(",n.createGradientImage(),");"].join("");t.appendChild(u);t.appendChild(f);n.set("element",t);n.set("labelsEl",u);n.update(1)},processGradientObject:function(){var r=this,i=this.config.gradient,n=[],t;for(t in i)i.hasOwnProperty(t)&&n.push({stop:t,value:i[t]});n.sort(function(n,t){return n.stop-t.stop});n.unshift({stop:0,value:"rgba(0,0,0,0)"});r.set("gradientArr",n)},createGradientImage:function(){var f=this,e=f.get("gradientArr"),i=e.length,r=document.createElement("canvas"),n=r.getContext("2d"),u,t;for(r.width="256",r.height="15",u=n.createLinearGradient(0,5,256,10),t=0;t<i;t++)u.addColorStop(1/(i-1)*t,e[t].value);for(n.fillStyle=u,n.fillRect(0,5,256,10),n.strokeStyle="black",n.beginPath(),t=0;t<i;t++)n.moveTo((1/(i-1)*t*256>>0)+.5,0),n.lineTo((1/(i-1)*t*256>>0)+.5,t==0?15:5);return n.moveTo(255.5,0),n.lineTo(255.5,15),n.moveTo(255.5,4.5),n.lineTo(0,4.5),n.stroke(),f.set("ctx",n),r.toDataURL()},getElement:function(){return this.get("element")},update:function(n){for(var u=this,i=u.get("gradientArr"),o=u.get("ctx"),s=u.get("labelsEl"),f,e="",r,t=0;t<i.length;t++)f=n*i[t].stop>>0,r=o.measureText(f).width/2>>0,t==0&&(r=0),t==i.length-1&&(r*=2),e+='<li style="position:absolute;left:'+(((1/(i.length-1)*t*256||0)>>0)-r+.5)+'px">'+f+"<\/li>";s.innerHTML=e}},t=function(n){var t={radius:40,element:{},canvas:{},acanvas:{},ctx:{},actx:{},legend:null,visible:!0,width:0,height:0,max:!1,gradient:!1,opacity:180,premultiplyAlpha:!1,bounds:{l:1e3,r:0,t:1e3,b:0},debug:!1};this.store=new i(this);this.get=function(n){return t[n]};this.set=function(n,i){t[n]=i};this.configure(n);this.init()},t.prototype={configure:function(t){var i=this,r;i.set("radius",t.radius||40);i.set("element",t.element instanceof Object?t.element:document.getElementById(t.element));i.set("visible",t.visible!=null?t.visible:!0);i.set("max",t.max||!1);i.set("gradient",t.gradient||{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"});i.set("opacity",parseInt(255/(100/t.opacity),10)||180);i.set("width",t.width||0);i.set("height",t.height||0);i.set("debug",t.debug);t.legend&&(r=t.legend,r.gradient=i.get("gradient"),i.set("legend",new n(r)))},resize:function(){var n=this,t=n.get("element"),i=n.get("canvas"),r=n.get("acanvas");i.width=r.width=n.get("width")||t.style.width.replace(/px/,"")||n.getWidth(t);this.set("width",i.width);i.height=r.height=n.get("height")||t.style.height.replace(/px/,"")||n.getHeight(t);this.set("height",i.height)},init:function(){var n=this,t=document.createElement("canvas"),i=document.createElement("canvas"),f=t.getContext("2d"),r=i.getContext("2d"),u=n.get("element");n.initColorPalette();n.set("canvas",t);n.set("ctx",f);n.set("acanvas",i);n.set("actx",r);n.resize();t.style.cssText=i.style.cssText="position:absolute;top:0;left:0;z-index:10000000;";t.setAttribute("id","heatmap-canvas");n.get("visible")||(t.style.display="none");u.appendChild(t);n.get("legend")&&u.appendChild(n.get("legend").getElement());n.get("debug")&&document.body.appendChild(i);r.shadowOffsetX=15e3;r.shadowOffsetY=15e3;r.shadowBlur=15},initColorPalette:function(){var i=this,r=document.createElement("canvas"),e=i.get("gradient"),t,u,n,f;r.width="1";r.height="256";t=r.getContext("2d");u=t.createLinearGradient(0,0,1,256);n=t.getImageData(0,0,1,1);n.data[0]=n.data[3]=64;n.data[1]=n.data[2]=0;t.putImageData(n,0,0);n=t.getImageData(0,0,1,1);i.set("premultiplyAlpha",n.data[0]<60||n.data[0]>70);for(f in e)u.addColorStop(f,e[f]);t.fillStyle=u;t.fillRect(0,0,1,256);i.set("gradient",t.getImageData(0,0,1,256).data)},getWidth:function(n){var t=n.offsetWidth;return n.style.paddingLeft&&(t+=n.style.paddingLeft),n.style.paddingRight&&(t+=n.style.paddingRight),t},getHeight:function(n){var t=n.offsetHeight;return n.style.paddingTop&&(t+=n.style.paddingTop),n.style.paddingBottom&&(t+=n.style.paddingBottom),t},colorize:function(n,t){var u=this,l=u.get("width"),g=u.get("radius"),a=u.get("height"),nt=u.get("actx"),tt=u.get("ctx"),e=g*3,it=u.get("premultiplyAlpha"),p=u.get("gradient"),k=u.get("opacity"),f=u.get("bounds"),o,s,w,b,v,i,d,y,h,c,r;for(n!=null&&t!=null?(n+e>l&&(n=l-e),n<0&&(n=0),t<0&&(t=0),t+e>a&&(t=a-e),o=n,s=t,b=n+e,w=t+e):(o=f.l<0?0:f.l,b=f.r>l?l:f.r,s=f.t<0?0:f.t,w=f.b>a?a:f.b),v=nt.getImageData(o,s,b-o,w-s),i=v.data,d=i.length,r=3;r<d;r+=4)(y=i[r],h=y*4,h)&&(c=y<k?y:k,i[r-3]=p[h],i[r-2]=p[h+1],i[r-1]=p[h+2],it&&(i[r-3]/=255/c,i[r-2]/=255/c,i[r-1]/=255/c),i[r]=c);v.data=i;tt.putImageData(v,o,s)},drawAlpha:function(n,t,i,r){var e=this,o=e.get("radius"),u=e.get("actx"),a=e.get("max"),f=e.get("bounds"),s=n-1.5*o>>0,h=t-1.5*o>>0,c=n+1.5*o>>0,l=t+1.5*o>>0;u.shadowColor="rgba(0,0,0,"+(i?i/e.store.max:"0.1")+")";u.shadowOffsetX=15e3;u.shadowOffsetY=15e3;u.shadowBlur=15;u.beginPath();u.arc(n-15e3,t-15e3,o,0,Math.PI*2,!0);u.closePath();u.fill();r?e.colorize(s,h):(s<f.l&&(f.l=s),h<f.t&&(f.t=h),c>f.r&&(f.r=c),l>f.b&&(f.b=l))},toggleDisplay:function(){var n=this,t=n.get("visible"),i=n.get("canvas");i.style.display=t?"none":"block";n.set("visible",!t)},getImageData:function(){return this.get("canvas").toDataURL()},clear:function(){var n=this,t=n.get("width"),i=n.get("height");n.store.set("data",[]);n.get("ctx").clearRect(0,0,t,i);n.get("actx").clearRect(0,0,t,i)},cleanup:function(){var n=this;n.get("element").removeChild(n.get("canvas"))}},{create:function(n){return new t(n)},util:{mousePosition:function(n){var t,i;if(n.layerX?(t=n.layerX,i=n.layerY):n.offsetX&&(t=n.offsetX,i=n.offsetY),typeof t!="undefined")return[t,i]}}}}();n.h337=n.heatmapFactory=t}(window);jss=function(){function a(n){for(var u=n.cssRules||n.rules||[],i={},r,t=0;t<u.length;t++)r=s(u[t].selectorText),i[r]||(i[r]=[]),i[r].push({sheet:n,index:t,style:u[t].style});return i}function n(n,t){var u=n.cssRules||n.rules||[],f=[],i,r;for(t=t.toLowerCase(),i=0;i<u.length;i++)r=u[i].selectorText,r&&(r==t||r==b(t)||r==k(t))&&f.push({sheet:n,index:i,style:u[i].style});return f}function v(n,t){var u=n.cssRules||n.rules||[],i=u.length,f=y(n,t,u,i);return f||r(n,t,i),{sheet:n,index:i,style:u[i].style}}function r(n,t,i){n.insertRule?n.insertRule(t+" { }",i):n.addRule(t,null,i)}function y(n,u,f,e){var c,l;if(t.exec(u))c=u,l=h(u);else if(o.exec(u))c=s(u),l=u;else return!1;return i||(r(n,c,e),f.length<=e&&(i=!0)),i&&r(n,l,e),!0}function s(n){return n.replace(o,function(n,t,i,r){return t+"::"+r})}function h(n){return n.replace(t,function(n,t,i){return":"+i})}function p(n){var t=n.sheet;t.deleteRule?t.deleteRule(n.index):t.removeRule&&t.removeRule(n.index)}function c(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function u(n){for(var i={},t=0;t<n.length;t++)c(i,w(n[t].style));return i}function w(n){for(var i={},t=0;t<n.length;t++)i[n[t]]=n[g(n[t])];return i}function b(n){for(var t="",i=0;(match=l.exec(n))!=null;){if(match[0]==="")break;t+=n.substring(i,match.index);t+=n.substr(match.index+match[1].length,match[2].length);t+=n.substr(match.index,match[1].length);i=match.index+match[0].length}return t+n.substr(i)}function k(n){return t.exec(n)?h(n):n}function d(n,t){var i,r,u;for(i in t)r=t[i],u=r.indexOf(" !important"),n.style.removeProperty(i),u>0?n.style.setProperty(i,r.substr(0,u),"important"):n.style.setProperty(i,r)}function g(n){return n.replace(/-([a-z])/g,function(n,t){return t.toUpperCase()})}function nt(n){var i={},t;for(t in n)i[tt(t)]=n[t];return i}function tt(n){return n.replace(/([A-Z])/g,function(n,t){return"-"+t.toLowerCase()})}var l=/((?:\.|#)[^\.\s#]+)((?:\.|#)[^\.\s#]+)/g,t=/(::)(before|after|first-line|first-letter|selection)/,o=/([^:])(:)(before|after|first-line|first-letter|selection)/,i,f=function(n){this.doc=n;this.head=this.doc.head||this.doc.getElementsByTagName("head")[0];this.sheets=this.doc.styleSheets||[]},e;return f.prototype={get:function(t){if(!this.defaultSheet)return{};if(t)return u(n(this.defaultSheet,t));var i=a(this.defaultSheet);for(t in i)i[t]=u(i[t]);return i},getAll:function(t){for(var r={},i=0;i<this.sheets.length;i++)c(r,u(n(this.sheets[i],t)));return r},set:function(t,i){var r,u;for(this.defaultSheet||(this.defaultSheet=this._createSheet()),i=nt(i),r=n(this.defaultSheet,t),r.length||(r=[v(this.defaultSheet,t)]),u=0;u<r.length;u++)d(r[u],i)},remove:function(t){var i,r;if(this.defaultSheet){if(!t){this._removeSheet(this.defaultSheet);delete this.defaultSheet;return}for(i=n(this.defaultSheet,t),r=0;r<i.length;r++)p(i[r]);return i.length}},_createSheet:function(){var n=this.doc.createElement("style");return n.type="text/css",n.rel="stylesheet",this.head.appendChild(n),n.sheet},_removeSheet:function(n){var t=n.ownerNode;t.parentNode.removeChild(t)}},e=new f(document),e.forDocument=function(n){return new f(n)},e}();typeof module!="undefined"&&module.exports&&(module.exports=jss);EventRecorder=function(n,t,i){var r={},s=null,l=-1,a=!1,v=2147483647,nt=3e3,f={record:!0,debug:!1,escPlayback:!1},tt=function(n,t,i){var r=parent&&parent.EVENTPLAYBACK&&parent.EVENTPLAYBACK.playback;typeof n=="boolean"&&(f.record=n);typeof t=="boolean"&&(f.debug=t);typeof i=="boolean"&&(f.escPlayback=i);f.record&&!r&&ot()},it=function(){f.record&&(s=Date.now(),e(null,null,null,null,null,null,null,null,null,o(s),null,null,null),u("recording started at "+s),a=!0,et())},rt=function(){var t=Date.now(),n;u("recording stopped");a=!1;e(null,null,null,null,null,null,null,null,null,o(t),null,null,null);r.Filesize=AVL.UTILITIES.FUNCTIONS.GetPhysicalSize(h());(r.Inactivity==null||r.Inactivity<0)&&(r.Inactivity=0);n=t-s;r.Duration=n>v?v:n;r.Engagement=r.Duration-r.Inactivity;ut()},ut=function(){r.Active=!1;f.record&&r.Unloadable&&ht()},h=function(){return JSON.stringify(r)},ft=function(t){if(t.length>0)switch(t[0]){case"tagRecording":typeof r.Tags=="undefined"&&(r.Tags="");switch(typeof t[1]){case"object":n.each(t[1],function(n,t){var i=t==null||t==""?"":":"+t,u=n+i,f=r.Tags==""?"":",";r.Tags+=f+u});break;case"string":r.Tags+=","+t[1]}u(r.Tags)}},et=function(){if(f.record){i.onload=function(){wgxpath.install()};"onbeforeunload"in i?(i.onbeforeunload=function(){rt()},r.Unloadable=!0,u("window beforeunload event bound!")):(r.Unloadable=!1,r.Active=!1,u("window beforeunload failed!"));n(i).on("resize",function(n){n.timeStamp=Date.now();y(n)});n(t).on("resize mousedown mouseup mousemove dblclick keydown keyup scroll change touchstart touchmove touchend touchcancel",function(n){if(yt(n)){n.timeStamp=Date.now();switch(n.type){case"mousedown":case"mouseup":n.which==1&&y(n);break;default:y(n)}}});var e=n("#slideout-content").length==0?n(t):n("#slideout-content");e.on("scroll",function(n){n.timeStamp=Date.now();y(n)})}},y=function(t){if(a&&f.record)switch(t.type){case"mousemove":case"mousedown":case"mouseup":case"dblclick":(r.Events.length==0||t.type!="mousemove"||t.type=="mousemove"&&r.Events[r.Events.length-1].Mx!=t.pageX&&r.Events[r.Events.length-1].My!=t.pageY)&&(lt(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),t.type=="mouseup"&&(e(t.type,null,t.pageX,t.pageY,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),k(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null),t.type="click",r.Clicks==null?r.Clicks=1:r.Clicks++),e(t.type,null,t.pageX,t.pageY,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null));break;case"keydown":case"keyup":var u=t.which?t.which:t.keyCode;e(t.type,u,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)).val());break;case"change":e(t.type,null,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),k(n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t))),AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)).val());break;case"resize":p();e(t.type,null,null,null,n(i).scrollLeft(),n(i).scrollTop(),null,n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null);break;case"scroll":p();e(t.type,t.pageX,t.pageY,null,n(i).scrollLeft(),n(i).scrollTop(),"window",n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null)}},e=function(n,t,i,f,e,o,s,h,c,l,a,v,y){var p={Et:n,Kc:t,Mx:i,My:f,Sx:e,Sy:o,St:s,Ww:h,Wh:c,Ts:l,Tg:a,Tr:v,Vl:y};vt(l,nt);r.Events.push(p);u(p)},u=function(n){f.debug&&console.log(n)},ot=function(){r={Active:!0,Application:"",Belowfold:0,Brand:0,Browsername:"",Browserversion:"",Clicks:0,Colordepth:"",Cookiesenabled:!1,Country:"",Countrycode:"",Customerid:"",Date:c(),Devicetype:"",Documentheight:0,Duration:0,Engagement:0,Error:0,Events:"",Filesize:"",Flashversion:"",Inactivity:0,Ip:"",Isp:"",Javaenabled:!1,Language:"",Lastmodified:c(),Lastvisit:c(),Latitude:"",Loadtime:0,Longitude:"",Osname:"",Osversion:"",Page:"",Pagetitle:"",Referrer:"",Region:"",Regioncode:"",Screenheight:0,Screenres:"",Screenwidth:0,Scrollreach:0,Servertime:0,Sessionid:"",Sourcecode:"",Tags:"",Timezone:"",Unscrolled:0,Url:"",Useragent:"",Utmcampaign:"",Utmsource:"",Utmmedium:"",Utmcontent:"",Viewportheight:"",Viewportwidth:"",Visitortype:"",Browserfeatures:{Applicationcache:"",Audio:"",Backgroundsize:"",Borderimage:"",Canvas:"",Canvastext:"",Cssanimations:"",Csscolumns:"",Cssgradients:"",Cssreflections:"",Csstransforms:"",Csstransforms3d:"",Csstransitions:"",Borderradius:"",Boxshadow:"",Draganddrop:"",Flexbox:"",Fontface:"",Geolocation:"",Generatedcontent:"",Hashchange:"",History:"",Hsla:"",Indexeddb:"",Inlinesvg:"",Localstorage:"",Multiplebgs:"",Opacity:"",Postmessage:"",Rgba:"",Sessionstorage:"",Smil:"",Svg:"",Svgclippaths:"",Textshadow:"",Touch:"",Unloadable:0,Video:"",Webgl:"",Websockets:"",websqldatabase:"",webworkers:""}};ct();at();st();u(r);it()},st=function(){function i(n){l=parseInt(n.d);r.Servertime=(new Date).getTime()-t;u(r.Servertime)}function f(){r.Servertime=(new Date).getTime()-t;u("failed save!")}var t=(new Date).getTime();!0&&n.ajax({type:"POST",async:!0,cache:!1,url:g()+"/AddRecording",contentType:"application/json; charset=utf-8",data:JSON.stringify({jsonRequest:h()}),dataType:"json",success:i,error:f})},ht=function(){function r(n){u(n)}function f(n){u(n.status+" \n\r "+n.statusText+"\n\r"+n.responseText)}var t=g()+(l==-1?"/AddRecording":"/UpdateRecording"),i=l==-1?JSON.stringify({jsonRequest:h()}):JSON.stringify({id:l,jsonRequest:h()});!0&&n.ajax({type:"POST",async:!1,cache:!1,url:t,contentType:"application/json; charset=utf-8",data:i,dataType:"json",success:r,error:f})},ct=function(){var e=!0,o="ER_PV_"+d(),s="ER_RSID",u="ER_RLV",h="ER_RVT",t=AVL.UTILITIES.FUNCTIONS.GetCookie(s),f,n,i;t==undefined||t==null||t==""?(r.Sessionid=pt(),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(s,r.Sessionid)):(r.Sessionid=t,e=!1);f=AVL.UTILITIES.FUNCTIONS.GetCookie(u);n=AVL.UTILITIES.FUNCTIONS.GetCookie(h);e||!w(f)||n==undefined||n==null||n==""?(i=AVL.UTILITIES.FUNCTIONS.GetCookie(o),w(i)?(r.Visitortype="returning",r.Lastvisit=i,AVL.UTILITIES.FUNCTIONS.SetSessionCookie(u,i)):(r.Visitortype="new",r.Lastvisit=b(),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(u,b())),AVL.UTILITIES.FUNCTIONS.SetSessionCookie(h,r.Visitortype)):(r.Lastvisit=f,r.Visitortype=n);w(r.Lastvisit)||(r.Lastvisit=b());AVL.UTILITIES.FUNCTIONS.SetCookie(o,c(),360)},lt=function(r){var f=r.scrollParent(),s=r.hasScroll(),h=!f.is(t)&&f.hasScroll(),u;if((s||h)&&(u=s?r:r.scrollParent(),!u.hasClass("scrollable-record"))){u.addClass("scrollable-record");u.on("scroll",function(t){a&&e(t.type,null,null,null,u.scrollLeft(),u.scrollTop(),"element",n(i).width(),n(i).height(),o(Date.now()),null,AVL.UTILITIES.FUNCTIONS.GetElementXPath(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t)),null)})}},p=function(){var h=n(i).height(),c=n("#slideout-content").length==0?n(t).height():n("#slideout-content")[0].scrollHeight,o=n("#slideout-content").length==0?n(i).scrollTop():n("#slideout-content").scrollTop(),e=c-h,l=Math.ceil(e-o),s=100,f;return e>0&&(s=parseInt((o/e*100).toFixed(0))),f={percent:s,unscrolled:l},(r.Scrollreach==null||r.Scrollreach<f.percent)&&(r.Scrollreach=f.percent),(r.Unscrolled==null||r.Unscrolled>f.unscrolled)&&(r.Unscrolled=Math.ceil(f.unscrolled)),u(r.Unscrolled+"/"+f.unscrolled+"px - "+r.Scrollreach+"/"+f.percent+"%"),f},at=function(){var v="-",g=screen.width||0,nt=screen.height||0,rt=g+" x "+nt,ut=navigator.appVersion||"",u=navigator.userAgent||"",o=navigator.appName||"",f=""+parseFloat(navigator.appVersion),y=parseInt(navigator.appVersion,10),tt,e,l,h,w,it,b,s,k,a;(e=u.indexOf("Opera"))!=-1?(o="Opera",f=u.substring(e+6),(e=u.indexOf("Version"))!=-1&&(f=u.substring(e+8))):(e=u.indexOf("MSIE"))!=-1?(o="Internet Explorer",f=u.substring(e+5)):(e=u.indexOf("Chrome"))!=-1?(o="Chrome",f=u.substring(e+7)):(e=u.indexOf("Safari"))!=-1?(o="Safari",f=u.substring(e+7),(e=u.indexOf("Version"))!=-1&&(f=u.substring(e+8))):(e=u.indexOf("Firefox"))!=-1?(o="Firefox",f=u.substring(e+8)):u.indexOf("Trident/")!=-1?(o="Internet Explorer",f=u.substring(u.indexOf("rv:")+3)):(tt=u.lastIndexOf(" ")+1)<(e=u.lastIndexOf("/"))&&(o=u.substring(tt,e),f=u.substring(e+1),o.toLowerCase()==o.toUpperCase()&&(o=navigator.appName||""));(l=f.indexOf(";"))!=-1&&(f=f.substring(0,l));(l=f.indexOf(" "))!=-1&&(f=f.substring(0,l));(l=f.indexOf(")"))!=-1&&(f=f.substring(0,l));y=parseInt(""+f,10);isNaN(y)&&(f=""+parseFloat(navigator.appVersion),y=parseInt(navigator.appVersion,10));typeof navigator.cookieEnabled!="undefined"||cookieEnabled||(t.cookie="testcookie",cookieEnabled=t.cookie.indexOf("testcookie")!=-1?!0:!1);h=v;w=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(it in w)if(b=w[it],b.r.test(u)){h=b.s;break}s=v;/Windows/.test(h)&&(s=/Windows (.*)/.exec(h)[1],h="Windows");switch(h){case"Mac OS X":s=/Mac OS X (10[\.\_\d]+)/.exec(u)[1];break;case"Android":s=/Android ([\.\_\d]+)/.exec(u)[1];break;case"iOS":s=/OS (\d+)_(\d+)_?(\d+)?/.exec(ut);s=s[1]+"."+s[2]+"."+(s[3]|0)}k="no check";typeof swfobject!="undefined"&&(a=swfobject.getFlashPlayerVersion(),k=a.major>0?a.major+"."+a.minor+" r"+a.release:v);typeof r.Tags=="undefined"&&(r.Tags="");r.Customerid=n("#avlCT").val()||"";r.Devicetype=AVL.UTILITIES.FUNCTIONS.GetDeviceType();r.Application=AVL.UTILITIES.FUNCTIONS.GetApplication();r.Date=c();r.Brand=AVL.UTILITIES.FUNCTIONS.GetAvlBrand();r.Lastmodified=t.lastModified||"";r.Loadtime=(new Date).getTime()-ERMV.ls;r.Url=t.URL||"";r.Page=AVL.UTILITIES.FUNCTIONS.GetFileNameNoParams(t.URL);r.Pagetitle=AVL.UTILITIES.FUNCTIONS.GetPageTitle();r.Error=AVL.UTILITIES.FUNCTIONS.IsErrorPage(t.URL);r.Duration=0;r.Language=navigator.language||"";r.Useragent=navigator.userAgent||"";r.Browsername=o||"";r.Browserversion=f||"";r.Osname=h||"";r.Osversion=s||"";r.Flashversion=k||"";r.Cookiesenabled=AVL.UTILITIES.FUNCTIONS.IsCookiesEnabled();r.Javaenabled=navigator.javaEnabled()||!1;r.Belowfold=n(t).height()-n(i).height();r.Documentheight=n(t).height();r.Scrollreach=p().percent;r.Unscrolled=p().unscrolled;r.Viewportheight=n(i).height();r.Viewportwidth=n(i).width();r.Screenres=rt;r.Screenwidth=g;r.Screenheight=nt;r.Colordepth=screen.colorDepth+" bit";r.Sourcecode=AVL.UTILITIES.FUNCTIONS.GetCookie(d()+"SourceCode","")||"";r.Utmcampaign=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_campaign");r.Utmsource=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_source");r.Utmmedium=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_medium");r.Utmcontent=AVL.UTILITIES.FUNCTIONS.GetQuerystringParamByName(t.URL,"utm_content");r.Referrer=t.referrer||"";r.Events=[];r.Browserfeatures=AVL.UTILITIES.FUNCTIONS.GetBrowserFeatures()},w=function(n){return!(n==undefined||n==null||n==""||!XDate(n).valid())},c=function(){return AVL.UTILITIES.FUNCTIONS.FormatDate(new Date)},b=function(){return AVL.UTILITIES.FUNCTIONS.FormatDate(new Date(1970,0,1,12))},o=function(n){return n-s},k=function(n){var t=n.attr("data-tagEvent"),i=null;return typeof t!="undefined"&&t!==!1&&(i=t),i},vt=function(n,t){if(r.Events.length>0){var i=n-r.Events[r.Events.length-1].Ts;i>t&&((r.Inactivity==null||r.Inactivity<0)&&(r.Inactivity=0),r.Inactivity+=i,r.Inactivity>v&&(r.Inactivity=v),u(n+" / "+r.Inactivity))}},yt=function(t){var i=n(AVL.UTILITIES.FUNCTIONS.GetEventTarget(t));return i.attr("data-recordingignore")!="true"&&i.closest("[data-recordingignore='true']").length==0},pt=function(){var n=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t=="x"?i:i&7|8).toString(16)})},d=function(){var n="";switch(AVL.UTILITIES.FUNCTIONS.GetAvlBrand()){case"0":n="DM";break;case"4":n="OAS";break;case"5":n="CDB";break;case"12":n="TC";break;case"14":n="BB";break;case"16":n="BS";break;case"17":n="AS"}return n},g=function(){return"/EventRecorderWebService/EventRecorder.asmx"};return{init:tt,push:ft,getRecording:h}}(jQuery,document,window);EventPlayer=function(n,t,i){var f=null,u=[],o=null,p=!1,g=!1,w=null,a=null,s=[],v=0,b=new Date,c=null,h=parent&&parent.EVENTPLAYBACK&&parent.EVENTPLAYBACK.playback,r={autoplay:!1,debug:!1,showprogress:!1,playbackSpeed:h?parent.PAGE.PlaybackSpeed:1},nt=function(n,t,i,o){typeof n=="string"?f=JSON.parse(n):n===Object(n)?f=n:e("invalid recording...");typeof t=="boolean"&&(r.autoplay=t);typeof i=="boolean"&&(r.showprogress=i);typeof o=="boolean"&&(r.debug=o);d();ct();u=_.clone(f.Events);pt();r.debug&&wt();r.showprogress&&parent.AVL.UTILITIES.MODULES.ProgressBar.init({duration:f.Duration,debug:!1});r.autoplay&&y()},y=function(){e("play recording...");l(!0,!1);n("#virtual-cursor").show();k()},tt=function(){clearTimeout(c);u=_.clone(f.Events);h&&u!=null&&u[1]!=null&&parent.PAGE.UTILITIES.ResizeIframe(null,u[1].Ww,u[1].Wh);y();r.showprogress&&parent.AVL.UTILITIES.MODULES.ProgressBar.replay()},it=function(){e("pause recording...");l(!1,!0);r.showprogress&&parent.AVL.UTILITIES.MODULES.ProgressBar.pause()},rt=function(){e("stop recording...");clearTimeout(c);l(!1,!1);u=_.clone(f.Events);r.showprogress&&parent.AVL.UTILITIES.MODULES.ProgressBar.pause()},ut=function(){e("stop recording...");clearTimeout(c);l(!1,!1)},ft=function(n){r.playbackSpeed=n},et=function(){var i=f.Events,r,u,n;if(i.length>0)for(r={element:t.getElementsByTagName("body")[0],radius:20,opacity:50},u=h337.create(r),n=0;n<i.length;n++)i[n].Et=="click"&&u.store.addDataPoint(i[n].Mx,i[n].My)},ot=function(){var i=f.Events,r,n;if(i.length>0)for(r={element:t.getElementsByTagName("body")[0],radius:10,opacity:50},w=h337.create(r),n=0;n<i.length;n++)i[n].Et=="mousemove"&&w.store.addDataPoint(i[n].Mx,i[n].My)},e=function(n){r.debug&&console.log(n)},st=function(){return f},l=function(n,t){p=n;g=t},k=function(){if(u.length>0){if(p){var t=u[0].Ts,n=t;o!=null&&(n-=o.Ts);n<v&&(n=v);h&&parent.PAGE.SkipInactivity&&n>1e3&&(n=1e3);c=setTimeout(function(){k()},n/r.playbackSpeed);r.showprogress&&h&&o&&parent.AVL.UTILITIES.MODULES.ProgressBar.play(o.Ts);ht(u[0]);o=u[0];u.shift()}}else ut()},ht=function(t){var f,r,o,l,c,u;switch(t.Et){case"dblclick":n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("dblclick");break;case"click":f=n("<div class='pulse_holder' style='top:"+t.My+"px; left:"+t.Mx+"px;'><div class='pulse_marker'><div class='pulse_rays'><\/div><\/div><\/div>");n("body").append(f);setTimeout(function(){f.fadeOut()},1e3);n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("click");break;case"mousedown":n("#virtual-cursor").addClass("mousedown");n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("mousedown");break;case"mouseup":n("#virtual-cursor").removeClass("mousedown");n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("mouseup");break;case"mousemove":r=!1;o=a!=null?a.Tr:"";yt(n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).closest("a"));at(o,t.Tr)?(l=n.unique(s),n.each(l,function(t,i){n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(i)).trigger("mouseleave");r&&e("MouseLeave ... "+t+" "+i)}),r&&e(n.unique(s).length+" element(s) triggered mouseenter/mouseleave..."),s=[],n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("mouseenter"),s.push(t.Tr),r&&e("\r\nMouseEnter (new) ... "+t.Tr)):t.Tr!=o&&(s.push(t.Tr),n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("mouseenter"),r&&e("MouseEnter (sibling) ... "+t.Tr));a=t;n("#virtual-cursor").css({left:t.Mx+"px",top:t.My+"px"});break;case"scroll":c=t.St=="window"?n(i):n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr));c.scrollLeft(t.Sx);c.scrollTop(t.Sy);n("#virtual-cursor").css({left:t.Mx,top:t.My});break;case"keydown":case"keyup":n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).val(t.Vl);u=jQuery.Event(t.Et);u.which=t.Kc;u.keyCode=t.Kc;n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger("focus").trigger(u);break;case"change":n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).val(t.Vl);break;case"touchstart":case"touchmove":case"touchend":case"touchcancel":n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t.Tr)).trigger(t.Et);break;case"resize":h&&parent.PAGE.UTILITIES.ResizeIframe(null,t.Ww,t.Wh)}},d=function(){var n=new Date;v=n-b;b=n;requestAnimationFrame(d)},ct=function(){var r=t.styleSheets,i,e,u,o,f;if(r&&r.length>0){for(e=/:hover/,u="",i=0;i<r.length;++i)o=r[i],f=AVL.UTILITIES.FUNCTIONS.GetStylesheetRules(o),f&&n.each(f,function(t,r){if(e.test(r.selectorText)){var o=r.selectorText.toLowerCase().replace(/:hover/g,""),s=r.style?r.style.cssText:r.cssText,f="tempHoverClass"+i+t;u+="."+f+"{"+lt(s)+"}";n(o).on({mouseenter:function(){n(this).addClass("tempHoverClass "+f)},mouseleave:function(){n(this).removeClass("tempHoverClass "+f)}})}});AVL.UTILITIES.FUNCTIONS.AddCSSToPage(u)}},lt=function(n){return n.replace(/!important/g,"").replace(/;/," !important;")},at=function(n,t){var i=!1;return n!=null&&(n==t||vt(n,t))||(i=!0),i},vt=function(t,i){return n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(t)).closest(".tempHoverClass").is(n(AVL.UTILITIES.FUNCTIONS.GetElementByXPath(i)).closest(".tempHoverClass"))},yt=function(t){t.length>0&&!n("#virtual-cursor").hasClass("showhand")?n("#virtual-cursor").addClass("showhand"):t.length==0&&n("#virtual-cursor").removeClass("showhand")},pt=function(){n("#virtual-cursor").length==0&&(n("body").append("<div id='virtual-cursor'><\/div>"),n("#virtual-cursor").append("<div id='cursor-highlight'><\/div>"),n("#virtual-cursor").append("<img id='cursor-pointer' src='/commoncontrols/eventrecorder/img/cursor.png''>"),n("#virtual-cursor").append("<img id='cursor-hand' src='/commoncontrols/eventrecorder/img/hand.png''>"))},wt=function(){n("#playback").length==0&&(n("body").append("<div id='playback'><\/div>"),n("#playback").append("<a href='#view' onclick='$(\"#heatmap-canvas\").remove(); console.log(EventPlayer.getRecording()); return false;'>view object<\/a>").append("<a href='#clickmap' id='clickmap' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.clickHeatmap(); return false;'>click map<\/a>").append("<a href='#movemap' id='movemap' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.movementHeatmap(); return false;'>move map<\/a>").append("<a href='#play' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.play(); return false;'>play<\/a>").append("<a href='#pause' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.pause(); return false;'>pause<\/a>").append("<a href='#stop' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.stop(); return false;'>stop<\/a>").append("<a href='#replay' onclick='$(\"#heatmap-canvas\").remove(); EventPlayer.replay(); return false;'>replay<\/a>"));n("#playback-progress").length==0&&n("body").append("<div id='playback-progress'><div class='bar'><\/div><div class='spinner'><div class='spinner-icon'><\/div><\/div><\/div>")};return{init:nt,play:y,replay:tt,pause:it,stop:rt,updateSpeed:ft,getRecording:st,clickHeatmap:et,movementHeatmap:ot}}(jQuery,document,window);$(document).ready(function(){typeof ERMV!="undefined"&&ERMV.on&&typeof overrideERMV=="undefined"&&EventRecorder.init(!0,!1,!1)})