* Copyright (c) 2017 joonis new media, Thimo Kraemer <thimo.kraemer@joonis.de>
*/
"use strict";
!function(){functione(e,s){vart;s=s||{};try{(t=document.createEvent("CustomEvent")).initCustomEvent(e,!!s.bubbles,!!s.cancelable,s.detail)}catch(n){(t=document.createEvent("Event")).initEvent(e,!!s.bubbles,!!s.cancelable),t.detail=s.detail}returnt}"function"!=typeofwindow.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}();varkss={version:"0.6-beta",_initialized:!1,_ruleSheets:{},_eventBinders:{},_activeBinders:[],_activeHandlers:[],_actionProviders:{},_paramProviders:{},_stateVars:{},logging:"warn",config:{protocol:"json-rpc",endpoint:"",dateEncoding:"iso8601",timeout:1e4},_init:function(){if(kss._initialized)kss.warn("KSS already initialized");else{kss._initialized=!0,kss.createLogger(kss);vare=window.location.hash.match(/^#logging=([\w]+)/);e&&kss.setSessionVar("kssLogging",e[1]),kss.logging=kss.getSessionVar("kssLogging")||kss.logging,kss.log("Initializing KSS v"+kss.version+" ..."),window.cssQuery?(kss.info("Using an unknown selector engine"),kss._cssQuery=function(e,s){returncssQuery(e,s)}):window.jQuery?(kss.info("Using jQuery selector engine"),kss._cssQuery=function(e,s){returnjQuery(e,s)}):window.Sizzle?(kss.info("Using Sizzle selector engine"),kss._cssQuery=function(e,s){returnSizzle(e,s)}):window.Slick?(kss.info("Using Slick (MooTools) selector engine"),kss._cssQuery=function(e,s){returns=s||document,Slick.search(s,e)}):document.querySelectorAll?(kss.info("Using built-in selector engine"),kss._cssQuery=function(e,s){return(s=s||document).querySelectorAll(e)}):kss.error("No selector engine found"),kss.info("Loaded animation library: "+(kss._loadAnimationLib()||"none"));vars=document.getElementsByTagName("link"),t=0;kss.each(s,function(e){"kinetic-stylesheet"==(e.getAttribute("data-rel")||e.rel)&&"text/kss"==e.type&&(kss.addRuleSheet(e.href),t++)}),kss.info("Found "+t+" rulesheet link(s) in document"),setInterval(kss._cleanUp,6e4),window.addEventListener("unload",kss._cleanUp,!1)}}};"undefined"!=typeofwindow&&document.addEventListener("DOMContentLoaded",kss._init,!1),kss._cleanUp=function(e){for(vars=0,t=document.documentElement,n=kss._activeHandlers,r=n.length-1;r>=0;r--){varo=n[r];!e&&t.contains(o.node)||(o.node.removeEventListener(o.eventname,o),o.node._kssRules=null,o.node=null,n.splice(r,1),s++)}vari=kss._activeBinders;for(r=i.length-1;r>=0;r--){vara=i[r];!e&&t.contains(a.node)||(a.node=null,i.splice(r,1))}s&&kss.log("Cleand up "+s+" event handler(s)")},kss._register=function(e,s,t,n){varr={};einstanceofObject?r=e:r[e]=s,kss.each(r,function(e,s){einstanceofFunction&&"_"!=s.charAt(0)&&(n?(t[s]||(t[s]=[]),t[s].push(e)):t[s]=e)})},kss.registerActionProvider=function(e,s){kss._register(e,s,kss._actionProviders)},kss.registerParameterProvider=function(e,s){kss._register(e,s,kss._paramProviders)},kss.registerEventBinder=function(e,s){kss._register(e,s,kss._eventBinders,!0)},kss._hyphenateCache={cssFloat:"float",styleFloat:"float"},kss.hyphenate=function(e){returnkss._hyphenateCache[e]||(kss._hyphenateCache[e]=e.replace(/([A-Z])/g,"-$1").toLowerCase())},kss._camelCaseCache={},kss.camelCase=function(e){returnkss._camelCaseCache[e]||(kss._camelCaseCache[e]=e.replace(/\-(\w)/g,function(e,s){returns.toUpperCase()}))},kss.dateToISO8601=function(e){return[e.getUTCFullYear(),"-",("0"+(e.getUTCMonth()+1)).slice(-2),"-",("0"+e.getUTCDate()).slice(-2),"T",("0"+e.getUTCHours()).slice(-2),":",("0"+e.getUTCMinutes()).slice(-2),":",("0"+e.getUTCSeconds()).slice(-2),".",("00"+e.getUTCMilliseconds()).slice(-3),"Z"].join("")},kss.ISO8601toDate=function(e){vars;if(s=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(e)){for(vart,n=[1,4,5,6,7,10,11],r=0;t=n[r];++r)s[t]=+s[t]||0;s[2]=(+s[2]||1)-1,s[3]=+s[3]||1;varo=0;"Z"!==s[8]&&void0!==s[9]&&(o=60*s[10]+s[11],"+"===s[9]&&(o=0-o));vari=Date.UTC(s[1],s[2],s[3],s[4],s[5]+o,s[6],s[7]);returnnewDate(i)}},kss.randomString=function(){returnMath.floor(1e16*Math.random()).toString(16)},kss.eval=function(__expr__){returneval("("+__expr__+")")},kss.isNativeEvent=function(e,s){vart=e["on"+s];returnnull===t||"function"==typeoft},kss.isArrayLike=function(e){if(e&&"object"==typeofe&&e!=window){vars=e.length,t=e.propertyIsEnumerable&&e.propertyIsEnumerable("length");return(0===s||"number"==typeofs&&s>0&&s-1ine)&&(!t||"function"==typeofe.item)}return!1},kss.each=function(e,s,t){if("string"==typeofe&&(e=e.split(/[\s,;]+/)),kss.isArrayLike(e))for(varn=0;n<e.length;n++){if(void0!==(o=s.call(t,e[n],n)))returno}elseif(e)for(varrine){varo;if(e.hasOwnProperty(r))if(void0!==(o=s.call(t,e[r],r)))returno}},kss.contains=function(e,s){return"string"==typeofe&&(e=e.split(/[\s,;]+/)),e.indexOf?e.indexOf(s)>-1:kss.each(e,function(e){if(s===e)return!0})||!1},kss._logTimers={},kss._logLevels=["none","error","warn","time","info","log","debug"],kss._log=function(e,s){vart=kss._logLevels;if(window.console&&!(t.indexOf(e)>t.indexOf(kss.logging))){if(s=[].slice.call(s),"time"==e)returnkss._logTimers[s[0]]=(newDate).getTime(),s[0];if(s[0]inkss._logTimers){varn=(newDate).getTime()-kss._logTimers[s[0]];s[0]+=" ("+n+"ms)",deletekss._logTimers[s[0]]}if(!this.logHandler||!1!==this.logHandler(s,e)){console.dir||kss.each(s,function(e,t){"object"!=typeofe||einstanceofError||(s[t]=JSON.stringify(e,null,4)||e)});varr=console[e]||console.log;Function.prototype.apply.call(r,console,s)}}},kss.createLogger=function(e){return(e=e||{})._log=kss._log,kss.each(kss._logLevels.slice(1),function(s){sine||(e[s]=function(){returnthis._log(s,arguments)})}),e},kss.RuleSheet=function(e,s){this.url=e,this.config=s||kss.config,this.source="",this.rules=[],this.status=null},kss.RuleSheet.prototype={load:function(e){if("loaded"!=this.status){vars=this,t=kss.time("Loaded RuleSheet: "+this.url);kss.GET(this.url,{},this.config.timeout,{},function(n){200!=n.status?(s.status="failed",kss.error('Failed to load "'+s.url+'": '+n.status+""+n.statusText)):(kss.log(t),s.source=n.responseText,s._parse(!0),s.status="loaded"),e&&e()})}elsekss.warn("Rulesheet already loaded")},_parse:function(e){vars=kss.time("Parsed RuleSheet: "+this.url),t=newkss.Parser(this.source,this.url).rules(!0);this.rules=[];varn=this.config;kss.each(t,function(s){if("config"!=s.type||s.name&&"kss"!=s.name){if("rule"==s.type){vart={},r=[];kss.each(s.declarations,function(e){if("declaration"==e.type){varn=e.property,o=e.value;o||kss.warn('Missing value for property "'+n+'".',s);vari=r[r.length-1],a=n.match(/^kss-action-(client|server)$/i);a?r.push({type:a[1].toLowerCase(),name:o,props:{},params:{}}):!i||/^evt-/i.test(n)?t[n.toLowerCase()]=o:/^kss-/i.test(n)?i.props[n.toLowerCase()]=o:i.params[n]=o}}),this.rules.push({selectors:s.selectors,props:t,actions:r,config:n,position:s.position,url:this.url}),r.length||kss.warn("Rule without action.",s)}elseif(e&&"import"==s.type){varo=s.import;o=o.replace(/url\s*\(|\)|'|"|\s/g,""),kss.addRuleSheet(o,n)}}else{vari,a={};for(iinn)a[i]=n[i];n=a,kss.each(s.declarations,function(e){"declaration"==e.type&&(i=kss.camelCase(e.property),n[i]=e.value)})}},this),kss.debug(s)},apply:function(e){vars=0;kss.each(this.rules,function(t){kss.each(t.selectors,function(n){varr=kss.cssQuery(n.selector,e),o=n.event;kss.each(r,function(n){if(n._kssRules||(n._kssRules={}),n._kssRules[o]||(n._kssRules[o]=[]),!kss.contains(n._kssRules[o],t))try{newkss._EventHandler(n,o,t,!e),n._kssRules[o].push(t),s++}catch(e){kss.error(e.message,t)}})})}),this.rules.length&&kss.log("Applied rules to "+s+" node(s)")}},kss.addRuleSheet=function(e,s){if((e=kss.toAbsoluteURL(e))inkss._ruleSheets)kss.warn('Rulesheet "'+e+'" already added.');else{vart=newkss.RuleSheet(e,s);kss._ruleSheets[e]=t,t.load(function(){"loaded"==t.status&&t.apply()})}},kss.applyRules=function(e){kss._cleanUp(),kss.each(kss._ruleSheets,function(s){s.apply(e)})},kss._EventHandler=function(e,s,t,n){if(!kss.isNativeEvent(e,s)&&!kss._eventBinders[s])throwError('Unknown event type "'+s+'"');this.node=e,this.eventname=s,this.event={},this.rule=t,this.kssProps=this.propertyGetter({selector:"@samenode",precondition:!0},t.props),this.evtProps=this.propertyGetter({preventdefault:!1,allowbubbling:!1,preventbubbling:!1}),kss.each(kss._eventBinders[s],function(s){kss._activeBinders.push({node:e,binder:news(this)})},this),e.addEventListener(s,this,!1),kss._activeHandlers.push(this),"load"==s&&(n&&this.evtProps("initial",!0)||!n&&this.evtProps("insert",!0))&&this.dispatchEvent()},kss._EventHandler.prototype={logHandler:function(e,s){if(e.unshift("Event ["+this.eventname+"]:"),"debug"==kss.logging){vart=this.rule.position;e.push("\nRuleSheet: "+this.rule.url),e.push("\nLine: "+t.start.line+" to "+t.end.line)}},propertyGetter:function(e,s){vart="kss";s||(t="evt-"+this.eventname,s=this.rule.props);varn=this;returnfunction(r,o){vari=t+"-"+r;returniins||"preventdefault"!=r&&"preventbubbling"!=r&&"allowbubbling"!=r||(i="evt-"+r),iins?n._evalParam(s[i]):void0!==o?o:e?e[r]:void0}},dispatchEvent:function(e,s,t){varn=newCustomEvent(this.eventname,{bubbles:!!e,cancelable:!!s,detail:t});returnthis.node.dispatchEvent(n)},handleEvent:function(e){this.event=e,(this.evtProps("allowbubbling")||e.target==this.node)&&(this.info("Triggered on element",this.node),this.evtProps("preventdefault")&&e.preventDefault(),this.evtProps("preventbubbling")&&e.stopPropagation(),this.kssProps("precondition")&&kss.each(this.rule.actions,function(e){vars=this.propertyGetter({selector:null,precondition:!0,includeform:null},e.props);if(s("precondition")){vart={},n=s("includeform");if(n){varr=null;if(r="@currentform"==n?kss.cssQuery(n,this.node)[0]:document.forms[n]){varo=0;kss.each(kss.getAllFormVars(r),function(e,s){t[s]=e,o++}),this.log("Acquired "+o+' value(s) of form "'+r.name+'"')}elsethis.warn('Form "'+n+'" not found')}kss.each(e.params,function(e,s){t[s]=this._evalParam(e)},this),"client"==e.type?this._execClientAction(e.name,t,s("selector")):this._execServerAction(e.name,t)}},this))},_execClientAction:function(e,s,t){if(kss._actionProviders[e]){varn;s=s||{},e={name:e,type:"client"},this._callBinders("onstart",e);try{t=t||this.kssProps("selector");varr=kss.cssQuery(t,this.node,!0);this.log('Execute client action "'+e.name+'" for '+r.length+' node(s) (selector "'+t+'")'),this.debug("Parameters:",s),kss.each(r,function(t){kss._actionProviders[e.name].call(this,t,s)},this)}catch(e){this.error(e),n=e}this._callBinders("oncomplete",e,n)}elsethis.error('Skipping non-existent client action "'+e+'"')},_execServerAction:function(e,s){if(!(["mousemove","drag","dragover"].indexOf(this.eventname)>-1)){vart=this.rule.config;!s||"xml-rpc"!=t.protocol&&"json-rpc-v1"!=t.protocol||(s=[s]),e={name:e,type:"server"},this._callBinders("onstart",e);try{varn=this.time('Execute server action "'+e.name+'"'),r=newkss.RPC(t.endpoint,t),o=this;r.invoke(e.name,s,function(t){varr;try{if("object"!=typeoft||!(t.commandsinstanceofArray))thrownewError("Invalid KSS response");if(t.error)thrownewError(t.error);o.log(n),o.debug("Parameters:",s),o.log("Server action returned "+t.commands.length+" command(s)"),kss.each(t.commands,function(e){o._execClientAction(e.action,e.params,e.selector)})}catch(e){o.error(e),r=e}o._callBinders("oncomplete",e,r)},function(s){o.error(s),o._callBinders("oncomplete",e,s)})}catch(s){this.error(s),this._callBinders("oncomplete",e,s)}}},_callBinders:function(e,s,t){kss.each(kss._activeBinders,function(n){varr=n.binder;try{r[e]&&r[e](this,s,t)}catch(e){this.error(e)}},this)},_evalParam:function(e){if(!e||"string"!=typeofe||!/^(".*"|'.*'|\[.*\]|\{.*\}|true|false|null|[\d.]+)$|\(.*\)/.test(e))returne;vars=e.replace(/\\["']|["'](?:\\["']|[^"'])*["']|([\w.$]+\s*\()/g,function(e,s){returns?e=(e="kss._paramProviders."+e).replace("(",".call(this,this.node,"):e});s=s.replace(/,\s*\)/g,")");try{returnkss.eval.call(this,s)}catch(s){returns.message='Error evaluating "'+e+'". Error was:\n'+s.message,this.warn(s),null}}},kss.createLogger(kss._EventHandler.prototype),kss.GET=function(e,s,t,n,r){returnkss.SEND("GET",e,s,t,n,r)},kss.POST=function(e,s,t,n,r){returnkss.SEND("POST",e,s,t,n,r)},kss.SEND=function(e,s,t,n,r,o){vari,a,c=!!o,l=newXMLHttpRequest;if(l.open(e,s,c),r||(r={}),r["X-Requested-With"]="XMLHttpRequest",kss.each(r,function(e,s){"content-type"==s.toLowerCase()&&(i=e),l.setRequestHeader(s,e)}),tinstanceofObject)if("application/json"==i)t=kss.toJSON(t);else{if(tinstanceofArray)throwError("invalid data type");t=kss.toQueryString(t),"GET"==e&&(s+=(s.indexOf("?")<0?"?":"&")+t,t=null)}if(c?(l.timeout=n,l.onreadystatechange=function(){4==l.readyState&&o(l)}):n&&(a=setTimeout(l.abort,n)),l.send(t),a){if(0==l.readyState)throwError("Request timed out");clearTimeout(a)}returnl},kss.toAbsoluteURL=function(e){vars=document.createElement("a");returns.href=e||"",s.href},kss.toQueryString=function(e){vars=[];returnkss.each(e,function(e,t){einstanceofArray||(e=[e]),kss.each(e,function(e){e||0===e?einstanceofDate&&(e=kss.dateToISO8601(e)):e="",s.push(t+"="+encodeURIComponent(String(e)))})}),s.join("&")},kss.RPC=function(e,s){if(this._endpoint=e,this._methodList=[],this._protocol="json-rpc",this._timeout=1e4,this._dateEncoding="iso8601",this._decodeISO8601=!0,s){if(s.protocol){vart=s.protocol.toLowerCase();switch(t){case"json-rpc":case"json-rpc-v1":case"json-rpc-v2":case"xml-rpc":case"url-encoded":case"json":this._protocol=t;break;default:thrownewError("unknown protocol")}}if(s.timeout&&(this._timeout=parseInt(s.timeout)),s.dateEncoding){varn=s.dateEncoding.toLowerCase();switch(n){case"iso8601":case"@timestamp@":case"class-hinting":case"asp.net":this._dateEncoding=n;break;default:thrownewError("unknown dateEncoding")}}void0!==s.decodeISO8601&&(this._decodeISO8601=!!s.decodeISO8601),"auto"==s.methods?this._methodList=this.invoke("system.listMethods"):s.methods&&(this._methodList=s.methods.slice())}this._methodList.push("system.listMethods"),this._methodList.push("system.describe"),kss.each(this._methodList,function(e){vars=this,t=e.split(/\./);kss.each(t.slice(0,-1),function(e){s[e]||(s[e]={}),s=s[e]});varn=function(e,s){vart={instance:e,method:s};returnfunction(){returnt.instance.invoke(t.method,arguments[0],arguments[1],arguments[2],arguments[3])}}(this,e);s[t[t.length-1]]=n},this)},kss.RPC.prototype.invoke=function(e,s,t,n){if(einstanceofObject&&e.method&&(s=e.params,t=e.onSuccess,n=e.onError,e=e.method),s&&!(sinstanceofObject))throwError("params must be an array or object");varr,o,i=this._endpoint;if("url-encoded"==this._protocol||"json"==this._protocol){i&&"/"!=i.substr(-1)&&(i+="/"),i+=e,r=s||{};vara="application/x-www-form-urlencoded";"json"==this._protocol&&(r=kss.toJSON(r,this._dateEncoding),a="application/json"),o={"Content-Type":a,Accept:"application/json"}}elseif("xml-rpc"==this._protocol)r=kss.toXMLRPC(e,s||[]),o={"Content-Type":"text/xml",Accept:"text/xml"};else{varc={method:e,params:s||[],id:kss.randomString()};"json-rpc-v1"!=this._protocol&&(c.jsonrpc="2.0"),r=kss.toJSON(c,this._dateEncoding),o={"Content-Type":"application/json",Accept:"application/json"}}if(i+=i.indexOf("?")<0?"?":"&",i+="_ts="+(newDate).getTime(),!t){varl=kss.POST(i,r,this._timeout,o);returnthis._getRPCResponse(l)}varu=this;kss.POST(i,r,this._timeout,o,function(e){try{vars=u._getRPCResponse(e)}catch(e){if(!n)throwe;returnvoidn(e)}t(s)})},kss.RPC.prototype._getRPCResponse=function(e){vars=0;try{s=e.status}catch(e){}if(0==s)throwError("Network error or request timed out");if(200!=s)thrownewError(s+""+e.statusText);vart={};if("xml-rpc"==this._protocol){if(!e.responseXML)throwError("Malformed XML document.");t=kss.parseXMLRPC(e.responseXML)}elset=kss.parseJSON(e.responseText,this._decodeISO8601),"url-encoded"!=this._protocol&&"json"!=this._protocol||(t={result:t});if(t.error)thrownewError(t.error.code+""+t.error.message);returnt.result},kss.toJSON=function(e,s){vart=Date.prototype.toJSON;deleteDate.prototype.toJSON;varn=JSON.stringify(e,function(e,t){if(tinstanceofDate)switch(s){case"class-hinting":return{__jsonclass__:["Date",[t.valueOf()]]};case"@timestamp@":return"@"+t.valueOf()+"@";case"asp.net":return"\\/Date("+t.valueOf()+")\\/";default:returnkss.dateToISO8601(t)}returnt});returnDate.prototype.toJSON=t,n},kss.parseJSON=function(e,s){returnJSON.parse(e,function(e,t){if("string"==typeoft){varn;if(s&&(n=kss.ISO8601toDate(t)))returnn;if(n=t.match(/^@(\d+)@$/))returnnewDate(parseInt(n[1],10));if(n=t.match(/^\/Date\((\d+)\)\/$/))returnnewDate(parseInt(n[1],10))}elseif(tinstanceofObject&&t.__jsonclass__instanceofArray&&"Date"==t.__jsonclass__[0])returnt.__jsonclass__[1]instanceofArray&&t.__jsonclass__[1][0]?newDate(t.__jsonclass__[1][0]):newDate;returnt})},kss.toXMLRPC=function(e,s){vart=['<?xml version="1.0"?><methodCall><methodName>'+e+"</methodName>"];if(s){if(!(sinstanceofArray))throwError("params must be an array");t.push("<params>"),kss.each(s,function(e){t.push("<param>"+kss._toXMLRPCValue(e)+"</param>")}),t.push("</params>")}returnt.push("</methodCall>"),t.join("")},kss._toXMLRPCValue=function(e){vars=["<value>"];switch(typeofe){case"number":isFinite(e)?Math.floor(e)==e?s.push("<int>",e.toString(),"</int>"):s.push("<double>",e.toString(),"</double>"):s.push("<nil/>");break;case"boolean":s.push("<boolean>",e?"1":"0","</boolean>");break;case"string":e=e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),s.push("<string>",e,"</string>");break;case"object":null===e?s.push("<nil/>"):einstanceofDate?s.push("<dateTime.iso8601>",kss.dateToISO8601(e),"</dateTime.iso8601>"):einstanceofArray?(s.push("<array><data>"),kss.each(e,function(e){s.push(kss._toXMLRPCValue(e))}),s.push("</data></array>")):(s.push("<struct>"),kss.each(e,function(e,t){s.push("<member>"),s.push("<name>",t,"</name>"),s.push(kss._toXMLRPCValue(e)),s.push("</member>")}),s.push("</struct>"));break;default:s.push("<nil/>"),kss.error('Unable to convert type "'+typeofe+'" to XML-RPC.')}returns.push("</value>"),s.join("")},kss.parseXMLRPC=function(e){vars={result:null},t=e.documentElement;if("methodResponse"!=t.nodeName)throwError("Invalid XML-RPC document.");varn=t.getElementsByTagName("value")[0],r=n.parentNode;if("param"==r.nodeName&&"params"==r.parentNode.nodeName)s.result=kss._parseXMLRPCValue(n);else{if("fault"!=r.nodeName)throwError("Invalid XML-RPC document.");varo=kss._parseXMLRPCValue(n);s.error={code:o.faultCode,message:o.faultString}}returns},kss._parseXMLRPCValue=function(e){for(vars="",t=e.childNodes,n=0;n<t.length;n++)if(3==(e=t[n]).nodeType||4==e.nodeType)s+=e.nodeValue.trim();elseif(1==e.nodeType){varr=e.nodeName.toLowerCase();if("array"==r){for(varo=[],i=e.firstChild;i&&(1!=i.nodeType||"data"!=i.nodeName);)i=i.nextSibling;if(!i)returno;for(vara=i.firstChild;a;)1==a.nodeType&&"value"==a.nodeName&&o.push(kss._parseXMLRPCValue(a)),a=a.nextSibling;returno}if("struct"==r){varc={};returnkss.each(e.childNodes,function(e){if(1==e.nodeType&&"member"==e.nodeName){vars="",t=null;kss.each(e.childNodes,function(e){1==e.nodeType&&("name"==e.nodeName?s=e.firstChild.nodeValue.trim():"value"==e.nodeName&&(t=e))}),s&&t&&(c[s]=kss._parseXMLRPCValue(t))}}),c}varl=e.firstChild;a=l?l.nodeValue.trim():"";switch(r){case"i4":case"int":returnparseInt(a,10);case"double":returnparseFloat(a);case"boolean":returnBoolean(parseInt(a,10));case"string":case"base64":returnkss._parseXMLRPCValue(e);case"datetime.iso8601":returnkss.ISO8601toDate(a);case"nil":returnnull;default:returnvoidkss.warn("XML-RPC Parsing Error: Unknown element: "+e.nodeName)}}returns},kss.Parser=function(e,s){for(vartinthis.commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,this.atRules=[],kss.Parser.prototype)"at_"==t.slice(0,3)&&this.atRules.push(t);this.source=e.replace(/\r\n?/g,"\n"),this.url=s,this.nestinglevel=0,this.lineno=1,this.column=1},kss.Parser.prototype={position:function(){vare={line:this.lineno,column:this.column},s=this;returnfunction(t){returnt.position={start:e,end:{line:s.lineno,column:s.column}},s.whitespace(),t}},logHandler:function(e,s){e.push("\nRuleSheet: "+(this.url||"unknown")),e.push("\nLine: "+this.lineno+", Column: "+this.column)},match:function(e){vars=e.exec(this.source);if(!s)returnnull;vart=s[0];this.source=this.source.slice(t.length);varn=t.match(/\n/g);n&&(this.lineno+=n.length);varr=t.lastIndexOf("\n");returnthis.column=~r?t.length-r:this.column+t.length,s},open:function(){vare=this.match(/^\{[{\s]*/);returne?(e[0].trim().length>1&&this.warn("multiple '{'"),this.nestinglevel++,e):this.error("missing '{'")||null},close:function(){vare=1==this.nestinglevel?/^\}[}\s]*/:/^\}\s*/,s=this.match(e);returns?(s[0].trim().length>1&&this.warn("multiple '}'"),this.nestinglevel--,s):this.error("missing '}'")||null},whitespace:function(){this.match(/^\s*/)},comments:function(e){vars;for(e=e||[],this.whitespace();s=this.comment();)e.push(s);returne},comment:function(){vare=this.position(),s=this.match(/^\/\*([\s\S]*?)(\*\/|$)/);returns?(s[2]||this.error("end of comment missing"),e({type:"comment",comment:s[1].trim()})):null},selectors:function(e){vars=this.match(/^([^{]+)/);if(!s)returnthis.error("selector missing")||[];vart=s[0].trim().replace(this.commentre,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(e){returne.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(e){returne.replace(/\u200C/g,",")});if(!e)returnt;for(varn=[],r=0;r<t.length;r++)(s=t[r].match(/^\s*(.+)\s*:\s*([a-z]+)\s*$/))?n.push({selector:s[1],event:s[2]}):this.error('selector "'+t[r]+'" missing event');returnn},declaration:function(){vare=this.position(),s=this.match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!s)returnnull;s=s[0].trim();vart=this.match(/^[:\s]*/);(!t||t[0].indexOf(":")<0)&&this.warn('property "'+s+'" missing ":"');varn=this.match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};\n])+)/),r=e({type:"declaration",property:s.replace(this.commentre,""),value:n?n[0].trim().replace(this.commentre,""):""});return(!(t=this.match(/^[;\s]*/))||t[0].indexOf(";")<0)&&this.warn('property "'+s+'" missing ";"'),r},declarations:function(){vare,s=[];if(!this.open())return[];for(this.comments(s);e=this.declaration();)s.push(e),this.comments(s);returns.length||this.warn("no declarations"),this.close(),s},atRuleBlock:function(e){vars=newRegExp("^@("+e+")\\b\\s*"),t=this.position();if(!(n=this.match(s)))returnnull;e=n[1].trim();varn,r="";return(n=this.match(/^([-\w]+)\s*/))&&(r=n[1]),this.comments(),t({type:e,name:r,declarations:this.declarations()})},atRuleNonBlock:function(e){vars=newRegExp("^@("+e+")\\b\\s*([^;{]+);"),t=this.position(),n=this.match(s);if(!n)returnnull;varr={type:e=n[1].trim()};returnr[e]=n[2].trim(),t(r)},atrule:function(){if("@"!=this.source.charAt(0))returnnull;vare=kss.each(this.atRules,function(e){returnthis[e]()||void0},this);if(!e&&(this.warn('Skipping unknown at-rule "'+this.match(/^@[\w-]*/)[0]+'"'),!this.match(/^\s*[^;{]+;/))){vars,t,n=0;do{this.comments(),(s=this.match(/^[^{}]*{/))&&n++,this.comments(),(t=this.match(/^[^{}]*}/))&&n--}while(n&&(s||t))}returne||null},rule:function(e){vars=this.position(),t=this.selectors(e);returnthis.comments(),s({type:"rule",selectors:t,declarations:this.declarations()})},rules:function(e){vars,t=[];for(this.comments(t);this.source.length&&"}"!=this.source.charAt(0)&&(s=this.atrule()||this.rule(e));)s&&(t.push(s),this.comments(t));returnt},at_config:function(){returnthis.atRuleBlock("config")},at_import:function(){returnthis.atRuleNonBlock("import")}},kss.createLogger(kss.Parser.prototype),kss.cssQuery=function(e,s,t){if(!kss._cssQuery)thrownewError("no selector engine available");if("window"==e)return[window];if("document"==e)return[document];if("@"==e.charAt(0)){if(!s)thrownewError("context required for @-selectors");varn=[];switch(e.toLowerCase()){case"@samenode":n=[s];break;case"@parentnode":n=[s.parentNode];break;case"@firstchild":n=[s.firstElementChild];break;case"@lastchild":n=[s.lastElementChild];break;case"@children":case"@childnodes":kss.each(s.childNodes,function(e){1==e.nodeType&&n.push(e)});break;case"@previoussibling":case"@prevsibling":n=[s.previousElementSibling];break;case"@nextsibling":n=[s.nextElementSibling];break;case"@currentform":for(varr=s;r&&r.tagName;){if("form"==r.tagName.toLowerCase()){n=[r];break}r=r.parentNode}break;default:thrownewError('invalid selector "'+e+'"')}returnn[0]?n:[]}t&&(s=null);n=kss._cssQuery(e,s);try{return[].slice.call(n)}catch(e){returnn}},kss.replaceInnerHTML=function(e,s){e.innerHTML=s,kss.applyRules(e)},kss.replaceHTML=function(e,s){vart=e.parentNode;if(document.all&&!window.atob&&"body"==e.tagName.toLowerCase())returndocument.body.innerHTML=s,voidkss.applyRules(t);e.outerHTML=s,kss.applyRules(t)},kss.appendHTML=function(e,s){e.insertAdjacentHTML("beforeend",s),kss.applyRules(e)},kss.prependHTML=function(e,s){e.insertAdjacentHTML("afterbegin",s),kss.applyRules(e)},kss.insertHTMLAfter=function(e,s){e.insertAdjacentHTML("afterend",s),kss.applyRules(e.parentNode)},kss.insertHTMLBefore=function(e,s){e.insertAdjacentHTML("beforebegin",s),kss.applyRules(e.parentNode)},kss.deleteNode=function(e){returne=e.parentNode.removeChild(e),kss._cleanUp(),e},kss.getNodeAttr=function(e,s,t){do{varn=e.getAttribute(s);e=e.parentNode}while(t&&null===n&&e&&e.getAttribute);returnn},kss.setNodeAttr=function(e,s,t){switch(s){case"checked":case"selected":case"disabled":e[s]=!!t;break;default:e.setAttribute(s,t)}},kss.getDataAttr=function(e,s,t){returnthis.getNodeAttr(e,"data-"+s.toLowerCase(),t)},kss.setDataAttr=function(e,s,t){this.setNodeAttr(e,"data-"+s.toLowerCase(),t)},function(){kss._transformProp="transform";vare=document.createElement("div").style;"transform"ine||kss.each(["Webkit","Moz","ms"],function(s){vart=s+"Transform";if(tine)returnkss._transformProp=t,!0})}(),kss._transformProps=["translate","translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","matrix"],kss.getStyle=function(e,s){s=kss.camelCase(s);vart=getComputedStyle(e);if(kss.contains(kss._transformProps,s)){varn=newRegExp("\\b"+s+"\\s*\\(([^)]+)\\s*\\)");s=kss._transformProp;varr=t.getPropertyValue(s).match(n);returnr?r[1]:""}returns=kss.hyphenate(s),t.getPropertyValue(s)},kss.setStyle=function(e,s,t){if(s=kss.camelCase(s),kss.contains(kss._transformProps,s)){varn=e.style,r=!1;t=t&&"none"!=t?""+s+"("+t+")":"";varo=newRegExp("\\b\\s*"+s+"\\s*\\([^)]+\\s*\\)");returnn[s=kss._transformProp]=n[s].replace(o,function(){returnr=!0,t}),void(!r&&t&&(n[s]+=t))}sine.style&&(e.style[s]=t)},kss.setStyles=function(e,s){kss.each(s,function(s,t){this.setStyle(e,t,s)},this)},kss.hasClass=function(e,s){returnkss.contains(e.className,s)},kss.addClass=function(e,s){this.hasClass(e,s)||(e.className+=""+s)},kss.removeClass=function(e,s){vart=newRegExp("\\b"+s+"\\b");s=e.className.replace(t,"").trim(),e.className=s.replace(/\s+/g,"")},kss.toggleClass=function(e,s){this.hasClass(e,s)?this.removeClass(e,s):this.addClass(e,s)},kss.submit=function(e){"form"==e.tagName.toLowerCase()?e.submit():kss.warn("Element is not a form!")},kss.focus=function(e){switch(e.tagName.toLowerCase()){case"input":case"select":case"textarea":case"button":e.focus();break;default:kss.warn("Focus on node that cannot have focus!")}},kss.blur=function(e){switch(e.tagName.toLowerCase()){case"input":case"select":case"textarea":case"button":e.blur();break;default:kss.warn("Blur on node that cannot be blurred!")}},kss.getStateVar=function(e){returneinkss._stateVars?kss._stateVars[e]:null},kss.setStateVar=function(e,s){kss._stateVars[e]=s},kss.setStateVars=function(e){kss.each(e,function(e,s){this.setStateVar(s,e)},this)},kss._localStorage={},kss.getLocalVar=function(e){vars=null;try{s=window.localStorage.getItem(e)}catch(t){einkss._localStorage&&(s=kss._localStorage[e])}try{s=kss.parseJSON(s)}catch(e){}returns},kss.setLocalVar=function(e,s){if(null===s)try{window.localStorage.removeItem(e)}catch(s){deletekss._localStorage[e]}else{s=kss.toJSON(s);try{window.localStorage.setItem(e,s)}catch(t){kss._localStorage[e]=s}}},kss.setLocalVars=function(e){kss.each(e,function(e,s){this.setLocalVar(s,e)},this)},kss._sessionStorage={},kss.getSessionVar=function(e){vars=null;try{s=window.sessionStorage.getItem(e)}catch(t){einkss._sessionStorage&&(s=kss._sessionStorage[e])}try{s=kss.parseJSON(s)}catch(e){}returns},kss.setSessionVar=function(e,s){if(null===s)try{window.sessionStorage.removeItem(e)}catch(s){deletekss._sessionStorage[e]}else{s=kss.toJSON(s);try{window.sessionStorage.setItem(e,s)}catch(t){kss._sessionStorage[e]=s}}},kss.setSessionVars=function(e){kss.each(e,function(e,s){this.setSessionVar(s,e)},this)},kss.getFormVar=function(e){if(e.disabled)returnnull;vars;switch((e.tagName||"").toLowerCase()){case"input":switch(e.type){case"text":case"hidden":case"password":returne.value;case"checkbox":case"radio":returne.checked?e.value:null;default:returnnull}case"textarea":returne.value;case"select":returne.multiple?(s=[],kss.each(e.options,function(e){e.selected&&s.push(e.value)}),s):e.value}if(kss.isArrayLike(e)){vart=[];returnkss.each(e,function(e){(s=kss.getFormVar(e))instanceofArray||(s=[s]),kss.each(s,function(e){null!==e&&t.push(e)})}),t.length?1==t.length?t[0]:t:null}returnvoid0===(s=e.value)&&(kss.warn("Not a form element!"),s=null),s},kss.getAllFormVars=function(e){vars={};returnkss.each(e.elements,function(e){e.name&&(s[e.name]=kss.getFormVar(e))}),s},kss._windows={_self:self,_parent:parent,_top:top},kss.openURL=function(e,s){vart={width:"60%",height:"60%",redirect:!1,focus:!0};kss.each(s,function(e,s){t[s]=e});varn=t.target||"_self",r=kss._windows[n]||{closed:!0},o=[];if(r.closed){vari=screen.availWidth,a=screen.availHeight;kss.each({width:i,height:a,left:i,top:a},function(e,s){"string"==typeoft[s]&&"%"==t[s].slice(-1)&&(t[s]=Math.round(e/100*parseInt(t[s])))}),!t.left&&t.width&&(t.left=Math.round((i-t.width)/2)),!t.top&&t.height&&(t.top=Math.round((a-t.height)/2)),kss.each(t,function(e,s){"target"!=s&&"redirect"!=s&&"focus"!=s&&o.push(s+"="+e)})}if(o=o.join(","),e)if(isFinite(e)&&!isNaN(e)){if(r.closed)return;r.history.go(parseInt(e))}elset.redirect&&!r.closed?r.location.replace(e):(r=window.open(e,n,o),"_blank"!=n&&(kss._windows[n]=r));else{if(r.closed)return;r.location.reload(!0)}t.focus&&r&&r.focus()},kss.registerActionProvider({replaceInnerHTML:function(e,s){kss.replaceInnerHTML(e,s.html)},replaceHTML:function(e,s){kss.replaceHTML(e,s.html)},appendHTML:function(e,s){kss.appendHTML(e,s.html)},prependHTML:function(e,s){kss.prependHTML(e,s.html)},insertHTMLAfter:function(e,s){kss.insertHTMLAfter(e,s.html)},insertHTMLBefore:function(e,s){kss.insertHTMLBefore(e,s.html)},deleteNode:function(e,s){kss.deleteNode(e)},setNodeAttr:function(e,s){kss.setNodeAttr(e,s.name,s.value)},setDataAttr:function(e,s){kss.setDataAttr(e,s.name,s.value)},setStyle:function(e,s){kss.setStyle(e,s.name,s.value)},setStyles:function(e,s){kss.setStyles(e,s)},addClass:function(e,s){kss.addClass(e,s.value)},removeClass:function(e,s){kss.removeClass(e,s.value)},toggleClass:function(e,s){kss.toggleClass(e,s.value)},setStateVar:function(e,s){kss.setStateVar(s.name,s.value)},setStateVars:function(e,s){kss.setStateVars(s)},setLocalVar:function(e,s){kss.setLocalVar(s.name,s.value)},setLocalVars:function(e,s){kss.setLocalVars(s)},setSessionVar:function(e,s){kss.setSessionVar(s.name,s.value)},setSessionVars:function(e,s){kss.setSessionVars(s)},openURL:function(e,s){vart=s.href;deletes.href,kss.openURL(t,s)},submit:function(e,s){kss.submit(e)},focus:function(e,s){kss.focus(e)},blur:function(e,s){kss.blur(e)},alert:function(e,s){alert(s.message)},log:function(e,s){vart=s.level;kss._logLevels.indexOf(t)<1&&(t="log"),kss[t](s.message)},error:function(e,s){thrownewError(s.message)}}),kss.registerParameterProvider({nodeAttr:function(e,s,t){returnkss.getNodeAttr(e,s,t)},dataAttr:function(e,s,t){returnkss.getDataAttr(e,s,t)},stateVar:function(e,s){returnkss.getStateVar(s)},localVar:function(e,s){returnkss.getLocalVar(s)},sessionVar:function(e,s){returnkss.getSessionVar(s)},formVar:function(e,s,t){if(s){varn;if(t){if(!(n=document.forms[t]))returnkss.warn('Form "'+t+'" does not exist.'),null}elseif(!(n=kss.cssQuery("@currentform",e)[0]))returnkss.warn("Element is not a child of a form."),null;if(!(e=n.elements[s]))returnkss.warn('Form element "'+s+'" does not exist.'),null}returnkss.getFormVar(e)},eventAttr:function(e,s){returnsinthis.event?this.event[s]:null},errorAttr:function(e,s){vart=this.event.detail;returntinstanceofError&&sint?t[s]:null},styleVal:function(e,s,t){returnt&&!(e=kss.cssQuery(t,e,!0)[0])?null:kss.getStyle(e,s)},hashTag:function(e,s){if("string"==typeofs){vart=s.lastIndexOf("#");returnt<0?"":s.slice(t)}returnwindow.location.hash},url:function(e,s){returnkss.toAbsoluteURL(s)},contains:function(e,s,t){returnkss.contains(s,t)},confirm:function(e,s){returnconfirm(s)},prompt:function(e,s,t){returnprompt(s,t||"")}}),kss.each(["innerText","textContent","innerHTML","outerHTML","clientWidth","clientHeight","offsetWidth","offsetHeight","scrollWidth","scrollHeight"],function(e){kss.registerParameterProvider(e,function(s,t){returnt&&!(s=kss.cssQuery(t,s,!0)[0])?null:s[e]})}),kss._historyre=/^#kss-[\w]+$/,kss._historyHash=window.location.hash,kss._loadHistoryHTML=function(e){vars=window.location.hash;if(kss._historyre.test(s)){vart=kss.getSessionVar(s);t&&kss.replaceHTML(document.body,t)}},window.addEventListener("load",kss._loadHistoryHTML,!1),kss._storeHistoryHTML=function(e){vars=kss._historyHash;kss._historyre.test(s)&&kss.setSessionVar(s,document.body.outerHTML)},window.addEventListener("unload",kss._storeHistoryHTML,!1),window.addEventListener("hashchange",function(e){vars=kss._historyHash,t=window.location.hash;s!=t&&(kss._storeHistoryHTML(),kss._historyHash=t,kss._loadHistoryHTML())},!1),kss.addHistoryState=function(){vare=window.location.hash;kss._historyre.test(e)||(kss._historyHash="#kss-"+kss.randomString(),window.location.replace(kss._historyHash)),window.location.hash="#kss-"+kss.randomString()},kss.registerActionProvider("addHistoryState",kss.addHistoryState),kss._TimeoutEventBinder=function(e){this.eventHandler=e,this.props=e.propertyGetter({delay:null,repeat:!0}),this.hasServerActions=kss.each(e.rule.actions,function(e){if("server"==e.type)return!0})||!1,this.setTimeout()},kss._TimeoutEventBinder.prototype={setTimeout:function(){vare=this.props("delay");if(isNaN(e))this.eventHandler.error('Not a number for timeout-delay: "'+e+'"');else{this.hasServerActions&&e<1e3&&(this.eventHandler.warn("Delay of timeout event must be at least 1000 for rules containing server actions"),e=1e3);vars=this;setTimeout(function(){s.timeout()},e)}},timeout:function(){vare=this.eventHandler.node;document.documentElement.contains(e)&&(this.eventHandler.dispatchEvent(),this.props("repeat")&&this.setTimeout())}},kss.registerEventBinder("timeout",kss._TimeoutEventBinder),kss._SpinnerOnEventBinder=function(e){this.eventHandler=e,this.props=e.propertyGetter({laziness:0,filter:null}),this.timer=null,this.counter=0},kss._SpinnerOnEventBinder.prototype={onstart:function(e,s){if("client"!=s.type){switch(e.eventname){case"spinneron":case"spinneroff":return}vart=this.props("filter");if((!t||kss.contains(t,s.name))&&(this.counter++,!this.timer)){varn=this;this.timer=setTimeout(function(){n.timeout()},this.props("laziness"))}}},oncomplete:function(e,s){if("client"!=s.type){switch(e.eventname){case"spinneron":case"spinneroff":return}vart=this.props("filter");t&&!kss.contains(t,s.name)||(this.counter--,!this.counter&&this.timer&&(clearTimeout(this.timer),this.timer=null))}},timeout:function(){this.eventHandler.dispatchEvent()}},kss.registerEventBinder("spinneron",kss._SpinnerOnEventBinder),kss._SpinnerOffEventBinder=function(e){this.eventHandler=e,this.props=e.propertyGetter({laziness:0,filter:null}),this.timer=null,this.counter=0},kss._SpinnerOffEventBinder.prototype={onstart:function(e,s){if("client"!=s.type){switch(e.eventname){case"spinneroff":return}vart=this.props("filter");t&&!kss.contains(t,s.name)||(this.counter++,this.timer&&(clearTimeout(this.timer),this.timer=null))}},oncomplete:function(e,s){if("client"!=s.type){switch(e.eventname){case"spinneroff":return}vart=this.props("filter");if((!t||kss.contains(t,s.name))&&(this.counter--,!this.counter&&!this.timer)){varn=this;this.timer=setTimeout(function(){n.timeout()},this.props("laziness"))}}},timeout:function(){this.timer=null,this.eventHandler.dispatchEvent()}},kss.registerEventBinder("spinneroff",kss._SpinnerOffEventBinder),kss._ErrorEventBinder=function(e){this.eventHandler=e},kss._ErrorEventBinder.prototype={oncomplete:function(e,s,t){t&&("error"!=e.eventname?(t.action=s,this.eventHandler.dispatchEvent(!1,!1,t)):e.error('Failed to execute action "'+s.name+'" for error event. Error was:\n'+t.message))}},kss.registerEventBinder("error",kss._ErrorEventBinder),kss._loadAnimationLib=function(){vare;functions(e,s,t){varn=s.container;if(deletes.container,(n=n?kss.cssQuery(n)[0]:t)===t){varr=e.id||e.name;r&&window.history.pushState?window.history.pushState({},"","#"+r):window.location.hash="#"+kss.randomString()}returnn}vart=window.Velocity||window.jQuery&&jQuery.Velocity,n=window.TweenMax||window.TweenLite;if("function"==typeoft)e="Velocity",kss.animate=function(e,n,r){varo={};kss.each(t.defaults,function(e,s){sinn&&(o[s]=n[s],deleten[s])});vari=n.behaviour||"queue";if(deleten.behaviour,kss.hasClass(e,"velocity-animating"))switch(i){case"ignore":return;case"combine":o.queue=!1;break;case"finish":t(e,"finish",!0);break;case"stop":t(e,"stop",!0);break;case"queue":default:o.queue=t.defaults.queue}n.reverse&&(r="reverse"),"scroll"==r?(o.axis=n.axis||["x","y"],o.container=s(e,n),o.queue=!1,kss.each(o.axis,function(s){if(o.axis=s,o.offset=n["offset-"+s]||n.offset||0,o.container){varr="x"==s?"scrollLeft":"scrollTop";o.offset=parseInt(o.offset)-o.container[r]}t(e,"scroll",o)})):t(e,r||n,o)},kss.scroll=function(e,s){kss.animate(e,s,"scroll")};elseif(n){e="GreenSock";varr=function(){vare=this.data;this.data=null,e&&e.play()};kss.animate=function(e,s){vart=s.duration||750;deletes.duration;varo=s.behaviour||"queue";deletes.behaviour;vari={};kss.each(s,function(e,s){i[kss.camelCase(s)]=e}),i.paused=!1;vara=n.getTweensOf(e);if(a.length)switch(o){case"ignore":return;case"combine":i.overwrite="auto";break;case"finish":kss.each(a,function(e){e.data=null,e.totalProgress(1).kill()});break;case"stop":i.overwrite="all",kss.each(a,function(e){e.data=null});break;case"queue":default:i.paused=!0}i.onComplete=r;varc=n.to(e,t/1e3,i);i.paused&&(a[a.length-1].data=c)},window.ScrollToPlugin&&(kss.scroll=function(e,t){t.scrollTo=e,kss.animate(s(e,t,window),t)})}elsewindow.jQuery?(e="jQuery",kss.animate=function(e,s){vart={duration:s.duration,easing:s.easing,queue:s.queue};deletes.duration,deletes.easing,deletes.queue;varn=s.behaviour||"queue";deletes.behaviour;varr=$(e);if(r.is(":animated"))switch(n){case"ignore":return;case"combine":t.queue=!1;break;case"finish":r.finish();break;case"stop":r.stop(!0);break;case"queue":default:t.queue=!0}r.animate(s,t)},kss.scroll=function(e,t){varn=$(e).offset();t.scrollTop=n.top,t.scrollLeft=n.left,kss.animate(s(e,t,"html, body"),t)}):window.MooTools&&window.Fx&&Fx.Morph&&(e="MooTools",kss.animate=function(e,s){vart={};s.duration&&(t.duration=s.duration),deletes.duration,s.transition&&(t.transition=s.transition),deletes.transition;varn=s.behaviour||"queue";deletes.behaviour;varr=$(e).get("morph");if(r.isRunning())switch(n){case"ignore":return;case"stop":t.link="cancel";break;case"combine":case"finish":kss.warn('Animation behaviour "'+n+'" not supported');case"queue":default:t.link="chain"}r.setOptions(t),r.start(s)},Fx.Scroll&&(kss.scroll=function(e,t){newFx.Scroll(s(e,t,window),t).toElement(e,["x","y"])}));returnkss.animate||(kss.animate=function(e,s){kss.each(s,function(s,t){switch(t){case"scrollLeft":case"scrollTop":kss.setNodeAttr(e,t,s);break;default:kss.setStyle(e,t,s)}})}),kss.scroll||(kss.scroll=function(e,s){window.location.hash=e.id||kss.randomString(),e.scrollIntoView()}),kss.registerActionProvider("animate",kss.animate),kss.registerActionProvider("scroll",kss.scroll),e};