forked from meritt/base2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase2-dom-fp.js
9 lines (8 loc) · 66.4 KB
/
base2-dom-fp.js
1
2
3
4
5
6
7
8
9
/*
base2 - copyright 2007-2009, Dean Edwards
http://code.google.com/p/base2/
http://www.opensource.org/licenses/mit-license.php
Contributors:
Doeke Zanstra
*/
var base2={name:"base2",version:"1.1 (alpha1)",exports:"Base,Package,Abstract,Module,Enumerable,Map,Collection,RegGrp,Undefined,Null,This,True,False,assignID,detect,global",namespace:""};new function(_1o){/*@cc_on @*/var Undefined=K(),Null=K(null),True=K(true),False=K(false),This=function(){return this};var global=This(),base2=global.base2;var _T=K(),_2q=/%([1-9])/g,_1p=/^\s\s*/,_1q=/\s\s*$/,_1r=/([\/()[\]{}|*+-.,^$?\\])/g,_U=/try/.test(detect)?/\bbase\b/:/.*/,_V=["constructor","toString"],_1s=detect("(jscript)")?new RegExp("^"+rescape(isNaN).replace(/isNaN/,"\\w+")+"$"):{test:False},_1t=1,_4=Array.prototype.slice;_c();function assignID(a,b){if(!b)b=a.nodeType==1?"uniqueID":"base2ID";if(!a[b])a[b]="b2_"+_1t++;return a[b]};var _W=function(a,b){base2.__prototyping=this.prototype;var c=new this;if(a)extend(c,a);c.base=function(){};delete base2.__prototyping;var d=c.constructor;function e(){if(!base2.__prototyping){if(this.constructor==e||this.__constructing){this.__constructing=true;d.apply(this,arguments);delete this.__constructing}else{return extend(arguments[0],c)}}return this};c.constructor=e;for(var f in Base)e[f]=this[f];if(b)extend(e,b);e.ancestor=this;e.ancestorOf=Base.ancestorOf;e.base=c.base;e.prototype=c;if(e.init)e.init();return e};var Base=_W.call(Object,{constructor:function(){if(arguments.length>0){this.extend(arguments[0])}},extend:delegate(extend),toString:function(){if(this.constructor.toString==Function.prototype.toString){return"[object base2.Base]"}else{return"[object "+String2.slice(this.constructor,1,-1)+"]"}}},Base={ancestorOf:function(a){return _y(this,a)},extend:_W,forEach:function(a,b,c){_c(this,a,b,c)},implement:function(a){if(typeof a=="function"){a=a.prototype}extend(this.prototype,a);return this}});var Package=Base.extend({constructor:function(d,e){var f=this;f.extend(e);if(f.name&&f.name!="base2"){if(e.parent===undefined)f.parent=base2;if(f.parent)f.parent.addName(f.name,f);f.namespace=format("var %1=%2;",f.name,String2.slice(f,1,-1))}if(d){var g=base2.js?base2.js.namespace:"";var h="var base2=(function(){return this.base2})(),_0=base2.toString;"+base2.namespace+g;var j=csv(f.imports),k;for(var l=0;k=j[l];l++){var o=r(k)||r("js."+k);if(!o)throw new ReferenceError(format("Object not found: '%1'.",k));h+=o.namespace}d.init=function(){if(f.init)f.init()};d.imports=h+lang.namespace+"this.init();";h="";var s=csv(f.exports);for(var l=0;k=s[l];l++){var n=f.name+"."+k;f.namespace+="var "+k+"="+n+";";h+="if(!"+n+")"+n+"="+k+";"}d.exports=h+"this._1u"+f.name+"();";var m=String2.slice(f,1,-1);d["_1u"+f.name]=function(){for(var a in f){var b=f[a];if(b&&b.ancestorOf==Base.ancestorOf&&a!="constructor"){b.toString=K("["+m+"."+a+"]")}}}}function r(a){a=a.split(".");var b=base2,c=0;while(b&&a[c]!=null){b=b[a[c++]]}return b}},exports:"",imports:"",name:"",namespace:"",parent:null,addName:function(a,b){if(!this[a]){this[a]=b;this.exports+=","+a;this.namespace+=format("var %1=%2.%1;",a,this.name);if(b&&b.ancestorOf==Base.ancestorOf&&a!="constructor"){b.toString=K("["+String2.slice(this,1,-1)+"."+a+"]")}}},addPackage:function(a){this.addName(a,new Package(null,{name:a,parent:this}))},toString:function(){return format("[%1]",this.parent?String2.slice(this.parent,1,-1)+"."+this.name:this.name)}});var Abstract=Base.extend({constructor:function(){throw new TypeError("Abstract class cannot be instantiated.");}});var _1v=0;var Module=Abstract.extend(null,{namespace:"",extend:function(a,b){var c=this.base();var d=_1v++;c.namespace="";c.partial=this.partial;c.toString=K("[base2.Module["+d+"]]");Module[d]=c;c.implement(this);if(a)c.implement(a);if(b){extend(c,b);if(c.init)c.init()}return c},forEach:function(c,d){_c(Module,this.prototype,function(a,b){if(typeOf(a)=="function"){c.call(d,this[b],b,this)}},this)},implement:function(a){var b=this;var c=b.toString().slice(1,-1);if(typeof a=="function"){if(!_y(a,b)){this.base(a)}if(_y(Module,a)){for(var d in a){if(typeof b[d]=="undefined"){var e=a[d];if(typeof e=="function"&&e.call&&a.prototype[d]){e=_1w(a,d)}b[d]=e}}b.namespace+=a.namespace.replace(/base2\.Module\[\d+\]/g,c)}}else{extend(b,a);_X(b,a)}return b},partial:function(){var c=Module.extend();var d=c.toString().slice(1,-1);c.namespace=this.namespace.replace(/(\w+)=b[^\)]+\)/g,"$1="+d+".$1");this.forEach(function(a,b){c[b]=partial(bind(a,c))});return c}});Module.prototype.base=Module.prototype.extend=_T;function _X(a,b){var c=a.prototype;var d=a.toString().slice(1,-1);for(var e in b){var f=b[e],g="";if(e.indexOf("@")==0){if(detect(e.slice(1)))_X(a,f)}else if(!c[e]){if(e==e.toUpperCase()){g="var "+e+"="+d+"."+e+";"}else if(typeof f=="function"&&f.call){g="var "+e+"=base2.lang.bind('"+e+"',"+d+");";c[e]=_1x(a,e)}if(a.namespace.indexOf(g)==-1){a.namespace+=g}}}};function _1w(a,b){return function(){return a[b].apply(a,arguments)}};function _1x(b,c){return function(){var a=_4.call(arguments);a.unshift(this);return b[c].apply(b,a)}};var Enumerable=Module.extend({every:function(c,d,e){var f=true;try{forEach(c,function(a,b){f=d.call(e,a,b,c);if(!f)throw StopIteration;})}catch(error){if(error!=StopIteration)throw error;}return!!f},filter:function(d,e,f){var g=0;return this.reduce(d,function(a,b,c){if(e.call(f,b,c,d)){a[g++]=b}return a},[])},invoke:function(b,c){var d=_4.call(arguments,2);return this.map(b,typeof c=="function"?function(a){return a==null?undefined:c.apply(a,d)}:function(a){return a==null?undefined:a[c].apply(a,d)})},map:function(c,d,e){var f=[],g=0;forEach(c,function(a,b){f[g++]=d.call(e,a,b,c)});return f},pluck:function(b,c){return this.map(b,function(a){return a==null?undefined:a[c]})},reduce:function(c,d,e,f){var g=arguments.length>2;forEach(c,function(a,b){if(g){e=d.call(f,e,a,b,c)}else{e=a;g=true}});return e},some:function(a,b,c){return!this.every(a,not(b),c)}});var _2="#";var Map=Base.extend({constructor:function(a){if(a)this.merge(a)},clear:function(){for(var a in this)if(a.indexOf(_2)==0){delete this[a]}},copy:function(){base2.__prototyping=true;var a=new this.constructor;delete base2.__prototyping;for(var b in this)if(this[b]!==a[b]){a[b]=this[b]}return a},forEach:function(a,b){for(var c in this)if(c.indexOf(_2)==0){a.call(b,this[c],c.slice(1),this)}},get:function(a){return this[_2+a]},getKeys:function(){return this.map(II)},getValues:function(){return this.map(I)},has:function(a){a=_2+a;/*@if(@_jscript_version<5.5)return this[a]!==undefined||$Legacy.has(this,a);@else @*/return a in this;/*@end @*/},merge:function(b){var c=flip(this.put);forEach(arguments,function(a){forEach(a,c,this)},this);return this},put:function(a,b){this[_2+a]=b;return b},remove:function(a){delete this[_2+a]},size:function(){var a=0;for(var b in this)if(b.indexOf(_2)==0)a++;return a},union:function(a){return this.merge.apply(this.copy(),arguments)}});Map.implement(Enumerable);Map.prototype.filter=function(d,e){return this.reduce(function(a,b,c){if(!d.call(e,b,c,this)){a.remove(c)}return a},this.copy(),this)};var _1="~";var Collection=Map.extend({constructor:function(a){this[_1]=new Array2;this.base(a)},add:function(a,b){if(this.has(a))throw"Duplicate key '"+a+"'.";return this.put.apply(this,arguments)},clear:function(){this.base();this[_1].length=0},copy:function(){var a=this.base();a[_1]=this[_1].copy();return a},forEach:function(a,b){var c=this[_1].concat();var d=c.length;for(var e=0;e<d;e++){a.call(b,this[_2+c[e]],c[e],this)}},getAt:function(a){var b=this[_1].item(a);return(b===undefined)?undefined:this[_2+b]},getKeys:function(){return this[_1].copy()},indexOf:function(a){return this[_1].indexOf(String(a))},insertAt:function(a,b,c){if(this[_1].item(a)==null)throw"Index out of bounds.";if(this.has(b))throw"Duplicate key '"+b+"'.";this[_1].insertAt(a,String(b));this[_2+b]=null;return this.put.apply(this,_4.call(arguments,1))},item:function(a){return this[typeof a=="number"?"getAt":"get"](a)},put:function(a,b){var c=this.constructor;if(c.Item&&!instanceOf(b,c.Item)){b=c.create.apply(c,arguments)}if(!this.has(a)){this[_1].push(String(a))}this[_2+a]=b;return b},putAt:function(a,b){arguments[0]=this[_1].item(a);if(arguments[0]==null)throw"Index out of bounds.";return this.put.apply(this,arguments)},remove:function(a){if(this.has(a)){this[_1].remove(String(a));delete this[_2+a]}},removeAt:function(a){var b=this[_1].item(a);if(b!==undefined){this[_1].removeAt(a);delete this[_2+b]}},reverse:function(){this[_1].reverse();return this},size:function(){return this[_1].length},slice:function(a,b){var c=this.copy();if(arguments.length>0){var d=this[_1],e=d;c[_1]=Array2(_4.apply(d,arguments));if(c[_1].length){e=e.slice(0,a);if(arguments.length>1){e=e.concat(d.slice(b))}}for(var f=0;f<e.length;f++){delete c[_2+e[f]]}}return c},sort:function(c){if(c){this[_1].sort(bind(function(a,b){return c(this[_2+a],this[_2+b],a,b)},this))}else this[_1].sort();return this},toString:function(){return"("+(this[_1]||"")+")"}},{Item:null,create:function(a,b){return this.Item?new this.Item(a,b):b},extend:function(a,b){var c=this.base(a);c.create=this.create;if(b)extend(c,b);if(!c.Item){c.Item=this.Item}else if(typeof c.Item!="function"){c.Item=(this.Item||Base).extend(c.Item)}if(c.init)c.init();return c}});var _1y=/\\(\d+)/g,_1z=/\\./g,_1A=/\(\?[:=!]|\[[^\]]+\]/g,_1B=/\(/g,_1C=/\$(\d+)/,_1D=/^\$\d+$/;var RegGrp=Collection.extend({constructor:function(a,b){this.base(a);this.ignoreCase=!!b},ignoreCase:false,exec:function(g,h){g+="";var j=this,k=this[_1];if(!k.length)return g;if(h==RegGrp.IGNORE)h=0;return g.replace(new RegExp(this,this.ignoreCase?"gi":"g"),function(a){var b,c=1,d=0;while((b=j[_2+k[d++]])){var e=c+b.length+1;if(arguments[c]){var f=h==null?b.replacement:h;switch(typeof f){case"function":return f.apply(j,_4.call(arguments,c,e));case"number":return arguments[c+f];default:return f}}c=e}return a})},insertAt:function(a,b,c){if(instanceOf(b,RegExp)){arguments[1]=b.source}return this.base.apply(this,arguments)},test:function(a){return this.exec(a)!=a},toString:function(){var e=1;return"("+this.map(function(c){var d=(c+"").replace(_1y,function(a,b){return"\\"+(e+Number(b))});e+=c.length+1;return d}).join(")|(")+")"}},{IGNORE:"$0",init:function(){forEach("add,get,has,put,remove".split(","),function(b){this[b]=_z(this,b,function(a){if(instanceOf(a,RegExp)){arguments[0]=a.source}return this.base.apply(this,arguments)})},this.prototype)},Item:{constructor:function(a,b){if(b==null)b=RegGrp.IGNORE;else if(b.replacement!=null)b=b.replacement;else if(typeof b!="function")b=String(b);if(typeof b=="string"&&_1C.test(b)){if(_1D.test(b)){b=parseInt(b.slice(1),10)}else{var c='"';b=b.replace(/\\/g,"\\\\").replace(/"/g,"\\x22").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\$(\d+)/g,c+"+(arguments[$1]||"+c+c+")+"+c).replace(/(['"])\1\+(.*)\+\1\1$/,"$1");b=new Function("return "+c+b+c)}}this.length=RegGrp.count(a);this.replacement=b;this.toString=K(a+"")},disabled:false,length:0,replacement:""},count:function(a){a=(a+"").replace(_1z,"").replace(_1A,"");return match(a,_1B).length}});var lang={name:"lang",version:base2.version,exports:"assert,assertArity,assertType,bind,copy,extend,forEach,format,instanceOf,match,pcopy,rescape,trim,typeOf",namespace:""};function assert(a,b,c){if(!a){throw new(c||Error)(b||"Assertion failed.");}};function assertArity(a,b,c){if(b==null)b=a.callee.length;if(a.length<b){throw new SyntaxError(c||"Not enough arguments.");}};function assertType(a,b,c){if(b&&(typeof b=="function"?!instanceOf(a,b):typeOf(a)!=b)){throw new TypeError(c||"Invalid type.");}};function copy(a){var b={};for(var c in a){b[c]=a[c]}return b};function pcopy(a){_Y.prototype=a;return new _Y};function _Y(){};function extend(a,b){if(a&&b){var c=base2.__prototyping;if(arguments.length>2){var d=b;b={};b[d]=arguments[2];c=true}var e=global[(typeof b=="function"?"Function":"Object")].prototype;if(c){var f=_V.length,d;while((d=_V[--f])){var g=b[d];if(g!=e[d]){if(_U.test(g)){a[d]=_z(a,d,g)}else{a[d]=g}}}}for(d in b){if(typeof e[d]=="undefined"){g=b[d];if(d.indexOf("@")==0){if(detect(d.slice(1)))extend(a,g)}else if(g!=_T){var h=a[d];if(h&&typeof g=="function"){if(g!=h){if(_U.test(g)){a[d]=_z(a,d,g)}else{g.ancestor=h;a[d]=g}}}else{a[d]=g}}}}}/*@if(@_jscript){try{return a}finally{a=null}}@else @*/return a;/*@end @*/};function _y(a,b){while(b){if(!b.ancestor)return false;b=b.ancestor;if(b==a)return true}return false};function _z(c,d,e){var f=c[d];var g=base2.__prototyping;if(g&&f!=g[d])g=null;function h(){var a=this.base;this.base=g?g[d]:f;var b=e.apply(this,arguments);this.base=a;return b};h.method=e;h.ancestor=f;return h};if(typeof StopIteration=="undefined"){StopIteration=new Error("StopIteration")}function forEach(a,b,c,d){if(a==null)return;if(!d){if(typeof a=="function"&&a.call){d=Function}else if(typeof a.forEach=="function"&&a.forEach!=forEach){a.forEach(b,c);return}else if(typeof a.length=="number"){_o(a,b,c);return}}_c(d||Object,a,b,c)};forEach.csv=function(a,b,c){forEach(csv(a),b,c)};forEach.detect=function(c,d,e){var f=function(a,b){if(b.indexOf("@")==0){if(detect(b.slice(1)))forEach(a,f)}else d.call(e,a,b,c)};forEach(c,f)};function _o(a,b,c){if(a==null)a=global;var d=a.length||0,e;if(typeof a=="string"){for(e=0;e<d;e++){b.call(c,a.charAt(e),e,a)}}else{for(e=0;e<d;e++){/*@if(@_jscript_version<5.2)if(a[e]!==undefined&&$Legacy.has(a,e))@else @*/if(e in a)/*@end @*/b.call(c,a[e],e,a)}}};function _c(g,h,j,k){var l=function(){this.i=1};l.prototype={i:1};var o=0;for(var s in new l)o++;_c=o>1?function(a,b,c,d){var e={};for(var f in b){if(!e[f]&&a.prototype[f]===undefined){e[f]=true;c.call(d,b[f],f,b)}}}:function(a,b,c,d){for(var e in b){if(typeof a.prototype[e]=="undefined"){c.call(d,b[e],e,b)}}};_c(g,h,j,k)};function instanceOf(a,b){if(typeof b!="function"){throw new TypeError("Invalid 'instanceOf' operand.");}if(a==null)return false;/*@if(@_jscript)if(typeof a.constructor!="function"){return b==Object}/*@end @*/if(a.constructor==b)return true;if(b.ancestorOf)return b.ancestorOf(a.constructor);/*@if(@_jscript_version<5.1)@else @*/if(a instanceof b)return true;/*@end @*/if(Base.ancestorOf==b.ancestorOf)return false;if(Base.ancestorOf==a.constructor.ancestorOf)return b==Object;switch(b){case Array:return _p.call(a)=="[object Array]";case Date:return _p.call(a)=="[object Date]";case RegExp:return _p.call(a)=="[object RegExp]";case Function:return typeOf(a)=="function";case String:case Number:case Boolean:return typeOf(a)==typeof b.prototype.valueOf();case Object:return true}return false};var _p=Object.prototype.toString;function typeOf(a){var b=typeof a;switch(b){case"object":return a==null?"null":typeof a.constructor!="function"?_1s.test(a)?"function":b:_p.call(a)=="[object Date]"?b:typeof a.constructor.prototype.valueOf();case"function":return typeof a.call=="function"?b:"object";default:return b}};var js={name:"js",version:base2.version,exports:"Array2,Date2,Function2,String2",namespace:"",bind:function(c){var d=global;global=c;forEach.csv(this.exports,function(a){var b=a.slice(0,-1);extend(c[b],this[a]);this[a](c[b].prototype)},this);global=d;return c}};function _q(b,c,d,e){var f=Module.extend();var g=f.toString().slice(1,-1);forEach.csv(d,function(a){f[a]=unbind(b.prototype[a]);f.namespace+=format("var %1=%2.%1;",a,g)});forEach(_4.call(arguments,3),f.implement,f);var h=function(){return f(this.constructor==f?c.apply(null,arguments):arguments[0])};h.prototype=f.prototype;for(var j in f){var k=b[j];if(k&&j!="prototype"&&j!="toString"&&k!=Function.prototype[j]){f[j]=k;delete f.prototype[j]}h[j]=f[j]}h.ancestor=Object;delete h.extend;h.namespace=h.namespace.replace(/(var (\w+)=)[^,;]+,([^\)]+)\)/g,"$1$3.$2");return h};if((new Date).getYear()>1900){Date.prototype.getYear=function(){return this.getFullYear()-1900};Date.prototype.setYear=function(a){return this.setFullYear(a+1900)}}var _Z=new Date(Date.UTC(2006,1,20));_Z.setUTCDate(15);if(_Z.getUTCHours()!=0){forEach.csv("FullYear,Month,Date,Hours,Minutes,Seconds,Milliseconds",function(b){extend(Date.prototype,"setUTC"+b,function(){var a=this.base.apply(this,arguments);if(a>=57722401000){a-=3600000;this.setTime(a)}return a})})}Function.prototype.prototype={};if("".replace(/^/,K("$$"))=="$"){extend(String.prototype,"replace",function(a,b){if(typeof b=="function"){var c=b;b=function(){return String(c.apply(null,arguments)).split("$").join("$$")}}return this.base(a,b)})}var Array2=_q(Array,Array,"concat,join,pop,push,reverse,shift,slice,sort,splice,unshift",Enumerable,{batch:function(d,e,f,g,h){var j=0,k=d.length;var l=function(){var a=Date2.now(),b=a,c=0;while(j<k&&(a-b<f)){e.call(h,d[j],j++,d);if(c++<5||c%50==0)a=Date2.now()}if(j<k){setTimeout(l,10)}else{if(g)g.call(h)}};setTimeout(l,1)},combine:function(d,e){if(!e)e=d;return Array2.reduce(d,function(a,b,c){a[b]=e[c];return a},{})},contains:function(a,b){return Array2.indexOf(a,b)!=-1},copy:function(a){var b=_4.call(a);if(!b.swap)Array2(b);return b},flatten:function(c){var d=0;var e=function(a,b){if(Array2.like(b)){Array2.reduce(b,e,a)}else{a[d++]=b}return a};return Array2.reduce(c,e,[])},forEach:_o,indexOf:function(a,b,c){var d=a.length;if(c==null){c=0}else if(c<0){c=Math.max(0,d+c)}for(var e=c;e<d;e++){if(a[e]===b)return e}return-1},insertAt:function(a,b,c){Array2.splice(a,b,0,c)},item:function(a,b){if(b<0)b+=a.length;return a[b]},lastIndexOf:function(a,b,c){var d=a.length;if(c==null){c=d-1}else if(c<0){c=Math.max(0,d+c)}for(var e=c;e>=0;e--){if(a[e]===b)return e}return-1},map:function(c,d,e){var f=[];_o(c,function(a,b){f[b]=d.call(e,a,b,c)});return f},remove:function(a,b){var c=Array2.indexOf(a,b);if(c!=-1)Array2.removeAt(a,c)},removeAt:function(a,b){Array2.splice(a,b,1)},swap:function(a,b,c){if(b<0)b+=a.length;if(c<0)c+=a.length;var d=a[b];a[b]=a[c];a[c]=d;return a}});Array2.forEach=_o;Array2.reduce=Enumerable.reduce;Array2.like=function(a){return typeOf(a)=="object"&&typeof a.length=="number"};var _1E=/^((-\d+|\d{4,})(-(\d{2})(-(\d{2}))?)?)?T((\d{2})(:(\d{2})(:(\d{2})(\.(\d{1,3})(\d)?\d*)?)?)?)?(([+-])(\d{2})(:(\d{2}))?|Z)?$/;var _6={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14};var _7={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20};var Date2=_q(Date,function(a,b,c,d,e,f,g){switch(arguments.length){case 0:return new Date;case 1:return typeof a=="string"?new Date(Date2.parse(a)):new Date(a.valueOf());default:return new Date(a,b,arguments.length==2?1:c,d||0,e||0,f||0,g||0)}},"",{toISOString:function(c){var d="####-##-##T##:##:##.###";for(var e in _6){d=d.replace(/#+/,function(a){var b=c["getUTC"+e]();if(e=="Month")b++;return("000"+b).slice(-a.length)})}return d+"Z"}});delete Date2.forEach;Date2.now=function(){return(new Date).valueOf()};Date2.parse=function(a,b){if(arguments.length>1){assertType(b,"number","Default date should be of type 'number'.")}var c=match(a,_1E);if(c.length){var d=c[_6.Month];if(d)c[_6.Month]=String(d-1);if(c[_7.Hectomicroseconds]>=5)c[_6.Milliseconds]++;var e=c[_7.UTC]||c[_7.Hours]?"UTC":"";var f=new Date(b||0);if(c[_6.Date])f["set"+e+"Date"](14);for(var g in _6){var h=c[_6[g]];if(h){f["set"+e+g](h);if(f["get"+e+g]()!=c[_6[g]]){return NaN}}}if(c[_7.Hours]){var j=Number(c[_7.Sign]+c[_7.Hours]);var k=Number(c[_7.Sign]+(c[_7.Minutes]||0));f.setUTCMinutes(f.getUTCMinutes()+(j*60)+k)}return f.valueOf()}else{return Date.parse(a)}};var String2=_q(String,function(a){return new String(arguments.length==0?"":a)},"charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase",{csv:csv,format:format,rescape:rescape,trim:trim});delete String2.forEach;function trim(a){return String(a).replace(_1p,"").replace(_1q,"")};function csv(a){return a?(a+"").split(/\s*,\s*/):[]};function format(c){var d=arguments;var e=new RegExp("%([1-"+(arguments.length-1)+"])","g");return(c+"").replace(e,function(a,b){return d[b]})};function match(a,b){return(a+"").match(b)||[]};function rescape(a){return(a+"").replace(_1r,"\\$1")};var Function2=_q(Function,Function,"",{I:I,II:II,K:K,bind:bind,compose:compose,delegate:delegate,flip:flip,not:not,partial:partial,unbind:unbind});function I(a){return a};function II(a,b){return b};function K(a){return function(){return a}};function bind(a,b){var c=typeof a!="function";if(arguments.length>2){var d=_4.call(arguments,2);return function(){return(c?b[a]:a).apply(b,d.concat.apply(d,arguments))}}else{return function(){return(c?b[a]:a).apply(b,arguments)}}};function compose(){var c=_4.call(arguments);return function(){var a=c.length,b=c[--a].apply(this,arguments);while(a--)b=c[a].call(this,b);return b}};function delegate(b,c){return function(){var a=_4.call(arguments);a.unshift(this);return b.apply(c,a)}};function flip(a){return function(){return a.apply(this,Array2.swap(arguments,0,1))}};function not(a){return function(){return!a.apply(this,arguments)}};function partial(d){var e=_4.call(arguments,1);return function(){var a=e.concat(),b=0,c=0;while(b<e.length&&c<arguments.length){if(a[b]===undefined)a[b]=arguments[c++];b++}while(c<arguments.length){a[b++]=arguments[c++]}if(Array2.contains(a,undefined)){a.unshift(d);return partial.apply(null,a)}return d.apply(this,a)}};function unbind(b){return function(a){return b.apply(a,_4.call(arguments,1))}};function detect(){var j=NaN/*@cc_on||@_jscript_version@*/,k=true;if(global.navigator){var l=/MSIE[\d.]+/g,o=document.createElement("span"),s=document.createElement("input"),n=o.style,m=navigator.userAgent.replace(/([a-z])[\s\/](\d)/gi,"$1$2");k&=navigator.javaEnabled();if(!j)m=m.replace(l,"");if(/MSIE/.test(m)){m=m.match(l)[0]+";"+m.replace(l,"").replace(/user\-agent.*$/i,"")}if(/Chrome/.test(m))m=m.replace(/Safari[\d.]*/gi,"");else if(/Gecko/.test(m))m=m.replace(/Gecko/g,"Gecko/").replace(/rv:/,"Gecko");if(!/^CSS/.test(document.compatMode))m+=";QuirksMode";base2.userAgent=m.replace(/like \w+/gi,"")+";"+navigator.platform}var r={};detect=function(e){var f=e.indexOf("!")==0;if(f)e=e.slice(1);if(r[e]==null){var g=false,h=e;if(h.indexOf("(")==0){if(base2.dom){h=h.replace(/(hasFeature)/,"document.implementation.$1").replace(/\bstyle\.(\w+)/g,function(a,b){if(!n[b]){b=base2.dom.CSSStyleDeclaration.getPropertyName(b)}return"style."+b}).replace(/^\((\w+\.[\w\.]+)\)$/,function(a,b){b=b.split(".");var c=b.pop(),d=b.join(".");return"("+(j<5.6?d+"."+c+"!==undefined":"'"+c+"' in "+d)+")"})}try{g=new Function("global,element,input,style,jscript,java","return !!"+h)(global,o,s,n,j,k?global.java:null)}catch(x){}}else{g=new RegExp("("+h+")","i").test(base2.userAgent)}r[e]=g}return!!(f^r[e])};detect.MSIE=!!j;detect.MSIE5=j<5.6;return detect(arguments[0])};base2=global.base2=new Package(this,base2);base2.toString=K("[base2]");var exports=this.exports;lang=new Package(this,lang);exports+=this.exports;js=new Package(this,js);eval(exports+this.exports);lang.extend=extend;base2.JavaScript=pcopy(js);base2.JavaScript.namespace+="var JavaScript=js;"};new function(_1o){var dom=new base2.Package(this,{name:"dom",version:base2.version,imports:"Function2",exports:"Interface,Binding,Node,Document,Element,Traversal,AbstractView,ViewCSS,CSSStyleDeclaration,NodeSelector,StaticNodeList,Selector,CSSParser,XPathParser,Event,EventTarget,DocumentEvent,HTMLDocument,HTMLElement,ClassList,ElementView",bind:function(a){/*@if(@_jscript_version<5.6)if(a&&a.getElementById){a.nodeType=9}/*@end @*/if(a&&a.nodeType){var b=(a.nodeType==1?a.uniqueID:a.base2ID)||assignID(a);if(!_A[b]){switch(a.nodeType){case 1:if(typeof a.className=="string"){(HTMLElement.bindings[a.tagName]||HTMLElement).bind(a)}else{Element.bind(a)}break;case 9:if(a.getElementById){HTMLDocument.bind(a)}else{Document.bind(a)}break;default:Node.bind(a)}_A[b]=true}}return a},isBound:function(a){return!!_A[a.nodeType==1?a.uniqueID:a.base2ID]}});eval(this.imports);base2.DOM=pcopy(dom);base2.DOM.namespace+="var DOM=dom;";/*@cc_on @*/var _A={};var _5=document.createElement("span"),_B=_5.style;var _C=detect("(element.textContent)")?"textContent":"innerText";var _1F=/^(action|cite|codebase|data|href|longdesc|lowsrc|src|usemap)$/i,_1G=/^(type|value)$/i;var _D=detect("(element.parentElement)")?"parentElement":"parentNode";var _1H=/type="?([^\s">]*)"?/i,_1I=/value="?([^\s">]*)"?/i;function _10(b){return extend(this.base(b),"removeEventListener",function(){var a=Array2.slice(arguments);a.unshift(this);EventTarget.removeEventListener.apply(EventTarget,a)})};var _11=_5.sourceIndex==undefined?function(a){var b=0;while(a){var c=Traversal.getNodeIndex(a);b="0000".slice(0,4-String(c).length)+c+"."+b;a=a.parentNode}return b}:function(a){return a.sourceIndex};var _r={"class":"className","for":"htmlFor"};var _12="accessKey,allowTransparency,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,frameBorder,longDesc,maxLength,noHref,noResize,noShade,noWrap,readOnly,rowSpan,tabIndex,useMap,vAlign";extend(_r,Array2.combine(_12.toLowerCase().split(","),_12.split(",")));var _1J=_5.getAttributeNode?function(a,b){return a.getAttributeNode(b)}:function(a,b){return a.attributes[b]||a.attributes[_r[b.toLowerCase()]]};var Interface=Module.extend(null,{forEach:function(c,d){forEach(this,function(a,b){if(typeOf(a)=="function"&&(this.prototype[b]||a._s)){c.call(d,a,b,this)}},this,Module)},implement:function(a){if(typeof a=="object"){_13(this,a)}else if(Interface.ancestorOf(a)){for(var b in a){if(a[b]&&a[b]._s){this[b]=bind(b,a);this[b]._s=b}}}return this.base(a)}});function _13(a,b){var c=a.toString().slice(1,-1);for(var d in b){var e=b[d];if(d.indexOf("@")==0){_13(a,e)}else if(!a[d]&&typeof e=="function"&&e.call){var f="abcdefghij".slice(0,e.length).split("");var g=new Function(f.join(","),format("%2.base=%2.%1.ancestor;var m=%2.base?'base':'%1';return %2[m](%3)",d,f[0],f.slice(1)));g._s=d;a[d]=g;a.namespace+="var "+d+"=base2.lang.bind('"+d+"',"+c+");";}}};var Binding=Interface.extend(null,{bind:function(a){return extend(a,this.prototype);}});var Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(a,b){if(Traversal.contains(a,b)){return 4|16;}else if(Traversal.contains(b,a)){return 2|8;}var c=_11(a);var d=_11(b);if(c<d){return 4;}else if(c>d){return 2;}return 1;}}});var Document=Node.extend(null,{bind:function(b){extend(b,"createElement",function(a){return dom.bind(this.base(a));});if(!b.defaultView){b.defaultView=Traversal.getDefaultView(b);}AbstractView.bind(b.defaultView);if(b!=window.document){new DOMContentLoadedEvent(b);}return this.base(b);},"@Gecko":{bind:_10}});detect("(element.className='test',element.expando=true)");var Element=Node.extend({"@(element.getAttribute('made-up')===''||element.getAttribute('id')!=null||element.getAttribute('expando'))":{getAttribute:function(a,b){var c=_1J(a,b),d=c&&c.specified;/*@if(@_jscript)if(a.nodeName=="INPUT"&&_1G.test(b)&&a.outerHTML){var e=a.outerHTML||"";with(e)e=slice(0,indexOf(">")+1);return match(e,b=="type"?_1H:_1I)[1]||null;}if((d&&_1F.test(b))||(!c&&@_jscript_version<5.6)){var f="getAttribute";if(a["_"+f])f="_"+f;return a[f](b,2);}/*@end @*/if(d){/*@if(@_jscript)if(b=="style")return a.style.cssText.toLowerCase();/*@end @*/return c.nodeValue;}return null;},hasAttribute:function(a,b){return this.getAttribute(a,b)!=null;}},"@!(element.getAttribute('class'))":{removeAttribute:function(a,b){b=_r[b.toLowerCase()]||b;/*@if(@_jscript)var c="removeAttribute";if(a["_"+c])c="_"+c;a[c](b);@else @*/this.base(a,b);/*@end @*/},setAttribute:function(a,b,c){b=_r[b.toLowerCase()]||b;/*@if(@_jscript)if(b=="style"){a.style.cssText=c;}else{var d="setAttribute";if(a["_"+d])d="_"+d;a[d](b,String(c));}@else @*/this.base(a,b,c);/*@end @*/}},"@!(element.hasAttribute)":{hasAttribute:function(a,b){return this.getAttribute(a,b)!=null;}},"@!(element.matchesSelector)":{matchesSelector:function(a,b){return new Selector(b).test(a);}}},{"@Gecko":{bind:_10}});var Traversal=Module.extend({contains:function(a,b){a.nodeType;while(b&&(b=b[_D])&&a!=b)continue;return!!b;},getFirstElementChild:function(a){a=a.firstChild;return this.isElement(a)?a:this.getNextElementSibling(a);},getLastElementChild:function(a){a=a.lastChild;return this.isElement(a)?a:this.getPreviousElementSibling(a);},getNextElementSibling:function(a){while(a&&(a=a.nextSibling)&&!this.isElement(a))continue;return a;},getNodeIndex:function(a){var b=0;while(a&&(a=a.previousSibling))b++;return b;},getOwnerDocument:function(a){return a.ownerDocument;},getPreviousElementSibling:function(a){while(a&&(a=a.previousSibling)&&!this.isElement(a))continue;return a;},getTextContent:function(a,b){return a[a.nodeType==1?b?"innerHTML":_C:"nodeValue"];},includes:function(a,b){return!!b&&(a==b||this.contains(a,b));},isEmpty:function(a){a=a.firstChild;while(a){if(a.nodeType==3||this.isElement(a))return false;a=a.nextSibling;}return true;},setTextContent:function(a,b,c){a[a.nodeType==1?c?"innerHTML":_C:"nodeValue"]=b;},"@!MSIE":{setTextContent:function(a,b,c){with(a)while(lastChild)removeChild(lastChild);this.base(a,b,c);}},"@(jscript<5.6)":{getOwnerDocument:function(a){return a.document.parentWindow.document;}}},{TEXT_CONTENT:_C,getDefaultView:function(a){return(a.ownerDocument||a.document||a).defaultView;},getDocument:function(a){return this.isDocument(a)?a:a.nodeType?this.getOwnerDocument(a):a.document||null;},isDocument:function(a){return!!a&&a.nodeType==9;},isElement:function(a){return!!a&&a.nodeType==1;},isXML:function(a){return!this.getDocument(a).getElementById;},"@!(document.defaultView)":{getDefaultView:function(a){return(a.document||a).parentWindow;}},"@(jscript<5.6)":{isDocument:function(a){return!!(a&&(a.nodeType==9||a.writeln));},isElement:function(a){return!!a&&a.nodeType==1&&a.nodeName!="!";}}});var AbstractView=Binding.extend();var _g=1,_14=2,_h=3;var _15={"2":2,"4":1},_16={focusin:"focus",focusout:"blur"},_17=/^mouse(up|down)|click$/,_1K=/click$/,_18=/^((before|un)?load|focus|blur|stop|(readystate|property|filter)change|losecapture)$/,_1L=/^((dbl)?click|mouse(down|up|over|out|wheel)|key(down|up|press)|submit|DOMActivate|(before)?(cut|copy|paste)|contextmenu|drag(start|enter|over)?|drop|before(de)?activate)$/,_1M=/^(abort|error|load|scroll|(readystate|property|filter)change)$/;var _t={},_19=extend({},{DOMContentLoaded:"base2ContentLoaded",mouseenter:"mouseover",mouseleave:"mouseout","@Gecko":{mousewheel:"DOMMouseScroll"}});function _9(a,b,c){var d=a+"#"+assignID(b);if(!_t[d]){_t[d]=c;}return _t[d];};function _1N(a,b){return _t[a+"#"+b.base2ID]||b;};function _d(a,b,c){if(typeof b=="function"){b.call(a,c);}else{b.handleEvent(c);}};extend(_0,{suppress:{},listeners:{},handlers:{},attachEvent:function(a,b,c){var d=base2.assignID(c);var e=this.handlers[d];if(!e){this.listeners[d]=c;e=this.handlers[d]=new Function("e","base2.toString.listeners['"+d+"'](e)");}a.attachEvent(b,e);},detachEvent:function(a,b,c,d){var e=c.base2ID;a.detachEvent(b,this.handlers[e]);if(d){delete this.listeners[e];delete this.handlers[e];}}});var Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(a,b,c,d){a.type=String(b);a.bubbles=!!c;a.cancelable=!!d;},preventDefault:function(b){if(b.cancelable!==false)b.returnValue=false;if(b.type=="mousedown"){var c=Traversal.getDocument(b.target).activeElement,d=_0.suppress;var e=function(a){d.focus=true;c.focus();_0.detachEvent(c,"onblur",e,true);setTimeout(function(){delete d.focus;delete d.blur;},1);};d.blur=true;_0.attachEvent(c,"onblur",e);}},stopPropagation:function(a){a.cancelBubble=true;},"@(element.onbeforedeactivate)":{preventDefault:function(b){if(b.cancelable!==false)b.returnValue=false;if(b.type=="mousedown"){var c=Traversal.getDocument(b.target).body;var d=function(a){_0.detachEvent(c,"onbeforedeactivate",d,true);a.returnValue=false;};_0.attachEvent(c,"onbeforedeactivate",d);}}}}},{CAPTURING_PHASE:_g,AT_TARGET:_14,BUBBLING_PHASE:_h,cloneEvent:function(a){if(a.isClone)return a;var b=copy(a);b.isClone=true;b.stopPropagation=function(){a.stopPropagation();this.cancelBubble=true;};b.preventDefault=function(){a.preventDefault();this.returnValue=false;};return b;},"@!(document.createEvent)":{bind:function(a){if(!a.timeStamp){a.bubbles=!_18.test(a.type);a.cancelable=_1L.test(a.type);a.timeStamp=new Date().valueOf();}a.relatedTarget=a[(a.target==a.fromElement?"to":"from")+"Element"];return this.base(a);}}});if(detect.MSIE&&!detect("element.dispatchEvent")){var _u=document.createElement(/^CSS/.test(document.compatMode)?"meta":"marquee"),_E=_0.base2Event={};_u.base2Events=0;_u.attachEvent("onpropertychange",new Function('e','var d=base2.toString.base2Event;if (e.propertyName=="base2Events"){if(typeof d.listener=="function")d.listener.call(d.target,d.event);else d.listener.handleEvent(d.event)}'));document.getElementsByTagName("head")[0].appendChild(_u);var EventDispatcher=Base.extend({constructor:function(a){this.state=a;},dispatch:function(a,b,c,d){b.eventPhase=c;var e=a.length;while(e--&&!b.cancelBubble){var f=a[e],g=d[f.nodeType==1?f.uniqueID:f.base2ID];if(g){g=copy(g);b.currentTarget=f;b.eventPhase=f==b.target?_14:c;for(var h in g){_E.event=b;_E.target=f;_E.listener=g[h];_u.base2Events++;if(b.returnValue===false){b.preventDefault();}}}}},handleEvent:function(a){a=Event.cloneEvent(Event.bind(a));var b=a.type;if(_16[b]){b=a.type=_16[b];a.bubbles=!_18.test(b);}var c=this.state.events[b];if(c&&!_0.suppress[b]){if(_17.test(b)){var d=_1K.test(b)?this.state._F:a.button;a.button=_15[d]||0;}var e=a.target,f=[],g=0;while(e){f[g++]=e;e=e.parentNode;}/*@if(@_jscript_version<5.6)if(f[0].nodeType==1&&!f[g-1].documentElement){f[g]=Traversal.getDocument(f[0]);}/*@end @*/var h=c[_g];if(h)this.dispatch(f,a,_g,h);h=c[_h];if(h&&!a.cancelBubble){if(a.bubbles){f.reverse();}else{f.length=1;}this.dispatch(f,a,_h,h);}}return a.returnValue!==false;}});}var EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(a,b,c,d){var e=DocumentState.getInstance(a);var f=assignID(a),g=assignID(c),h=d?_g:_h,j=e.registerEvent(b,a),k=j[h];if(!k)k=j[h]={};var l=k[f];if(!l)l=k[f]={};l[g]=c;},dispatchEvent:function(a,b){b.target=a;b._G=true;return DocumentState.getInstance(a).handleEvent(b);},removeEventListener:function(a,b,c,d){var e=DocumentState.getInstance(a).events;var f=e[b];if(f){var g=f[d?_g:_h];if(g){var h=g[a.nodeType==1?a.uniqueID:a.base2ID];if(h)delete h[c.base2ID];}}}},addEventListener:function(b,c,d,e){var f=d;if(c=="DOMContentLoaded"){d=_9(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.bubbles=a.cancelable=false;EventTarget.removeEventListener(b,c,f,e);_d(this,f,a);});}else if(c=="mouseenter"||c=="mouseleave"){d=_9(c,f,function(a){if(Traversal.includes(this,a.target)&&!Traversal.includes(this,a.relatedTarget)){a=copy(a);a.target=this;a.type=c;a.bubbles=a.cancelable=false;_d(this,f,a);}});}this.base(b,_19[c]||c,d,e);},removeEventListener:function(a,b,c,d){this.base(a,_19[b]||b,_1N(b,c),d);},"@Gecko":{addEventListener:function(b,c,d,e){if(c=="mousewheel"){var f=d;d=_9(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.wheelDelta=(-a.detail*40)||0;_d(this,f,a);});}this.base(b,c,d,e);}},"@Gecko1\\.[0-3]|Webkit[1-4]":{addEventListener:function(b,c,d,e){if(/^mouse/.test(c)){var f=d;d=_9(c,f,function(a){try{if(a.target.nodeType==3){a=Event.cloneEvent(a);a.target=a.target.parentNode;}}catch(x){return;}_d(this,f,a);});}this.base(b,c,d,e);}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(c,d,e,f){var g=e;if(_17.test(d)){e=_9(d,g,function(a){var b=_15[a.button]||0;if(a.button!=b){a=Event.cloneEvent(a);a.button=b;}_d(this,g,a);});}else if(typeof e=="object"){e=_9(d,g,bind("handleEvent",e));}this.base(c,d,e,f);}},"@Linux|Mac|Opera":{addEventListener:function(g,h,j,k){if(h=="keydown"){var l=j;j=_9(h,l,function(b){var c=0,d=false;extend(b,"preventDefault",function(){this.base();d=true;});function e(a){if(d)a.preventDefault();if(a==b||c>1){_d(this,l,b);}c++;};var f=function(){this.removeEventListener("keypress",e,true);this.removeEventListener("keyup",f,true);};e.call(this,b);this.addEventListener("keyup",f,true);this.addEventListener("keypress",e,true);});}this.base(g,h,j,k);}}});if(detect("Gecko")){EventTarget.removeEventListener._s="removeEventListener";delete EventTarget.prototype.removeEventListener;}var DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(a,b){return Event({bubbles:false,cancelable:false,eventPhase:0,target:a,currentTarget:null,relatedTarget:null,timeStamp:new Date().valueOf()});}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(a,b){return this.base(a,b=="Events"?"UIEvents":b);}}}});var DOMContentLoadedEvent=Base.extend({constructor:function(b){var c=false;this.fire=function(){if(!c){c=true;setTimeout(function(){var a=DocumentEvent.createEvent(b,"Events");Event.initEvent(a,"base2ContentLoaded",false,false);EventTarget.dispatchEvent(b,a);},1);}};this.listen(b);},listen:function(a){EventTarget.addEventListener(Traversal.getDefaultView(a),"load",this.fire,false);},"@(document.addEventListener)":{constructor:function(a){this.base(a);a.addEventListener("DOMContentLoaded",this.fire,false);}},"@MSIE.+win":{listen:function(a){this.base(a);try{a.body.doScroll("left");if(!this.__constructing)this.fire();}catch(x){setTimeout(bind(this.listen,this,a),10);}}},"@KHTML":{listen:function(a){if(/loaded|complete/.test(a.readyState)){if(!this.__constructing)this.fire();}else{setTimeout(bind(this.listen,this,a),10);}}}});Document.implement(DocumentEvent);Document.implement(EventTarget);Element.implement(EventTarget);var ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@(element.currentStyle)":{getComputedStyle:function(b,c,d){var e=c.currentStyle,f=_1a.bind({});for(var g in e){if(_H.test(g)||_I.test(g)){f[g]=this.getComputedPropertyValue(b,c,g);}else if(g.indexOf("ruby")!=0){f[g]=e[g];}}forEach.csv("backgroundPosition,boxSizing,clip,cssFloat,opacity",function(a){f[a]=this.getComputedPropertyValue(b,c,a);},this);return f;}}}},{prefix:"","@Gecko":{prefix:"Moz"},"@KHTML":{prefix:"Khtml"},"@Webkit":{prefix:"Webkit"},"@Opera":{prefix:"O"},"@MSIE":{prefix:"Ms"},getComputedPropertyValue:function(a,b,c){var d=CSSStyleDeclaration.getPropertyValue(this.getComputedStyle(a,b,null),c);if(_I.test(c))d=_1b(d);return d;},"@!(document.defaultView.getComputedStyle)":{"@(element.currentStyle)":{getComputedPropertyValue:function(a,b,c){var d=b.currentStyle,e=d[c];if(e==null){c=_a(c);e=d[c]||"";}switch(c){case"float":case"cssFloat":return d.cssFloat||d.styleFloat||"";case"cursor":return e=="hand"?"pointer":e;case"opacity":return e==null?"1":e;case"clip":return"rect("+[d.clipTop,d.clipRight,d.clipBottom,d.clipLeft].join(", ")+")";case"backgroundPosition":return d.backgroundPositionX+" "+d.backgroundPositionY;case"boxSizing":return e==null?/^CSS/.test(Traversal.getDocument(b).compatMode)?"content-box":"border-box":e;}if(e.indexOf(" ")>0)return e;if(_H.test(c)){if(_1O.test(e))return e;if(e=="auto")return"0px";if(c.indexOf("border")==0){if(d[c.replace("Width","Style")]=="none")return"0px";e=_1P[e]||e;if(typeof e=="number")return e+"px";}/*@if(@_jscript)if(_1Q.test(e))return _1R(b,e);/*@end @*/}else if(_I.test(c)){if(e=="transparent")return e;if(/^(#|rgb)/.test(e))return _1b(e);/*@if(@_jscript)return _1S(e);/*@end @*/}return e;}}}});var _1Q=/\d/,_1O=/\dpx$/i,_H=/(width|height|top|bottom|left|right|fontSize)$/i,_I=/color$/i;var _1T=/\-/,_1U=/\-([a-z])/g,_J=/[A-Z]/g;var _1P={thin:1,medium:2,thick:4};var _1V={"@MSIE":{opacity:1,cursor:1}};var _a=function(c,d){if(c=="float"||c=="cssFloat"||c=="styleFloat"){return d?"float":_B.cssFloat==null?"styleFloat":"cssFloat";}if(_1T.test(c)){c=c.replace(_1U,_1W);}if(_B[c]==null){var e=/^border(\w+)Radius$/;if(ViewCSS.prefix=="Moz"&&e.test(c)){c=c.replace(e,function(a,b){return"borderRadius"+b.charAt(0)+b.slice(1).toLowerCase();});}var f=ViewCSS.prefix+c.charAt(0).toUpperCase()+c.slice(1);if(_B[f]!=null){c=f;}}if(d){c=c.replace(_J,_K);}return c;};function _K(a){return"-"+a.toLowerCase();};var _1W=flip(String2.toUpperCase),_1X=partial(parseInt,undefined,16);function _1R(a,b){var c=a.style.left;var d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;b=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return b+"px";};function _1S(a){if(window.createPopup){var b=createPopup().document;}else{b=new ActiveXObject("htmlfile");b.write("<body>");}var c=b.body,d=c.createTextRange();c.style.color=a.toLowerCase();var e=d.queryCommandValue("ForeColor");return format("rgb(%1, %2, %3)",e&0xff,(e&0xff00)>>8,(e&0xff0000)>>16);};function _1b(a){if(a.indexOf("rgb")==0)return a.replace(/(\d)\s,/g,"$1,");if(a.indexOf("#")!=0)return a;var b=a.slice(1);if(b.length==3)b=b.replace(/(\w)/g,"$1$1");return"rgb("+Array2.map(b.match(/(\w\w)/g),_1X).join(", ")+")";};var _1a=Binding.extend({getPropertyValue:function(a,b){if(a[b]==null)b=_a(b);return a[b]||"";},"@MSIE5":{getPropertyValue:function(a,b){if(a[b]==null)b=_a(b);var c=a[b];if(b=="cursor"&&c=="hand"){c="pointer";}return c||"";}}});var CSSStyleDeclaration=_1a.extend({setProperty:function(a,b,c,d){if(a[b]==null)b=_a(b);if(d){this.base(a,b.replace(_J,_K),c,d);}else{a[b]=c;}},"@!(style['setProperty'])":{setProperty:function(a,b,c,d){if(a[b]==null)b=_a(b);/*@if(@_jscript)if(@_jscript_version<5.6&&b=="cursor"&&c=="pointer"){c="hand";}else if(b=="opacity"){c*=100;a.zoom="100%";a.filter="alpha(opacity="+Math.round(c)+")";}/*@end @*/if(d=="important"){a.cssText+=format(";%1:%2!important;",b.replace(_J,_K),c);}else{a[b]=c;}}}},{getPropertyName:_a,setProperties:function(a,b){b=extend({},b);for(var c in b){var d=b[c];if(a[c]==null)c=_a(c);if(typeof d=="number"&&_H.test(c))d+="px";if(_1V[c]){this.setProperty(a,c,d,"");}else{a[c]=d;}}}});AbstractView.implement(ViewCSS);var _1c=detect("(input.getAttribute('type')=='text')")?/:visited|\[(type|value)|\b(object|param)\b/i:/:visited/;var _1Y=detect("(element.compareDocumentPosition)")?function(a,b){return(a.compareDocumentPosition(b)&2)-1;}:document.createRange?function(a,b){var c=a.ownerDocument,d=c.createRange(),e=c.createRange();d.selectNode(a);d.collapse(true);e.selectNode(b);e.collapse(true);return d.compareBoundaryPoints(Range.START_TO_END,e);}:function(a,b){return(Node.compareDocumentPosition(a,b)&2)-1;};var _1Z=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"|\\./g,_20=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_21=/(^|,)([^\s>+~])/g,_22=/\s*([\^*~|$]?=|[\s>+~,]|^|$)\s*/g,_23=/\s*([\])])/g,_24=/([\[(])\s*/g,_25=/\x01(\d+)\x01/g,_1d=/^ \*?/g,_26=/'/g;var _27=/#/g,_28=/[.:\[]/g,_29=/^\w|[\s>+~]\w/g;var _2a=/^[\s>+~]$/;var _v=":(checked|disabled|enabled|selected|hover|active|focus|link|visited|target)",_e=_v+"|^(#[\\w\u00a1-\uffff\\-]+\\s*)?[\\w\u00a1-\uffff\\-]+$";if(detect("KHTML")){if(detect("WebKit5")){_e+="|nth\\-|,"}else{_e="."}}_v=new RegExp(_v);_e=new RegExp(_e);var _w=function(a,b){if(typeof a!="function"){a=new Selector(a).toDOMQuery(true)}return this.base(a,b)};function _1e(a,b,c,d,e,f,g,h){d=/last/i.test(a)?d+"+1-":"";if(!isNaN(b))b="0n+"+b;else if(b=="even")b="2n";else if(b=="odd")b="2n+1";b=b.split("n");var j=b[0]?(b[0]=="-")?-1:parseInt(b[0],10):1;var k=parseInt(b[1],10)||0;var l=j<0;if(l){j=-j;if(j==1)k++}var o=format(j==0?"%3%7"+(d+k):"(%4%3-(%2))%6%1%70%5%4%3>=%2",j,k,c,d,f,g,h);if(l)o=e+"("+o+")";return o};var _L,_M;function _2b(a,b){if(!_M)_M=new XPathParser;return"[not("+_M.exec(trim(b)).replace(/\[1\]/g,"").replace(/^(\*|[\w\u00a1-\uffff\-\x01]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"};function _N(a,b,c){return"["+_1e(a,b,c||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"};var id="base2"+Date2.now(),root=document.documentElement;_5.innerHTML='<a name="'+id+'"></a>';root.insertBefore(_5,root.firstChild);var _1f=document.getElementById(id)==_5.firstChild?document.all?function(a,b){var c=a.all[b]||null;if(!c||(c.nodeType&&Element.getAttribute(c,"id")==b))return c;for(var d=0;d<c.length;d++){if(Element.getAttribute(c[d],"id")==b)return c[d]}return null}:null:function(a,b){return a.getElementById(b)};root.removeChild(_5);var _i=1,_j={};function _2c(a){if(_j._i!=_i){_j={_i:_i}}var b=a.sourceIndex>0,c=b?a.sourceIndex:a.uniqueID||assignID(a);if(!_j[c]){var d={},e=1,f=a.firstChild;while(f){if(f.nodeType==1)/*@if(@_jscript_version<5.6)if(f.nodeName!="!")/*@end @*/d[b?f.sourceIndex:f.uniqueID||assignID(f)]=e++;f=f.nextSibling}d.length=e;_j[c]=d}return _j[c]};function _1g(a,b,c){try{var d=a.base(b,c)}catch(x){if(Traversal.isDocument(b)||Traversal.isElement(b)||b.nodeType==11){if(Traversal.isXML(b)&&_v.test(a)){d=null}else{var e=new SyntaxError(format("'%1' is not a valid CSS selector.",a));e.code=12;throw e;}}else{throw new TypeError("Invalid argument.");}}return d};var StaticNodeList=Base.extend({constructor:function(a){a=a||[];if(a.unsorted)a.sort(_1Y);var b=a.length,c=0,d=0;if(b)this[0]=undefined;while(c<b){if(a[c])this[d++]=a[c];c++}this.length=d},length:0,forEach:function(a,b){var c=this.length;for(var d=0;d<c;d++){a.call(b,this[d],d,this)}},item:Array2.prototype.item,not:function(a,b){return this.filter(not(a),b)},slice:function(a,b){return new StaticNodeList(this.map(I).slice(a,b))},"@(XPathResult)":{constructor:function(a){if(a&&a.snapshotItem){var b=this.length=a.snapshotLength,c=0;while(c<b)this[c]=a.snapshotItem(c++)}else this.base(a)}}},{bind:function(c){Base.forEach(this.prototype,function(a,b){if(c[b]===undefined){c[b]=a}});return c}});StaticNodeList.implement(Enumerable);StaticNodeList.implement({every:_w,filter:_w,not:_w,some:_w});StaticNodeList.implement({filter:function(a,b){return new StaticNodeList(this.base(a,b))}});var NodeSelector=Interface.extend({"@(element.querySelector)":{querySelector:function(a,b){if(!_1c.test(b)){try{return this.base(a,b)}catch(x){}}return new Selector(b).exec(a,1)},querySelectorAll:function(a,b){if(!_1c.test(b)){try{return StaticNodeList.bind(this.base(a,b))}catch(x){}}return new Selector(b).exec(a)}},"@!(element.querySelector)":{querySelector:function(a,b){return new Selector(b).exec(a,1)},querySelectorAll:function(a,b){return new Selector(b).exec(a)}}});if(_5.querySelectorAll){_5.innerHTML='<a id="X"></a>';if(_5.querySelectorAll("#X").length==0){NodeSelector.implement({querySelectorAll:function(a,b){if(/[A-Z]/.test(b)){if(!/^CSS/.test(Traversal.getDocument(a).compatMode)){return new Selector(b).exec(a)}}return this.base(a,b)}})}}extend(NodeSelector.prototype,{querySelector:function(a){return dom.bind(this.base(a))},querySelectorAll:function(a){var b=this.base(a);var c=b.length;while(c--)dom.bind(b[c]);return b}});var CSSParser=RegGrp.extend({constructor:function(a){this.base(a);this.cache={};this.sorter=new RegGrp;this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE);this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:true,escape:function(b){var c=this._2d=[];return String(b).replace(_1Z,function(a){if(a.indexOf("\\")!=0){a=a.slice(1,-1).replace(_26,"\\'")}return"\x01"+c.push(a)+"\x01"})},format:function(a){return this.normalise(this.escape(a+""))},normalise:function(a){return a.replace(_22,"$1").replace(_23,"$1").replace(_24,"$1").replace(_21,"$1 $2").replace(_20,"$1*$2")},parse:function(a,b){return this.cache[a]||(this.cache[a]=this.revert(this.exec(this.format(a,b))))},put:function(a,b){return this.base(a.replace(/ID/g,"\\w\u00a1-\uffff\\-\\x01"),b)},revert:function(a){return this.unescape(a)},unescape:function(c){var d=this._2d;return c.replace(_25,function(a,b){return d[b-1]})}});var XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.build());this.sorter.putAt(1,"$1$4$3$6")},format:function(a){return this.base(a).replace(/,/g,"\x02")},unescape:function(a){return this.base(a).replace(/\\(.)/g,"$1")},revert:function(b){return this.base(b.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | ")).replace(/'[^'\\]*\\'(\\.|[^'\\])*'/g,function(a){return"concat("+a.split("\\'").join("',\"'\",'")+")"})},"@Opera(7|8|9\\.[0-4])":{revert:function(a){return this.base(a.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{build:function(){this.values.attributes[""]="[@$1]";forEach(this.types,function(a,b){forEach(this.values[b],a,this.rules)},this);this.build=K(this.rules);return this.rules},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML|Opera":{"(^|\\x02) (\\*|[ID]+)#([ID]+)":"$1id('$3')[self::$2]"},"@!KHTML":{"([ >])(\\*|[ID]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(a,b,c,d,e,f){var g=(b==" ")?"//*":"/*";if(/^nth/i.test(d)){g+=_N(d,f,"position()")}else{g+=XPathParser.optimised.pseudoClasses[d]}return g+"[self::"+c+"]"}}}),types:{identifiers:function(a,b){this[rescape(b)+"([ID]+)"]=a},combinators:function(a,b){this[rescape(b)+"(\\*|[ID]+)"]=a},attributes:function(a,b){this["\\[([ID]+)"+rescape(b)+"([^\\]]*)\\]"]=a},pseudoClasses:function(a,b){this[":"+b.replace(/\(\)$/,b=="not()"?"\\((([^\\s>+~]|~=)+)\\)":"\\(([^)]+)\\)")]=a}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","=":"[@$1='$2']"},pseudoClasses:{"contains()":"[contains(.,'$1')]","empty":"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_2b,"nth-child()":_N,"nth-last-child()":_N,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]","root":"[not(parent::*)]"}},"@Opera(7|8|9\\.[1-4])":{build:function(){this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"];this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"];return this.base()}}});var Selector=Base.extend({constructor:function(a){this.toString=K(trim(a))},exec:function(a,b){return this.toDOMQuery()(a,b)},getSpecificity:function(){var a=_8.escape(this);if(a.indexOf(",")==-1){return match(a,_27).length*10000+match(a,_28).length*100+match(a,_29).length}else{return-1}},split:function(){return Array2.map(_8.escape(this).split(","),function(a){return new Selector(_8.unescape(a))})},test:function(a){return this.toDOMQuery(true)(a)},toDOMQuery:function(t){var E=_2e[t?"test":"exec"];if(!E[this]){var q="",M=["e0,c"],y=[],z=(t?"":"_k.complete=false;")+"_i++;var r=[],l,d=e0.nodeType==9?e0:e0.ownerDocument||Traversal.getDocument(e0),t=d.getElementById?'toUpperCase':'toString',u,v={},k=0,p0;",A=[],N=[],F=_8.format(this).split(","),G=F.length>1,p=0;var B=function(d,e){var f="",g=_l[e?"test":"exec"],h,j,k=0;if(e)d=d.replace(_1d,"");var l=match(d,_2f),o;if(e)l.reverse();for(var s=0;o=l[s];s++){var n="";j=false;if(_2a.test(o)){h=o;n+=g[h];if(h==" "||h==">"){if(!e&&h==" "&&l[s+1].indexOf("*")==0){n=n.replace(/\bT\b/,"'*'")}p++;k++;if(!e){y.push(p)}}}else{var m=match(o,_2g),r=m[1]||"*",Q=m[2]||"",H=r=="*";if(!H){A.push(r)}if(e){if(!H){n+="if(e.nodeName==t){"}}else{if(H){if(!_2h&&h=="~"){n+="if("+_O+"){"}/*@if(@_jscript)if(h==" "||h==">"){n+="if(e.nodeName!='"+(@_jscript_version<5.6?"!":"#comment")+"'){"}@else @*/if(!_1h&&h==">"){n+="if(e.nodeType==1){"}/*@end @*/}else if(h!=" "){n+="if(e.nodeName==t){"}if((k>1&&h==" ")||h=="~"){n+=_2i;N.push(p);j=true}}n+=_8.exec(Q)}f+=n.replace(_2j,function(a,b,c){if(c)return c;return b=="T"?"t"+A.length:b=="t"?b+(A.length-1):b=="E"?"e"+(p-1):b+p})}if(G){var C="";if(!j){C=_1i}if(!_x){if(v==0){C+="v[u]=1;"}else{C+="if(!v[u]){v[u]=1;"}}f+=format(C,p)}return f};var J=function(a){if(t){a+="return true;"}else{var b="if(c==1)return e%1;";if(G&&_x){b+="r[u]=e%1;k++;"}else{b+="r[k++]=e%1;"}b+="if(k===c){_k.state=[%state%];return r;";a+=format(b,p)}a+=Array(match(a,/\)\{/g).length+1).join("}");if(G&&!t&&!_x){a+="if(l&&r.length>l)r.unsorted=1;l=r.length;"}return a};_f=[];for(var v=0;v<F.length;v++){var w=F[v];if(v>0)q+="e"+p+"=e0;";var L=w.lastIndexOf("#");if(t||L==-1){q+=J(B(w,t))}else{var O=w.slice(0,L),P=match(w.slice(L),_2k),R=P[1]||"",S=P[2]||"";var D=B(w,t);q+="if(!_1f||!d.getElementById||(e0!=d&&Node.compareDocumentPosition(e0,d)&1)){"+J(D)+"}";q+=format("else{var e%1=_1f(d,'%2');if(e%1&&(e0==d||Traversal.contains(e0,e%1))){",++p,R);var u="";if(O.replace(_1d,"")){var T=p;u="var q"+p+"=function(e0){";p=0;u+=B(O,true)+"return true";u+=Array(match(u,/\)\{/g).length+1).join("}")+";";p=T}D=u?"if(q"+p+"(e"+p+")){":"";D+=B(S);q+=u+J(D)+"}}"}}/*@if(@_jscript_version<5.6)q=q.replace(/getElementsByTagName\('\*'\)/g,"all");/*@end @*/z+="var reg=["+_f.join(",")+"];";z+=Array2.map(A,function(a,b){return"var t"+b+"='"+a+"'"+(a==a.toUpperCase()?";":"[t]();")}).join("");z+=Array2.map(N,function(a){return"var s"+a+"={};"}).join("");forEach(y,function(a,b){y[b]="i"+a;M.push("a"+a)});q=_8.unescape(z+q);q+=t?";return false":"_k.state=[%state%];_k.complete=true;return c==1?null:r";q=q.replace(/%state%/g,y.join(","));eval("var _k=function("+M.join(",")+"){"+q+"}");E[this]=_k}return E[this]},toXPath:function(){if(!_L)_L=new XPathParser;return _L.parse(this)},"@(XPathResult)":{exec:function(a,b){if(_e.test(this)){return this.base(a,b)}var c=Traversal.getDocument(a);var d=b==1?9:7;var e=c.evaluate(this.toXPath(),a,null,d,null);return b==1?e.singleNodeValue:e}},"@(jscript)":{exec:function(a,b){if(typeof a.selectNodes!="undefined"&&!_e.test(this)){var c=Traversal.getDocument(a),d=b==1?"selectSingleNode":"selectNodes";c.setProperty("SelectionLanguage","XPath");return a[d](this.toXPath())}return this.base(a,b)}},"@(true)":{exec:function(a,b){this.base;var c=_1g(this,a||document,b);return b==1?c:new StaticNodeList(c)},test:function(a){this.base;return!!_1g(this,a)}}});var _x=detect("(element.sourceIndex)"),_1h=detect("(element.children)"),_2h=detect("(element.nextElementSibling)"),_1j=_x?"e.sourceIndex":"e.uniqueID||assignID(e)",_1i="u="+_1j.replace(/\be\b/g,"e%1")+";",_O="e.nodeType==1",_2i="u="+_1j+";if(s[u])break;s[u]=1;",_2g=new RegExp("^(\\*|[\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_2k=new RegExp("^#([\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_2f=/[^\s>+]+(~=|n\+\d)[^\s>+]+|[^\s>+~]+|[\s>+~]/g,_2j=/\b([aeEijnpstT])\b|('[^']+')/g;/*@if(@_jscript_version<5.6)_O+="&&e.nodeName!='!'";/*@end @*/var _f=[],_2e={exec:{},test:{}};var _l={exec:extend({},{" ":"var i,e,p,n=E.getElementsByTagName(T);for(i=a||0;e=n[i];i++){",">":"var i,e,p,n=E."+(_1h?"children":"childNodes")+";for(i=a||0;e=n[i];i++){","+":"while((e=e.nextSibling)&&!("+_O+"))continue;if(e){","~":"while((e=e.nextSibling)){","@(element.nextElementSibling)":{"+":"e=e.nextElementSibling;if(e){","~":"while((e=e.nextElementSibling)){"}}),test:{" ":"var e=E;while((e=e."+_D+")){",">":"var e=E."+_D+";if(e){"}};_l.test["+"]=_l.exec["+"].replace("next","previous");_l.test["~"]=_l.exec["~"].replace("next","previous");var _m=extend({},{"checked":"e.checked","contains":"e."+Traversal.TEXT_CONTENT+".indexOf('%1')!=-1","disabled":"e.disabled===true","empty":"Traversal.isEmpty(e)","enabled":"e.disabled===false","first-child":"!(e.previousSibling&&Traversal.getPreviousElementSibling(e))","last-child":"!(e.nextSibling&&Traversal.getNextElementSibling(e))","@(element.nextElementSibling)":{"first-child":"!e.previousElementSibling","last-child":"!e.nextElementSibling"},"root":"e==d.documentElement","target":"e.id&&Element.getAttribute(e,'id')==d.location.hash.slice(1)","hover":"DocumentState.getInstance(d).isHover(e)","active":"DocumentState.getInstance(d).isActive(e)","focus":"DocumentState.getInstance(d).hasFocus(e)","link":"d.links&&Array2.contains(d.links,e)","visited":"false"});_m["only-child"]=_m["first-child"]+"&&"+_m["last-child"];var _P={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};_P[""]="%1";var _8=new CSSParser({":not\\((\\*|[ID]+)?(([^\\s>+~]|~=)+)\\)":function(a,b,c){var d=(b&&b!="*")?"if(e.nodeName!='"+b+"'){":"";d+=_8.exec(c).replace(/if\(\(/g,"if(!(");return d},"#([ID]+)":"if(((e.submit?Element.getAttribute(e,'id'):e.id)=='$1')){","\\.([ID]+)":function(a,b){_f.push(new RegExp("(^|\\s)"+rescape(b)+"(\\s|$)"));return"if((e.className&®["+(_f.length-1)+"].test(e.className))){"},":nth(-last)?-child\\(([^)]+)\\)":function(a,b,c){return"p=_2c(e.parentNode);"+format(_1i,"")+"var j=p[u];if(("+_1e(a,c,"j","p.length","!","&&","% ","==")+")){"},":([a-z\\-]+)(\\(([^)]+)\\))?":function(a,b,c,d){return"if(("+format(_m[b]||"throw",d)+")){"},"\\[([ID]+)([^=]?=)?([^\\]]*)\\]":function(a,b,c,d){d=trim(d);if(b=="class"){var e="e.className"}else{var f=(c?"get":"has")+"Attribute";if(Element.prototype[f]){e="Element."+f+"(e,'"+b+"')"}else{e="e."+f+"('"+b+"')"}}var g=_P[c||""];if(instanceOf(g,RegExp)){_f.push(new RegExp(format(g.source,rescape(_8.unescape(d)))));g="reg[%2].test(%1)";d=_f.length-1}return"if(("+format(g,e,d)+")){"}});Document.implement(NodeSelector);Element.implement(NodeSelector);Selector.pseudoClasses=_m;Selector.operators=_P;var HTMLDocument=Document.extend(null,{bind:function(a){DocumentState.createState(a);return this.base(a)}});var HTMLElement=Element.extend(null,{bindings:{},tags:"*",bind:function(a){if(!a.classList){a.classList=new _2l(a)}if(!a.ownerDocument){a.ownerDocument=Traversal.getOwnerDocument(a)}/*@if(@_jscript)for(var b,c=0;b=_2m[c];c++){b+="Attribute";a["_"+b]=a[b]}/*@end @*/return this.base(a)},extend:function(){var b=this.base.apply(this,arguments);forEach.csv(b.tags,function(a){HTMLElement.bindings[a]=b});return b}});HTMLElement.extend(null,{tags:"APPLET,EMBED,OBJECT,IFRAME",bind:I});var _2m="get,set,has,remove".split(",");/*@if(@_jscript_version<5.7)for(var i in HTMLElement.prototype){if(i!="base"&&i!="extend"){HTMLElement.prototype[i]=new Function("var a=base2.js.Array2.slice(arguments),m=base2.dom.HTMLElement."+i+";a.unshift(this);return m.apply(m,a)")}}/*@end @*/var ClassList=Module.extend({add:function(a,b){if(!ClassList.contains(a,b)){a.className+=(a.className?" ":"")+b}},contains:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)");return c.test(a.className||"")},remove:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)","g");a.className=trim(a.className.replace(c,"$2"))},toggle:function(a,b){ClassList[ClassList.has(a,b)?"remove":"add"](a,b)}});var _2l=new Function("e",Array2.reduce(String2.csv("add,contains,remove,toggle"),function(a,b){return a+="this."+b+"=function(t){return base2.dom.ClassList."+b+"(e,t)};"},""));ClassList.has=ClassList.contains;var _1k=/^(TABLE|TH|TD)$/,_2n=detect("QuirksMode"),_1l=detect("MSIE6"),_2o=detect("Webkit5")?_1k:detect("Opera8")?{test:function(a){return!_1k.test(a)}}:{test:False};var _3=new Base({getBodyClient:function(a){var b=0,c=0,d=a.defaultView,e=a.body,f=ViewCSS.getComputedStyle(d,e,null),g=f.position,h=g!="static";if(h){b+=parseInt(f.left)+parseInt(f.marginLeft);c+=parseInt(f.top)+parseInt(f.marginTop);if(g=="relative"){var j=ViewCSS.getComputedStyle(d,a.documentElement,null);b+=parseInt(j.paddingLeft)+parseInt(j.borderLeftWidth);c+=parseInt(j.paddingTop)+parseInt(j.borderTopWidth);if(!_1l){b+=parseInt(j.marginLeft);c+=parseInt(j.marginTop)}}}else{var k=a.createElement("div");e.insertBefore(k,e.firstChild);b+=k.offsetLeft-parseInt(f.paddingLeft);c+=k.offsetTop-parseInt(f.paddingTop);e.removeChild(k)}return{position:g,isAbsolute:h,left:b,top:c}},getBodyOffset:function(a){var b=this.getBodyClient(a),c=a.defaultView,d=a.body;return{isAbsolute:b.isAbsolute,left:b.left+parseInt(ViewCSS.getComputedPropertyValue(c,d,"borderLeftWidth")),top:b.top+parseInt(ViewCSS.getComputedPropertyValue(c,d,"borderTopWidth"))}},getViewport:function(a){var b=a.defaultView,c=a.documentElement;return{left:parseInt(ViewCSS.getComputedPropertyValue(b,c,"marginLeft")),top:parseInt(ViewCSS.getComputedPropertyValue(b,c,"marginTop"))}},getGeckoRoot:function(a){var b=a.defaultView.getComputedStyle(a.documentElement,null);return{x:parseInt(b.marginLeft)+parseInt(b.borderLeftWidth),y:parseInt(b.marginTop)+parseInt(b.borderTopWidth)}},"@MSIE.+QuirksMode":{getViewport:K({left:0,top:0})},"@(true)":{getBodyClient:_b(1),getBodyOffset:_b(2),getViewport:_b(3),getGeckoRoot:_b(4)}});function _b(c){return function(a){var b=c+(a.base2ID||assignID(a));if(!_b[b])_b[b]=this.base(a);return _b[b]}};var ElementView=Interface.extend({"@!(element.getBoundingClientRect)":{getBoundingClientRect:function(a){var b=a.ownerDocument;switch(a.nodeName){case"HTML":var c=_3.getViewport(b);break;case"BODY":c=_3.getBodyClient(b);break;default:var d=a.offsetLeft,e=a.offsetTop,f=b.defaultView,g=b.documentElement,h=f.getComputedStyle(a,null);offsetParent=a.offsetParent;while(offsetParent&&(offsetParent!=g||h.position=="static")){d+=offsetParent.offsetLeft-offsetParent.scrollLeft;e+=offsetParent.offsetTop-offsetParent.scrollTop;h=f.getComputedStyle(offsetParent,null);if(_2o.test(offsetParent.nodeName)){if(offsetParent.clientLeft===undefined){d+=parseInt(h.borderLeftWidth);e+=parseInt(h.borderTopWidth)}else{d+=offsetParent.clientTop;e+=offsetParent.clientLeft}}offsetParent=offsetParent.offsetParent}c={left:d,top:e}}return{top:c.top,right:c.left+a.clientWidth,bottom:c.top+a.clientHeight,left:c.left}},"@Webkit5":{getBoundingClientRect:function(a){var b=this.base(a);if(a.nodeName!="HTML"){var c=a.ownerDocument,d=_3.getBodyOffset(c);if(!d.isAbsolute){d=_3.getViewport(c)}b.left+=d.left;b.top+=d.top}return b}},"@(document.getBoxObjectFor)":{getBoundingClientRect:function(a){var b=a.ownerDocument,c=b.defaultView,d=b.documentElement,e=b.getBoxObjectFor(a),f=c.getComputedStyle(a,null),g=e.x-parseInt(f.borderLeftWidth),h=e.y-parseInt(f.borderTopWidth),j=a.parentNode;if(a!=d){while(j&&j!=d){g-=j.scrollLeft;h-=j.scrollTop;f=c.getComputedStyle(j,null);if(f.position!="absolute"){g+=parseInt(f.borderTopWidth);h+=parseInt(f.borderLeftWidth)}j=j.parentNode}if(f.position!="fixed"){g-=c.pageXOffset;h-=c.pageYOffset}var k=c.getComputedStyle(b.body,null).position;if(k=="relative"){var l=b.getBoxObjectFor(d)}else if(k=="static"){l=_3.getGeckoRoot(b)}if(l){g+=l.x;h+=l.y}}return{top:h,right:g+a.clientWidth,bottom:h+a.clientHeight,left:g}}}},"@(jscript)":{getBoundingClientRect:function(a){var b=this.base(a);if(a.nodeName=="HTML"){var c=Traversal.getDocument(a),d=_3.getViewport(c),e=c.documentElement,f=d.left-e.scrollLeft,g=d.left-e.scrollTop;b={top:g,right:f+b.right-b.left,bottom:g+b.bottom-b.top,left:f}}return b}},"@Gecko1\\.9([^\\.]|\\.0)":{getBoundingClientRect:function(a){var b=this.base(a);if(a.nodeName!="HTML"&&_3.getBodyClient(a.ownerDocument).position=="absolute"){var c=_3.getGeckoRoot(document);return{top:b.top-c.y,right:b.right-c.x,bottom:b.bottom-c.y,left:b.left-c.x}}return b}}},{getOffsetFromBody:function(a){var b=0,c=0;if(a.nodeName!="BODY"){var d=Traversal.getOwnerDocument(a),e=d.defaultView,f=d.documentElement,g=d.body,h=this.getBoundingClientRect(a);b=h.left+Math.max(f.scrollLeft,g.scrollLeft);c=h.top+Math.max(f.scrollTop,g.scrollTop);var j=_3.getBodyOffset(d);/*@if(@_jscript)if(_1l&&g.currentStyle.position!="relative"){b-=f.clientLeft;c-=f.clientTop}if(@_jscript_version==5.7||d.documentMode==7){var k=f.getBoundingClientRect();b-=k.left;c-=k.top}if(_2n){b-=g.clientLeft;c-=g.clientTop;j.isAbsolute=false}/*@end @*/if(j.isAbsolute){b-=j.left;c-=j.top}}return{left:b,top:c}},"@!(element.getBoundingClientRect)":{"@Webkit5":{getOffsetFromBody:function(a){var b=this.base(a);if(a.nodeName!="HTML"){var c=a.ownerDocument,d=_3.getBodyOffset(c);if(!d.isAbsolute){d=_3.getViewport(c)}b.left-=d.left;b.top-=d.top}return b}}},"@Gecko1\\.([^9]|9(\\.0|[^\\.]))":{getOffsetFromBody:function(a){var b=this.base(a);if(!_3.getBodyClient(a.ownerDocument).isAbsolute){var c=_3.getGeckoRoot(document);b.left-=c.x;b.top-=c.y}return b}},getOffsetXY:function(a,b,c){var d=this.getBoundingClientRect(a);return{x:b-d.left-a.clientLeft,y:c-d.top-a.clientTop}},"@!(element.clientLeft)":{getOffsetXY:function(a,b,c){var d=this.getBoundingClientRect(a),e=a.ownerDocument.defaultView.getComputedStyle(a,null);return{x:b-d.left-parseInt(e.borderLeftWidth),y:c-d.top-parseInt(e.borderTopWidth)}}}});HTMLElement.implement(ElementView);var DocumentState=Base.extend({init:function(d){this.document=d;this.events={};this._1m=d.documentElement;var e=/^on((DOM)?\w+|[a-z]+)$/;forEach(this,function(a,b,c){if(e.test(b)){c.registerEvent(b.slice(2))}})},hasFocus:function(a){return a==this._Q},isActive:function(a){return Traversal.includes(a,this._R)},isHover:function(a){return Traversal.includes(a,this._1m)},handleEvent:function(a){if(!a._G){this["on"+a.type](a)}},onblur:function(a){delete this._Q},onmouseover:function(a){this._1m=a.target},onmousedown:function(a){this._R=a.target},onfocus:function(a){this._Q=a.target},onmouseup:function(a){delete this._R},registerEvent:function(a){this.document.addEventListener(a,this,true);this.events[a]=true},"@!(document.activeElement)":{init:function(a){this.base(a);if(dom.isBound(a)){a.activeElement=a.body}},onfocus:function(a){this.base(a);if(dom.isBound(this.document)){this.document.activeElement=this._Q}},onblur:function(a){this.base(a);if(dom.isBound(this.document)){this.document.activeElement=this.document.body}}},"@!(element.addEventListener)":{init:function(b){this.base(b);var c=new EventDispatcher(this);this._n=function(a){a.target=a.target||a.srcElement||b;c.handleEvent(a)};this.handleEvent=function(a){if(this["on"+a.type]){this["on"+a.type](a)}return c.handleEvent(a)}},registerEvent:function(a,b){var c=this.events[a],d=b&&b.Infinity,e=!d&&!_1M.test(a);if(!c||!e){if(!c)c=this.events[a]={};if(e||!b)b=this.document;if(!b)b=this.document;this.addEvent(a,b)}return c},addEvent:function(b,c){var d=this;c["on"+b]=function(a){if(!a){a=Traversal.getDefaultView(this).event}if(a)d.handleEvent(a)}},"@(element.attachEvent)":{init:function(c){this.base(c);var d={};this._1n=function(a){var b=assignID(a);if(!d[b]){d[b]=true;_0.attachEvent(a,"onsubmit",this._n);_0.attachEvent(a,"onreset",this._n)}};var e=this;this._2p=function(a){if(e._R==a.target){e._S=copy(a)}else{e._n(a)}}},registered:{},fireEvent:function(a,b){b=Event.cloneEvent(b);b.type=a;this.handleEvent(b)},addEvent:function(b,c){var d=assignID(c)+b;if(!this.registered[d]&&c["on"+b]!==undefined){this.registered[d]=true;var e=this;_0.attachEvent(c,"on"+b,function(a){/*@if(@_jscript_version<5.6)if(a.srcElement&&!a.srcElement.nodeName)return;/*@end @*/a.target=a.srcElement||c;e.handleEvent(a);if(e["after"+b]){e["after"+b](a)}})}},onDOMContentLoaded:function(a){forEach(a.target.forms,this._1n,this);this.activate(this.document.activeElement)},onmousedown:function(a){this.base(a);this._F=a.button},onmouseup:function(a){this.base(a);if(!a._G&&this._F==null){this.fireEvent("mousedown",a)}delete this._F},aftermouseup:function(){if(this._S){this._n(this._S);delete this._S}},onfocusin:function(a){this.activate(a.target);this.onfocus(a)},activate:function(a){var b=this.events.change&&a.onchange!==undefined,c=this.events.select&&a.onselect!==undefined;if(b||c){var d=this._n,e=this._2p;if(b)_0.attachEvent(a,"onchange",d);if(c)_0.attachEvent(a,"onselect",e);var f=function(){_0.detachEvent(a,"onblur",f,true);if(b)_0.detachEvent(a,"onchange",d);if(c)_0.detachEvent(a,"onselect",e)};_0.attachEvent(a,"onblur",f)}},onfocusout:function(a){this.onblur(a)},onclick:function(a){var b=a.target;if(b.form)this._1n(b.form)},ondblclick:function(a){if(!a._G)this.fireEvent("click",a)},"@!(element.onfocusin)":{init:function(b){this.base(b);var c=this,d=b.activeElement;_0.attachEvent(b,"onpropertychange",function(a){if(a.propertyName=="activeElement"){if(d){_0.attachEvent(d,"onblur",f)}d=b.activeElement;if(d){_0.attachEvent(d,"onfocus",e);c.activate(d)}}});function e(a){_0.detachEvent(a.srcElement,"onfocus",e);a.target=a.srcElement;c.handleEvent(a)};function f(a){_0.detachEvent(a.srcElement,"onblur",f);a.target=a.srcElement;c.handleEvent(a)}}}}}},{createState:function(a){var b=assignID(a);if(!this[b]&&!Traversal.isXML(a)){this[b]=new this();this[b].init(a)}return this[b]},getInstance:function(a){var b=Traversal.getDocument(a);return this[b.base2ID]||this.createState(b)}});DocumentState.createState(document);new DOMContentLoadedEvent(document);eval(this.exports)};