-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbase2-jsb-fp.js
9 lines (8 loc) · 84.7 KB
/
base2-jsb-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(_14){/*@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 _15=K(),_2N=/%([1-9])/g,_1F=/^\s\s*/,_1G=/\s\s*$/,_1H=/([\/()[\]{}|*+-.,^$?\\])/g,_16=/try/.test(detect)?/\bbase\b/:/.*/,_17=["constructor","toString"],_1I=detect("(jscript)")?new RegExp("^"+rescape(isNaN).replace(/isNaN/,"\\w+")+"$"):{test:False},_1J=1,_6=Array.prototype.slice;_f();function assignID(a,b){if(!b)b=a.nodeType==1?"uniqueID":"base2ID";if(!a[b])a[b]="b2_"+_1J++;return a[b]};var _18=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=_18.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 _H(this,a)},extend:_18,forEach:function(a,b,c){_f(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 n=p(k)||p("js."+k);if(!n)throw new ReferenceError(format("Object not found: '%1'.",k));h+=n.namespace}d.init=function(){if(f.init)f.init()};d.imports=h+lang.namespace+"this.init();";h="";var q=csv(f.exports);for(var l=0;k=q[l];l++){var o=f.name+"."+k;f.namespace+="var "+k+"="+o+";";h+="if(!"+o+")"+o+"="+k+";"}d.exports=h+"this._1K"+f.name+"();";var m=String2.slice(f,1,-1);d["_1K"+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 p(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 _1L=0;var Module=Abstract.extend(null,{namespace:"",extend:function(a,b){var c=this.base();var d=_1L++;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){_f(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(!_H(a,b)){this.base(a)}if(_H(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=_1M(a,d)}b[d]=e}}b.namespace+=a.namespace.replace(/base2\.Module\[\d+\]/g,c)}}else{extend(b,a);_19(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=_15;function _19(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)))_19(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]=_1N(a,e)}if(a.namespace.indexOf(g)==-1){a.namespace+=g}}}};function _1M(a,b){return function(){return a[b].apply(a,arguments)}};function _1N(b,c){return function(){var a=_6.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=_6.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 _3="#";var Map=Base.extend({constructor:function(a){if(a)this.merge(a)},clear:function(){for(var a in this)if(a.indexOf(_3)==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(_3)==0){a.call(b,this[c],c.slice(1),this)}},get:function(a){return this[_3+a]},getKeys:function(){return this.map(II)},getValues:function(){return this.map(I)},has:function(a){a=_3+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[_3+a]=b;return b},remove:function(a){delete this[_3+a]},size:function(){var a=0;for(var b in this)if(b.indexOf(_3)==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 _2="~";var Collection=Map.extend({constructor:function(a){this[_2]=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[_2].length=0},copy:function(){var a=this.base();a[_2]=this[_2].copy();return a},forEach:function(a,b){var c=this[_2].concat();var d=c.length;for(var e=0;e<d;e++){a.call(b,this[_3+c[e]],c[e],this)}},getAt:function(a){var b=this[_2].item(a);return(b===undefined)?undefined:this[_3+b]},getKeys:function(){return this[_2].copy()},indexOf:function(a){return this[_2].indexOf(String(a))},insertAt:function(a,b,c){if(this[_2].item(a)==null)throw"Index out of bounds.";if(this.has(b))throw"Duplicate key '"+b+"'.";this[_2].insertAt(a,String(b));this[_3+b]=null;return this.put.apply(this,_6.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[_2].push(String(a))}this[_3+a]=b;return b},putAt:function(a,b){arguments[0]=this[_2].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[_2].remove(String(a));delete this[_3+a]}},removeAt:function(a){var b=this[_2].item(a);if(b!==undefined){this[_2].removeAt(a);delete this[_3+b]}},reverse:function(){this[_2].reverse();return this},size:function(){return this[_2].length},slice:function(a,b){var c=this.copy();if(arguments.length>0){var d=this[_2],e=d;c[_2]=Array2(_6.apply(d,arguments));if(c[_2].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[_3+e[f]]}}return c},sort:function(c){if(c){this[_2].sort(bind(function(a,b){return c(this[_3+a],this[_3+b],a,b)},this))}else this[_2].sort();return this},toString:function(){return"("+(this[_2]||"")+")"}},{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 _1O=/\\(\d+)/g,_1P=/\\./g,_1Q=/\(\?[:=!]|\[[^\]]+\]/g,_1R=/\(/g,_1S=/\$(\d+)/,_1T=/^\$\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[_2];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[_3+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,_6.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(_1O,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]=_I(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"&&_1S.test(b)){if(_1T.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(_1P,"").replace(_1Q,"");return match(a,_1R).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){_w.prototype=a;return new _w};function _w(){};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=_17.length,d;while((d=_17[--f])){var g=b[d];if(g!=e[d]){if(_16.test(g)){a[d]=_I(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!=_15){var h=a[d];if(h&&typeof g=="function"){if(g!=h){if(_16.test(g)){a[d]=_I(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 _H(a,b){while(b){if(!b.ancestor)return false;b=b.ancestor;if(b==a)return true}return false};function _I(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"){_x(a,b,c);return}}_f(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 _x(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 _f(g,h,j,k){var l=function(){this.i=1};l.prototype={i:1};var n=0;for(var q in new l)n++;_f=n>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)}}};_f(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 _y.call(a)=="[object Array]";case Date:return _y.call(a)=="[object Date]";case RegExp:return _y.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 _y=Object.prototype.toString;function typeOf(a){var b=typeof a;switch(b){case"object":return a==null?"null":typeof a.constructor!="function"?_1I.test(a)?"function":b:_y.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 _z(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(_6.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 _1a=new Date(Date.UTC(2006,1,20));_1a.setUTCDate(15);if(_1a.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=_z(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=_6.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:_x,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=[];_x(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=_x;Array2.reduce=Enumerable.reduce;Array2.like=function(a){return typeOf(a)=="object"&&typeof a.length=="number"};var _1U=/^((-\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 _9={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14};var _a={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20};var Date2=_z(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 _9){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,_1U);if(c.length){var d=c[_9.Month];if(d)c[_9.Month]=String(d-1);if(c[_a.Hectomicroseconds]>=5)c[_9.Milliseconds]++;var e=c[_a.UTC]||c[_a.Hours]?"UTC":"";var f=new Date(b||0);if(c[_9.Date])f["set"+e+"Date"](14);for(var g in _9){var h=c[_9[g]];if(h){f["set"+e+g](h);if(f["get"+e+g]()!=c[_9[g]]){return NaN}}}if(c[_a.Hours]){var j=Number(c[_a.Sign]+c[_a.Hours]);var k=Number(c[_a.Sign]+(c[_a.Minutes]||0));f.setUTCMinutes(f.getUTCMinutes()+(j*60)+k)}return f.valueOf()}else{return Date.parse(a)}};var String2=_z(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(_1F,"").replace(_1G,"")};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(_1H,"\\$1")};var Function2=_z(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=_6.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=_6.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=_6.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=_6.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,_6.call(arguments,1))}};function detect(){var j=NaN/*@cc_on||@_jscript_version@*/,k=true;if(global.navigator){var l=/MSIE[\d.]+/g,n=document.createElement("span"),q=document.createElement("input"),o=n.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 p={};detect=function(e){var f=e.indexOf("!")==0;if(f)e=e.slice(1);if(p[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(!o[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,n,q,o,j,k?global.java:null)}catch(x){}}else{g=new RegExp("("+h+")","i").test(base2.userAgent)}p[e]=g}return!!(f^p[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(_14){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(!_J[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)}_J[b]=true}}return a},isBound:function(a){return!!_J[a.nodeType==1?a.uniqueID:a.base2ID]}});eval(this.imports);base2.DOM=pcopy(dom);base2.DOM.namespace+="var DOM=dom;";/*@cc_on @*/var _J={};var _7=document.createElement("span"),_g=_7.style;var _K=detect("(element.textContent)")?"textContent":"innerText";var _1V=/^(action|cite|codebase|data|href|longdesc|lowsrc|src|usemap)$/i,_1W=/^(type|value)$/i;var _L=detect("(element.parentElement)")?"parentElement":"parentNode";var _1X=/type="?([^\s">]*)"?/i,_1Y=/value="?([^\s">]*)"?/i;function _1b(b){return extend(this.base(b),"removeEventListener",function(){var a=Array2.slice(arguments);a.unshift(this);EventTarget.removeEventListener.apply(EventTarget,a)})};var _1c=_7.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 _A={"class":"className","for":"htmlFor"};var _1d="accessKey,allowTransparency,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,frameBorder,longDesc,maxLength,noHref,noResize,noShade,noWrap,readOnly,rowSpan,tabIndex,useMap,vAlign";extend(_A,Array2.combine(_1d.toLowerCase().split(","),_1d.split(",")));var _1Z=_7.getAttributeNode?function(a,b){return a.getAttributeNode(b)}:function(a,b){return a.attributes[b]||a.attributes[_A[b.toLowerCase()]]};var Interface=Module.extend(null,{forEach:function(c,d){forEach(this,function(a,b){if(typeOf(a)=="function"&&(this.prototype[b]||a._B)){c.call(d,a,b,this)}},this,Module)},implement:function(a){if(typeof a=="object"){_1e(this,a)}else if(Interface.ancestorOf(a)){for(var b in a){if(a[b]&&a[b]._B){this[b]=bind(b,a);this[b]._B=b}}}return this.base(a)}});function _1e(a,b){var c=a.toString().slice(1,-1);for(var d in b){var e=b[d];if(d.indexOf("@")==0){_1e(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._B=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=_1c(a);var d=_1c(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:_1b}});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=_1Z(a,b),d=c&&c.specified;/*@if(@_jscript)if(a.nodeName=="INPUT"&&_1W.test(b)&&a.outerHTML){var e=a.outerHTML||"";with(e)e=slice(0,indexOf(">")+1);return match(e,b=="type"?_1X:_1Y)[1]||null;}if((d&&_1V.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=_A[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=_A[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:_1b}});var Traversal=Module.extend({contains:function(a,b){a.nodeType;while(b&&(b=b[_L])&&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":_K:"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":_K:"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:_K,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 _m=1,_1f=2,_n=3;var _1g={"2":2,"4":1},_1h={focusin:"focus",focusout:"blur"},_1i=/^mouse(up|down)|click$/,_20=/click$/,_1j=/^((before|un)?load|focus|blur|stop|(readystate|property|filter)change|losecapture)$/,_21=/^((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)$/,_M=/^(abort|error|load|scroll|(readystate|property|filter)change)$/;var _C={},_1k=extend({},{DOMContentLoaded:"base2ContentLoaded",mouseenter:"mouseover",mouseleave:"mouseout","@Gecko":{mousewheel:"DOMMouseScroll"}});function _c(a,b,c){var d=a+"#"+assignID(b);if(!_C[d]){_C[d]=c;}return _C[d];};function _22(a,b){return _C[a+"#"+b.base2ID]||b;};function _h(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:_m,AT_TARGET:_1f,BUBBLING_PHASE:_n,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=!_1j.test(a.type);a.cancelable=_21.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 _8=document.createElement(/^CSS/.test(document.compatMode)?"meta":"marquee"),_N=_0.base2Event={};_8.base2Events=0;_8.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(_8);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?_1f:c;for(var h in g){_N.event=b;_N.target=f;_N.listener=g[h];_8.base2Events++;if(b.returnValue===false){b.preventDefault();}}}}},handleEvent:function(a){a=Event.cloneEvent(Event.bind(a));var b=a.type;if(_1h[b]){b=a.type=_1h[b];a.bubbles=!_1j.test(b);}var c=this.state.events[b];if(c&&!_0.suppress[b]){if(_1i.test(b)){var d=_20.test(b)?this.state._O:a.button;a.button=_1g[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[_m];if(h)this.dispatch(f,a,_m,h);h=c[_n];if(h&&!a.cancelBubble){if(a.bubbles){f.reverse();}else{f.length=1;}this.dispatch(f,a,_n,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?_m:_n,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._P=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?_m:_n];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=_c(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.bubbles=a.cancelable=false;EventTarget.removeEventListener(b,c,f,e);_h(this,f,a);});}else if(c=="mouseenter"||c=="mouseleave"){d=_c(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;_h(this,f,a);}});}this.base(b,_1k[c]||c,d,e);},removeEventListener:function(a,b,c,d){this.base(a,_1k[b]||b,_22(b,c),d);},"@Gecko":{addEventListener:function(b,c,d,e){if(c=="mousewheel"){var f=d;d=_c(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.wheelDelta=(-a.detail*40)||0;_h(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=_c(c,f,function(a){try{if(a.target.nodeType==3){a=Event.cloneEvent(a);a.target=a.target.parentNode;}}catch(x){return;}_h(this,f,a);});}this.base(b,c,d,e);}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(c,d,e,f){var g=e;if(_1i.test(d)){e=_c(d,g,function(a){var b=_1g[a.button]||0;if(a.button!=b){a=Event.cloneEvent(a);a.button=b;}_h(this,g,a);});}else if(typeof e=="object"){e=_c(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=_c(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){_h(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._B="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=_1l.bind({});for(var g in e){if(_Q.test(g)||_R.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(_R.test(c))d=_1m(d);return d;},"@!(document.defaultView.getComputedStyle)":{"@(element.currentStyle)":{getComputedPropertyValue:function(a,b,c){var d=b.currentStyle,e=d[c];if(e==null){c=_d(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(_Q.test(c)){if(_23.test(e))return e;if(e=="auto")return"0px";if(c.indexOf("border")==0){if(d[c.replace("Width","Style")]=="none")return"0px";e=_24[e]||e;if(typeof e=="number")return e+"px";}/*@if(@_jscript)if(_25.test(e))return _26(b,e);/*@end @*/}else if(_R.test(c)){if(e=="transparent")return e;if(/^(#|rgb)/.test(e))return _1m(e);/*@if(@_jscript)return _27(e);/*@end @*/}return e;}}}});var _25=/\d/,_23=/\dpx$/i,_Q=/(width|height|top|bottom|left|right|fontSize)$/i,_R=/color$/i;var _28=/\-/,_29=/\-([a-z])/g,_S=/[A-Z]/g;var _24={thin:1,medium:2,thick:4};var _2a={"@MSIE":{opacity:1,cursor:1}};var _d=function(c,d){if(c=="float"||c=="cssFloat"||c=="styleFloat"){return d?"float":_g.cssFloat==null?"styleFloat":"cssFloat";}if(_28.test(c)){c=c.replace(_29,_2b);}if(_g[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(_g[f]!=null){c=f;}}if(d){c=c.replace(_S,_T);}return c;};function _T(a){return"-"+a.toLowerCase();};var _2b=flip(String2.toUpperCase),_U=partial(parseInt,undefined,16);function _26(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 _27(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 _1m(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),_U).join(", ")+")";};var _1l=Binding.extend({getPropertyValue:function(a,b){if(a[b]==null)b=_d(b);return a[b]||"";},"@MSIE5":{getPropertyValue:function(a,b){if(a[b]==null)b=_d(b);var c=a[b];if(b=="cursor"&&c=="hand"){c="pointer";}return c||"";}}});var CSSStyleDeclaration=_1l.extend({setProperty:function(a,b,c,d){if(a[b]==null)b=_d(b);if(d){this.base(a,b.replace(_S,_T),c,d);}else{a[b]=c;}},"@!(style['setProperty'])":{setProperty:function(a,b,c,d){if(a[b]==null)b=_d(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(_S,_T),c);}else{a[b]=c;}}}},{getPropertyName:_d,setProperties:function(a,b){b=extend({},b);for(var c in b){var d=b[c];if(a[c]==null)c=_d(c);if(typeof d=="number"&&_Q.test(c))d+="px";if(_2a[c]){this.setProperty(a,c,d,"");}else{a[c]=d;}}}});AbstractView.implement(ViewCSS);var _1n=detect("(input.getAttribute('type')=='text')")?/:visited|\[(type|value)|\b(object|param)\b/i:/:visited/;var _2c=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 _2d=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"|\\./g,_2e=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_2f=/(^|,)([^\s>+~])/g,_2g=/\s*([\^*~|$]?=|[\s>+~,]|^|$)\s*/g,_2h=/\s*([\])])/g,_2i=/([\[(])\s*/g,_2j=/\x01(\d+)\x01/g,_1o=/^ \*?/g,_2k=/'/g;var _2l=/#/g,_2m=/[.:\[]/g,_2n=/^\w|[\s>+~]\w/g;var _2o=/^[\s>+~]$/;var _D=":(checked|disabled|enabled|selected|hover|active|focus|link|visited|target)",_i=_D+"|^(#[\\w\u00a1-\uffff\\-]+\\s*)?[\\w\u00a1-\uffff\\-]+$";if(detect("KHTML")){if(detect("WebKit5")){_i+="|nth\\-|,"}else{_i="."}}_D=new RegExp(_D);_i=new RegExp(_i);var _E=function(a,b){if(typeof a!="function"){a=new Selector(a).toDOMQuery(true)}return this.base(a,b)};function _1p(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 n=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)n=e+"("+n+")";return n};var _V,_W;function _2p(a,b){if(!_W)_W=new XPathParser;return"[not("+_W.exec(trim(b)).replace(/\[1\]/g,"").replace(/^(\*|[\w\u00a1-\uffff\-\x01]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"};function _X(a,b,c){return"["+_1p(a,b,c||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"};var id="base2"+Date2.now(),root=document.documentElement;_7.innerHTML='<a name="'+id+'"></a>';root.insertBefore(_7,root.firstChild);var _1q=document.getElementById(id)==_7.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(_7);var _o=1,_p={};function _2q(a){if(_p._o!=_o){_p={_o:_o}}var b=a.sourceIndex>0,c=b?a.sourceIndex:a.uniqueID||assignID(a);if(!_p[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;_p[c]=d}return _p[c]};function _1r(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)&&_D.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(_2c);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:_E,filter:_E,not:_E,some:_E});StaticNodeList.implement({filter:function(a,b){return new StaticNodeList(this.base(a,b))}});var NodeSelector=Interface.extend({"@(element.querySelector)":{querySelector:function(a,b){if(!_1n.test(b)){try{return this.base(a,b)}catch(x){}}return new Selector(b).exec(a,1)},querySelectorAll:function(a,b){if(!_1n.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(_7.querySelectorAll){_7.innerHTML='<a id="X"></a>';if(_7.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._2r=[];return String(b).replace(_2d,function(a){if(a.indexOf("\\")!=0){a=a.slice(1,-1).replace(_2k,"\\'")}return"\x01"+c.push(a)+"\x01"})},format:function(a){return this.normalise(this.escape(a+""))},normalise:function(a){return a.replace(_2g,"$1").replace(_2h,"$1").replace(_2i,"$1").replace(_2f,"$1 $2").replace(_2e,"$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._2r;return c.replace(_2j,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+=_X(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()":_2p,"nth-child()":_X,"nth-last-child()":_X,"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=_b.escape(this);if(a.indexOf(",")==-1){return match(a,_2l).length*10000+match(a,_2m).length*100+match(a,_2n).length}else{return-1}},split:function(){return Array2.map(_b.escape(this).split(","),function(a){return new Selector(_b.unescape(a))})},test:function(a){return this.toDOMQuery(true)(a)},toDOMQuery:function(r){var G=_2s[r?"test":"exec"];if(!G[this]){var t="",N=["e0,c"],B=[],C=(r?"":"_q.complete=false;")+"_o++;var r=[],l,d=e0.nodeType==9?e0:e0.ownerDocument||Traversal.getDocument(e0),t=d.getElementById?'toUpperCase':'toString',u,v={},k=0,p0;",D=[],O=[],H=_b.format(this).split(","),J=H.length>1,s=0;var E=function(d,e){var f="",g=_r[e?"test":"exec"],h,j,k=0;if(e)d=d.replace(_1o,"");var l=match(d,_2t),n;if(e)l.reverse();for(var q=0;n=l[q];q++){var o="";j=false;if(_2o.test(n)){h=n;o+=g[h];if(h==" "||h==">"){if(!e&&h==" "&&l[q+1].indexOf("*")==0){o=o.replace(/\bT\b/,"'*'")}s++;k++;if(!e){B.push(s)}}}else{var m=match(n,_2u),p=m[1]||"*",u=m[2]||"",w=p=="*";if(!w){D.push(p)}if(e){if(!w){o+="if(e.nodeName==t){"}}else{if(w){if(!_2v&&h=="~"){o+="if("+_Y+"){"}/*@if(@_jscript)if(h==" "||h==">"){o+="if(e.nodeName!='"+(@_jscript_version<5.6?"!":"#comment")+"'){"}@else @*/if(!_1s&&h==">"){o+="if(e.nodeType==1){"}/*@end @*/}else if(h!=" "){o+="if(e.nodeName==t){"}if((k>1&&h==" ")||h=="~"){o+=_2w;O.push(s);j=true}}o+=_b.exec(u)}f+=o.replace(_2x,function(a,b,c){if(c)return c;return b=="T"?"t"+D.length:b=="t"?b+(D.length-1):b=="E"?"e"+(s-1):b+s})}if(J){var v="";if(!j){v=_1t}if(!_F){if(z==0){v+="v[u]=1;"}else{v+="if(!v[u]){v[u]=1;"}}f+=format(v,s)}return f};var L=function(a){if(r){a+="return true;"}else{var b="if(c==1)return e%1;";if(J&&_F){b+="r[u]=e%1;k++;"}else{b+="r[k++]=e%1;"}b+="if(k===c){_q.state=[%state%];return r;";a+=format(b,s)}a+=Array(match(a,/\)\{/g).length+1).join("}");if(J&&!r&&!_F){a+="if(l&&r.length>l)r.unsorted=1;l=r.length;"}return a};_j=[];for(var z=0;z<H.length;z++){var A=H[z];if(z>0)t+="e"+s+"=e0;";var M=A.lastIndexOf("#");if(r||M==-1){t+=L(E(A,r))}else{var P=A.slice(0,M),Q=match(A.slice(M),_2y),R=Q[1]||"",S=Q[2]||"";var F=E(A,r);t+="if(!_1q||!d.getElementById||(e0!=d&&Node.compareDocumentPosition(e0,d)&1)){"+L(F)+"}";t+=format("else{var e%1=_1q(d,'%2');if(e%1&&(e0==d||Traversal.contains(e0,e%1))){",++s,R);var y="";if(P.replace(_1o,"")){var T=s;y="var q"+s+"=function(e0){";s=0;y+=E(P,true)+"return true";y+=Array(match(y,/\)\{/g).length+1).join("}")+";";s=T}F=y?"if(q"+s+"(e"+s+")){":"";F+=E(S);t+=y+L(F)+"}}"}}/*@if(@_jscript_version<5.6)t=t.replace(/getElementsByTagName\('\*'\)/g,"all");/*@end @*/C+="var reg=["+_j.join(",")+"];";C+=Array2.map(D,function(a,b){return"var t"+b+"='"+a+"'"+(a==a.toUpperCase()?";":"[t]();")}).join("");C+=Array2.map(O,function(a){return"var s"+a+"={};"}).join("");forEach(B,function(a,b){B[b]="i"+a;N.push("a"+a)});t=_b.unescape(C+t);t+=r?";return false":"_q.state=[%state%];_q.complete=true;return c==1?null:r";t=t.replace(/%state%/g,B.join(","));eval("var _q=function("+N.join(",")+"){"+t+"}");G[this]=_q}return G[this]},toXPath:function(){if(!_V)_V=new XPathParser;return _V.parse(this)},"@(XPathResult)":{exec:function(a,b){if(_i.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"&&!_i.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=_1r(this,a||document,b);return b==1?c:new StaticNodeList(c)},test:function(a){this.base;return!!_1r(this,a)}}});var _F=detect("(element.sourceIndex)"),_1s=detect("(element.children)"),_2v=detect("(element.nextElementSibling)"),_1u=_F?"e.sourceIndex":"e.uniqueID||assignID(e)",_1t="u="+_1u.replace(/\be\b/g,"e%1")+";",_Y="e.nodeType==1",_2w="u="+_1u+";if(s[u])break;s[u]=1;",_2u=new RegExp("^(\\*|[\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_2y=new RegExp("^#([\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_2t=/[^\s>+]+(~=|n\+\d)[^\s>+]+|[^\s>+~]+|[\s>+~]/g,_2x=/\b([aeEijnpstT])\b|('[^']+')/g;/*@if(@_jscript_version<5.6)_Y+="&&e.nodeName!='!'";/*@end @*/var _j=[],_2s={exec:{},test:{}};var _r={exec:extend({},{" ":"var i,e,p,n=E.getElementsByTagName(T);for(i=a||0;e=n[i];i++){",">":"var i,e,p,n=E."+(_1s?"children":"childNodes")+";for(i=a||0;e=n[i];i++){","+":"while((e=e.nextSibling)&&!("+_Y+"))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."+_L+")){",">":"var e=E."+_L+";if(e){"}};_r.test["+"]=_r.exec["+"].replace("next","previous");_r.test["~"]=_r.exec["~"].replace("next","previous");var _s=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"});_s["only-child"]=_s["first-child"]+"&&"+_s["last-child"];var _Z={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};_Z[""]="%1";var _b=new CSSParser({":not\\((\\*|[ID]+)?(([^\\s>+~]|~=)+)\\)":function(a,b,c){var d=(b&&b!="*")?"if(e.nodeName!='"+b+"'){":"";d+=_b.exec(c).replace(/if\(\(/g,"if(!(");return d},"#([ID]+)":"if(((e.submit?Element.getAttribute(e,'id'):e.id)=='$1')){","\\.([ID]+)":function(a,b){_j.push(new RegExp("(^|\\s)"+rescape(b)+"(\\s|$)"));return"if((e.className&®["+(_j.length-1)+"].test(e.className))){"},":nth(-last)?-child\\(([^)]+)\\)":function(a,b,c){return"p=_2q(e.parentNode);"+format(_1t,"")+"var j=p[u];if(("+_1p(a,c,"j","p.length","!","&&","% ","==")+")){"},":([a-z\\-]+)(\\(([^)]+)\\))?":function(a,b,c,d){return"if(("+format(_s[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=_Z[c||""];if(instanceOf(g,RegExp)){_j.push(new RegExp(format(g.source,rescape(_b.unescape(d)))));g="reg[%2].test(%1)";d=_j.length-1}return"if(("+format(g,e,d)+")){"}});Document.implement(NodeSelector);Element.implement(NodeSelector);Selector.pseudoClasses=_s;Selector.operators=_Z;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 _2z(a)}if(!a.ownerDocument){a.ownerDocument=Traversal.getOwnerDocument(a)}/*@if(@_jscript)for(var b,c=0;b=_2A[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 _2A="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 _2z=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 _1v=/^(TABLE|TH|TD)$/,_2B=detect("QuirksMode"),_1w=detect("MSIE6"),_2C=detect("Webkit5")?_1v:detect("Opera8")?{test:function(a){return!_1v.test(a)}}:{test:False};var _5=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(!_1w){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:_e(1),getBodyOffset:_e(2),getViewport:_e(3),getGeckoRoot:_e(4)}});function _e(c){return function(a){var b=c+(a.base2ID||assignID(a));if(!_e[b])_e[b]=this.base(a);return _e[b]}};var ElementView=Interface.extend({"@!(element.getBoundingClientRect)":{getBoundingClientRect:function(a){var b=a.ownerDocument;switch(a.nodeName){case"HTML":var c=_5.getViewport(b);break;case"BODY":c=_5.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(_2C.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=_5.getBodyOffset(c);if(!d.isAbsolute){d=_5.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=_5.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=_5.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"&&_5.getBodyClient(a.ownerDocument).position=="absolute"){var c=_5.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=_5.getBodyOffset(d);/*@if(@_jscript)if(_1w&&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(_2B){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=_5.getBodyOffset(c);if(!d.isAbsolute){d=_5.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(!_5.getBodyClient(a.ownerDocument).isAbsolute){var c=_5.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._1x=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._k},isActive:function(a){return Traversal.includes(a,this._10)},isHover:function(a){return Traversal.includes(a,this._1x)},handleEvent:function(a){if(!a._P){this["on"+a.type](a)}},onblur:function(a){delete this._k},onmouseover:function(a){this._1x=a.target},onmousedown:function(a){this._10=a.target},onfocus:function(a){this._k=a.target},onmouseup:function(a){delete this._10},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._k}},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._t=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&&!_M.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._1y=function(a){var b=assignID(a);if(!d[b]){d[b]=true;_0.attachEvent(a,"onsubmit",this._t);_0.attachEvent(a,"onreset",this._t)}};var e=this;this._2D=function(a){if(e._10==a.target){e._11=copy(a)}else{e._t(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._1y,this);this.activate(this.document.activeElement)},onmousedown:function(a){this.base(a);this._O=a.button},onmouseup:function(a){this.base(a);if(!a._P&&this._O==null){this.fireEvent("mousedown",a)}delete this._O},aftermouseup:function(){if(this._11){this._t(this._11);delete this._11}},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._t,e=this._2D;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._1y(b.form)},ondblclick:function(a){if(!a._P)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)};new function(_14){base2.global.jsb=new base2.Package(this,{name:"jsb",version:"0.9.6",imports:"Function2,Enumerable,dom",exports:"Animation,Rule,RuleList,behavior",INTERVAL:25,TIMEOUT:100,QUERY_SIZE:100,createStyleSheet:function(a){if(document.body){var b=document.createElement("style");b.type="text/css";if(b.textContent===undefined){b.innerHTML=a}else{b.textContent=a}new Selector("head").exec(document,1).appendChild(b)}else{document.write('<style type="text/css">'+a+'<\/style>')}},"@(document.createStyleSheet)":{createStyleSheet:function(a){document.createStyleSheet().cssText=a}}});eval(this.imports);jsb.host=_1z();/*@cc_on @*/ var _1A =/^on([a-z]{3,}|DOM[A-Z]\w+)$/,_2E=/^mouse(up|down)|click$/,_2O=/click$/,_1B=/^mouse|click$/,_2F=/^mouse(enter|leave|over|out)$/,_2G=/^(attach|detach|(content|document)ready)$/,_2H=/^(key|text)/,_2I=/^(focus|blur)$/;var _M=/^(abort|error|load|scroll|DOMAttrModified|mouse(enter|leave)|(readystate|property|filter)change)$/,_2J=/^(HTML|BODY)$/,_2K=/^[^12]$/;var _1C=/\d+/g,_2L=/\d+%?/g;var _12=detect("(document.createEvent('Events'))")?"Events":"UIEvents";var _u={};var _U=partial(parseInt,undefined,16);function _1D(a,b){return b.specificity-a.specificity};function _G(a,b){if(a==null)return[];a=trim(a).split(/\s+/);if(b){if(a.length==1)a[1]=a[0];if(a.length==2)a[2]=a[0];if(a.length==3)a[3]=a[1]}return a};var _g=document.createElement("span").style;function _1z(){var a=location.pathname,b=Array2.item(document.getElementsByTagName("script"),-1);if(b)a=b.src||a;return a.replace(/[\?#].*$/,"").replace(/[^\/]*$/,"")};var _1E=Base.extend({attach:Undefined,detach:Undefined,modify:Undefined,jsbExtendedMouse:false,jsbUseDispatch:true,jsbUseDelegation:true,ancestorOf:function(a){return a instanceof this.constructor},extend:function(e){if(!e)e={};var f=function(){};(f.prototype=new this.constructor).constructor=f;var g=e["implements"]||[];delete e["implements"];g.push(e);for(var h=0;e=g[h];h++){extend(f.prototype,e)}var j=new f;var k=[],l,n={handleEvent:function(a){jsb.eventDispatcher.dispatch(j,a.target,a)}};for(var q in j){if(typeof j[q]=="function"&&_1A.test(q)){var o=q.slice(2);if(!j.jsbUseDelegation||_M.test(o)){if(!l)l=[];l.push(o)}else if(!_2G.test(o)){k.push(o)}}}var m={behavior:j};j.attach=function(a){var b=a.uniqueID||assignID(a);if(m[b]===undefined){m[b]=true;if(!_u[b])_u[b]=0;_u[b]++;if(k){for(var c=0;o=k[c];c++){jsb.eventDelegator.addEventListener(o,m)}k=null}if(l){for(var c=0;o=l[c];c++){EventTarget.addEventListener(a,o,n,false)}}if(j.onattach){_v(j,a,"attach")}if(j.oncontentready){if(_1.isContentReady(a)){_v(j,a,"contentready")}else{_1.contentReadyQueue.push({behavior:j,element:a})}}if(j.ondocumentready){if(_1.ready){_v(j,a,"documentready")}else{_1.documentReadyQueue.push({behavior:j,element:a})}}if(j.onfocus&&a==document.activeElement){j.dispatchEvent(a,"focus")}}};j.detach=function(a){var b=a.uniqueID;if(m[b]){if(arguments[1]){m[b]=false}else{delete m[b]}_u[b]--;if(l){for(var c=0;o=l[c];c++){EventTarget.removeEventListener(a,o,n,false)}}}};var p=f.modifications={},u={};j.modify=function(d){d=extend(pcopy(j),d);return{isModification:true,attach:function(a,b){j.attach(a);var c=a.uniqueID;if(b.specificity>=(u[c]||0)){u[c]=b.specificity;p[c]=d}}}};return j},get:function(a,b){if(b=="textContent"){b=Traversal.TEXT_CONTENT}var c=this.constructor.modifications[a.uniqueID]||this,d=c[b],e;if(b!="type"){e=a[b]}if(e===undefined){e=Element.getAttribute(a,b)}if(e==null)return d;switch(typeof d){case"boolean":return true;case"number":return e-0}return e},set:function(a,b,c){var d=b=="innerHTML";if(d||b=="textContent"){Traversal.setTextContent(a,c,d)}else{var e=a[b];if(e===undefined){e=this.get(a,b);if(typeof this[b]=="boolean"&&!c){Element.removeAttribute(a,b)}else{Element.setAttribute(a,b,c)}}else{a[b]=c}if(e!==this.get(a,b)){this.dispatchEvent(a,"propertyset",{propertyName:b,originalValue:e})}}},toggle:function(a,b){this.set(a,b,!this.get(a,b))},dispatchEvent:function(a,b,c){if(typeof b=="string"){var d=b;b=DocumentEvent.createEvent(document,_12);var e=true,f=false;if(c){if(c.bubbles!=null)e=!!c.bubbles;if(c.cancelable!=null)f=!!c.cancelable;delete c.bubbles;delete c.cancelable}Event.initEvent(b,d,e,f)}if(c)extend(b,c);b.returnValue=undefined;b.cancelBubble=false;EventTarget.dispatchEvent(a,b)},getStyle:function(a,b){return CSSStyleDeclaration.getPropertyValue(a.style,b)},setStyle:function(a,b,c,d){var e=a.style;if(arguments.length>2){CSSStyleDeclaration.setProperty(e,b,c,d?"important":"")}else{CSSStyleDeclaration.setProperties(e,arguments[1])}},getComputedStyle:function(a,b){var c=document.defaultView;if(arguments.length==1){return ViewCSS.getComputedStyle(c,a,null)}else{return ViewCSS.getComputedPropertyValue(c,a,b)}},animate:function(a,b){return new Animation(a.style,b,a,true)},getOffsetFromBody:function(a){return ElementView.getOffsetFromBody(a)},setCapture:function(a){if(a!=_1.captureElement)this.releaseCapture();if(!_1.captureElement){_1.captureElement=a}},releaseCapture:function(){var a=_1.captureElement;if(a){delete _1.captureElement;this.dispatchEvent(a,"losecapture");if(!this.matchesSelector(a,":hover")){this.dispatchEvent(a,"mouseout")}}}});var behavior=_1E.prototype;forEach.csv("setInterval,setTimeout",function(e){behavior[e]=function(a,b){if(typeof a=="string")a=this[a];var c=Array2.slice(arguments,2);var d=this;return global[e](function(){a.apply(d,c)},b||1)}});forEach.csv("querySelector,querySelectorAll",function(c){behavior[c]=function(a,b){if(arguments.length==1){b=a;a=document}return NodeSelector[c](a,b)}});forEach([EventTarget,ElementView,Node,Element],function(c){c.forEach(function(a,b){if(!behavior[b]){behavior[b]=bind(a,c)}})});ClassList.forEach(function(a,b){if(b=="contains")b="has";behavior[b+"Class"]=a});behavior=new _1E;var Rule=Base.extend({constructor:function(b,c){if(!(b instanceof Selector)){b=new Selector(b)}if(typeof c=="string"){c=new External(c,function(a){c=a})}else if(!c.isModification&&!jsb.behavior.ancestorOf(c)){c=jsb.behavior.extend(c)}this.refresh=function(){if(typeof c.attach=="function"){b.exec(document).forEach(c.attach)}};this.toString=b.toString;forEach(b.split(),function(a){_1.addRule(a,c)})},refresh:Undefined});var RuleList=Collection.extend({put:function(a,b){a=String(a);if(a.indexOf("@")==0){if(detect(a.slice(1)))this.merge(b)}else{this.base.apply(this,arguments)}},refresh:function(){this.invoke("refresh")}},{Item:Rule});var Animation=Base.extend({constructor:function(l,n,q,o){var m={},p;var u=function(d,e){if(typeof d!="object"){d={end:String(d)}}if(!p)p=d;d=copy(d);d.styleElement=q;if(d.delay==null&&p.delay!=null){d.delay=p.delay}if(d.duration==null&&p.duration!=null){d.duration=p.duration}if(/^(font|background(Position)?)$/.test(e)){throw"Cannot animate shorthand property '"+e+"'.";}else if(/^border(Top|Right|Bottom|Left)?$/.test(e)){var f=e,g=_G(d.start),h=_G(d.end),j=["Width","Style","Color"];forEach(h,function(a,b){var c=copy(d);c.start=g[b];c.end=a;u(c,f+j[b])})}else if(/^(margin|padding|border(Width|Color|Style))$/.test(e)){var f=e.replace(/Width|Color|Style/,""),k=e.replace(f,"");g=_G(d.start,true);h=_G(d.end,true);forEach.csv("Top,Right,Bottom,Left",function(a,b){var c=copy(d);c.start=g[b];c.end=h[b];m[f+a+k]=c})}else{m[e]=d}};forEach(n,u);function w(a,b){return _1.transitions.add(l,a,b)};var v=false;this.start=function(){forEach(m,function(a,b){var c=w(b,a);if(!v){a.start=c.start;a.duration=c.duration}});v=true};this.reverse=function(c){forEach(m,function(a,b){w(b,{end:a.start,duration:c||a.duration,styleElement:q})})};this.accelerate=function(c){forEach(m,function(a,b){a=_1.transitions.get(a);if(a)a.accelerate(c)})};if(o)this.start()},transitions:null,accelerate:Undefined,reverse:Undefined,start:Undefined},{timingFunctions:{"ease":function(a,b,c,d){if((a/=d/2)<1){return c/2*a*a*a*a+b}return-c/2*((a-=2)*a*a*a-2)+b},"linear":function(a,b,c,d){return c*a/d+b},"ease-in":function(a,b,c,d){return c*(a/=d)*a+b},"ease-out":function(a,b,c,d){return-c*(a/=d)*(a-2)+b},"ease-in-out":function(a,b,c,d){if((a/=d/2)<1){return c/2*a*a+b}return-c/2*((--a)*(a-2)-1)+b}}});var Transition=Base.extend({constructor:function(d,e,f){extend(this,f);this.toString=K(Transition.getKey(d,e,f));this.propertyName=e;var g=this.styleElement,h=this.start,j=this.timing;if(g)e=CSSStyleDeclaration.getPropertyName(e);if(h==null){h=this.start=d[e]||(g?ViewCSS.getComputedPropertyValue(document.defaultView,g,e):"")||""}if(/color$/i.test(e)){h=this.parseColor(h);var k=this.parseColor(this.end),l=map(h,function(a,b){return k[b]-a}),n=function(c){return"#"+map(h,function(a,b){a=Math.round(j(c,a,l[b],duration));return(a<16?"0":"")+a.toString(16)}).join("")}}else if(g&&e=="clip"){h=map(match(h,_1C),Number);k=map(match(this.end,_1C),Number);l=map(h,function(a,b){return k[b]-a});n=function(c){return"rect("+map(h,function(a,b){return Math.round(j(c,a,l[b],duration))}).join("px, ")+"px)"}}else if(/^\-?\.?\d/.test(this.end)){var q=String(this.end).replace(/^[-.\d]+/,"").toLowerCase();if(!parseFloat(h))h=this.start=0+q;h=Number(String(h).replace(q,""));k=Number(String(this.end).replace(q,""));l=k-h;n=function(a){var b=j(a,h,l,duration);if(q=="px")b=Math.round(b);return b+q}}else{k=this.end||"";n=function(a){return j(a,0,1,duration)<1?h:k}}var o=0,m=false,p=0,u=0,w=~~(this.delay*1000),duration=~~(this.duration*1000),v=1,r=0;if(typeof j!="function"){j=Animation.timingFunctions[j]}assertType(j,"function","Invalid timing function.");this.tick=function(a){if(!o)o=a;if(!this.complete&&!u){r=a-o;if(!p&&r>=w){p=a}if(p){r=Math.round(Math.min((a-p)*v,duration));var b=m?duration-r:r;if(g){CSSStyleDeclaration.setProperty(d,e,n(b))}else{d[e]=n(b)}this.complete=r>=duration;if(this.complete){this.elapsedTime=a-o}}}};this.reverse=function(){var a=this.start;this.start=this.end;this.end=a;this.complete=false;m=!m;if(p){p=Date2.now()-(duration-r)/v}};this.setSpeed=function(a){v=a;if(p){p=Date2.now()-r/v}};this.accelerate=function(a){this.setSpeed(v*a)}},complete:false,delay:0,duration:1,timing:"ease",start:null,end:null,compare:function(a,b){if(/color$/i.test(this.propertyName)){return this.parseColor(this[b]).join(",")==this.parseColor(a).join(",")}else if(this.propertyName=="clip"){var c=/,\s*/g;return this[b].replace(c," ")==a.replace(c," ")}return this[b]==a},parseColor:function(b){b=b.toLowerCase();var c=Transition.colors,d=b,e=c[b];if(typeof e=="string"){d=e;e=""}if(!e){if(/^rgb/.test(d)){e=map(d.match(_2L),function(a){return a.indexOf("%")==-1?a-0:Math.round(2.55*a.slice(0,-1))})}else if(d.indexOf("#")==0){var f=d.slice(1);if(f.length==3)f=f.replace(/([0-9a-f])/g,"$1$1");e=map(f.match(/([0-9a-f]{2})/g),_U)}else{var g=Transition._w;if(!g){g=Transition._w=document.createElement("input");g.style.cssText="position:absolute;left:0;top:-9999px;"}document.body.appendChild(g);try{g.style.color=d;var h=ViewCSS.getComputedPropertyValue(document.defaultView,g,"color")}catch(x){}document.body.removeChild(g);if(h!=d){e=this.parseColor(h||"#000")}}if(!e||e.length!=3||Array2.contains(e,NaN)){throw"Invalid color '"+b+"'.";}c[b]=e}return e}},{colors:{},getKey:function(a,b,c){var d=c.styleElement||a,e=assignID(d);if(c.styleElement)e+=".style";return e+"."+b}});var Transitions=Collection.extend({constructor:function(a){this.base(a);this.tick=bind(this.tick,this)},add:function(a,b,c){var d=Transition.getKey(a,b,c),e=this.get(d);if(e){if(e.duration!=c.duration){e.setSpeed(e.duration/(c.duration||1))}if(e.compare(c.end,"start")){e.reverse()}}else{e=this.put(d,a,b,c);if(!this._13){this._13=setTimeout(this.tick,4)}}return e},tick:function(){this.invoke("tick",Date2.now());var b=this.filter(function(a){return a.complete});b.forEach(this.remove,this);b.forEach(function(a){if(a.styleElement){behavior.dispatchEvent(a.styleElement,"transitionend",{propertyName:a.propertyName,elapsedTime:a.elapsedTime/1000})}});delete this._13;if(this.size()>0){this._13=setTimeout(this.tick,4)}}},{Item:Transition,create:function(a,b,c,d){return new this.Item(b,c,d)}});extend(jsb,"createStyleSheet",function(h){if(typeof h!="string"){var j=h;var k={toString:function(){return map(this,function(a,b){return b+a}).join("\n").replace(/!([^\w])/g,"!important$1")}};var l;var n=function(e,f){if(/,/.test(f)){forEach(new Selector(f).split(),partial(n,e))}else{if(!l){l=f=="*"?e:{}}if(f!="*"){var g=k[f];if(!g){g=k[f]=extend({toString:function(){return" {\n"+map(this,function(b,c){if(typeof b=="function")b="none";return" "+c.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})+": "+b}).join(";\n")+"\n}"}},l)}forEach.detect(e,function(c,d){if(_g[d]==undefined){d=CSSStyleDeclaration.getPropertyName(d)}if(_g[d]!=undefined){if(c=="initial"){forEach(g,function(a,b){if(b.indexOf(d)==0){delete g[b]}});delete g[d]}else{/*@if(@_jscript_version<5.6)if(d=="cursor"&&c=="pointer")c="hand";/*@end @*/g[d]=c}}})}}};forEach.detect(j,n);h=k.toString()}h=h.replace(/%theme%/g,"themes/"+jsb.theme);var q=/(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;this.base(h.replace(q,"$1"+_1z()+"$2"));return h});var External=Base.extend({constructor:function(a,b){a=a.split("#");this.src=a[0];this.path=a[1].split(".");this.register=b},attach:true,getObject:function(){var a=global,b=0;while(a&&b<this.path.length){a=a[this.path[b++]]}return a},load:function(){var a=this.getObject();if(!a&&!this.script){External.SCRIPT.src=this.src;if(!External.scripts[External.SCRIPT.src]){External.scripts[External.SCRIPT.src]=true;this.script=document.createElement("script");this.script.type="text/javascript";this.script.src=this.src;behavior.querySelector("head").appendChild(this.script)}a=this.getObject()}if(a){this.register(a);if(!a.attach)this.attach=false}return a}},{SCRIPT:document.createElement("script"),scripts:{}});jsb.eventDelegator=new Base({types:{},addEventListener:function(a,b){var c=this.types;if(!c[a]){c[a]=[];EventTarget.addEventListener(document,a,this,_2I.test(a))}c[a].push(b)},handleEvent:function(a){var b=a.target;if(b.nodeType!=1)return;var c=a.type,d=_1B.test(c),e=d&&_1.captureElement;if(e&&_2F.test(c))return;var f=this.types[c];if(!f||!f.length)return;if(d&&c!="mousewheel"){if(a.offsetX!=null){a=Event.cloneEvent(a)}var g=ElementView.getOffsetXY(b,a.clientX,a.clientY);a.offsetX=g.x;a.offsetY=g.y}var h=e||!a.bubbles,j=e?_1.captureElement:b;if(!h){extend(a,"stopPropagation",function(){this.base();h=true})}do{var k=j.uniqueID;if(_u[k]){for(var l=0,n;n=f[l];l++){if(n[k]){jsb.eventDispatcher.dispatch(n.behavior,j,a)}}}j=j.parentNode}while(j&&!h)}});jsb.eventDispatcher=new Base({dispatch:function(a,b,c,d){var e=c.type;_4.listener=a["on"+e];if(!_4.listener||_4.listener==Undefined)return;_4.behavior=a;_4.args=[b,c];if(_1B.test(e)){if(e=="mousewheel"){_4.args.push(c.wheelDelta)}else{if(_2E.test(e)){if(a.jsbExtendedMouse){_4.args.push(c.button)}else{if(!_2K.test(c.button||0))return}}if(b==c.target){var f=c.offsetX,g=c.offsetY}else{var h=ElementView.getOffsetXY(b,c.clientX,c.clientY);f=h.x;g=h.y}_4.args.push(f,g,c.screenX,c.screenY)}}else if(_2H.test(e)){_4.args.push(c.keyCode,c.shiftKey,c.ctrlKey,c.altKey,c.metaKey)}else if(e=="propertychange"||e=="propertyset"||e=="transitionend"){_4.args.push(c.propertyName)}if(a.jsbUseDispatch&&(d||c.bubbles||c.eventPhase==Event.CAPTURING_PHASE)){if(_8){_8.jsbEvents++}else{var j=document.createEvent(_12);j.initEvent("jsbEvents",false,false);document.dispatchEvent(j)}}else{_4.listener.apply(a,_4.args)}}});var _4=_0.jsbEvent={};if(detect.MSIE&&!detect("element.dispatchEvent")){var _8=document.createElement(/^CSS/.test(document.compatMode)?"meta":"marquee");_8.jsbEvents=0;_8.attachEvent("onpropertychange",new Function("e",'if(e.propertyName=="jsbEvents"){var d=base2.toString.jsbEvent;d.listener.apply(d.behavior,d.args)}'));document.getElementsByTagName("head")[0].appendChild(_8)}else{document.addEventListener("jsbEvents",function(){_4.listener.apply(_4.behavior,_4.args)},false)}var _l=DocumentEvent.createEvent(document,_12);_l.initEvent("dummy",false,false);_l=Event.cloneEvent(_l);function _v(a,b,c){_l.target=b;_l.type=c;jsb.eventDispatcher.dispatch(a,b,_l,true)};var _1=new Base({timestamp:Date2.now(),contentReadyQueue:[],documentReadyQueue:[],liveRules:[],rules:[],transitions:new Transitions,onDOMContentLoaded:function(){_1.loaded=true;if(!_1.ready&&!_1.rules.length){setTimeout(_1.fireReady,_1.getInterval())}_1.isContentReady=True},onblur:function(){_1._2M=_1._k;_1._k=null},onfocus:function(a){_1._k=a.target},onmousedown:function(a){_1.active=_1.busy=true},onmouseup:function(){_1.active=_1.busy=false},addRule:function(a,b){var c={query:a.toDOMQuery(),behavior:b,specificity:a.getSpecificity()};_1.liveRules.push(c);if(!_1.loaded){_1.rules.push(c);_1.rules.unsorted=true}if(!_1.started){_1.started=true;_1.tick()}},getInterval:function(){return _1.busy?jsb.INTERVAL*10:jsb.INTERVAL},fireReady:function(){if(!_1.ready){_1.ready=true;Array2.batch(_1.documentReadyQueue,function(a){_v(a.behavior,a.element,"documentready")},jsb.TIMEOUT,_1.parseComplete);_1.documentReadyQueue=[]}},isContentReady:function(a){if(_2J.test(a.nodeName))return _1.loaded;while(a&&!a.nextSibling){a=a.parentNode}return!!a},parseComplete:function(){_1.rules=Array2.filter(_1.liveRules,function(a){return!!a.behavior.attach});_1.rules.sort(_1D);_1.tick()},tick:function(a,b,c){var d=Date2.now(),e=_1.rules,f=e.length;if(!_1.busy&&_1.timestamp-d<=jsb.INTERVAL){_1.timestamp=d;var g=_1.contentReadyQueue;var h=Date2.now(),j=h,k=0;while(g.length&&(h-j<jsb.TIMEOUT)){var l=g.shift();if(_1.isContentReady(l.element)){_v(l.behavior,l.element,"contentready")}else{g.push(l)}if(k++<5||k%50==0)h=Date2.now()}while(f&&e.length&&(h-j<jsb.TIMEOUT)){if(a==null)a=b=0;var n=e[a],q=n.behavior;if(q.attach){var o=false;if(!c){var m=n.query;var p=m.state||[];p.unshift(document,q.constructor==External?2:jsb.QUERY_SIZE);c=m.apply(null,p);o=!!m.complete}h=Date2.now();var u=c.length,k=0;if(u&&q.constructor==External){n.behavior=q.load()||q;delete m.state;c=null;a++}else{while(b<u&&(h-j<jsb.TIMEOUT)){q.attach(c[b++],n);if(k++<5||k%50==0)h=Date2.now()}if(b==u){b=0;c=null;if(_1.loaded&&o){e.splice(a,1);delete m.state}else a++}}}else{e.splice(a,1)}if(a>=e.length){a=0;if(e.unsorted){e.sort(_1D);e.unsorted=false}}f--}}if(e.length){var w=function(){_1.tick(a,b,c)}}else{if(_1.ready){w=_1.parseComplete}else{w=_1.fireReady}}setTimeout(w,_1.getInterval())}});for(var i in _1)if(_1A.test(i)){EventTarget.addEventListener(document,i.slice(2),_1[i],i!="onDOMContentLoaded")}EventTarget.addEventListener(window,"blur",function(a){var b=_1.captureElement;if(b&&document.body==_1._2M){behavior.releaseCapture();if(behavior.matchesSelector(b,":hover")){behavior.dispatchEvent(b,"mouseout")}}},false);behavior.addClass(document.documentElement,"jsb-enabled");eval(this.exports)};