UNPKG

can

Version:

MIT-licensed, client-side, JavaScript framework that makes building rich web applications easy.

3 lines 124 kB
/*! MooTools: the javascript framework. license: MIT-style license. copyright: Copyright (c) 2006-2015 [Valerio Proietti](http://mad4milk.net/).*/ !function(){function forEachObjectEnumberableKey(object,fn,bind){if(enumerables)for(var i=enumerables.length;i--;){var k=enumerables[i];hasOwnProperty.call(object,k)&&fn.call(bind,k,object[k])}}this.MooTools={version:"1.5.2",build:"ed01297a1a19de0675404640e7377cf97694e131"};var typeOf=this.typeOf=function(item){if(null==item)return"null";if(null!=item.$family)return item.$family();if(item.nodeName){if(1==item.nodeType)return"element";if(3==item.nodeType)return/\S/.test(item.nodeValue)?"textnode":"whitespace"}else if("number"==typeof item.length){if("callee"in item)return"arguments";if("item"in item)return"collection"}return typeof item},instanceOf=this.instanceOf=function(item,object){if(null==item)return!1;for(var constructor=item.$constructor||item.constructor;constructor;){if(constructor===object)return!0;constructor=constructor.parent}return item.hasOwnProperty?item instanceof object:!1},hasOwnProperty=Object.prototype.hasOwnProperty,enumerables=!0;for(var i in{toString:1})enumerables=null;enumerables&&(enumerables=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]);var Function=this.Function;Function.prototype.overloadSetter=function(usePlural){var self=this;return function(a,b){if(null==a)return this;if(usePlural||"string"!=typeof a){for(var k in a)self.call(this,k,a[k]);forEachObjectEnumberableKey(a,self,this)}else self.call(this,a,b);return this}},Function.prototype.overloadGetter=function(usePlural){var self=this;return function(a){var args,result;if("string"!=typeof a?args=a:arguments.length>1?args=arguments:usePlural&&(args=[a]),args){result={};for(var i=0;i<args.length;i++)result[args[i]]=self.call(this,args[i])}else result=self.call(this,a);return result}},Function.prototype.extend=function(key,value){this[key]=value}.overloadSetter(),Function.prototype.implement=function(key,value){this.prototype[key]=value}.overloadSetter();var slice=Array.prototype.slice;Function.from=function(item){return"function"==typeOf(item)?item:function(){return item}},Array.from=function(item){return null==item?[]:Type.isEnumerable(item)&&"string"!=typeof item?"array"==typeOf(item)?item:slice.call(item):[item]},Number.from=function(item){var number=parseFloat(item);return isFinite(number)?number:null},String.from=function(item){return item+""},Function.implement({hide:function(){return this.$hidden=!0,this},protect:function(){return this.$protected=!0,this}});var Type=this.Type=function(name,object){if(name){var lower=name.toLowerCase(),typeCheck=function(item){return typeOf(item)==lower};Type["is"+name]=typeCheck,null!=object&&(object.prototype.$family=function(){return lower}.hide(),object.type=typeCheck)}return null==object?null:(object.extend(this),object.$constructor=Type,object.prototype.$constructor=object,object)},toString=Object.prototype.toString;Type.isEnumerable=function(item){return null!=item&&"number"==typeof item.length&&"[object Function]"!=toString.call(item)};var hooks={},hooksOf=function(object){var type=typeOf(object.prototype);return hooks[type]||(hooks[type]=[])},implement=function(name,method){if(!method||!method.$hidden){for(var hooks=hooksOf(this),i=0;i<hooks.length;i++){var hook=hooks[i];"type"==typeOf(hook)?implement.call(hook,name,method):hook.call(this,name,method)}var previous=this.prototype[name];null!=previous&&previous.$protected||(this.prototype[name]=method),null==this[name]&&"function"==typeOf(method)&&extend.call(this,name,function(item){return method.apply(item,slice.call(arguments,1))})}},extend=function(name,method){if(!method||!method.$hidden){var previous=this[name];null!=previous&&previous.$protected||(this[name]=method)}};Type.implement({implement:implement.overloadSetter(),extend:extend.overloadSetter(),alias:function(name,existing){implement.call(this,name,this.prototype[existing])}.overloadSetter(),mirror:function(hook){return hooksOf(this).push(hook),this}}),new Type("Type",Type);var force=function(name,object,methods){var isType=object!=Object,prototype=object.prototype;isType&&(object=new Type(name,object));for(var i=0,l=methods.length;l>i;i++){var key=methods[i],generic=object[key],proto=prototype[key];generic&&generic.protect(),isType&&proto&&object.implement(key,proto.protect())}if(isType){var methodsEnumerable=prototype.propertyIsEnumerable(methods[0]);object.forEachMethod=function(fn){if(!methodsEnumerable)for(var i=0,l=methods.length;l>i;i++)fn.call(prototype,prototype[methods[i]],methods[i]);for(var key in prototype)fn.call(prototype,prototype[key],key)}}return force};force("String",String,["charAt","charCodeAt","concat","contains","indexOf","lastIndexOf","match","quote","replace","search","slice","split","substr","substring","trim","toLowerCase","toUpperCase"])("Array",Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","indexOf","lastIndexOf","filter","forEach","every","map","some","reduce","reduceRight","contains"])("Number",Number,["toExponential","toFixed","toLocaleString","toPrecision"])("Function",Function,["apply","call","bind"])("RegExp",RegExp,["exec","test"])("Object",Object,["create","defineProperty","defineProperties","keys","getPrototypeOf","getOwnPropertyDescriptor","getOwnPropertyNames","preventExtensions","isExtensible","seal","isSealed","freeze","isFrozen"])("Date",Date,["now"]),Object.extend=extend.overloadSetter(),Date.extend("now",function(){return+new Date}),new Type("Boolean",Boolean),Number.prototype.$family=function(){return isFinite(this)?"number":"null"}.hide(),Number.extend("random",function(min,max){return Math.floor(Math.random()*(max-min+1)+min)}),Array.implement({forEach:function(fn,bind){for(var i=0,l=this.length;l>i;i++)i in this&&fn.call(bind,this[i],i,this)},each:function(fn,bind){return Array.forEach(this,fn,bind),this}}),Object.extend({keys:function(object){var keys=[];for(var k in object)hasOwnProperty.call(object,k)&&keys.push(k);return forEachObjectEnumberableKey(object,function(k){keys.push(k)}),keys},forEach:function(object,fn,bind){Object.keys(object).forEach(function(key){fn.call(bind,object[key],key,object)})}}),Object.each=Object.forEach;var cloneOf=function(item){switch(typeOf(item)){case"array":return item.clone();case"object":return Object.clone(item);default:return item}};Array.implement("clone",function(){for(var i=this.length,clone=new Array(i);i--;)clone[i]=cloneOf(this[i]);return clone});var mergeOne=function(source,key,current){switch(typeOf(current)){case"object":"object"==typeOf(source[key])?Object.merge(source[key],current):source[key]=Object.clone(current);break;case"array":source[key]=current.clone();break;default:source[key]=current}return source};Object.extend({merge:function(source,k,v){if("string"==typeOf(k))return mergeOne(source,k,v);for(var i=1,l=arguments.length;l>i;i++){var object=arguments[i];for(var key in object)mergeOne(source,key,object[key])}return source},clone:function(object){var clone={};for(var key in object)clone[key]=cloneOf(object[key]);return clone},append:function(original){for(var i=1,l=arguments.length;l>i;i++){var extended=arguments[i]||{};for(var key in extended)original[key]=extended[key]}return original}}),["Object","WhiteSpace","TextNode","Collection","Arguments"].each(function(name){new Type(name)});var UID=Date.now();String.extend("uniqueID",function(){return(UID++).toString(36)});var Hash=this.Hash=new Type("Hash",function(object){"hash"==typeOf(object)&&(object=Object.clone(object.getClean()));for(var key in object)this[key]=object[key];return this});Hash.implement({forEach:function(fn,bind){Object.forEach(this,fn,bind)},getClean:function(){var clean={};for(var key in this)this.hasOwnProperty(key)&&(clean[key]=this[key]);return clean},getLength:function(){var length=0;for(var key in this)this.hasOwnProperty(key)&&length++;return length}}),Hash.alias("each","forEach"),Object.type=Type.isObject;var Native=this.Native=function(properties){return new Type(properties.name,properties.initialize)};Native.type=Type.type,Native.implement=function(objects,methods){for(var i=0;i<objects.length;i++)objects[i].implement(methods);return Native};var arrayType=Array.type;Array.type=function(item){return instanceOf(item,Array)||arrayType(item)},this.$A=function(item){return Array.from(item).slice()},this.$arguments=function(i){return function(){return arguments[i]}},this.$chk=function(obj){return!(!obj&&0!==obj)},this.$clear=function(timer){return clearTimeout(timer),clearInterval(timer),null},this.$defined=function(obj){return null!=obj},this.$each=function(iterable,fn,bind){var type=typeOf(iterable);("arguments"==type||"collection"==type||"array"==type||"elements"==type?Array:Object).each(iterable,fn,bind)},this.$empty=function(){},this.$extend=function(original,extended){return Object.append(original,extended)},this.$H=function(object){return new Hash(object)},this.$merge=function(){var args=Array.slice(arguments);return args.unshift({}),Object.merge.apply(null,args)},this.$lambda=Function.from,this.$mixin=Object.merge,this.$random=Number.random,this.$splat=Array.from,this.$time=Date.now,this.$type=function(object){var type=typeOf(object);return"elements"==type?"array":"null"==type?!1:type},this.$unlink=function(object){switch(typeOf(object)){case"object":return Object.clone(object);case"array":return Array.clone(object);case"hash":return new Hash(object);default:return object}}}(),Array.implement({every:function(fn,bind){for(var i=0,l=this.length>>>0;l>i;i++)if(i in this&&!fn.call(bind,this[i],i,this))return!1;return!0},filter:function(fn,bind){for(var value,results=[],i=0,l=this.length>>>0;l>i;i++)i in this&&(value=this[i],fn.call(bind,value,i,this)&&results.push(value));return results},indexOf:function(item,from){for(var length=this.length>>>0,i=0>from?Math.max(0,length+from):from||0;length>i;i++)if(this[i]===item)return i;return-1},map:function(fn,bind){for(var length=this.length>>>0,results=Array(length),i=0;length>i;i++)i in this&&(results[i]=fn.call(bind,this[i],i,this));return results},some:function(fn,bind){for(var i=0,l=this.length>>>0;l>i;i++)if(i in this&&fn.call(bind,this[i],i,this))return!0;return!1},clean:function(){return this.filter(function(item){return null!=item})},invoke:function(methodName){var args=Array.slice(arguments,1);return this.map(function(item){return item[methodName].apply(item,args)})},associate:function(keys){for(var obj={},length=Math.min(this.length,keys.length),i=0;length>i;i++)obj[keys[i]]=this[i];return obj},link:function(object){for(var result={},i=0,l=this.length;l>i;i++)for(var key in object)if(object[key](this[i])){result[key]=this[i],delete object[key];break}return result},contains:function(item,from){return-1!=this.indexOf(item,from)},append:function(array){return this.push.apply(this,array),this},getLast:function(){return this.length?this[this.length-1]:null},getRandom:function(){return this.length?this[Number.random(0,this.length-1)]:null},include:function(item){return this.contains(item)||this.push(item),this},combine:function(array){for(var i=0,l=array.length;l>i;i++)this.include(array[i]);return this},erase:function(item){for(var i=this.length;i--;)this[i]===item&&this.splice(i,1);return this},empty:function(){return this.length=0,this},flatten:function(){for(var array=[],i=0,l=this.length;l>i;i++){var type=typeOf(this[i]);"null"!=type&&(array=array.concat("array"==type||"collection"==type||"arguments"==type||instanceOf(this[i],Array)?Array.flatten(this[i]):this[i]))}return array},pick:function(){for(var i=0,l=this.length;l>i;i++)if(null!=this[i])return this[i];return null},hexToRgb:function(array){if(3!=this.length)return null;var rgb=this.map(function(value){return 1==value.length&&(value+=value),parseInt(value,16)});return array?rgb:"rgb("+rgb+")"},rgbToHex:function(array){if(this.length<3)return null;if(4==this.length&&0==this[3]&&!array)return"transparent";for(var hex=[],i=0;3>i;i++){var bit=(this[i]-0).toString(16);hex.push(1==bit.length?"0"+bit:bit)}return array?hex:"#"+hex.join("")}}),Array.alias("extend","append");var $pick=function(){return Array.from(arguments).pick()};Function.extend({attempt:function(){for(var i=0,l=arguments.length;l>i;i++)try{return arguments[i]()}catch(e){}return null}}),Function.implement({attempt:function(args,bind){try{return this.apply(bind,Array.from(args))}catch(e){}return null},bind:function(that){var self=this,args=arguments.length>1?Array.slice(arguments,1):null,F=function(){},bound=function(){var context=that,length=arguments.length;this instanceof bound&&(F.prototype=self.prototype,context=new F);var result=args||length?self.apply(context,args&&length?args.concat(Array.slice(arguments)):args||arguments):self.call(context);return context==that?result:context};return bound},pass:function(args,bind){var self=this;return null!=args&&(args=Array.from(args)),function(){return self.apply(bind,args||arguments)}},delay:function(delay,bind,args){return setTimeout(this.pass(null==args?[]:args,bind),delay)},periodical:function(periodical,bind,args){return setInterval(this.pass(null==args?[]:args,bind),periodical)}}),delete Function.prototype.bind,Function.implement({create:function(options){var self=this;return options=options||{},function(event){var args=options.arguments;args=null!=args?Array.from(args):Array.slice(arguments,options.event?1:0),options.event&&(args=[event||window.event].extend(args));var returns=function(){return self.apply(options.bind||null,args)};return options.delay?setTimeout(returns,options.delay):options.periodical?setInterval(returns,options.periodical):options.attempt?Function.attempt(returns):returns()}},bind:function(bind,args){var self=this;return null!=args&&(args=Array.from(args)),function(){return self.apply(bind,args||arguments)}},bindWithEvent:function(bind,args){var self=this;return null!=args&&(args=Array.from(args)),function(event){return self.apply(bind,null==args?arguments:[event].concat(args))}},run:function(args,bind){return this.apply(bind,Array.from(args))}}),Object.create==Function.prototype.create&&(Object.create=null);var $try=Function.attempt;Number.implement({limit:function(min,max){return Math.min(max,Math.max(min,this))},round:function(precision){return precision=Math.pow(10,precision||0).toFixed(0>precision?-precision:0),Math.round(this*precision)/precision},times:function(fn,bind){for(var i=0;this>i;i++)fn.call(bind,i,this)},toFloat:function(){return parseFloat(this)},toInt:function(base){return parseInt(this,base||10)}}),Number.alias("each","times"),function(math){var methods={};math.each(function(name){Number[name]||(methods[name]=function(){return Math[name].apply(null,[this].concat(Array.from(arguments)))})}),Number.implement(methods)}(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]),String.implement({contains:function(string,index){return(index?String(this).slice(index):String(this)).indexOf(string)>-1},test:function(regex,params){return("regexp"==typeOf(regex)?regex:new RegExp(""+regex,params)).test(this)},trim:function(){return String(this).replace(/^\s+|\s+$/g,"")},clean:function(){return String(this).replace(/\s+/g," ").trim()},camelCase:function(){return String(this).replace(/-\D/g,function(match){return match.charAt(1).toUpperCase()})},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(match){return"-"+match.charAt(0).toLowerCase()})},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(match){return match.toUpperCase()})},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(base){return parseInt(this,base||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(array){var hex=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return hex?hex.slice(1).hexToRgb(array):null},rgbToHex:function(array){var rgb=String(this).match(/\d{1,3}/g);return rgb?rgb.rgbToHex(array):null},substitute:function(object,regexp){return String(this).replace(regexp||/\\?\{([^{}]+)\}/g,function(match,name){return"\\"==match.charAt(0)?match.slice(1):null!=object[name]?object[name]:""})}}),String.prototype.contains=function(string,separator){return separator?(separator+this+separator).indexOf(separator+string+separator)>-1:String(this).indexOf(string)>-1},function(){var document=this.document,window=document.window=this,parse=function(ua,platform){ua=ua.toLowerCase(),platform=platform?platform.toLowerCase():"";var UA=ua.match(/(edge)[\s\/:]([\w\d\.]+)/);return UA||(UA=ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\s\/:]([\w\d\.]+)?.*?(safari|(?:rv[\s\/:]|version[\s\/:])([\w\d\.]+)|$)/)||[null,"unknown",0]),"trident"==UA[1]?(UA[1]="ie",UA[4]&&(UA[2]=UA[4])):"crios"==UA[1]&&(UA[1]="chrome"),platform=ua.match(/ip(?:ad|od|hone)/)?"ios":(ua.match(/(?:webos|android)/)||ua.match(/mac|win|linux/)||["other"])[0],"win"==platform&&(platform="windows"),{extend:Function.prototype.extend,name:"version"==UA[1]?UA[3]:UA[1],version:parseFloat("opera"==UA[1]&&UA[4]?UA[4]:UA[2]),platform:platform}},Browser=this.Browser=parse(navigator.userAgent,navigator.platform);"ie"==Browser.name&&document.documentMode&&(Browser.version=document.documentMode),Browser.extend({Features:{xpath:!!document.evaluate,air:!!window.runtime,query:!!document.querySelector,json:!!window.JSON},parseUA:parse}),Browser[Browser.name]=!0,Browser[Browser.name+parseInt(Browser.version,10)]=!0,"ie"==Browser.name&&Browser.version>="11"&&delete Browser.ie;var platform=Browser.platform;"windows"==platform&&(platform="win"),Browser.Platform={name:platform},Browser.Platform[platform]=!0,Browser.Request=function(){var XMLHTTP=function(){return new XMLHttpRequest},MSXML2=function(){return new ActiveXObject("MSXML2.XMLHTTP")},MSXML=function(){return new ActiveXObject("Microsoft.XMLHTTP")};return Function.attempt(function(){return XMLHTTP(),XMLHTTP},function(){return MSXML2(),MSXML2},function(){return MSXML(),MSXML})}(),Browser.Features.xhr=!!Browser.Request;var version=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);if(Browser.Plugins={Flash:{version:Number(version[0]||"0."+version[1])||0,build:Number(version[2])||0}},Browser.exec=function(text){if(!text)return text;if(window.execScript)window.execScript(text);else{var script=document.createElement("script");script.setAttribute("type","text/javascript"),script.text=text,document.head.appendChild(script),document.head.removeChild(script)}return text},String.implement("stripScripts",function(exec){var scripts="",text=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(all,code){return scripts+=code+"\n",""});return exec===!0?Browser.exec(scripts):"function"==typeOf(exec)&&exec(scripts,text),text}),Browser.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}),this.Window=this.$constructor=new Type("Window",function(){}),this.$family=Function.from("window").hide(),Window.mirror(function(name,method){window[name]=method}),this.Document=document.$constructor=new Type("Document",function(){}),document.$family=Function.from("document").hide(),Document.mirror(function(name,method){document[name]=method}),document.html=document.documentElement,document.head||(document.head=document.getElementsByTagName("head")[0]),document.execCommand)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}if(this.attachEvent&&!this.addEventListener){var unloadEvent=function(){this.detachEvent("onunload",unloadEvent),document.head=document.html=document.window=null,window=this.Window=document=null};this.attachEvent("onunload",unloadEvent)}var arrayFrom=Array.from;try{arrayFrom(document.html.childNodes)}catch(e){Array.from=function(item){if("string"!=typeof item&&Type.isEnumerable(item)&&"array"!=typeOf(item)){for(var i=item.length,array=new Array(i);i--;)array[i]=item[i];return array}return arrayFrom(item)};var prototype=Array.prototype,slice=prototype.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(name){var method=prototype[name];Array[name]=function(item){return method.apply(Array.from(item),slice.call(arguments,1))}})}Browser.Platform.ios&&(Browser.Platform.ipod=!0),Browser.Engine={};var setEngine=function(name,version){Browser.Engine.name=name,Browser.Engine[name+version]=!0,Browser.Engine.version=version};if(Browser.ie)switch(Browser.Engine.trident=!0,Browser.version){case 6:setEngine("trident",4);break;case 7:setEngine("trident",5);break;case 8:setEngine("trident",6)}if(Browser.firefox&&(Browser.Engine.gecko=!0,Browser.version>=3?setEngine("gecko",19):setEngine("gecko",18)),Browser.safari||Browser.chrome)switch(Browser.Engine.webkit=!0,Browser.version){case 2:setEngine("webkit",419);break;case 3:setEngine("webkit",420);break;case 4:setEngine("webkit",525)}if(Browser.opera&&(Browser.Engine.presto=!0,Browser.version>=9.6?setEngine("presto",960):Browser.version>=9.5?setEngine("presto",950):setEngine("presto",925)),"unknown"==Browser.name)switch((navigator.userAgent.toLowerCase().match(/(?:webkit|khtml|gecko)/)||[])[0]){case"webkit":case"khtml":Browser.Engine.webkit=!0;break;case"gecko":Browser.Engine.gecko=!0}this.$exec=Browser.exec}(),function(){var Class=this.Class=new Type("Class",function(params){instanceOf(params,Function)&&(params={initialize:params});var newClass=function(){if(reset(this),newClass.$prototyping)return this;this.$caller=null,this.$family=null;var value=this.initialize?this.initialize.apply(this,arguments):this;return this.$caller=this.caller=null,value}.extend(this).implement(params);return newClass.$constructor=Class,newClass.prototype.$constructor=newClass,newClass.prototype.parent=parent,newClass}),parent=function(){if(!this.$caller)throw new Error('The method "parent" cannot be called.');var name=this.$caller.$name,parent=this.$caller.$owner.parent,previous=parent?parent.prototype[name]:null;if(!previous)throw new Error('The method "'+name+'" has no parent.');return previous.apply(this,arguments)},reset=function(object){for(var key in object){var value=object[key];switch(typeOf(value)){case"object":var F=function(){};F.prototype=value,object[key]=reset(new F);break;case"array":object[key]=value.clone()}}return object},wrap=function(self,key,method){method.$origin&&(method=method.$origin);var wrapper=function(){if(method.$protected&&null==this.$caller)throw new Error('The method "'+key+'" cannot be called.');var caller=this.caller,current=this.$caller;this.caller=current,this.$caller=wrapper;var result=method.apply(this,arguments);return this.$caller=current,this.caller=caller,result}.extend({$owner:self,$origin:method,$name:key});return wrapper},implement=function(key,value,retain){if(Class.Mutators.hasOwnProperty(key)&&(value=Class.Mutators[key].call(this,value),null==value))return this;if("function"==typeOf(value)){if(value.$hidden)return this;this.prototype[key]=retain?value:wrap(this,key,value)}else Object.merge(this.prototype,key,value);return this},getInstance=function(klass){klass.$prototyping=!0;var proto=new klass;return delete klass.$prototyping,proto};Class.implement("implement",implement.overloadSetter()),Class.Mutators={Extends:function(parent){this.parent=parent,this.prototype=getInstance(parent)},Implements:function(items){Array.from(items).each(function(item){var instance=new item;for(var key in instance)implement.call(this,key,instance[key],!0)},this)}}}(),function(){this.Chain=new Class({$chain:[],chain:function(){return this.$chain.append(Array.flatten(arguments)),this},callChain:function(){return this.$chain.length?this.$chain.shift().apply(this,arguments):!1},clearChain:function(){return this.$chain.empty(),this}});var removeOn=function(string){return string.replace(/^on([A-Z])/,function(full,first){return first.toLowerCase()})};this.Events=new Class({$events:{},addEvent:function(type,fn,internal){return type=removeOn(type),fn==$empty?this:(this.$events[type]=(this.$events[type]||[]).include(fn),internal&&(fn.internal=!0),this)},addEvents:function(events){for(var type in events)this.addEvent(type,events[type]);return this},fireEvent:function(type,args,delay){type=removeOn(type);var events=this.$events[type];return events?(args=Array.from(args),events.each(function(fn){delay?fn.delay(delay,this,args):fn.apply(this,args)},this),this):this},removeEvent:function(type,fn){type=removeOn(type);var events=this.$events[type];if(events&&!fn.internal){var index=events.indexOf(fn);-1!=index&&delete events[index]}return this},removeEvents:function(events){var type;if("object"==typeOf(events)){for(type in events)this.removeEvent(type,events[type]);return this}events&&(events=removeOn(events));for(type in this.$events)if(!events||events==type)for(var fns=this.$events[type],i=fns.length;i--;)i in fns&&this.removeEvent(type,fns[i]);return this}}),this.Options=new Class({setOptions:function(){var options=this.options=Object.merge.apply(null,[{},this.options].append(arguments));if(this.addEvent)for(var option in options)"function"==typeOf(options[option])&&/^on[A-Z]/.test(option)&&(this.addEvent(option,options[option]),delete options[option]);return this}})}(),function(){Object.prototype.hasOwnProperty;Object.extend({subset:function(object,keys){for(var results={},i=0,l=keys.length;l>i;i++){var k=keys[i];k in object&&(results[k]=object[k])}return results},map:function(object,fn,bind){for(var results={},keys=Object.keys(object),i=0;i<keys.length;i++){var key=keys[i];results[key]=fn.call(bind,object[key],key,object)}return results},filter:function(object,fn,bind){for(var results={},keys=Object.keys(object),i=0;i<keys.length;i++){var key=keys[i],value=object[key];fn.call(bind,value,key,object)&&(results[key]=value)}return results},every:function(object,fn,bind){for(var keys=Object.keys(object),i=0;i<keys.length;i++){var key=keys[i];if(!fn.call(bind,object[key],key))return!1}return!0},some:function(object,fn,bind){for(var keys=Object.keys(object),i=0;i<keys.length;i++){var key=keys[i];if(fn.call(bind,object[key],key))return!0}return!1},values:function(object){for(var values=[],keys=Object.keys(object),i=0;i<keys.length;i++){var k=keys[i];values.push(object[k])}return values},getLength:function(object){return Object.keys(object).length},keyOf:function(object,value){for(var keys=Object.keys(object),i=0;i<keys.length;i++){var key=keys[i];if(object[key]===value)return key}return null},contains:function(object,value){return null!=Object.keyOf(object,value)},toQueryString:function(object,base){var queryString=[];return Object.each(object,function(value,key){base&&(key=base+"["+key+"]");var result;switch(typeOf(value)){case"object":result=Object.toQueryString(value,key);break;case"array":var qs={};value.each(function(val,i){qs[i]=val}),result=Object.toQueryString(qs,key);break;default:result=key+"="+encodeURIComponent(value)}null!=value&&queryString.push(result)}),queryString.join("&")}})}(),Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(value){return Object.keyOf(this,value)},hasValue:function(value){return Object.contains(this,value)},extend:function(properties){return Hash.each(properties||{},function(value,key){Hash.set(this,key,value)},this),this},combine:function(properties){return Hash.each(properties||{},function(value,key){Hash.include(this,key,value)},this),this},erase:function(key){return this.hasOwnProperty(key)&&delete this[key],this},get:function(key){return this.hasOwnProperty(key)?this[key]:null},set:function(key,value){return(!this[key]||this.hasOwnProperty(key))&&(this[key]=value),this},empty:function(){return Hash.each(this,function(value,key){delete this[key]},this),this},include:function(key,value){return null==this[key]&&(this[key]=value),this},map:function(fn,bind){return new Hash(Object.map(this,fn,bind))},filter:function(fn,bind){return new Hash(Object.filter(this,fn,bind))},every:function(fn,bind){return Object.every(this,fn,bind)},some:function(fn,bind){return Object.some(this,fn,bind)},getKeys:function(){return Object.keys(this)},getValues:function(){return Object.values(this)},toQueryString:function(base){return Object.toQueryString(this,base)}}),Hash.extend=Object.append,Hash.alias({indexOf:"keyOf",contains:"hasValue"}),function(){function parser(rawMatch,separator,combinator,combinatorChildren,tagName,id,className,attributeKey,attributeOperator,attributeQuote,attributeValue,pseudoMarker,pseudoClass,pseudoQuote,pseudoClassQuotedValue,pseudoClassValue){if((separator||-1===separatorIndex)&&(parsed.expressions[++separatorIndex]=[],combinatorIndex=-1,separator))return"";if(combinator||combinatorChildren||-1===combinatorIndex){combinator=combinator||" ";var currentSeparator=parsed.expressions[separatorIndex];reversed&&currentSeparator[combinatorIndex]&&(currentSeparator[combinatorIndex].reverseCombinator=reverseCombinator(combinator)),currentSeparator[++combinatorIndex]={combinator:combinator,tag:"*"}}var currentParsed=parsed.expressions[separatorIndex][combinatorIndex];if(tagName)currentParsed.tag=tagName.replace(reUnescape,"");else if(id)currentParsed.id=id.replace(reUnescape,"");else if(className)className=className.replace(reUnescape,""),currentParsed.classList||(currentParsed.classList=[]),currentParsed.classes||(currentParsed.classes=[]),currentParsed.classList.push(className),currentParsed.classes.push({value:className,regexp:new RegExp("(^|\\s)"+escapeRegExp(className)+"(\\s|$)")});else if(pseudoClass)pseudoClassValue=pseudoClassValue||pseudoClassQuotedValue,pseudoClassValue=pseudoClassValue?pseudoClassValue.replace(reUnescape,""):null,currentParsed.pseudos||(currentParsed.pseudos=[]),currentParsed.pseudos.push({key:pseudoClass.replace(reUnescape,""),value:pseudoClassValue,type:1==pseudoMarker.length?"class":"element"});else if(attributeKey){attributeKey=attributeKey.replace(reUnescape,""),attributeValue=(attributeValue||"").replace(reUnescape,"");var test,regexp;switch(attributeOperator){case"^=":regexp=new RegExp("^"+escapeRegExp(attributeValue));break;case"$=":regexp=new RegExp(escapeRegExp(attributeValue)+"$");break;case"~=":regexp=new RegExp("(^|\\s)"+escapeRegExp(attributeValue)+"(\\s|$)");break;case"|=":regexp=new RegExp("^"+escapeRegExp(attributeValue)+"(-|$)");break;case"=":test=function(value){return attributeValue==value};break;case"*=":test=function(value){return value&&value.indexOf(attributeValue)>-1};break;case"!=":test=function(value){return attributeValue!=value};break;default:test=function(value){return!!value}}""==attributeValue&&/^[*$^]=$/.test(attributeOperator)&&(test=function(){return!1}),test||(test=function(value){return value&&regexp.test(value)}),currentParsed.attributes||(currentParsed.attributes=[]),currentParsed.attributes.push({key:attributeKey,operator:attributeOperator,value:attributeValue,test:test})}return""}var parsed,separatorIndex,combinatorIndex,reversed,cache={},reverseCache={},reUnescape=/\\/g,parse=function(expression,isReversed){if(null==expression)return null;if(expression.Slick===!0)return expression;expression=(""+expression).replace(/^\s+|\s+$/g,""),reversed=!!isReversed;var currentCache=reversed?reverseCache:cache;if(currentCache[expression])return currentCache[expression];for(parsed={Slick:!0,expressions:[],raw:expression,reverse:function(){return parse(this.raw,!0)}},separatorIndex=-1;expression!=(expression=expression.replace(regexp,parser)););return parsed.length=parsed.expressions.length,currentCache[parsed.raw]=reversed?reverse(parsed):parsed},reverseCombinator=function(combinator){return"!"===combinator?" ":" "===combinator?"!":/^!/.test(combinator)?combinator.replace(/^!/,""):"!"+combinator},reverse=function(expression){for(var expressions=expression.expressions,i=0;i<expressions.length;i++){for(var exp=expressions[i],last={parts:[],tag:"*",combinator:reverseCombinator(exp[0].combinator)},j=0;j<exp.length;j++){var cexp=exp[j];cexp.reverseCombinator||(cexp.reverseCombinator=" "),cexp.combinator=cexp.reverseCombinator,delete cexp.reverseCombinator; }exp.reverse().push(last)}return expression},escapeRegExp=function(string){return string.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(match){return"\\"+match})},regexp=new RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+escapeRegExp(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),Slick=this.Slick||{};Slick.parse=function(expression){return parse(expression)},Slick.escapeRegExp=escapeRegExp,this.Slick||(this.Slick=Slick)}.apply("undefined"!=typeof exports?exports:this),function(){var local={},featuresCache={},toString=Object.prototype.toString;local.isNativeCode=function(fn){return/\{\s*\[native code\]\s*\}/.test(""+fn)},local.isXML=function(document){return!!document.xmlVersion||!!document.xml||"[object XMLDocument]"==toString.call(document)||9==document.nodeType&&"HTML"!=document.documentElement.nodeName},local.setDocument=function(document){var nodeType=document.nodeType;if(9==nodeType);else if(nodeType)document=document.ownerDocument;else{if(!document.navigator)return;document=document.document}if(this.document!==document){this.document=document;var feature,root=document.documentElement,rootUid=this.getUIDXML(root),features=featuresCache[rootUid];if(features)for(feature in features)this[feature]=features[feature];else{features=featuresCache[rootUid]={},features.root=root,features.isXMLDocument=this.isXML(document),features.brokenStarGEBTN=features.starSelectsClosedQSA=features.idGetsName=features.brokenMixedCaseQSA=features.brokenGEBCN=features.brokenCheckedQSA=features.brokenEmptyAttributeQSA=features.isHTMLDocument=features.nativeMatchesSelector=!1;var starSelectsClosed,starSelectsComments,brokenSecondClassNameGEBCN,cachedGetElementsByClassName,brokenFormAttributeGetter,selected,id="slick_uniqueid",testNode=document.createElement("div"),testRoot=document.body||document.getElementsByTagName("body")[0]||root;testRoot.appendChild(testNode);try{testNode.innerHTML='<a id="'+id+'"></a>',features.isHTMLDocument=!!document.getElementById(id)}catch(e){}if(features.isHTMLDocument){testNode.style.display="none",testNode.appendChild(document.createComment("")),starSelectsComments=testNode.getElementsByTagName("*").length>1;try{testNode.innerHTML="foo</foo>",selected=testNode.getElementsByTagName("*"),starSelectsClosed=selected&&!!selected.length&&"/"==selected[0].nodeName.charAt(0)}catch(e){}features.brokenStarGEBTN=starSelectsComments||starSelectsClosed;try{testNode.innerHTML='<a name="'+id+'"></a><b id="'+id+'"></b>',features.idGetsName=document.getElementById(id)===testNode.firstChild}catch(e){}if(testNode.getElementsByClassName){try{testNode.innerHTML='<a class="f"></a><a class="b"></a>',testNode.getElementsByClassName("b").length,testNode.firstChild.className="b",cachedGetElementsByClassName=2!=testNode.getElementsByClassName("b").length}catch(e){}try{testNode.innerHTML='<a class="a"></a><a class="f b a"></a>',brokenSecondClassNameGEBCN=2!=testNode.getElementsByClassName("a").length}catch(e){}features.brokenGEBCN=cachedGetElementsByClassName||brokenSecondClassNameGEBCN}if(testNode.querySelectorAll){try{testNode.innerHTML="foo</foo>",selected=testNode.querySelectorAll("*"),features.starSelectsClosedQSA=selected&&!!selected.length&&"/"==selected[0].nodeName.charAt(0)}catch(e){}try{testNode.innerHTML='<a class="MiX"></a>',features.brokenMixedCaseQSA=!testNode.querySelectorAll(".MiX").length}catch(e){}try{testNode.innerHTML='<select><option selected="selected">a</option></select>',features.brokenCheckedQSA=0==testNode.querySelectorAll(":checked").length}catch(e){}try{testNode.innerHTML='<a class=""></a>',features.brokenEmptyAttributeQSA=0!=testNode.querySelectorAll('[class*=""]').length}catch(e){}}try{testNode.innerHTML='<form action="s"><input id="action"/></form>',brokenFormAttributeGetter="s"!=testNode.firstChild.getAttribute("action")}catch(e){}if(features.nativeMatchesSelector=root.matches||root.mozMatchesSelector||root.webkitMatchesSelector,features.nativeMatchesSelector)try{features.nativeMatchesSelector.call(root,":slick"),features.nativeMatchesSelector=null}catch(e){}}try{root.slick_expando=1,delete root.slick_expando,features.getUID=this.getUIDHTML}catch(e){features.getUID=this.getUIDXML}testRoot.removeChild(testNode),testNode=selected=testRoot=null,features.getAttribute=features.isHTMLDocument&&brokenFormAttributeGetter?function(node,name){var method=this.attributeGetters[name];if(method)return method.call(node);var attributeNode=node.getAttributeNode(name);return attributeNode?attributeNode.nodeValue:null}:function(node,name){var method=this.attributeGetters[name];return method?method.call(node):node.getAttribute(name)},features.hasAttribute=root&&this.isNativeCode(root.hasAttribute)?function(node,attribute){return node.hasAttribute(attribute)}:function(node,attribute){return node=node.getAttributeNode(attribute),!(!node||!node.specified&&!node.nodeValue)};var nativeRootContains=root&&this.isNativeCode(root.contains),nativeDocumentContains=document&&this.isNativeCode(document.contains);features.contains=nativeRootContains&&nativeDocumentContains?function(context,node){return context.contains(node)}:nativeRootContains&&!nativeDocumentContains?function(context,node){return context===node||(context===document?document.documentElement:context).contains(node)}:root&&root.compareDocumentPosition?function(context,node){return context===node||!!(16&context.compareDocumentPosition(node))}:function(context,node){if(node)do if(node===context)return!0;while(node=node.parentNode);return!1},features.documentSorter=root.compareDocumentPosition?function(a,b){return a.compareDocumentPosition&&b.compareDocumentPosition?4&a.compareDocumentPosition(b)?-1:a===b?0:1:0}:"sourceIndex"in root?function(a,b){return a.sourceIndex&&b.sourceIndex?a.sourceIndex-b.sourceIndex:0}:document.createRange?function(a,b){if(!a.ownerDocument||!b.ownerDocument)return 0;var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();return aRange.setStart(a,0),aRange.setEnd(a,0),bRange.setStart(b,0),bRange.setEnd(b,0),aRange.compareBoundaryPoints(Range.START_TO_END,bRange)}:null,root=null;for(feature in features)this[feature]=features[feature]}}};var reSimpleSelector=/^([#.]?)((?:[\w-]+|\*))$/,reEmptyAttribute=/\[.+[*$^]=(?:""|'')?\]/,qsaFailExpCache={};local.search=function(context,expression,append,first){var found=this.found=first?null:append||[];if(!context)return found;if(context.navigator)context=context.document;else if(!context.nodeType)return found;var parsed,i,uniques=this.uniques={},hasOthers=!(!append||!append.length),contextIsDocument=9==context.nodeType;if(this.document!==(contextIsDocument?context:context.ownerDocument)&&this.setDocument(context),hasOthers)for(i=found.length;i--;)uniques[this.getUID(found[i])]=!0;if("string"==typeof expression){var simpleSelector=expression.match(reSimpleSelector);simpleSelectors:if(simpleSelector){var node,nodes,symbol=simpleSelector[1],name=simpleSelector[2];if(symbol){if("#"==symbol){if(!this.isHTMLDocument||!contextIsDocument)break simpleSelectors;if(node=context.getElementById(name),!node)return found;if(this.idGetsName&&node.getAttributeNode("id").nodeValue!=name)break simpleSelectors;if(first)return node||null;hasOthers&&uniques[this.getUID(node)]||found.push(node)}else if("."==symbol){if(!this.isHTMLDocument||(!context.getElementsByClassName||this.brokenGEBCN)&&context.querySelectorAll)break simpleSelectors;if(context.getElementsByClassName&&!this.brokenGEBCN){if(nodes=context.getElementsByClassName(name),first)return nodes[0]||null;for(i=0;node=nodes[i++];)hasOthers&&uniques[this.getUID(node)]||found.push(node)}else{var matchClass=new RegExp("(^|\\s)"+Slick.escapeRegExp(name)+"(\\s|$)");for(nodes=context.getElementsByTagName("*"),i=0;node=nodes[i++];)if(className=node.className,className&&matchClass.test(className)){if(first)return node;hasOthers&&uniques[this.getUID(node)]||found.push(node)}}}}else{if("*"==name&&this.brokenStarGEBTN)break simpleSelectors;if(nodes=context.getElementsByTagName(name),first)return nodes[0]||null;for(i=0;node=nodes[i++];)hasOthers&&uniques[this.getUID(node)]||found.push(node)}return hasOthers&&this.sort(found),first?null:found}querySelector:if(context.querySelectorAll){if(!this.isHTMLDocument||qsaFailExpCache[expression]||this.brokenMixedCaseQSA||this.brokenCheckedQSA&&expression.indexOf(":checked")>-1||this.brokenEmptyAttributeQSA&&reEmptyAttribute.test(expression)||!contextIsDocument&&expression.indexOf(",")>-1||Slick.disableQSA)break querySelector;var _expression=expression,_context=context;if(!contextIsDocument){var currentId=_context.getAttribute("id"),slickid="slickid__";_context.setAttribute("id",slickid),_expression="#"+slickid+" "+_expression,context=_context.parentNode}try{if(first)return context.querySelector(_expression)||null;nodes=context.querySelectorAll(_expression)}catch(e){qsaFailExpCache[expression]=1;break querySelector}finally{contextIsDocument||(currentId?_context.setAttribute("id",currentId):_context.removeAttribute("id"),context=_context)}if(this.starSelectsClosedQSA)for(i=0;node=nodes[i++];)!(node.nodeName>"@")||hasOthers&&uniques[this.getUID(node)]||found.push(node);else for(i=0;node=nodes[i++];)hasOthers&&uniques[this.getUID(node)]||found.push(node);return hasOthers&&this.sort(found),found}if(parsed=this.Slick.parse(expression),!parsed.length)return found}else{if(null==expression)return found;if(!expression.Slick)return this.contains(context.documentElement||context,expression)?(found?found.push(expression):found=expression,found):found;parsed=expression}this.posNTH={},this.posNTHLast={},this.posNTHType={},this.posNTHTypeLast={},this.push=!hasOthers&&(first||1==parsed.length&&1==parsed.expressions[0].length)?this.pushArray:this.pushUID,null==found&&(found=[]);var j,m,n,combinator,tag,id,classList,classes,attributes,pseudos,currentItems,currentExpression,currentBit,lastBit,expressions=parsed.expressions;search:for(i=0;currentExpression=expressions[i];i++)for(j=0;currentBit=currentExpression[j];j++){if(combinator="combinator:"+currentBit.combinator,!this[combinator])continue search;if(tag=this.isXMLDocument?currentBit.tag:currentBit.tag.toUpperCase(),id=currentBit.id,classList=currentBit.classList,classes=currentBit.classes,attributes=currentBit.attributes,pseudos=currentBit.pseudos,lastBit=j===currentExpression.length-1,this.bitUniques={},lastBit?(this.uniques=uniques,this.found=found):(this.uniques={},this.found=[]),0===j){if(this[combinator](context,tag,id,classes,attributes,pseudos,classList),first&&lastBit&&found.length)break search}else if(first&&lastBit){for(m=0,n=currentItems.length;n>m;m++)if(this[combinator](currentItems[m],tag,id,classes,attributes,pseudos,classList),found.length)break search}else for(m=0,n=currentItems.length;n>m;m++)this[combinator](currentItems[m],tag,id,classes,attributes,pseudos,classList);currentItems=this.found}return(hasOthers||parsed.expressions.length>1)&&this.sort(found),first?found[0]||null:found},local.uidx=1,local.uidk="slick-uniqueid",local.getUIDXML=function(node){var uid=node.getAttribute(this.uidk);return uid||(uid=this.uidx++,node.setAttribute(this.uidk,uid)),uid},local.getUIDHTML=function(node){return node.uniqueNumber||(node.uniqueNumber=this.uidx++)},local.sort=function(results){return this.documentSorter?(results.sort(this.documentSorter),results):results},local.cacheNTH={},local.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/,local.parseNTHArgument=function(argument){var parsed=argument.match(this.matchNTH);if(!parsed)return!1;var special=parsed[2]||!1,a=parsed[1]||1;"-"==a&&(a=-1);var b=+parsed[3]||0;return parsed="n"==special?{a:a,b:b}:"odd"==special?{a:2,b:1}:"even"==special?{a:2,b:0}:{a:0,b:a},this.cacheNTH[argument]=parsed},local.createNTHPseudo=function(child,sibling,positions,ofType){return function(node,argument){var uid=this.getUID(node);if(!this[positions][uid]){var parent=node.parentNode;if(!parent)return!1;var el=parent[child],count=1;if(ofType){var nodeName=node.nodeName;do el.nodeName==nodeName&&(this[positions][this.getUID(el)]=count++);while(el=el[sibling])}else do 1==el.nodeType&&(this[positions][this.getUID(el)]=count++);while(el=el[sibling])}argument=argument||"n";var parsed=this.cacheNTH[argument]||this.parseNTHArgument(argument);if(!parsed)return!1;var a=parsed.a,b=parsed.b,pos=this[positions][uid];if(0==a)return b==pos;if(a>0){if(b>pos)return!1}else if(pos>b)return!1;return(pos-b)%a==0}},local.pushArray=function(node,tag,id,classes,attributes,pseudos){this.matchSelector(node,tag,id,classes,attributes,pseudos)&&this.found.push(node)},local.pushUID=function(node,tag,id,classes,attributes,pseudos){var uid=this.getUID(node);!this.uniques[uid]&&this.matchSelector(node,tag,id,classes,attributes,pseudos)&&(this.uniques[uid]=!0,this.found.push(node))},local.matchNode=function(node,selector){if(this.isHTMLDocument&&this.nativeMatchesSelector)try{return this.nativeMatchesSelector.call(node,selector.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g,'[$1="$2"]'))}catch(matchError){}var parsed=this.Slick.parse(selector);if(!parsed)return!0;var i,currentExpression,expressions=parsed.expressions,simpleExpCounter=0;for(i=0;currentExpression=expressions[i];i++)if(1==currentExpression.length){var exp=currentExpression[0];if(this.matchSelector(node,this.isXMLDocument?exp.tag:exp.tag.toUpperCase(),exp.id,exp.classes,exp.attributes,exp.pseudos))return!0;simpleExpCounter++}if(simpleExpCounter==parsed.length)return!1;var item,nodes=this.search(this.document,parsed);for(i=0;item=nodes[i++];)if(item===node)return!0;return!1},local.matchPseudo=function(node,name,argument){var pseudoName="pseudo:"+name;if(this[pseudoName])return this[pseudoName](node,argument);var attribute=this.getAttribute(node,name);return argument?argument==attribute:!!attribute},local.matchSelector=function(node,tag,id,classes,attributes,pseudos){if(tag){var nodeName=this.isXMLDocument?node.nodeName:node.nodeName.toUpperCase();if("*"==tag){if("@">nodeName)return!1}else if(nodeName!=tag)return!1}if(id&&node.getAttribute("id")!=id)return!1;var i,part,cls;if(classes)for(i=classes.length;i--;)if(cls=this.getAttribute(node,"class"),!cls||!classes[i].regexp.test(cls))return!1;if(attributes)for(i=attributes.length;i--;)if(part=attributes[i],part.operator?!part.test(this.getAttribute(node,part.key)):!this.hasAttribute(node,part.key))return!1;if(pseudos)for(i=pseudos.length;i--;)if(part=pseudos[i],!this.matchPseudo(node,part.key,part.value))return!1;return!0};var combinators={" ":function(node,tag,id,classes,attributes,pseudos,classList){var i,item,children;if(this.isHTMLDocument){getById:if(id){if(item=this.document.getElementById(id),!item&&node.all||this.idGetsName&&item&&item.getAttributeNode("id").nodeValue!=id){if(children=node.all[id],!children)return;for(children[0]||(children=[children]),i=0;item=children[i++];){var idNode=item.getAttributeNode("id");if(idNode&&idNode.nodeValue==id){this.push(item,tag,null,classes,attributes,pseudos);break}}return}if(!item){if(this.contains(this.root,node))return;break getById}if(this.document!==node&&!this.contains(node,item))return;return void this.push(item,tag,null,classes,attributes,pseudos)}getByClass:if(classes&&node.getElementsByClassName&&!this.brokenGEBCN){if(children=node.getElementsByClassName(classList.join(" ")),!children||!children.length)break getByClass;for(i=0;item=children[i++];)this.push(item,tag,id,null,attributes,pseudos);return}}if(children=node.getElementsByTagName(tag),children&&children.length)for(this.brokenStarGEBTN||(tag=null),i=0;item=children[i++];)this.push(item,tag,id,classes,attributes,pseudos)},">":function(node,tag,id,classes,attributes,pseudos){if(node=node.firstChild)do 1==node.nodeType&&this.push(node,tag,id,classes,attributes,pseudos);while(node=node.nextSibling)},"+":function(node,tag,id,classes,attributes,pseudos){for(;node=node.nextSibling;)if(1==node.nodeType){this.push(node,tag,id,classes,attributes,pseudos);break}},"^":function(node,tag,id,classes,attributes,pseudos){node=node.firstChild,node&&(1==node.nodeType?this.push(node,tag,id,classes,attributes,pseudos):this["combinator:+"](node,tag,id,classes,attributes,pseudos))},"~":function(node,tag,id,classes,attributes,pseudos){for(;node=node.nextSibling;)if(1==node.nodeType){var uid=this.getUID(node);if(this.bitUniques[uid])break;this.bitUniques[uid]=!0,this.push(node,tag,id,classes,attributes,pseudos)}},"++":function(node,tag,id,classes,attributes,pseudos){this["combinator:+"](node,tag,id,classes,attributes,pseudos),this["combinator:!+"](node,tag,id,classes,attributes,pseudos)},"~~":function(node,tag,id,classes,attributes,pseudos){this["combinator:~"](node,tag,id,classes,attributes,pseudos),this["combinator:!~"](node,tag,id,classes,attributes,pseudos)},"!":function(node,tag,id,classes,attributes,pseudos){for(;node=node.parentNode;)node!==this.document&&this.push(node,tag,id,classes,attributes,pseudos)},"!>":function(node,tag,id,classes,attributes,pseudos){node=node.parentNode,node!==this.document&&this.push(node,tag,id,classes,attributes,pseudos)},"!+":function(node,tag,id,classes,attributes,pseudos){for(;node=node.previousSibling;)if(1==node.nodeType){this.push(node,tag,id,classes,attributes,pseudos);break}},"!^":function(node,tag,id,classes,attributes,pseudos){node=node.lastChild,node&&(1==node.nodeType?this.push(node,tag,id,classes,attributes,pseudos):this["combinator:!+"](node,tag,id,classes,attributes,pseudos))},"!~":function(node,tag,id,classes,attributes,pseudos){for(;node=node.previousSibling;)if(1=