if(!Array.prototype.filter){Array.prototype.filter=function(e,d){var b=this.length;if(typeof e!="function"){throw TypeError("First parameter to Array.filter() should be a function.")}var a=[];for(var c=0;c<b;c++){if(c in this){var f=this[c];if(e.call(d,f,c,this)){a.push(f)}}}return a}}Array.prototype.liveFilter=function(c,b){if(typeof c=="function"){for(var a=0;a<this.length;a++){if(a in this&&!c.call(b,this[a],a,this)){this.splice(a--,1)}}}return this};Array.prototype.cleanUp=function(){return this.filter(function(a){return !!a||a===0||a===""})};Array.prototype.remove=function(d,b){var a=-1,c=-1;do{c=this.indexOf(d);if(c>-1){this.splice(c,1);a=c}}while(c>-1&&!b);return a};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(b,c){var a=this.length;c=Number(arguments[1])||0;c=(c<0)?Math.ceil(c):Math.floor(c);if(c<0){c+=a}for(;c<a;c++){if(c in this&&this[c]===b){return c}}return -1}}Array.prototype.contains=function(a){return this.indexOf(a)>-1};Array.prototype.diff=function(a){return this.filter(function(b){return a.indexOf(b)==-1})};Array.prototype.intersect=function(a){return this.filter(function(b){return a.indexOf(b)>-1})};if(!Array.prototype.map){Array.prototype.map=function(e,d){if(typeof e!="function"){return[]}var a=this.length;var c=new Array(a);for(var b=0;b<a;b++){if(b in this){c[b]=e.call(d,this[b],b,this)}}return c}}Array.prototype.addAt=function(a,b,c){if(c){this.splice(a,1)}if(b&&b.sort&&b.filter&&b.splice){b=b.clone();b.splice(0,0,a,0);Array.prototype.splice.apply(this,b);return b.length-2}else{if(b||b===0||b===""){this.splice(a,0,b);return 1}}return 0};Array.prototype.replace=function(d,c){if(d.call){var a=this.length;for(var b=a-1;b>=0;b--){var e=d.call(c,this[b],b,this);this.addAt(b,e,true)}}return this};if(!Array.prototype.forEach){Array.prototype.forEach=function(d,c){var a=this.length;if(typeof d!="function"){return[]}for(var b=0;b<a;b++){if(b in this){d.call(c,this[b],b,this)}}return this}}Array.prototype.iterate=function(e,d,b){var a=this.length;if(typeof e!="function"){return[]}if(b){for(var c=a;c>=0;c--){if(c in this&&e.call(d,this[c],c,this)===false){break}}}else{for(var c=0;c<a;c++){if(c in this&&e.call(d,this[c],c,this)===false){break}}}return this};Array.prototype.unique=function(){var a=[];this.forEach(function(b){if(a.indexOf(b)==-1){a.push(b)}});return a};Array.prototype.sum=function(){var a=0;this.forEach(function(b){a+=parseFloat(b)});return a};if(!Array.prototype.max){Array.prototype.max=function(){return Math.max.apply(Math,this)}}if(!Array.prototype.min){Array.prototype.min=function(){return Math.min.apply(Math,this)}}Array.prototype.average=function(){return this.sum()/this.length};Array.prototype.last=function(){return this[this.length-1]};Array.prototype.clone=function(){var a=[];this.forEach(function(b){a.push(b)});return a};Array.prototype.equals=function(a){if(!a||a.length!=this.length){return false}for(var b=0;b<this.length;b++){if(this[b]!==a[b]){return false}}return true};if(!String.prototype.trim){String.prototype.trim=function(){return this.replace(/((^\s+)|(\s+$))/g,"")}}String.prototype.startsWith=function(){for(var a=0;a<arguments.length;a++){var b=arguments[a].toString();if(this.length>=b.length&&this.indexOf(b)==0){return true}}return false};String.prototype.endsWith=function(){for(var a=0;a<arguments.length;a++){var b=arguments[a].toString();if(this.length>=b.length&&this.lastIndexOf(b)==this.length-b.length){return true}}return false};String.prototype.equalsIgnoreCase=function(a){a=a||"";a=a.toString();return(this.toLowerCase()==a.toLowerCase())};String.prototype.contains=function(){for(var a=0;a<arguments.length;a++){var b=arguments[a]||"";if(this.indexOf(b)>-1){return true}}return false};String.prototype.urlencode=function(){result=escape(this).replace(/\+/g,"%2B");result=result.replace(/(?:%([0-9A-F]{2}))/gi,function(a){charCode=parseInt(a.replace("%",""),16);if(charCode>=128&&a.length<4){return a.replace("%","%u00")}else{return a}});return result.replace("%25","%u0025")};String.prototype.escapeHTML=function(){return this.replace(/</g,"&lt;").replace(/>/g,"&gt;")};String.prototype.stripHTML=function(){var a=jAsset.util.toArray(arguments);if(a.length>0){return this.replace(new RegExp("</?("+a.join("|")+").*?>","gi"),"")}else{return this.replace(/<\/?.+?>/gi,"")}};String.prototype.escapeRegex=function(){return this.replace(/\*|\-|\\|\]|\[/g,function(b){return"\\"+b})};String.prototype.toRegex=function(a){a=a||"";return new RegExp(this.escapeRegex(),a)};String.prototype.camelCase=function(a){a=a||"-";a=a.escapeRegex();return this.replace(new RegExp(a+"(.)","g"),function(c,b){return b.toUpperCase()})};String.prototype.from=function(b){var a=this.lastIndexOf(b);return a>-1?this.substr(a):""};String.prototype.to=function(b){var a=this.indexOf(b);return a>-1?this.substr(0,a):""};(function(){try{var a="ddd"=="abc".replace(/./g,function(c){return"d"})}catch(b){var a=false}if(!a){String.prototype._replace=String.prototype.replace;String.prototype.replace=function(h,j){if(typeof j!="function"){return this._replace(h,j)}var k=j;if(!(h instanceof RegExp)){var d=this.indexOf(h);return(d==-1)?this:this._replace(h,k(h,d,this))}var c=[],e=h.lastIndex,g;while((g=h.exec(this))!=null){var d=g.index,f=g.concat(d,this);c.push(this.slice(e,d),k.apply(null,f).toString());if(!h.global){e+=RegExp.lastMatch.length;break}else{e=h.lastIndex}}c.push(this.slice(e));return c.join("")}}})();Function.prototype.curry=function(a,b){if(!a||!a.length){return this}var c=this;return function(){var e=a.clone();var d=0;for(var f=0;f<e.length;f++){if(!e[f]&&e[f]!==0&&e[f]!==""){e[f]=arguments[d++]}}if(d<arguments.length){for(;d<arguments.length;d++){e.push(arguments[d])}}b=b||this;return c.apply(b,e)};return result};Function.dummy=function(){};Function.identity=function(b){return b};["round","floor","ceil"].forEach(function(a){Math["_"+a]=Math[a];Math[a]=function(d,b){b=Math.abs(parseInt(b))||0;var c=Math.pow(10,b);return Math["_"+a](d*c)/c}});var jAsset={version:"0.0.16",scriptElement:document.getElementsByTagName("script")[0]};jAsset.constrain=function(b,c,a){return Math.min(a,Math.max(b,c))};jAsset.each=function(e,d,c){if(!jAsset.util.isFunction(d)){throw Error("The second argument in jAsset.each() must be a function")}c=c||e;for(var b in e){if(e.hasOwnProperty&&e.hasOwnProperty(b)){var a=d.call(c,e[b],b);if(jAsset.util.exists(a)){return a}}}return null};jAsset.attach=function(a,c,e,d){var b=function(f,g){if(e||!(g in a)){a[g]=f}};if(d){d.forEach(function(f){b(c[f],f)})}else{jAsset.each(c,b)}return a};jAsset.clone=function(b){if(!jAsset.util.exists(b)||!b.clone&&b.constructor!=Object){return b}if(b.clone){var a=b.clone()}else{var a={};jAsset.each(b,function(c,d){a[d]=jAsset.clone(c)})}return a};jAsset.serialize=function(d,c,b){c=c||"&";b=b||"=";var a="";jAsset.each(d,function(f,e){a+=c+e;if(f){a+=b+f}});return a.substring(c.length)};jAsset.get=function(a,b){if(!a){a=b;b=null}if(jAsset.util.isString(a)){return jAsset.selector?jAsset.selector.get(a,b):jAsset.getByTag(a,b)}if(jAsset.util.isString(b)){return jAsset.selector?jAsset.selector.get(b,a):jAsset.getByTag(b,a)}return jAsset.extend(jAsset.util.toArray(a))};jAsset.getFirst=function(a,b){return jAsset.get(a,b)[0]||null};jAsset.getById=function(b){if(!arguments.callee.__native){arguments.callee.__native=document.getElementById?function(c){return document.getElementById(c)}:(function(){var c=document.all||document.layers||[null];return function(d){return c[d]}})()}result=arguments.callee.__native(b);if(result&&result.id!=b&&document.all){if(document.all[b]){for(var a=0;a<document.all[b].length;a++){if(document.all[b][a].id==b){result=document.all[b][a];break}else{result=null}}}}return(result)?jAsset.extend(result)[0]:null};jAsset.getByClass=function(d,a,b){d=jAsset.util.toArray(d);a=a||"*";b=b||document;if(b.getElementsByClassName&&!jAsset.support.bugs.mutipleClasses()){var c=jAsset.util.toArray(b.getElementsByClassName(d.join(" ")));if(a!="*"){c=c.filter(function(e){return e.nodeName.equalsIgnoreCase(a)})}}else{if(b.querySelectorAll){var f=a+"."+d.join(".");try{return jAsset.extend(b.querySelectorAll(f))}catch(g){}}var c=jAsset.getByTag(a,b);d.replace(function(e){return new RegExp("(^|\\s+)"+e+"($|\\s+)","i")});c=c.filter(function(h){if(!h.className){return false}for(var e=0;e<d.length;e++){if(!d[e].test(h.className)){return false}}return true})}return jAsset.extend(c)};jAsset.getByTag=function(d,c,e){d=d||"*";d=d.split(/\s*,\s*/);c=c||document;var b=[];if(d.length>1){d.forEach(function(f){b=b.concat(jAsset.getByTag(f,c,true))})}else{var a=d[0];if(c.getElementsByTagName){b=jAsset.util.toArray(c.getElementsByTagName(a))}else{if(c.all&&c.all.tags){b=jAsset.util.toArray(c.all.tags(a))}}if(a=="*"){if(!jAsset.support.asteriscTag()&&c.all){b=jAsset.util.toArray(c.all)}if(jAsset.support.bugs.commentsAsElements()){b=b.filter(jAsset.util.isElement)}}}return e?b:jAsset.extend(b)};jAsset.matches=function(b,a){if(!a||!jAsset.util.isElement(b)){return false}if(!/^[a-z*]$/i.test(a)&&jAsset.selector){return jAsset.selector.matches(b,a)}return a=="*"||a.equalsIgnoreCase(b.nodeName)};jAsset.module=function(c,b,d,a){(jAsset.module.all=jAsset.module.all||[]).push(this);this.dependencies=c||[];this.elementMethods=[];if(b){jAsset.attach(jAsset.support,b)}if(d){jAsset.attach(jAsset.support.bugs,d)}if(a){jAsset.attach(jAsset.util,a)}};jAsset.module.prototype={chainLink:function(e,a,d){if(!jAsset.util.isString(e)){throw Error(e+" is not a String")}if(!jAsset.util.isFunction(a)){throw Error("The function passed for "+e+" is not a valid function")}d=d||{};d.type=d.type||"middle";if(d.tags){var c=d.tags.split(/\s+/gi);var b=new RegExp("^("+c.join("|")+")$","i")}this[e]=function(m){var g=jAsset.util.toArray(arguments),k;if(d.type!="start"){if(jAsset.util.isGettable(this)){m=this;k=jAsset.util.isArray(this)?this:[this]}else{m=m||"*";if(!jAsset.util.isGettable(m)){throw Error("The function "+e+"() was called without HTMLElement(s) as a context or first argument")}else{g.splice(0,1)}k=jAsset.get(m)}if(d.type=="middle"&&!k.length){return[]}}else{m=jAsset.util.is("bindable",this)?this:jAsset.util.is("bindable",g.last())?g.last():document}if("preProcess" in d){if(jAsset.util.isFunction(d.preProcess)){g=d.preProcess.apply(k,[g])}else{throw TypeError("preProcess is specified on "+e+" but it isn't a valid function")}}if(g){if(d.type=="start"){return a.apply(m,g)}var j=[];for(var h=0;h<k.length;h++){if(!(h in k)||!k[h]){continue}if(b&&!b.test(k[h].nodeName)){continue}var f=a.apply(k[h],g);if(d.type=="middle"&&f){h+=k.addAt(h,f,true)-1}if(d.type=="end"){switch(d.multiple){case"or":if(f===true){return true}break;case"and":if(f===false){return false}break;case"first":return f;case"all":default:j.push(f)}}}if(d.type=="end"){switch(d.multiple){case"or":return false;case"and":return true;case"all":default:return jAsset.util.isElement(m)&&!d.forceArray?j[0]:j}}else{jAsset.extend(k=k.unique());if(jAsset.util.isElement(m)&&!d.forceArray){if(k[0]||k[0]===null){return k[0]}if(m){return m}if(jAsset.util.isArray(this)&&this[0]){return this[0]}else{if(!(this instanceof jAsset.module)){return this}}return null}else{if(this instanceof jAsset.module){return k||[]}return k||jAsset.util.toArray(this)||[]}}}else{return(d.multiple=="all")?[]:null}};this.__addToProto(e,c);Array.prototype[e]=this[e];this[e].options=d;this[e].internal=a;return this},alias:function(a,f,c,b){var d=b||this;var e=d[f];if(!e){throw Error("Function "+f+" does not exist in the module specified")}var g=c?e.internal.curry(c):e.internal;this.chainLink(a,g,e.options)},__addToProto:function(c,b){var e=this[c];if(b){b.forEach(function(f){var g=window["HTML"+a(f)+"Element"];if(g&&g.prototype){g.prototype[c]=e}else{jAsset.module.prototype.extend=jAsset.module.prototype._extend}},this)}else{var d=window.HTMLElement||window.Element;if(d&&d.prototype){d.prototype[c]=e}else{jAsset.module.prototype.extend=jAsset.module.prototype.__extend}if(window.HTMLDocument&&window.HTMLDocument.prototype){HTMLDocument.prototype[c]=e}else{document[c]=e;jAsset.module.prototype.extend=jAsset.module.prototype.__extend}}this.elementMethods.push(c);function a(f){f=f.toLowerCase();var g={optgroup:"OptGroup",textarea:"TextArea",p:"Paragraph",fieldset:"FieldSet",ul:"UList",ol:"OList",dl:"DList",dir:"Directory",h1:"Heading",q:"Quote",ins:"Mod",a:"Anchor",img:"Image",caption:"TableCaption",col:"TableCol",colgroup:"TableCol",thead:"TableSection",tr:"TableRow",th:"TableCell",frameset:"FrameSet",iframe:"IFrame"};g.h6=g.h5=g.h4=g.h3=g.h2=g.h1;g.tfoot=g.tbody=g.thead;g.del=g.ins;g.td=g.th;if(g[f]){return g[f]}return f.replace(/^./,function(h){return h.toUpperCase()})}return e},__extend:function(a){if(a&&a.forEach){a.forEach(function(b){this.elementMethods.forEach(function(c){try{if(!b[c]){b[c]=this[c]}}catch(d){}},this)},this)}},extend:function(a){if(jAsset.util.is("window",a)||(jAsset.util.isArray(a)&&a.indexOf(window)>-1)){this.__extend(a)}},meetsDependencies:function(){for(var a=0;a<this.dependencies.length;a++){if(!jAsset.enabled(this.dependencies[a])){return false}}return true}};jAsset.enabled=function(a){return(jAsset[a] instanceof jAsset.module&&jAsset[a].meetsDependencies())?jAsset[a]:false};jAsset.extend=function(a){if(a){if(!jAsset.util.isArray(a)){return jAsset.get(a)}if(jAsset.module.prototype.extend){jAsset.module.all.forEach(function(b){if(b.extend){b.extend(a)}})}}return a};jAsset.registerNamespace=function(a,b){var d=a.split("."),c=b||window;d.forEach(function(e){if(!c[e]){c[e]={}}c=c[e]});return c};jAsset.util=new jAsset.module();jAsset.util.is=function(b,c){if(!b){return true}if(arguments.length==2&&b.toLowerCase){b=b.toLowerCase();if(!jAsset.util.exists(c)){return false}switch(b){case"collection":return(!!c.item||!!c.callee||jAsset.util.isArray(c))&&!jAsset.util.is("window",c);case"emptycollection":return jAsset.util.is("collection",c)&&!c.length;case"htmlelement":return c.nodeType==1;case"window":return !!c.window;case"document":return !!c.getElementById;case"bindable":return jAsset.util.is(["HTMLElement","document","window"],c);case"gettable":return jAsset.util.is(["bindable","collection","string"],c);default:return Object.prototype.toString.call(c).toLowerCase()=="[object "+b+"]"}}else{if(arguments.length>2){for(var a=arguments.length-1;a>0;a--){if(jAsset.util.is(b,arguments[a])){return true}}return false}else{for(var a=0;a<b.length;a++){if(jAsset.util.is(b[a],arguments[1])){return true}}return false}}};jAsset.util.isString=function(a){return Object.prototype.toString.call(a)==="[object String]"};jAsset.util.isNumber=function(a){return Object.prototype.toString.call(a)==="[object Number]"};jAsset.util.isFunction=function(a){return Object.prototype.toString.call(a)==="[object Function]"};jAsset.util.isArray=function(a){return Object.prototype.toString.call(a)==="[object Array]"};jAsset.util.isCollection=jAsset.util.is.curry(["collection"]);jAsset.util.isEmptyCollection=jAsset.util.is.curry(["emptycollection"]);jAsset.util.isElement=function(a){return a&&a.nodeType==1};jAsset.util.isGettable=jAsset.util.is.curry(["gettable"]);jAsset.util.getNative=function(b){if(b===null){return"null"}if(b===jAsset.undefined){return"undefined"}var a=Object.prototype.toString.call(b).match(/^\[object\s+(.*?)\]$/)[1];a=a?a.toLowerCase():"";if(a=="number"&&isNaN(b)){a="NaN"}return a};jAsset.util.exists=function(a){return !!a||a===0||a===""};jAsset.util.toArray=function(d){if("useSlice" in arguments.callee){arguments.callee.useSlice=false;try{Array.prototype.slice.call(document.getElementsByTagName("script"),0);arguments.callee.useSlice=true}catch(c){}}if(!jAsset.util.exists(d)){return[]}if(jAsset.util.isArray(d)){return d}else{if(d.toArray){return d.toArray()}else{if(jAsset.util.isCollection(d)){if(arguments.callee.useSlice){return Array.prototype.slice.call(d,0)}else{var a=new Array(d.length);for(var b=d.length-1;b>=0;b--){a[b]=d[b]}return a}}else{return[d]}}}};jAsset.util.getDate=function(d,b){if(!("offsetRegex" in arguments.callee)){arguments.callee.offsetRegex=/((\+|\-|^)[0-9]+(s|min|h|d|w|m|y))+$/i}b=(new Date(b)).getTime()||jAsset.util.now();if(jAsset.util.isNumber(d)){d=d*86400000||0;var a=new Date(b+d)}else{if(jAsset.util.isString(d)){var a=new Date();d=d.replace(/\s+/g,"");if(d.match(jAsset.util.getDate.offsetRegex)){d=d.replace(/(\+|\-)/g," $1").split(" ");if(d[0]==""){d.splice(0,1)}var c=/(?:\+|\-|^)(?:[0-9]+)(s|min|h|d|w|m|y)$/i;d.forEach(function(f){var e=parseInt(f);var g=f.match(c)[1];var h="Date";switch(g){case"s":h="Seconds";break;case"min":h="Minutes";break;case"h":h="Hours";break;case"w":e*=7;break;case"m":h="Month";break;case"y":h="FullYear";break}a["set"+h](a["get"+h]()+e)})}else{a=new Date(d);if(isNaN(a)){a=null}}}else{if(d instanceof Date){var a=d}}}return a||new Date(b)};jAsset.util.getDate.offsetRegex=/((\+|\-|^)[0-9]+(s|min|h|d|w|m|y))+$/i;jAsset.util.preload=function(a){var b=(jAsset.util.isArray(a))?a:jAsset.util.toArray(arguments);b.forEach(function(c){(new Image()).src=c})};jAsset.util.now=function(){return(new Date()).getTime()};jAsset.util.convertCSSProperty=function(b,a){if(!jAsset.util.isString(b)){return b}if(a&&/(css|style)Float/.test(b)){return"float"}if(!a&&/float$/i.test(b)){return(jAsset.support.cssProperty("styleFloat")?"style":"css")+"Float"}if(a){return b.replace(/([A-Z])/g,"-$1").toLowerCase()}else{return b.camelCase()}};jAsset.util.offset=function(d,c,e){d=d||0;c=c||0;var a=parseFloat(d)+parseFloat(c);if(isNaN(a)&&jAsset.Color.is(d)){return(new jAsset.Color(d)).add(c)}if(!e){var b=d.toString().match(/^\-?[0-9]+\.?[0-9]*([a-z%]+)$/);b=b?b[1]:0}return a+(e?b:0)};jAsset.util.range=function(a,b){a=parseFloat(a,10);b=parseFloat(b,10);this.smaller=(a<b)?a:b;this.larger=(a<b)?b:a;this.isWithin=function(c){return(this.smaller<=c&&this.larger>=c)};this.isWithinStrict=function(c){return(this.smaller<c&&this.larger>c)}};jAsset.support=new jAsset.module(["util"]);jAsset.support.cssProperty=function(b){if(!b){return false}if(b=="float"){return arguments.callee("cssFloat")||arguments.callee("styleFloat")}else{if(!/^(css|style)Float$/.test(b)){b=jAsset.util.convertCSSProperty(b)}var a=document.documentElement||document.body;return b in a.style}};jAsset.support.rgba=function(){if(!("result" in arguments.callee)){var b=jAsset.scriptElement.style.color;var a="rgba(0, 0, 0, 0.5)";if(jAsset.scriptElement.style.color==a){arguments.callee.result=true}else{try{jAsset.scriptElement.style.color=a}catch(c){}arguments.callee.result=jAsset.scriptElement.style.color!=b;jAsset.scriptElement.style.color=b}}return arguments.callee.result};jAsset.support.vendorPrefix=function(b){if(b){return jAsset.support.vendorPrefix()+jAsset.util.convertCSSProperty(b)}if("result" in arguments.callee){return arguments.callee.result}var a=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/;for(var c in jAsset.scriptElement.style){if(a.test(c)){return arguments.callee.result=c.match(a)[0]}}if("WebkitOpacity" in jAsset.scriptElement.style){return"Webkit"}if("KhtmlOpacity" in jAsset.scriptElement.style){return"Khtml"}return arguments.callee.result=""};jAsset.support.asteriscTag=function(){if("result" in arguments.callee){return arguments.callee.result}return arguments.callee.result=document.getElementsByTagName("*").length!==0};jAsset.support.bugs={commentsAsElements:function(){if("result" in arguments.callee){return arguments.callee.result}var a=document.createElement("div");if(document.createComment){a.appendChild(document.createComment("test"))}return arguments.callee.result=jAsset.support.asteriscTag()?a.getElementsByTagName("*").length!==0:(a.all?a.all.length!==0:false)},mutipleClasses:function(){if("result" in arguments.callee){return arguments.callee.result}if(!document.getElementsByClassName){return arguments.callee.result=false}var c="jAsset-test-";var d=document.createElement("div");var b=jAsset.util.now();d.className=c+b+"1 "+c+b;d=document.body.appendChild(d);var a=!document.getElementsByClassName(c+b).length;document.body.removeChild(d);return arguments.callee.result=a}};jAsset.Color=function(a,c,b){if(a instanceof jAsset.Color){this.colorSpace=a.colorSpace;this.alpha=a.alpha;this.components=a.components.clone();if(a.hasOwnProperty("toString")){this.toString=a.toString}}else{this.colorSpace=b||jAsset.Color.csRGB;this.alpha=c||1;this.components=this.colorSpace.parse(a);if(!this.components){if(!b){jAsset.each(jAsset.Color,function(e,d){if(e instanceof jAsset.Color.Space){this.components=e.parse(a);if(this.components){this.colorSpace=e;return true}}return null},this)}if(!this.components){throw Error("Invalid color for the "+this.colorSpace.name+" color space.")}}if(this.components){this.alpha=this.alpha||this.components.alpha||1;this.components=this.components.components;this.toString=function(){return this.colorSpace.toAlphaString(this.components)}}}};jAsset.Color.prototype={toRGB:function(){return this.colorSpace.toRGB(this.components)},toColorSpace:function(a){if(!(a instanceof jAsset.Color.Space)){throw Error("The first argument to jAsset.Color.toColorSpace() must be an instance of jAsset.Color.Space.")}if(a==this.colorSpace){return this.clone()}return new jAsset.Color(a.fromRGB(this.toRGB()),this.alpha,a)},toColorSpaceArray:function(a){if(!(a instanceof jAsset.Color.Space)){throw Error("The first argument to jAsset.Color.toColorSpace() must be an instance of jAsset.Color.Space.")}if(a==this.colorSpace){return this.components}return a.fromRGB(this.toRGB())},toHexString:function(){return"#"+this.toRGB().map(function a(b){b=parseInt(b,10)||"00";b=b.toString(16).toUpperCase();return(b.length==1?"0":"")+b}).join("")},complementary:function(){var a=this.toColorSpaceArray(jAsset.Color.csHSL);a[0]=(a[0]+180)%360;a=new jAsset.Color(a,this.alpha,jAsset.Color.csHSL);return a.toColorSpace(this.colorSpace)},overlay:function(){var k=this.red,j=this.green,c=this.blue,d=this.alpha;for(var h=0;h<arguments.length;h++){try{var f=(arguments[h] instanceof jAsset.Color)?arguments[h]:new jAsset.Color(arguments[h])}catch(m){continue}k+=(f.red-k)*f.alpha;j+=(f.green-j)*f.alpha;c+=(f.blue-c)*f.alpha;d+=(1-d)*f.alpha}return new jAsset.Color(k,j,c,d)},add:function(){var k=this.red,j=this.green,c=this.blue,e=this.alpha;for(var h=0;h<arguments.length;h++){if(jAsset.util.isNumber(arguments[h])){if(Math.abs(arguments[h])>=1){k+=arguments[h];j+=arguments[h];c+=arguments[h]}else{e+=arguments[h]}}else{var f=(arguments[h] instanceof jAsset.Color)?arguments[h]:new jAsset.Color(arguments[h]);k+=f.red;j+=f.green;c+=f.blue;e+=f.alpha}}var d=function(b,a){return Math.max(-a,Math.min(b,a))};k=d(k,255);j=d(j,255);c=d(c,255);e=d(e,1);return new jAsset.Color(k,j,c,e)},divide:function(e,j){var h=this.red,f=this.green,c=this.blue,d=this.alpha;e=(jAsset.util.isNumber(e))?[e,e,e,e]:e;e=(e instanceof jAsset.Color)?e:new jAsset.Color(e);h/=e.red;f/=e.green;c/=e.blue;d/=e.alpha;return j?h:new jAsset.Color(h,f,c,d)},subtract:function(e){var h=this.red,f=this.green,c=this.blue,d=this.alpha;e=(e instanceof jAsset.Color)?e:new jAsset.Color(e);h-=e.red;f-=e.green;c-=e.blue;d-=e.alpha;return new jAsset.Color(h,f,c,d)},clone:function(){return new jAsset.Color(this)},toString:jAsset.Color.prototype.toHexString};jAsset.attach(jAsset.Color,{is:function(a){return !!(jAsset.Color.csRGB.parse(a)||jAsset.Color.csHSL.parse(a))}});jAsset.Color.Space=function(b,a){if(!a||!a.components||!a.toRGB||!a.fromRGB){throw Error("Insufficient parameters to create a new jAsset.Color.Space")}this.components=a.components;this.axes=[];this.min=[];this.max=[];this.suffix=[];for(var c in this.components){this.axes.push(c);this.components[c].min=this.components[c].min||0;this.components[c].max=this.components[c].max||100;this.min.push(this.components[c].min);this.max.push(this.components[c].max);this.suffix.push(this.components[c].suffix||"");this.components[c].stops=this.components[c].stops||[];this.components[c].stops.splice(0,0,this.components[c].min);this.components[c].stops.push(this.components[c].max)}this.name=b;this.toRGB=a.toRGB;this.fromRGB=a.fromRGB;this.parseString=a.parseString||this.parseString;this.keywords=a.keywords||{};this.attach()};jAsset.Color.Space.prototype={parse:function(a){var b=false;var c=false;a=this.keywords[a]||a;if(jAsset.util.isString(a)){b=this.parseString(a)}else{if(jAsset.util.isArray(a)){b=a}else{if(jAsset.util.isNumber(a)){b=[];b[2]=a%256;b[1]=(a%65536-b[2])/256;b[0]=a/65536-b[1]/256-b[2]/65536}else{if(a instanceof jAsset.Color){b=this.fromRGB(a.toRGB());c=a.alpha}else{if(jAsset.util.getNative(a)=="object"){b=[];this.axes.iterate(function(d,e){if(d in a){b[e]=a[d]}else{b=false;return false}return true});if(b&&a.alpha){b.push(a.alpha)}}}}}}if(b){if(b.length>this.axes.length){c=parseFloat(b.pop())}return{components:b.map(Math.round),alpha:c}}else{return false}},parseString:function(a){var d="^"+this.name.toLowerCase()+"a?\\(";for(var c=0;c<this.axes.length;c++){d+="(\\-?[0-9]{1,3})";d+=this.suffix[c]?this.suffix[c]+"?":"";d+=c<this.axes.length-1?",\\s*":""}d+="(?:,\\s*(\\-?[0-1]|(?:[0-1]?\\.[0-9]+)?))?\\)";d=new RegExp(d,"i");var e;if(jAsset.util.isString(a)){var e=a.match(d);if(e&&e.length>1){var b=e.cleanUp().slice(1);b=b.map(function(g,f){if(f<this.axes.length){return parseInt(jAsset.constrain(this.min[f],g,this.max[f]),10)}else{return parseFloat(jAsset.constrain(0,g,1))}},this);return b}}return false},toString:function(){return this.name},toColorString:function(a){var b=this.name.toLowerCase()+"(";a.forEach(function(c,d){b+=c+this.suffix[d]+","},this);return b.substring(0,b.length-1)+")"},toAlphaString:function(a,d,c){var b=this.toColorString(a);if(d<1||c){b=b.replace("(","a(").substring(0,b.length-1)+","+d+")"}return b},getDimension:function(){var a=this.axes.clone();a.forEach(function(b,c){a[c]=this.components[b].stops.length},this);return a},getAverageColor:function(){var a=[];this.axes.forEach(function(b){a.push(Math.round(this.components[b].stops.average()))},this);return new jAsset.Color(a,1,this)},attach:function(){var b=this;for(var a=0;a<this.axes.length;a++){var c=this.axes[a];if(c in jAsset.Color.prototype){c+=this.name}jAsset.Color.prototype[c]=(function(d){return function(e){if(arguments.length){e=parseFloat(e);e=Math.max(e,b.min[d]);e=Math.min(e,b.max[d]);if(this.colorSpace==b){this.components[d]=e}else{var f=this.toColorSpaceArray(b);f[d]=e;this.components=this.colorSpace.fromRGB(b.toRGB(f))}return this}return b.fromRGB(this.toRGB())[d]}})(a);jAsset.Color.prototype["to"+this.name+"String"]=function(){return b.toColorString(this.toColorSpaceArray(b))};jAsset.Color.prototype["to"+this.name+"AString"]=function(d){return b.toColorString(this.toColorSpaceArray(b),this.alpha,d)};jAsset.Color.prototype["to"+this.name+"Color"]=function(d){return this.colorSpace==b?this:this.toColorSpace(b)}}}};jAsset.Color.csRGB=new jAsset.Color.Space("RGB",{components:{red:{max:255},green:{max:255},blue:{max:255}},toRGB:Function.identity,fromRGB:Function.identity,parseString:function(a){var b=/^#([0-9A-F]{1,2})([0-9A-F]{1,2})([0-9A-F]{1,2})$/i,d;if(jAsset.util.isString(a)){var c=jAsset.Color.Space.prototype.parseString.call(this,a);if(c){return c}d=a.match(b);if(d&&d.length>1){return d.slice(1).map(function e(f){if(f.length==1){f+=f}return parseInt(f,16)||0})}}return false},keywords:{aqua:"#00FFFF",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blue:"#0000FF",brown:"#A52A2A",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",crimson:"#DC143C",cyan:"#00FFFF",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",gold:"#FFD700",gray:"#808080",green:"#008000",honeydew:"#F0FFF0",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lime:"#00FF00",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",moccasin:"#FFE4B5",navy:"#000080",olive:"#808000",orange:"#FFA500",orchid:"#DA70D6",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",purple:"#800080",red:"#FF0000",salmon:"#FA8072",sienna:"#A0522D",silver:"#C0C0C0",snow:"#FFFAFA",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",yellow:"#FFFF00"}});if(jAsset.support.rgba()){jAsset.Color.prototype.toString=jAsset.Color.prototype.toRGBAString}jAsset.Color.csHSL=new jAsset.Color.Space("HSL",{components:{hue:{max:360,stops:[60,120,180,240,300]},saturation:{suffix:"%"},lightness:{suffix:"%",stops:[50]}},toRGB:function(c){var g=parseInt(c[0],10)/360+2/3;s=parseInt(c[1],10)/100;l=parseInt(c[2],10)/100;var b=l+s*(l<=0.5?l:1-l),e=2*l-b;var d=[];for(var f=0;f<3;f++){g-=1/3;var a=g+(g<0?1:(g>1?-1:0));if(6*a<1){d[f]=e+(b-e)*a*6}else{if(2*a<1){d[f]=b}else{if(3*a<2){d[f]=e+(b-e)*(2/3-a)*6}else{d[f]=e}}}d[f]=Math.round(255*d[f])}return d},fromRGB:function(c){var b=new Array(3),e=c.min()/2.55,a=c.max()/2.55;b[2]=Math.round((a+e)/2);b[1]=b[2]?Math.round(100*(a-b[2])/Math.min(100-b[2],b[2])):0;c=c.map(function(f){return Math.round(f/255,6)});a=Math.round(a/100,6);e=Math.round(e/100,6);var d=c.remove(a,true);b[0]=(60*((c[0]-c[1])*(d==1?-1:1)/(a-e)+2*d)+360)%360;b=b.map(Math.round);return b}});jAsset.Color.csLab=new jAsset.Color.Space("Lab",{components:{L:{},a:{min:-128,max:127},b:{min:-128,max:127}},toRGB:function(c){function e(){var g=[];g[1]=(c[0]+16)/116;g[0]=c[1]/500+g[1];g[2]=g[1]-c[2]/200;for(var f=0;f<3;f++){g[f]=Math.pow(g[f],3)>0.008856?Math.pow(g[f],3):(g[f]-16/116)/7.787}g[0]=95.047*g[0];g[1]=100*g[1];g[2]=108.883*g[2];return g}var d=e().map(function(f){return f/100});var a=[d[0]*3.2406+d[1]*-1.5372+d[2]*-0.4986,d[0]*-0.9689+d[1]*1.8758+d[2]*0.0415,d[0]*0.0557+d[1]*-0.204+d[2]*1.057];for(var b=0;b<3;b++){a[b]=a[b]>0.0031308?1.055*Math.pow(a[b],1/2.4)-0.055:12.92*a[b];a[b]=jAsset.constrain(0,Math.round(a[b]*255),255)}return a},fromRGB:function(j){var m=216/24389,e=24389/27;j=j.map(function(k){return k/255});for(var f=0;f<3;f++){j[f]=j[f]<=0.04045?j[f]/12:Math.pow((j[f]+0.055)/1.055,2.4)}var d=0.436052025*j[0]+0.385081593*j[1]+0.143087414*j[2],c=0.222491598*j[0]+0.71688606*j[1]+0.060621486*j[2],b=0.013929122*j[0]+0.097097002*j[1]+0.71418547*j[2];var h=[d/0.964221,c/1,b/0.825211];var a=[];for(var f=0;f<3;f++){a[f]=h[f]>m?Math.pow(h[f],1/3):(e*h[f]+16)/116}var g=[(116*a[1])-16+0.2,500*(a[0]-a[1])+0.5,200*(a[1]-a[2])+0.5];return g.map(function(k){return Math.round(k)})}});jAsset.Color.csCMYK=new jAsset.Color.Space("CMYK",{components:{cyan:{},magenta:{},yellow:{},key:{}},toRGB:function(a){var b=a.map(function(c){return c*(100-a[3])/100+a[3]});b.splice(3,1);return b.map(function(c){return Math.round((100-c)*2.55)})},fromRGB:function(a){var c=a.map(function(d){return 100-d/2.55});c[3]=c.min();if(c[3]==100){return[0,0,0,100]}for(var b=0;b<3;b++){c[b]=Math.round(100*(c[b]-c[3])/(100-c[3]))}c[3]=Math.round(c[3]);return c}});jAsset.URI=function(f){if(jAsset.util.isString(f)){var b=jAsset.URI.a;b.href=f}else{if("protocol" in f&&"hostname" in f&&"port" in f&&"pathname" in f&&"search" in f&&"hash" in f){var b=f}}this.protocol=b.protocol;if(!this.protocol||this.protocol==":"){this.protocol=location.protocol}this.hostname=b.hostname||location.hostname;this.port=b.port=="0"?"":b.port;this.pathname=b.pathname||location.pathname;if(this.pathname&&this.pathname.indexOf("/")!==0){this.pathname="/"+this.pathname}this.search=b.search.startsWith("?")?b.search.substring(1):b.search;this.hash=b.hash.startsWith("#")?b.hash.substring(1):b.hash;this.parameters={};if(this.search){var e=this.search.split("&");for(var d=0;d<e.length;d++){var c=e[d].split("=");this.parameters[c[0]]=c[1]}}jAsset.URI.a.href=""};jAsset.URI.prototype={addParameter:function(a,b){if(a){this.parameters[a]=b;this.search=jAsset.serialize(this.parameters)}return this},removeParameter:function(a){if(a){delete this.parameters[a];this.search=jAsset.serialize(this.parameters)}return this},isRelative:function(a){a=a||location;return this.protocol==a.protocol&&this.hostname==a.hostname&&this.port==a.port},isHash:function(a){a=a||location;return this.isRelative()&&this.pathname==a.pathname&&this.search==(a.search.startsWith("?")?a.search.substring(1):a.search)},toString:function(){return this.protocol+"//"+this.hostname+(this.port?":"+this.port:"")+(this.pathname?this.pathname:"/")+(this.search?"?"+this.search:"")+(this.hash?"#"+this.hash:"")}};jAsset.URI.a=document.createElement("a");jAsset.DOM=new jAsset.module(["util"]);jAsset.DOM.__propSubs={"for":"htmlFor","class":"className",maxlength:"maxLength",readonly:"readOnly",cellspacing:"cellSpacing",accesskey:"accessKey",colspan:"colSpan",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",cellpadding:"cellPadding"};jAsset.DOM.chainLink("getProperty",function(b){b=jAsset.DOM.__propSubs[b]||b;var a=this[b];if(!jAsset.util.exists(a)){if(this.getAttribute){a=this.getAttribute(b)}if(!jAsset.util.exists(a)&&this.getStyle){a=this.getStyle(b)}}return a},{type:"end"});jAsset.DOM.chainLink("setAttributes",function(a,b,c){jAsset.each(a,function(f,d){d=jAsset.DOM.__propSubs[d]||d;if(jAsset.util.isFunction(f)){f=f(this)}if(d in this){try{if(d==="style"&&jAsset.CSS){jAsset.CSS.setStyle(this,f)}else{this[d]=f}return null}catch(g){}}try{this.setAttribute(d,f)}catch(g){}return null},this)},{preProcess:function(c,b,d){if(c.length<1){return null}b=b||"end";var a;if(jAsset.util.isString(c[0])){a={};a[c[0]]=jAsset.util.exists(c[1])?c[1]:"";c[0]=a;c.splice(1,1)}a=a||c[0];if(c[1]&&jAsset.effects){var e=[];jAsset.each(a,function(h,g){var f={type:g,isAttribute:!d};f[b]=h;e.push(f)});jAsset.effects.transition(this,e,c[2]);return null}return c}});jAsset.DOM.chainLink("offsetAttributes",function(a,b,c){jAsset.each(a,function(f,e){var d=this.getProperty(e);a[e]=jAsset.util.offset(d,f)},this);jAsset.DOM.setAttributes(this,a)},{preProcess:jAsset.DOM.setAttributes.options.preProcess.curry([null,"offset"])});jAsset.DOM.chainLink("isDescendantOf",function(d,c){for(var a=0;a<d.length;a++){if(c){return this.parentNode==d[a]}else{if(d[a].contains){if(d[a].contains(this)){return true}}else{if(d[a].compareDocumentPosition){if(d[a].compareDocumentPosition(this)&16){return true}}else{var b=this.parentNode;while(b){if(b==d[a]){return true}b=b.parentNode}}}}}return false},{type:"end",preProcess:function(a){if(!a[0]){return null}a[0]=jAsset.get(a[0]);return a},multiple:"and"});jAsset.DOM.alias("isAncestor","isDescendantOf");jAsset.DOM.chainLink("isSibling",function(e,f,d){e=e.filter(function(g){return(g.parentNode==this.parentNode)&&g!=this},this);if(f===true||f===false){f=f?1:-1}if(!e.length){return false}if(!f){return true}if(d){var c=jAsset.DOM.getSibling.internal.call(children[0],false,type);(this,f>0);return e.indexOf(c)>-1}else{var a=jAsset.DOM.getSourceIndex(this);for(var b=e.length-1;b>=0;b--){if((jAsset.DOM.getSourceIndex(e[b])-a)*f>0){return true}}return false}},{type:"end",preProcess:function(a){if(!a[0]){return null}a[0]=jAsset.get(a[0]);return(a[0].length)?a:null},multiple:"and"});jAsset.DOM.chainLink("getSibling",function(c,b){b=b||"*";var d=(c?"previous":"next");d+=(this[d+"ElementSibling"]?"Element":"")+"Sibling";if(jAsset.util.isFunction(this[d])){var a=this[d]();while(a&&!jAsset.matches(a,b)){a=a[d]()}}else{var a=this[d];while(a&&!jAsset.matches(a,b)){a=a[d]}}return a||null});jAsset.DOM.chainLink("getSiblings",function(b,a){var c=jAsset.DOM.getChildren(this.parentNode,a);if(b){return c.slice(0,c.indexOf(this))}else{return c.slice(c.indexOf(this)+1)}},{preProcess:function(c){if(this.forEach&&this.length){var e=!!c[0],d=c[1];for(var b=this.length-1;b>=0;b--){for(var a=b-1;a>=0;a--){if(jAsset.DOM.isSibling(this[b],this[a],e)){this.splice(e?b:a,1)}}}}return c},forceArray:true});jAsset.DOM.chainLink("getFirstChild",function(b){var a=jAsset.DOM.getChildren.internal.call(this);if(b&&!jAsset.matches(a[0],b)){return jAsset.DOM.getSibling.internal.call(a[0],false,b)}else{return a[0]}});jAsset.DOM.chainLink("getLastChild",function(b){var a=jAsset.DOM.getChildren.internal.call(this);if(b&&!jAsset.matches(a.last(),b)){return jAsset.DOM.getSibling.internal.call(a.last(),true,b)}else{return a.last()}});jAsset.DOM.chainLink("getChildren",function(b){if(!this.hasChildNodes()){return[]}var a=jAsset.util.toArray(this.children||this.childNodes);if(b){a=a.filter(jAsset.matches.curry([null,b]))}else{if(!this.children){a=a.filter(jAsset.util.isElement)}}return a},{forceArray:true});jAsset.DOM.chainLink("getDescendants",function(a){if(!this.hasChildNodes()){return[]}a=a||"*";return jAsset.get(a,this)},{preProcess:function(a){if(this.liveFilter){this.liveFilter(function(b){return !jAsset.DOM.isDescendantOf(b,a[0])})}return a},forceArray:true});jAsset.DOM.chainLink("getParent",function(b){b=b>0?b:1;var a=this;while(b--){a=a.parentNode}return a});jAsset.DOM.chainLink("getAncestors",function(c){var a=(c)?[this]:[];for(var b=this.parentNode;b;b=b.parentNode){a.push(b)}return a},{forceArray:true});jAsset.DOM.chainLink("getClosest",function(b){var a=this;while(a&&!jAsset.matches(a,b)){a=a.parentNode}return a},{type:"end"});jAsset.DOM.chainLink("getSourceIndex",function(){if(this.sourceIndex===0||this.sourceIndex){return 0}return jAsset.util.toArray(document.getElementsByTagName("*")).indexOf(this)},{type:"end"});jAsset.DOM.chainLink("getOffsetLeft",function(){var a=this,b=a.offsetLeft;while(a.offsetParent&&!"html".equalsIgnoreCase(a.offsetParent.nodeName)){a=a.offsetParent;b+=a.offsetLeft}return b},{type:"end"});jAsset.DOM.chainLink("getOffsetTop",function(){var b=this,a=b.offsetTop;while(b.offsetParent&&!"html".equalsIgnoreCase(b.offsetParent.nodeName)){b=b.offsetParent;a+=b.offsetTop}return a},{type:"end"});jAsset.DOM.getScrollOffset=function(d,c){c=jAsset.util.is("window",c)?c:window;d=/left/i.test(d)?"Left":"Top";var b=d=="Left"?"X":"Y",a=c.document,e=a.documentElement||a.body;return e["scroll"+d]||c["page"+b+"Offset"]||0};jAsset.DOM.getScrollTop=jAsset.DOM.getScrollOffset.curry(["top"]);jAsset.DOM.getScrollLeft=jAsset.DOM.getScrollOffset.curry(["left"]);jAsset.DOM.create=function(b,a){if(!b||!jAsset.util.isString(b)){return null}var c=document.createElement(b);jAsset.extend(c);jAsset.DOM["set"+(jAsset.util.isString(a)?"Content":"Attributes")](c,a);return c};jAsset.DOM.createText=function(a){a=a||"";return document.createTextNode(a.toString().escapeHTML()+"")};jAsset.DOM.chainLink("dispose",function(){if(this.parentNode){this.parentNode.removeChild(this)}});jAsset.DOM.chainLink("destroy",function(){jAsset.DOM.setContent(this,"");jAsset.DOM.dispose(this)});jAsset.DOM.chainLink("insert",function(c,a){if(!c||!(c.appendChild||c.parentNode)){c=document.body}a=a||"end";a=(a+"").toLowerCase();if(this.ownerDocument!=c.ownerDocument&&"adoptNode" in c.ownerDocument){c.ownerDocument.adoptNode(this)}var b=c.parentNode;if(!b&&/^(before|after)$/i.test(a)){throw Error("Cannot insert "+a+" "+c+" because it doesn't (yet) have a parent.")}switch(a){case"wrap":if(b){b.insertBefore(this,c)}this.appendChild(c);break;case"before":b.insertBefore(this,c);break;case"after":if(c.nextSibling){b.insertBefore(this,c.nextSibling)}else{b.appendChild(this)}break;case"start":if(c.firstChild){c.insertBefore(this,c.firstChild)}else{c.appendChild(this)}break;case"end":default:c.appendChild(this)}});jAsset.DOM.chainLink("getTextContent",function(){return this.textContent||this.innerText||this.text||this.innerHTML.stripHTML()},{type:"end"});jAsset.DOM.chainLink("getContent",function(){switch(this.nodeType){case 1:return(this.hasChildNodes())?this.innerHTML:"";case 2:case 3:case 8:return this.nodeValue||this.data;case 9:return this[(this.documentElement)?"documentElement":"firstChild"].innerHTML}return""},{type:"end"});jAsset.DOM.chainLink("setContent",function(h,b,f){h+="";try{if(b&&jAsset.effects){jAsset.CSS.hide(this,b,function(e){jAsset.DOM.setContent(e,h,null,f);jAsset.CSS.show(e,{type:b})})}else{if(f&&this.outerHTML){var c,d,a;(c=this.previousSibling)||(d=this.nextSibling)||(a=this.parentNode);this.outerHTML=this.outerHTML.to(">")+">"+h+this.outerHTML.from("<");return c?c.nextSibling:(d?d.previousSibling:a.firstChild)}else{if(this.nodeName.toLowerCase()=="input"){throw Error()}this.innerHTML=h}}}catch(g){if("value" in this){this.value=h}else{if("text" in this){this.text=h}}}return jAsset.undefined});jAsset.DOM.alias("clearContent","setContent",[""]);jAsset.DOM.chainLink("offsetContent",function(a){this.setContent(jAsset.util.offset(this.getContent(),a))});jAsset.DOM.chainLink("undress",function(){jAsset.extend(this.childNodes).forEach(function(a){a.insert(this,"before")},this);this.destroy()});jAsset.DOM.chainLink("swapPosition",function(e,a){if(a!==false){a=a||document.body}var c,d,b;(d=this.nextSibling)||(b=this.parentNode);if(a){a.appendChild(this)}else{this.parentNode.removeChild(this)}e.call(this);if(d){d.parentNode.insertBefore(this,d)}else{if(b){b.appendChild(this)}else{if(a){a.removeChild(this)}}}});jAsset.selector=new jAsset.module(["DOM"]);jAsset.selector.Wrapper=function(b){var d=/(?=#|\.|\[.|:|$)/;var a=/(?=\^|\$|\*|~|\||!)|=/;var c=/^nth(\-last)?\-(child|of\-type)$/i;this.parseSimple=function(){var h={classes:[],attributes:[],pseudos:[]};var g=[];var f=this.selector.replace(/\((.*?)\)/g,function(m,k){g.push(k);return"()"});var j=f.split(d);if(j.last()===""){j.length--}j.forEach(function(k){var m=k.charAt(0);k=k.substr(1);switch(m){case"#":return h.id=k;case".":return h.classes.push(k);case"[":return h.attributes.push(k.substr(0,k.length-1));case":":return h.pseudos.push(k);default:return h.tag=m+k}},this);h.attributes.forEach(function(m,k){h.attributes[k]=h.attributes[k].split(a);h.attributes[k]={name:h.attributes[k][0],op:h.attributes[k].length>2?h.attributes[k][1]:"",query:h.attributes[k][h.attributes[k].length>2?2:1]||""};if(/^".*"$/.test(h.attributes[k].query)){h.attributes[k].query=h.attributes[k].query.substr(1,h.attributes[k].query.length-2)}},this);h.pseudos.forEach(function(m,k){if(h.pseudos[k].endsWith("()")){h.pseudos[k]=new String(h.pseudos[k].substr(0,h.pseudos[k].length-2));h.pseudos[k].param=g[0];g.splice(0,1);if(c.test(h.pseudos[k])){if(h.pseudos[k].param=="even"){h.pseudos[k].param=[2,0]}else{if(h.pseudos[k].param=="odd"){h.pseudos[k].param=[2,1]}else{var n=h.pseudos[k].param.split(/\+/);if(n.length==1){if(n[0].endsWith("n")){n[1]=0}else{n.splice(0,0,0)}}n=[parseInt(n[0]),parseInt(n[1])];if(isNaN(n[0])){n[0]=1}h.pseudos[k].param=n}}}}},this);return h};var e=/(?= (?:\+|~|>| ) )/;this.parseCombination=function(){if(this.selector.contains(" + "," ~ "," > ","   ")){var f=this.selector.split(e).replace(function(g){if(g.startsWith(" ")){return[g.charAt(1),(new jAsset.selector.Wrapper(g.substr(3))).parseSimple()]}else{return(new jAsset.selector.Wrapper(g)).parseSimple()}},this)}else{var f=[this.parseSimple()]}return f};this.parse=function(){if(this.selector.contains(",")){this.parsed=this.selector.split(",").map(function(g,f){return(new jAsset.selector.Wrapper(g)).parseCombination()},this)}else{this.parsed=[this.parseCombination()]}return this.parsed};this.toString=function(){return this.selector};this.matches=function(m){var g;allfor:for(var k=0;k<this.parsed.length;k++){var o=this.parsed[k];if(!this.matchesSimple(m,o.last())){continue allfor}combofor:for(var h=o.length-2;h>=0;h-=2){switch(o[h]){case"+":case"~":var n="Sibling"+(o[h]=="~"?"s":"");var f=true;break;case">":var n="Parent";break;case" ":var n="Ancestors"}m=jAsset.DOM["get"+n].internal.call(m,f);if(jAsset.util.isElement(m)&&this.matchesSimple(m,o[h-1])){continue combofor}else{if(jAsset.util.isArray(m)){for(var k=m.length;k>=0;k--){if(this.matchesSimple(m[k],o[h-1])){continue combofor}}continue allfor}else{continue allfor}}}return true}return false};this.matchesSimple=function(g,m){var j=jAsset.selector.Wrapper.filters;if(!g){return false}m=m||this.parsed[0][0];if(m.id&&g.id!=m.id){return false}if(m.tag&&m.tag!="*"&&!m.tag.equalsIgnoreCase(g.nodeName)){return false}if(m.classes.length){for(var f=m.classes.length-1;f>=0;f--){var k=jAsset.util.isString(m.classes[f])?new RegExp("(\\s+|^)"+m.classes[f]+"(\\s+|$)"):m.classes[f];if(!k.test(g.className)){return false}}}if(m.attributes.length){for(var f=0;f<m.attributes.length;f++){var n=jAsset.DOM.getProperty(g,m.attributes[f].name);if(!n){return false}else{if(m.attributes[f].query){var h=j.attributes[m.attributes[f].op+"="];if(h&&!h(m.attributes[f].query,n)){return false}}}}}if(m.pseudos.length){for(var f=0;f<m.pseudos.length;f++){if(j.pseudos[m.pseudos[f]]){if(!j.pseudos[m.pseudos[f]](g,m.pseudos[f].param)){return false}}}}return true};if(b instanceof jAsset.selector.Wrapper){this.selector=b.selector;this.parsed=b.parsed}else{if(jAsset.util.isString(b)){this.selector=b.trim().replace(/(?:\s*)(\+|>|~|,)(?:\s*)/g,"$1").replace(/(\+|~|>|\s)(?:\s*)/g," $1 ").replace(/ ~ =/g,"~=").replace(/\(\s*([0-9]+)n\s+\+(?:\s+)([0-9]+)\s*\)/ig,"($1n+$2)").replace(/:+/g,":");this.parse()}else{throw Error('Selector is neither a String nor a jAsset.selector.Wrapper object. (was "'+b+'")')}}};jAsset.selector.Wrapper.canBe=function(a){return jAsset.util.isString(a)||a instanceof jAsset.selector.Wrapper};jAsset.selector.Wrapper.filters={pseudos:{"first-child":function(a){return a==jAsset.DOM.getFirstChild(a.parentNode)},"not-first-child":function(a){return a!=jAsset.DOM.getFirstChild(a.parentNode)},"last-child":function(a){return a==jAsset.DOM.getLastChild(a.parentNode)},"not-last-child":function(a){return a!=jAsset.DOM.getLastChild(a.parentNode)},"only-child":function(a){return jAsset.DOM.getChildren.internal.call(a.parentNode).length<=1},"not-only-child":function(a){return jAsset.DOM.getChildren.internal.call(a.parentNode).length>1},"first-of-type":function(a){return a==jAsset.DOM.getFirstChild(a.parentNode,a.nodeName)},"not-first-of-type":function(a){return a!=jAsset.DOM.getFirstChild(a.parentNode,a.nodeName)},"last-of-type":function(a){return a==jAsset.DOM.getLastChild(a.parentNode,a.nodeName)},"not-last-of-type":function(a){return a!=jAsset.DOM.getLastChild(a.parentNode,a.nodeName)},"only-of-type":function(a){return jAsset.DOM.getChildren(a.parentNode,a.nodeName).length<=1},"not-only-of-type":function(a){return jAsset.DOM.getChildren(a.parentNode,a.nodeName).length>1},disabled:function(a){return a.disabled},enabled:function(a){return a.disabled===false},checked:function(a){return a.checked},empty:function(a){return !a.hasChildNodes()},target:function(a){return("#"+a.id).equalsIgnoreCase(location.hash)},even:function(b){var a=jAsset.DOM.getChildren.internal.call(b.parentNode);return a.indexOf(b)%2!=1},odd:function(b){var a=jAsset.DOM.getChildren.internal.call(b.parentNode);return !(a.indexOf(b)%2)},contains:function(a,b){return jAsset.DOM.getTextContent(a).contains(b)},"nth-child":function(b,c){var a=jAsset.DOM.getChildren.internal.call(b.parentNode);if(c[0]){return(a.indexOf(b)+1)%c[0]==c[1]}else{return a.indexOf(b)+1==c[1]}},"nth-of-type":function(b,c){var a=jAsset.DOM.getChildren.internal.call(b.parentNode,b.nodeName);if(c[0]){return(a.indexOf(b)+1)%c[0]==c[1]}else{return a.indexOf(b)+1==c[1]}},"nth-last-child":function(b,c){var a=jAsset.DOM.getChildren.internal.call(b.parentNode).reverse();if(c[0]){return(a.indexOf(b)+1)%c[0]==c[1]}else{return a.indexOf(b)+1==c[1]}},"nth-last-of-type":function(b,c){var a=jAsset.DOM.getChildren.internal.call(b.parentNode,b.nodeName).reverse();if(c[0]){return(a.indexOf(b)+1)%c[0]==c[1]}else{return a.indexOf(b)+1==c[1]}},not:function(a,b){return !jAsset.CSS.matches(a,b)}},attributes:{"=":function(b,a){return a.equalsIgnoreCase(b)},"~=":function(b,a){return(new RegExp("(^| )"+b+"($| )","i")).test(a)},"|=":function(b,a){return(new RegExp("(^|-)"+b+"($|-)","i")).test(a)},"^=":function(b,a){return a.startsWith(b)},"$=":function(b,a){return a.endsWith(b)},"*=":function(b,a){return a.indexOf(b)>-1},"!=":function(b,a){return a.indexOf(b)==-1}}};jAsset.selector.chainLink("get",function(a,d){var f,b=[];if(!a){return[]}a=new jAsset.selector.Wrapper(a);if(this==document&&!d){var c=jAsset.selector.get.cache.fetch(a);if(c){return c}}if(this.querySelectorAll){try{return jAsset.extend(this.querySelectorAll(a))}catch(g){}}a.parsed.forEach(function(j){var e=[];var h=j.last();if(h.id){e=[jAsset.getById(h.id)];if(this!=document&&!jAsset.DOM.isDescendantOf(e[0],this)){e=[]}}else{if(h.classes.length){e=jAsset.getByClass(h.classes,h.tag,this)}else{e=jAsset.getByTag(h.tag,this)}}e=e.filter(function(k){return a.matchesSimple(k,h)});if(j.length>1){e=e.filter(function(k){return a.matches(k,a)})}b=b.concat(e)},this);b=jAsset.extend(b);if(this==document){jAsset.selector.get.cache.store(a,b)}return b},{type:"start"});jAsset.selector.get.cache={storage:{},store:function(a,b){this.storage[a]={results:b.clone(),check:document.getElementsByTagName("*").length}},fetch:function(a){return this.storage[a]&&this.storage[a].check==document.getElementsByTagName("*").length?this.storage[a].results:null},empty:function(){this.storage={}}};jAsset.selector.chainLink("matches",function(a){if(!a){return false}a=new jAsset.selector.Wrapper(a);return a.matches(this)},{type:"end",multiple:"and"});jAsset.selector.chainLink("getFirst",function(a){if(this.querySelector){try{return jAsset.extend(this.querySelector(a))[0]}catch(b){}}return jAsset.selector.get(a,this)[0]||null},{type:"start"});jAsset.selector.chainLink("count",function(a){var b=jAsset.selector.get(a,this);return b?b.length:0},{type:"start"});jAsset.CSS=new jAsset.module(["DOM","util"]);jAsset.CSS.chainLink("getStyle",function(k,d){var o="";if(jAsset.util.isArray(k)){if(d){o=0}k.forEach(function(p){o+=jAsset.CSS.getStyle(this,p,d)+(d?0:" ")},this);return d?o:o.trim()}var f=jAsset.util.convertCSSProperty(k,true);var m=jAsset.util.convertCSSProperty(k);var a=jAsset.support.cssProperty(k);if(!a){if(jAsset.support.cssProperty(jAsset.support.vendorPrefix(k))){m=jAsset.support.vendorPrefix(k);f=jAsset.util.convertCSSProperty(m,true);a=true}}if(this.style[m]){o=this.style[m]}else{if(a){if(this.currentStyle){o=this.currentStyle[m];if(/^[0-9\.]+[a-z%]+$/.test(o)&&!/^[0-9\.]+px$/.test(o)){var b=this.style.left,c=this.runtimeStyle.left;this.runtimeStyle.left=this.currentStyle.left;this.style.left=o;o=style.pixelLeft+"px";this.style.left=b;this.runtimeStyle.left=c}}else{if(window.getComputedStyle){var e=document.defaultView.getComputedStyle(this,null);if(e){o=e.getPropertyValue(f)}}}}if(!o&&o!==0){switch(f){case"opacity":if(jAsset.support.cssProperty("filter")){if(this.filters.length&&this.filters.item("DXImageTransform.Microsoft.Alpha")){o=this.filters.item("DXImageTransform.Microsoft.Alpha").opacity/100+""}else{o="1"}}else{o=this.getStyle(jAsset.support.vendorPrefix()+"Opacity")}break;case"border":case"outline":case"border-top":case"border-right":case"border-bottom":case"border-left":o=this.getStyle([f+"-width",f+"-style",f+"-color"]);break;case"border-width":case"border-style":case"border-color":case"padding":case"margin":var g=[];if(!f.contains("-")){f+="-"}g[0]=g[1]=g[2]=g[3]=f;g[0]=f.replace("-","-top");g[1]=f.replace("-","-right");g[2]=f.replace("-","-bottom");g[3]=f.replace("-","-left");o=jAsset.CSS.getStyle(this,g);break;case"-moz-border-radius":o=jAsset.CSS.getStyle(this,[f+"-topleft",f+"-topright",f+"-bottomleft",f+"-bottomright"]);break;case"-webkit-border-radius":o=jAsset.CSS.getStyle(this,["-webkit-border-top-left-radius","-webkit-border-top-right-radius","-webkit-border-bottom-left-radius","-webkit-border-bottom-right-radius"]);break;case"font":o=jAsset.CSS.getStyle(this,["font-size","line-height","font-weight","font-style","font-family"]);break;case"background":o=jAsset.CSS.getStyle(this,["background-color","background-image","background-position","background-repeat","background-attachment"]);break;case"background-position-x":case"background-position-y":var h=jAsset.CSS.getStyle(this,"background-position").split(/\s+/);return h[f=="background-position-x"?0:1];break}}}if(jAsset.util.isString(o)){if(o=="auto"&&(f==="width"||f==="height")){var j=this.getStyle(f=="width"?["paddingLeft","paddingRight"]:["paddingTop","paddingBottom"],true)||0;o=Math.max(0,this[("client-"+f).camelCase()]-j)+"px"}if(parseInt(o)===0&&!this.isVisible()&&["width","height","top","left"].contains(f)){var n=this.getAncestors(true);if(n.length>1){n.forEach(function(p){if(p.style){p.__prevDisp=p.style.display;p.style.display="block"}});o=this.getStyle(f);n.forEach(function(p){if(p.style){p.style.display=p.__prevDisp;try{delete p.__prevDisp}catch(q){p.removeAttribute("__prevDisp")}}})}}o=o.split(" ");if(o.length>3&&o[1]==o[3]){o.splice(3,1)}if(o.length>2&&o[0]==o[2]){o.splice(2,1)}if(o.length>1&&o[0]==o[1]){o.splice(1,1)}o=o.join(" ");if(o=="normal"){o=""}if(jAsset.Color.is(o)){return(new jAsset.Color(o)).toString()}if(d){o=parseFloat(o)||0}return o}return jAsset.util.exists(o)?o:""},{type:"end"});jAsset.CSS.alias("getCurrent","getStyle");jAsset.CSS.chainLink("setStyle",function(c,a,b){jAsset.each(c,function(f,d){d=jAsset.util.convertCSSProperty(d);if(/^\-?[0-9]+\.?[0-9]*$/.test(f)&&!/^(lineHeight|zIndex|fontWeight|opacity|zoom)$/.test(d)){f+="px"}if(!jAsset.support.cssProperty(d)){if(jAsset.support.cssProperty(jAsset.support.vendorPrefix(d))){d=jAsset.support.vendorPrefix(d)}else{if(d=="opacity"&&jAsset.support.cssProperty("filter")){d="filter";if(f!==""){f=Math.round(parseFloat(f||0)*100);f="progid:DXImageTransform.Microsoft.Alpha(opacity="+f+")"}}else{if(d=="backgroundPositionX"){this.style.backgroundPosition=f+" "+jAsset.CSS.getStyle(this,"backgroundPositionY")}else{if(d=="backgroundPositionY"){this.style.backgroundPosition=jAsset.CSS.getStyle(this,"backgroundPositionX")+" "+f}}return null}}}try{if(d){this.style[d]=f}}catch(g){if(jAsset.debug){jAsset.debug("Unable to set property "+d+" to "+f+" on "+this)}}return null},this)},{preProcess:jAsset.DOM.setAttributes.options.preProcess.curry([null,null,true])});jAsset.CSS.chainLink("offsetStyle",function(c,a,b){jAsset.each(c,function(f,e){var d=jAsset.CSS.getStyle(this,e);c[e]=jAsset.util.offset(d,f)},this);jAsset.CSS.setStyle(this,c)},{preProcess:jAsset.CSS.setStyle.options.preProcess.curry([null,"offset",true])});jAsset.CSS.chainLink("clearStyle",function(a){if(a){this.setStyle(a)}else{this.removeAttribute("style")}},{preProcess:function(a){if(a[0]){var b={};jAsset.util.toArray(a[0]).forEach(function(c){b[c]=""});a[0]=b}return a}});jAsset.CSS.chainLink("swapStyle",function(c,d){if(c){var a={};for(var b in c){a[b]=this.style[b];this.style[b]=c[b]}}d.call(this);if(c){for(var b in c){this.style[b]=a[b]}}});jAsset.CSS.chainLink("hasClass",function(a){if(!this.className){return false}return a.intersect(this.className.split(/\s+/)).length==a.length},{type:"end",preProcess:function(a){if(a[0]){a[0]=jAsset.util.isArray(a[0])?a[0]:a[0].split(/\s+/);return a}return null},multiple:"and"});jAsset.CSS.chainLink("addClass",function(a){if(this.hasClass(a)){return}this.className=(this.className?this.className.split(/\s+/):[]).concat(a).join(" ")},{preProcess:jAsset.CSS.hasClass.options.preProcess});jAsset.CSS.chainLink("removeClass",function(a){this.className=(this.className?this.className.split(/\s+/):[]).diff(a).join(" ")},{preProcess:jAsset.CSS.hasClass.options.preProcess});jAsset.CSS.chainLink("toggleClass",function(a){this[(this.hasClass(a)?"remove":"add")+"Class"](a)},{preProcess:jAsset.CSS.hasClass.options.preProcess});jAsset.CSS.chainLink("isVisible",function(){var a=this;while(a){if(a.nodeType==11||(a.nodeType==1&&a.parentNode==null)){return false}else{if(jAsset.util.is("document",a)){return true}}if(jAsset.CSS.getStyle(a,"display")=="none"){return false}a=a.parentNode}return false},{type:"end",multiple:"and"});jAsset.CSS.chainLink("hide",function(a,b){if(jAsset.effects&&a){jAsset.effects.transition(this,a,function(c){a.forEach(function(d){if(!d.persist){c.clearStyle(d.type)}});jAsset.CSS.hide(c,null,b)})}else{jAsset.CSS.setStyle(this,"display","none");if(b){b(this)}}},{preProcess:function(a){if(a[0]&&jAsset.effects){a[0]=jAsset.util.toArray(a[0]);a[0].replace(function(b){if(jAsset.util.isString(b)){return{type:b,end:0}}else{b.end=b.end||0;return b}})}else{a[0]=null}if(a.length>1&&!jAsset.util.isFunction(a[1])){a[1]=null}return a}});jAsset.CSS.chainLink("show",function(a,b){if(jAsset.effects&&a){jAsset.effects.transition(this,a,function(c){a.forEach(function(d){if(!d.persist){c.clearStyle(d.type)}});if(b){b(this)}})}else{jAsset.CSS.setStyle(this,"display","block");if(b){b(this)}}},{preProcess:function(a){if(a[0]&&jAsset.effects){a[0]=jAsset.util.toArray(a[0]);a[0].replace(function(c){if(jAsset.util.isString(c)){var b={};b.type=c;b.start=0;return b}else{c.start=c.start||0;return c}})}else{a[0]=null}if(a.length>1&&!jAsset.util.isFunction(a[1])){a[1]=null}return a}});jAsset.CSS.chainLink("toggle",function(a,b,c){if(c!==false&&c!==true){c=!this.isVisible()}this[c?"show":"hide"](a,b)});jAsset.effects=new jAsset.module(true,["CSS"]);jAsset.effects.chainLink("transition",function(b,a){this.transitions=this.transitions||[];this.transitions.forEach(function(c){c.parameters.forEach(function(d){b.forEach(function(e){if(d.type==e.type){c.stop()}})})});this.transitions.push(new jAsset.effects.elementTransition(b,this,a));this.transitions.last().play()},{preProcess:function(a){if(!a[0]){return null}a[0]=jAsset.util.toArray(a[0]);if(!jAsset.util.isFunction(a[1])){a[1]=Function.dummy}return a}});jAsset.effects.chainLink("animation",function(f,e){if(!f){return}f=jAsset.util.toArray(f);var b=e||Function.dummy;var d=this;for(var c=f.length-1;c>0;c--){var a=b;b=(function(g){return function(h){jAsset.effects.transition(h,f[g],a)}})(c)}jAsset.effects.transition(this,f[0],b)});jAsset.effects.chainLink("playback",function(a,b){if(this.transitions.forEach){this.transitions.forEach(function(c){c[b]()})}},{preProcess:function(a){return(a.length>0)?a:null}});jAsset.effects.alias("stop","playback",["stop"]);jAsset.effects.alias("pause","playback",["pause"]);jAsset.effects.alias("resume","playback",["resume"]);jAsset.effects.alias("finalize","playback",["finalize"]);jAsset.effects.elementTransition=function(g,b,e){var f=25,a=0;this.onFinish=e;this.parameters=jAsset.clone(g);this.parameters.replace(function(h){h=new jAsset.effects.parameters(h,b);if(h.fps){f=h.fps}if(h.frames>a){a=h.frames}return h});this.parameters=this.parameters.cleanUp();var d=b.style.overflow||b.style.overflowX||b.style.overflowY;this.finalize=function(){this.parameters.forEach(function(h){if("opacity".equalsIgnoreCase(h.type)&&h.end==1){jAsset.CSS.clearStyle(b,h.type)}else{if(h.isAttribute){jAsset.DOM.setAttributes(b,h.type,h.end)}else{jAsset.CSS.setStyle(b,h.type,h.end)}}});jAsset.CSS.setStyle(b,"overflow",d).transitions.remove(this);b.transitions.remove(this);if(jAsset.util.isFunction(this.onFinish)){this.onFinish(b)}if(!b.transitions.length&&jAsset.event){jAsset.event.fire(b,"jAsset:transition:finished")}return b};this.play=function(){jAsset.CSS.setStyle(b,{display:"block",overflow:"hidden"});this.parameters.forEach(function(h){if(h.isAttribute){jAsset.DOM.setAttributes(b,h.type,h.start)}else{jAsset.CSS.setStyle(b,h.type,h.start)}});this.currentFrame=0;this[a>1?"animate":"finalize"]()};var c=this;this.animate=function(){if(++c.currentFrame<=a){c.parameters.forEach(function(h){if(c.currentFrame<=h.frames){if(h.isAttribute){jAsset.DOM.offsetAttributes(b,h.type,h.step)}else{jAsset.CSS.offsetStyle(b,h.type,h.step)}}});c.timer=setTimeout(arguments.callee,1000/f)}else{c.finalize()}};this.stop=function(){this.pause();this.finalize()};this.pause=function(){clearTimeout(this.timer)};this.resume=function(){this.animate()}};jAsset.effects.parameters=function(d,a){var b=20,f=25;this.type=d.type;this.isAttribute=d.isAttribute||false;if(!jAsset.Color&&/color/i.test(this.type)){throw Error("You need jAsset.Color in order to perform color transitions.")}this.start=d.start;if(!jAsset.util.exists(this.start)){this.start=a["get"+(this.isAttribute?"Property":"Current")](this.type)}this.end=d.end;this.offset=d.offset;if(!jAsset.util.exists(this.end)&&jAsset.util.exists(this.offset)){this.end=jAsset.util.offset(this.start,this.offset)}else{if(!jAsset.util.exists(this.end)){this.end=a["get"+(this.isAttribute?"Property":"Style")](this.type);if(this.end==this.start){a["set"+(this.isAttribute?"Attributes":"Style")](this.type,"");this.end=a["get"+(this.isAttribute?"Property":"Current")](this.type)}}}this.offset=c(this.end,this.start);this.step=d.step;if(this.offset){if(this.step){this.frames=d.frames||e(this.offset,this.step,true);this.frames=Math.round(Math.abs(this.frames))}this.frames=jAsset.util.isNumber(this.frames)?this.frames:b;this.step=e(this.offset,this.frames);if(this.step*this.offset<0){this.step=-this.step}}else{this.frames=this.step=0}this.fps=d.duration/this.frames||d.fps||f;this.duration=this.fps*this.frames;function e(j,m,k){var g=parseFloat(j)/parseFloat(m);if(!k){var h=j.toString().match(/^\-?[0-9]+\.?[0-9]*([a-z%]+)$/);h=h?h[1]:0}return g+(k?0:h)}function c(k,j,m){var g=parseFloat(k)-parseFloat(j);if(!m){var h=k.toString().match(/^\-?[0-9]+\.?[0-9]*([a-z%]+)$/);h=h?h[1]:0}return g+(m?h:0)}};jAsset.event=new jAsset.module(["util","DOM"],null,{duplicateEvents:function(){if("result" in arguments.callee){return arguments.callee.result}i=0;var f=function(){i++};var c=document.createElement("a");c.appendChild(document.createTextNode("test"));c.href="#";var e=document.body||jAsset.scriptElement.parentNode;c=e.appendChild(c);for(var d=0;d<2;d++){if(c.addEventListener){c.addEventListener("focus",f,false)}else{if(c.attachEvent){c.attachEvent("onfocus",f)}}}if(c.dispatchEvent){var b=document.createEvent("HTMLEvents");b.initEvent("focus",true,true);c.dispatchEvent(b)}else{if(c.fireEvent){c.fireEvent("onfocus",document.createEventObject())}}e.removeChild(c);return arguments.callee.result=i>1}});jAsset.event.storage={};jAsset.event.chainLink("bind",function(b,a){b.forEach(function(c){if(!(c in jAsset.event.storage)){jAsset.event.storage[c]=[]}var d=c=="DOMContentLoaded"?document:this;var e=new jAsset.event.Wrapper(d,c,a);jAsset.event.storage[c].push(e.bind())},this)},{preProcess:function(a){if(!a[0]||!jAsset.util.isFunction(a[1])){return null}a[0]=jAsset.util.toArray(a[0]);jAsset.event.unbind(this,a[0],a[1]);return a}});jAsset.event.chainLink("hover",function(b,a){if(jAsset.util.isFunction(b)){this.bind("mouseover",function(c){if(jAsset.DOM.isDescendantOf(this,c.relatedTarget)){b(c)}})}if(jAsset.util.isFunction(a)){this.bind("mouseout",function(c){if(jAsset.DOM.isDescendantOf(this,c.relatedTarget)){a(c)}})}});jAsset.event.chainLink("unbind",function(b,a){if(b&&b.length){b.forEach(function(c){if(!(c in jAsset.event.storage)){return}for(var d=jAsset.event.storage[c].length-1;d>=0;d--){var e=jAsset.event.storage[c][d];if(e&&e.matches(this,a)){e.unbind();e=null}}},this)}else{jAsset.each(jAsset.event.storage,function(d,c){d.forEach(function(f,e){if(f&&f.matches(this,a)){f.unbind();d[e]=f=null;delete d[e]}},this)},this)}},{preProcess:function(a){if(a[0]){a[0]=jAsset.util.toArray(a[0])}return a}});jAsset.event.chainLink("fire",function(c,a){var b=this.dispatchEvent?function(e){var d=document.createEvent("HTMLEvents");d.initEvent(e,true,true);d.custom=true;if(a){jAsset.attach(d,a)}this.dispatchEvent(d)}:(this.fireEvent?function(f){var d=document.createEventObject();d.type="on"+f;d.custom=true;if(a){jAsset.attach(d,a)}try{this.fireEvent("on"+f,d)}catch(h){if(h.message.startsWith("Invalid argument")){if(f in jAsset.event.storage){d.cancelBubble=false;if(!d.target&&!d.srcElement){d.target=this}var g=jAsset.DOM.getAncestors(this,true);g.iterate(function(e){if(!d.cancelBubble){jAsset.event.storage[f].forEach(function(j){if(j.matches(e)){j.fire(d)}})}return !d.cancelBubble})}}}}:function(d){if(jAsset.util.isFunction(this["on"+c])){this["on"+c]()}});c.forEach(b,this)},{preProcess:function(a){if(!a[0]){return null}a[0]=jAsset.util.toArray(a[0]);return a}});jAsset.event.fix=function(a){a=a||window.event;if(!a.stopPropagation){a.stopPropagation=function(){this.cancelBubble=true}}if(!a.preventDefault){a.preventDefault=function(){this.returnValue=false}}if(!a.target){a.target=a.srcElement}if(!a.relatedTarget&&(a.fromElement||a.toElement)){a.relatedTarget=a[(a.fromElement==a.target?"to":"from")+"Element"]}if(!jAsset.util.isNumber(a.pageX)&&jAsset.util.isNumber(a.clientX)){a.pageX=jAsset.DOM.getScrollLeft()+a.clientX||0}if(!jAsset.util.isNumber(a.pageY)&&jAsset.util.isNumber(a.clientY)){a.pageY=jAsset.DOM.getScrollTop()+a.clientY||0}if(/key/i.test(a.type)){if(!("keyCode" in a)){a.keyCode=a.which||a.charCode}if(!("charCode" in a)){a.charCode=a.charCode||a.keyCode}if(a.keyCode>63200){a.keyCode=({63276:33,63277:34,63234:37,63232:38,63235:39,63233:40})[a.keyCode]||a.keyCode}}if(!("wheelDelta" in a)&&["mousewheel","DOMMouseScroll"].contains(a.type)){a.wheelDelta=-a.detail*30}return a};(function(){var a=jAsset.getFirst("script");if(a&&a.getAttribute("defer")===false){document.write("<script id=__ie_DOMLoaded defer src=//:><\/script>");var b=jAsset.getById("__ie_DOMLoaded");if(b){b.onreadystatechange=function(){if(!jAsset.DOMLoaded&&this.readyState=="complete"){(function(){if(!jAsset.DOMLoaded){try{document.documentElement.doScroll("left")}catch(c){setTimeout(arguments.callee,1);return}jAsset.DOMLoaded=true;jAsset.event.fire(document,"DOMContentLoaded")}})();jAsset.DOM.destroy(b)}}}}else{if("readyState" in document){document.onreadystatechange=document.onreadystatechange||function(){if(!jAsset.DOMLoaded&&/loaded|complete/.test(document.readyState)){jAsset.DOMLoaded=true;jAsset.event.fire(document,"DOMContentLoaded")}}}}if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){jAsset.DOMLoaded=true},false)}else{window._onload=window.onload;window.onload=function(){if(!jAsset.DOMLoaded){jAsset.DOMLoaded=true;jAsset.event.fire(document,"DOMContentLoaded")}if(window._onload){window._onload()}}}})();jAsset.event.ready=jAsset.event.bind.curry([document,"DOMContentLoaded"]);jAsset.event.Wrapper=function(d,c,b){this.original=b;this.element=d;this.event=c;var a=this;this.get=function(e){e=jAsset.event.fix(e);if(!e.target){e.target=a.element}return a.original.call(a.element,e)}};jAsset.event.Wrapper.prototype={matches:function(b,a,c){return((!b||b==this.element)&&(!a||a==this.original)&&(!c||c==this.event))},destroy:function(){this.original=this.element=this.event=this.get=null;return this},bind:function(){if(this.element.addEventListener){this.element.addEventListener(this.event,this.get,false);if(this.event=="mousewheel"){this.element.addEventListener("DOMMouseScroll",this.get,false)}}else{if(this.element.attachEvent){this.element.attachEvent("on"+this.event,this.get)}else{if(!element["on"+this.event]){this.element["on"+this.event]=this.get}else{var b=this;var a=this.element["_on"+this.event];this.element["_on"+this.event]=function(c){a.call(this,c);b.get()}}}}return this},unbind:function(){if(!jAsset.event.storage[this.event]){return this}jAsset.event.storage[this.event].remove(this);if(this.element.removeEventListener){if(this.event=="mousewheel"){this.element.removeEventListener("DOMMouseScroll",this.get,false)}this.element.removeEventListener(this.event,this.get,false)}else{if(this.element.detachEvent){this.element.detachEvent("on"+this.event,this.get)}else{var b;for(var a=0;a<jAsset.event.storage[this.event].length;a--){var c=jAsset.event.storage[this.event][a];if(c.matches(this.element)){b=new jAsset.event.Wrapper(this.element,this.event,b?b:c)}}this.element["on"+this.event]=b}}this.destroy();return this},fire:function(a){this.get(a)}};if(document.attachEvent&&!document.addEventListener){jAsset.event.bind(document,"unload",jAsset.event.unbind)}jAsset.forms=new jAsset.module();jAsset.forms.chainLink("getValue",function(){var a;switch(this.nodeName.toLowerCase()){case"input":switch(this.getAttribute("type")){case"radio":case"checkbox":if(this.checked){a=this.value}break;case"submit":case"button":a="";break;case"text":case"hidden":default:a=this.value}break;case"select":a=this.options[this.selectedIndex].value;break;case"textarea":a=this.value||this.innerHTML}return jAsset.util.exists(a)?a+"":null},{type:"end",tags:"input select textarea"});jAsset.forms.chainLink("getEmptyFields",function(){var a=[];for(var c=this.elements.length-1;c>=0;c--){var b=this.elements[c];if(!/button|submit|image/i.test(b.type)&&!jAsset.forms.getValue(b)){a.push(b)}}return a},{tags:"form",forceArray:true});jAsset.forms.chainLink("serialize",function(){var b=jAsset.getByTag("input,select,textarea",this),a="";b.forEach(function(c){var d=jAsset.forms.getValue(c);if(d&&!c.disabled&&c.name){a+=c.name+"="+d.urlencode()+"&"}});return a.substr(0,a.length-1)},{type:"end"});jAsset.forms.alias("getQueryString","serialize");jAsset.ajax=new jAsset.module(["DOM","forms"]);jAsset.ajax.stack=[];jAsset.ajax.options={progressImage:"",progressText:"Please wait...",timeout:5000};jAsset.ajax.connect=function(b,d,a){var c;jAsset.ajax.stack.iterate(function(e){if(!e.inProgress()){c=e;return false}return true});if(!c){c=new jAsset.ajax.XHR();jAsset.ajax.stack.push(c)}a=a||{};c.onerror=a.onerror||function(){};c.onsuccess=d||function(){};c.progressPlaceholder=jAsset.getFirst(a.progressPlaceholder)||null;c.allowCache=!!a.allowCache;c.connect(b,a.method,a.postData,a.sync)};jAsset.ajax.chainLink("load",function(d,e,a){if(!d){return}a=a||{};var c=a.transition||"";a.method="get";var b=this;jAsset.ajax.connect(d,function(f){b.setContent(f.responseText,c);if(e){e(f)}},a)});jAsset.ajax.XHR=function(){if(window.XMLHttpRequest){this.xhrObj=new XMLHttpRequest()}else{if(window.ActiveXObject){if(this.ActiveXObject){this.xhrObj=new ActiveXObject(this.ActiveXObject)}else{["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"].iterate(function(a){try{this.xhrObj=new ActiveXObject(a);this.prototype.ActiveXObject=ActiveXObject;return false}catch(b){}return true})}}}if(!this.xhrObj){this.xhrObj={open:function(){},send:function(){},readyState:0}}};jAsset.ajax.XHR.prototype={connect:function(d,g,a,c){if(!d){return false}this.startProgress();d=new jAsset.URI(d);if(!this.allowCache){d.addParameter("timestamp",jAsset.util.now())}g=("post".equalsIgnoreCase(g))?"POST":"GET";a=a||null;try{this.xhrObj.open(g,d+"",!c)}catch(f){this.onerror(10001,f.message);return false}this.xhrObj.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xhrObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded");var b=this;this.xhrObj.onreadystatechange=function(){if(b.xhrObj.readyState==4){b.stopProgress();clearTimeout(b.timeout);if((b.xhrObj.responseText||b.xhrObj.responseXML)&&(!jAsset.util.exists(b.xhrObj.status)||(b.xhrObj.status>=200&&b.xhrObj.status<300)||b.xhrObj.status==304||b.xhrObj.status==1223)){b.onsuccess(b.xhrObj)}else{b.onerror(b.xhrObj.status,b.xhrObj.statusText)}}};this.xhrObj.send(a);this.timeout=setTimeout(function(){b.onerror(10000,"Request timed out");b.abort()},jAsset.ajax.options.timeout);return true},stopProgress:function(){if(this.progressPlaceholder){var a=jAsset.getByClass("jAsset-progress-indicator","*",this.progressPlaceholder);jAsset.DOM.dispose(a)}return this},startProgress:function(){if(this.progressPlaceholder){var a=jAsset.ajax.options.progressImage?jAsset.DOM.create("img",{src:jAsset.ajax.options.progressImage,alt:jAsset.ajax.options.progressText,className:"jAsset-progress-indicator"}):jAsset.DOM.create("span",{innerHTML:jAsset.ajax.options.progressText,className:"jAsset-progress-indicator"});jAsset.DOM.insert(a,this.progressPlaceholder)}return this},abort:function(){this.stopProgress().xhrObj.abort();return this},inProgress:function(){return[1,2,3].contains(this.xhrObj.readyState)},onerror:Function.dummy,onsuccess:Function.dummy,progressPlaceholder:null};jAsset.BOM=new jAsset.module();jAsset.BOM.getInnerDimension=function(c,b){b=jAsset.util.is("window",b)?b:window;c=(/width/i.test(c))?"Width":"Height";var a=b.document,d=a.documentElement||a.body;return b["inner"+c]||d["client"+c]||0};jAsset.BOM.getInnerWidth=jAsset.BOM.getInnerDimension.curry(["width"]);jAsset.BOM.getInnerHeight=jAsset.BOM.getInnerDimension.curry(["height"]);jAsset.BOM.stop=function(a){a=jAsset.util.is("window",a)?a:window;if(self.stop){a.stop()}else{if(document.execCommand){a.document.execCommand("Stop")}}};jAsset.cookie=new jAsset.module(["util"]);jAsset.cookie.get=function(b){var c=new RegExp("(?:^|;)\\s?"+b+"=(.*?)(?:;|$)","i");var a=document.cookie.match(c);return a&&a.length?unescape(a[1]):null};jAsset.cookie.set=function(c,e,a,g,d,f){var b=jAsset.util.getDate(a);document.cookie=c+"="+escape(e)+(a?";expires="+b.toGMTString():"")+(g?";path="+g:"")+(d?";domain="+d:"")+(f?";secure":"");return document.cookie};jAsset.cookie.remove=function(a){return jAsset.cookie.set(a,"",new Date(0))};jAsset.cookie.partial={defaultSeparator:"\n",defaultAssignment:"::"};jAsset.cookie.partial.get=function(c,b,f,g){var e=jAsset.cookie.get(c);if(!e){return null}if(!jAsset.util.exists(f)){f=jAsset.cookie.partial.defaultSeparator}if(!jAsset.util.exists(g)){g=jAsset.cookie.partial.defaultAssignment}var d=new RegExp("(?:^|"+f+")"+b+g+"(.*?)(?:"+f+"|$)","im");var a=e.match(d);return(a&&a.length)?a[1]:null};jAsset.cookie.partial.set=function(b,g,j,d,k,e,a,f,c){jAsset.cookie.partial.remove(b,g,f,c);if(!jAsset.util.exists(f)){f=jAsset.cookie.partial.defaultSeparator}if(!jAsset.util.exists(c)){c=jAsset.cookie.partial.defaultAssignment}var h=jAsset.cookie.get(b);h=h?h+f:"";h+=g+c+j;jAsset.cookie.set(b,h,d,k,e,a);return document.cookie};jAsset.cookie.partial.remove=function(b,g,d,k,e,a,f,c){var h=jAsset.cookie.get(b);if(h){if(!jAsset.util.exists(f)){f=jAsset.cookie.partial.defaultSeparator}if(!jAsset.util.exists(c)){c=jAsset.cookie.partial.defaultAssignment}var j=new RegExp("(?:^|"+f+")"+g+c+"(.*?)(?:"+f+"|$)","gim");h=h.replace(j,f);while(h.startsWith(f)){h=h.substr(f.length)}while(h.endsWith(f)){h=h.substr(0,h.length-f.length)}jAsset.cookie.set(b,h,d,k,e,a)}return document.cookie};jAsset.debug=function(a){if(window.console&&console.log&&((console.log+"").length>15)){console.log("jAsset msg: "+a)}else{arguments.callee.console=arguments.callee.console||[];arguments.callee.console.push(a)}return a};jAsset.debug.logObject=function(a){if(console.group){console.group("jAsset object logging")}jAsset.each(a,function(b,c){jAsset.debug(c+":\t\t\t"+b)});if(console.groupEnd){console.groupEnd()}return a};jAsset.debug.logProperties=function(a){return jAsset.each(a,function(b,c){jAsset.debug(c)})};jAsset.debug.getObjectProperties=function(b){var a="";jAsset.each(b,function(c,d){a+=d+":\t\t"+c+"\n"});return a};jAsset.debug.benchmark=function(c,k,b,a,d){if(!c){return NaN}b=b||window;a=a||4;var g=jAsset.util.now();for(var h=0;h<a;h++){try{var m=c.call(b,k)}catch(j){}}var f=(jAsset.util.now()-g)/a;if(!d){jAsset.debug("The function took "+f+"ms to execute and returned "+m)}return f};jAsset.debug.race=function(b,a,c,d,f){var g=jAsset.debug.benchmark(b,c,d,f,true);var e=jAsset.debug.benchmark(a,c,d,f,true);jAsset.debug("The first function took "+g+"ms and the second "+e+"ms. The difference is "+Math.abs(g-e)+"ms. The "+(g>e?"second":"first")+" function wins.")};jAsset.debug.element=function(b){if(!jAsset.util.isElement(b)){return""}var a=b.nodeName.toLowerCase();if(b.id){a+="#"+b.id}if(b.className){a+="."+b.className.replace(/\s+/g,".")}return a};if(!window.$){var $=jAsset.getFirst}if(!window.$$){var $$=jAsset.get}jAsset.DOM.nodeListToArray=jAsset.util.toArray;jAsset.CSS.setEvent=jAsset.event.bind;jAsset.CSS.setProperty=jAsset.DOM.setAttributes;jAsset.CSS.getElementsBySelector=jAsset.selector.get;jAsset.attach(jAsset.CSS,jAsset.selector);var CSS=jAsset.CSS;var DOM=jAsset.DOM;