(function(){var d={},k=Object.prototype.toString,i=Array.prototype,j=String.prototype;d={version:"1.0",build:"20100404",_lite:window.lite||null,browser:{},_b64ab:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_methods:{Function:{cyclic:function(a,b,c){return setInterval(this.delegate(b,c||[]),a)},defer:function(a,b,c){return setTimeout(this.delegate(b,c||[]),a)},callback:function(){var a=this,b=d.A(arguments);return function(){return a.apply(null,b.concat(d.A(arguments)))}}, delegate:function(a,b){var c=this;return function(){return c.apply(a,b.concat(d.A(arguments)))}},iterate:function(a,b,c){for(var e=0,f;e<a;f=this.apply(b,[e++].concat(c)));return f},chain:function(a){var b=[this].concat(d.A(arguments).epop(0));return function(){return b.map(function(c){return c.call(a)})}},_chainable:function(a){var b=this;return function(){var c=b.apply(this,arguments);return c==undefined||a?this:c}}},Array:{stringify:function(){return this.map(function(a){return String.fromCharCode(a* 1)}).join("")},compare:function(a){if(this.length-a.length)return false;for(var b=true,c=a.length;c--&&(b=this[c]===a[c]););return b},map:function(a,b){for(var c=0,e=this.length,f=[];c<e;c++)f[c]=a.call(b,this[c],c,this);return f},forEach:function(a,b){for(var c=0,e=this.length;c<e;c++)c in this&&a.call(b,this[c],c,this)},filter:function(a,b){for(var c=0,e=[],f=this.length,g;c<f;c++){g=this[c];if(a.call(b,g,c,this))e[c]=g}return e},indexOf:function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]== a)return b;return-1},lastIndexOf:function(a,b){for(b=b||this.length;b--;)if(this[b]==a)return b;return-1},indexAll:function(a){for(var b=0,c=[],e=this.length;b<e;b++)this[b]==a&&c.push(b);return c},randomValue:function(){return this[Math.intRandom(0,this.length-1)]},shuffle:function(){for(var a=this.length,b,c;a;c=this[--a],this[a]=this[b=Math.intRandom(0,a)],this[b]=c);return this},first:function(a){return a?this.slice(0,a):this[0]},last:function(){return this[this.length-1]},clone:function(){return this.slice()}, nuke:function(a){if(a)var b=this.clone();this.length=0;return a?b:this},clean:function(a){return this.filter(function(b){return a?!!b:b!==undefined&&b!==null})},exclude:function(){var a=d.A(arguments);return this.filter(function(b){return!a.contains(b)})},sortNum:function(){return this.sort(function(a,b){return a-b})},epop:function(a){a>=0?this.splice(a,1):this.length--;return this},isEmpty:function(a){return(a?this.clean(a):this).length===0},unique:function(a){return this.reduce(function(b,c,e){if(e=== 0||(a?b.last()!=c:!b.contains(c)))b.push(c);return b},[])},toObject:function(a){var b={};this.each(function(c,e){b[a?a[e]:e]=c});return b},max:function(){return Math.max.call(null,this)},min:function(){return Math.min.call(null,this)},sum:function(){return this.length?this.reduce(function(a,b){return a*1+b*1},0):0},average:function(){return this.sum()/this.length},reduce:function(a,b,c){this.each(function(e,f,g){b=a.call(c,b,e,f,g)});return b},reduceRight:function(a,b,c){this.clone().reverse().each(function(e, f,g){b=a.call(c,b,e,f,g)});return b},some:function(a,b){for(var c=0,e=this.length;c<e;c++)if(a.call(b,this[c],c,this))return true;return false},every:function(a,b){for(var c=0,e=this.length;c<e;c++)if(!a.call(b,this[c],c,this))return false;return true},contains:function(a){return this.indexOf(a)>=0},chunk:function(a,b,c){var e,f=0,g=-1,h=this.length;h=b?h-h%a:h;for(b=[];f<h;(e=f%a)?(b[g][e]=this[f++]):(b[++g]=[this[f++]]));return b.first(c||b.length)},flat:function(a){return this.reduce(function(b, c){return b.concat(a&&d.isArray(c)?c.flat(a):c)},[])}},Number:{max:function(a){return this<a?this:a},min:function(a){return this>a?this:a},clamp:function(a,b){return this.max(b).min(a)},abs:function(){return Math.abs(this)},sgn:function(){return Math.sgn(this)},fix:function(a){return this.toFixed(a)*1}},String:{escRe:function(){return this.replace(/([{}\(\)\^$&.\*\?\/\+\|\[\\\\]|\]|\-)/g,"\\$1")},rPad:function(a){return a.replace(new RegExp(".{"+this.length.max(a.length)+"}$"),this)},lPad:function(a){return a.replace(new RegExp("^.{"+ this.length.max(a.length)+"}"),this)},strReplace:function(a,b,c){if(d.isArray(a)){c=c?"g":"gi";if(d.isArray(b)){for(var e=0,f=escape(this),g=a.length;e<g;e++)f=f.replace(escape(a[e]),b[e]||b.last(),c);return unescape(f)}return this.replace(new RegExp(a.map(function(h){return escape(h)}).join("|"),c),b)}b=d.isArray(b)?b.first():b;return c?this.replace(new RegExp(escape(a),"i"),b):this.split(a).join(b)},endsWith:function(a,b){return!!this.match(a.escRe()+(b?"$/i":"$"))},beginsWith:function(a,b){return!!this.match("^"+ a.escRe()+(b?"/i":""))},reverse:function(){return this.split("").reverse().join("")},trim:function(){return this.replace(/(^\s+)|(\s+$)/g,"")},toIntArray:function(){return d.A(this).map(function(a){return a.charCodeAt(0)})},toArray:function(){return d.A(this)},stripTags:function(){return this.replace(/<\/?[^>]*>/gi,"")},htmlEntities:function(){return this.strReplace(["&","<",">",'"',"'"],["&amp;","&lt;","&gt;","&quot;","&#39;"])},left:function(a){return a<0?this.slice(-a):this.slice(0,a)},right:function(a){return a< 0?this.slice(0,a):this.slice(-a)},repeat:function(a){return(new Array((a||1)+1)).join(this)},camelize:function(){return this.replace(/[-_.]([a-z])/gi,function(a,b){return b.upper()})},uncamelize:function(a){return this.replace(/([A-Z])/g,(a||"-")+"$+").lower()},strWrap:function(a,b){var c=[];d.I(b,function(e,f){c.push(f+'="'+e+'"')});return"<{1}{3}>{2}</{1}>".template(a,this,b?" "+c.join(" "):"")},capitalize:function(){return this.lower().replace(/[^\s]|\D]/,function(a){return a.upper()})},isUpperCase:function(){return this== this.upper()},isLowerCase:function(){return this==this.lower()},invertCase:function(){return this.replace(/([^\d\s])/g,function(a){return a.isUpperCase()?a.lower():a.upper()})},isEmpty:function(){return!!!this.trim()},toggle:function(a,b){return!(a&&b)?this+"":this==a?b:a},template:function(){var a=arguments;return this.replace(/\{([1-9]|\d{2})\}/g,function(b,c){return a[c-1]})},dirname:function(a){return this.split(s=a||"/").epop().join(s)},basename:function(a){return this.split(a||"/").last()}, isValidEmail:function(){return/^[a-z0-9._-]+@[a-z0-9.-]{2,}[.][a-z]{2,4}$/i.test(this)},ellipsis:function(a,b){a=a||30;b=b||"\u2026";return this.length>a?this.left(a-b.length)+b:this+""},chunk:function(a,b,c){return d.A(this).chunk(a,b,c).map(function(e){return e.join("")})},bin2dec:function(){return this.toInt(2)},base64encode:function(){return typeof btoa==="function"?btoa(this):this.toIntArray().map(function(a){return a.toString(2).rPad("00000000")}).join("").toString().chunk(6).map(function(a){return d._b64ab[a.lPad("000000").bin2dec()]}).join("")+ ["","==","="][this.length%3]},base64decode:function(){if(typeof atob==="function")return atob(this);var a=d.A(this.strReplace("=","")).map(function(b){return d._b64ab.indexOf(b).toString(2).rPad("000000")}).join("").chunk(8);return(this.endsWith("=")?a.epop():a).map(function(b){return b.bin2dec()}).stringify()},toFloat:function(){return parseFloat(this)},toInt:function(a){return parseInt(this,a||10)},lower:j.toLowerCase,upper:j.toUpperCase},Date:{getLastMonthDayNbr:function(a,b){a=a||this.getMonth(); return![1,3,5,8,10].contains(a)?31:a!=1?30:(new Date).isLeap(b||this.getFullYear())?29:28},getMonthFirstDay:function(a,b){return d.chainable(this,true,["setFullYear","setMonth","setDate"]).setFullYear(b||this.getFullYear()).setMonth(a||this.getMonth()).setDate(1).getDay()},getWeekNumber:function(a,b,c){c=c||this.getFullYear();a=Date.UTC(c,b||this.getMonth(),a||this.getDate(),0,0,0);b=Date.UTC(c,0,1,0,0,0);c=d.chainable(new Date,true,["setFullYear","setMonth","setDate"]).setFullYear(c).setMonth(0).setDate(1).getDay(); return(((a-b)/864E5+(c>3?c-4:c+3))/7).fix()+1},isLeap:function(a){return(new Date(a||this.getFullYear(),1,29,0,0)).getMonth()!=2}}},I:function(a,b,c){for(var e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)},getConstructor:function(a){return(a=a.constructor)&&a.name?a.name:(/function (.*)\(/.exec(a+"")||[])[1]},getClass:function(a){return k.call(a).match(/^\[object\s(.*)\]$/)[1]},isNumeric:function(a){return!isNaN(a*1)},isArray:function(a){return/Array/.test(k.call(a))},A:function(a){return d.isArray(a)? a:d.getClass(a)=="String"?a.split(""):a.length?i.slice.call(a):["Number","Boolean"].contains(d.getClass(a))?[a]:function(){var b=[];d.I(a,function(c){b.push(c)});return b}()},chainable:function(a,b,c){var e=function(f,g){if(typeof f=="function")this[g]=this[g]._chainable(b)};c?c.each(e,a):d.I(a,e,a);return a},setCaretPos:function(a,b){a.focus();if(a.setSelectionRange)return a.setSelectionRange(b,b);if(a.createTextRange){a=a.createTextRange();a.collapse();a.move("character",b);return a.select()}return false}, colorToRGB:function(a){a=(a||"000").replace(/#/,"");return(a.length===3?a.replace(/([\dA-F])/gi,"$&$1"):a).match(/^([\dA-F]{2})([\dA-F]{2})([\dA-F]{2})$/i).map(function(b){return b.toInt(16)}).slice(1)},RGBtoColor:function(a){return"#"+a.map(function(b){return b.clamp(0,255).toString(16).lPad("00")}).join("")},applyIf:function(a,b,c){d.I(b,function(e,f){if(!a[f]||c)a[f]=e});return a},includeJS:function(a,b){var c=document.createElement("script"),e,f=false,g;if(!b)for(e=d.A(document.getElementsByTagName("script"));!f&& g<e.length;){c.src=a;f=e[g++].src==c.src}if(!f||b){c.type="text/javascript";c.src=a;(document.getElementsByTagName("head").item(0)||document.body).appendChild(c);return true}return false},serialize:function(a){var b=[];d.I(a,function(c,e){b.push(e+"="+encodeURIComponent(c))});return b.join("&")},unserialize:function(a){var b={};a.split("&").map(function(c){c=c.split("=");b[c[0]]=d.isNumeric(c[1])?decodeURIComponent(unescape(c[1])):c[1]*1});return b},onReady:function(a){if(document.addEventListener)return document.addEventListener("DOMContentLoaded", a,false);var b=d.browser.name,c=d.browser.version;c=b==="Opera"&&c>=9;if(b==="Safari"&&!c)return function(){/loaded|complete/.test(document.readyState)?a():arguments.callee.defer(1)}();if(d.browser.isIE||c){d._IEodr=function(){a();delete d._IEodr};document.write("<script defer src='//:' onreadystatechange='if(this.readyState==\"complete\") lite._IEodr();'><\/script>")}},emptyFn:function(){},getTS:function(){return(new Date).getTime()}};Math.PI2=Math.PI/2;Math.intRandom=function(a,b){return Math.round(Math.random()* (b-a)+a)};Math.sgn=function(a){return a<0?-1:a>0?1:0};d._methods.Array.each=i.forEach||d._methods.Array.forEach;d.applyIf(Function.prototype,d._methods.Function);d.applyIf(i,d._methods.Array);d.applyIf(Number.prototype,d._methods.Number);d.applyIf(Date.prototype,d._methods.Date);d.applyIf(j,d._methods.String);d.browser.name=function(){var a=navigator;return eval("!-[1,]")?"IE":a.product=="Gecko"&&a.vendor===""?"Firefox":/chrom/i.test(a.userAgent)?"Chrome":/a/.__proto__=="//"?"Safari":(window.opera+ "").match(/Opera/)?"Opera":"Unknown"}();d.browser.version=function(){var a=navigator.userAgent,b=d.browser.name;if(b=="IE"){a=a.split(" ");return a[a.indexOf("MSIE")+1].right(-1)}a=a.replace(/\((.*?)\)/g,"").trim().split(" ");return(["Chrome","Safari"].contains(b)?a.epop():a).last().split("/").last()}();d.browser.isIE=d.browser.name=="IE";window.lite=d})();
