forked from meritt/base2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase2-chrome-fp.js
9 lines (8 loc) · 131 KB
/
base2-chrome-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(_16){/*@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 _1y=K(),_3B=/%([1-9])/g,_2l=/^\s\s*/,_2m=/\s\s*$/,_2n=/([\/()[\]{}|*+-.,^$?\\])/g,_1z=/try/.test(detect)?/\bbase\b/:/.*/,_1A=["constructor","toString"],_2o=detect("(jscript)")?new RegExp("^"+rescape(isNaN).replace(/isNaN/,"\\w+")+"$"):{test:False},_2p=1,_7=Array.prototype.slice;_q();function assignID(a,b){if(!b)b=a.nodeType==1?"uniqueID":"base2ID";if(!a[b])a[b]="b2_"+_2p++;return a[b]};var _1B=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=_1B.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 _17(this,a)},extend:_1B,forEach:function(a,b,c){_q(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._2q"+f.name+"();";var m=String2.slice(f,1,-1);d["_2q"+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 _2r=0;var Module=Abstract.extend(null,{namespace:"",extend:function(a,b){var c=this.base();var d=_2r++;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){_q(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(!_17(a,b)){this.base(a)}if(_17(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=_2s(a,d)}b[d]=e}}b.namespace+=a.namespace.replace(/base2\.Module\[\d+\]/g,c)}}else{extend(b,a);_1C(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=_1y;function _1C(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)))_1C(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]=_2t(a,e)}if(a.namespace.indexOf(g)==-1){a.namespace+=g}}}};function _2s(a,b){return function(){return a[b].apply(a,arguments)}};function _2t(b,c){return function(){var a=_7.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=_7.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,_7.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(_7.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 _2u=/\\(\d+)/g,_2v=/\\./g,_2w=/\(\?[:=!]|\[[^\]]+\]/g,_2x=/\(/g,_2y=/\$(\d+)/,_2z=/^\$\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,_7.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(_2u,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]=_18(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"&&_2y.test(b)){if(_2z.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(_2v,"").replace(_2w,"");return match(a,_2x).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){_O.prototype=a;return new _O};function _O(){};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=_1A.length,d;while((d=_1A[--f])){var g=b[d];if(g!=e[d]){if(_1z.test(g)){a[d]=_18(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!=_1y){var h=a[d];if(h&&typeof g=="function"){if(g!=h){if(_1z.test(g)){a[d]=_18(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 _17(a,b){while(b){if(!b.ancestor)return false;b=b.ancestor;if(b==a)return true}return false};function _18(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"){_P(a,b,c);return}}_q(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 _P(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 _q(g,h,j,k){var l=function(){this.i=1};l.prototype={i:1};var n=0;for(var q in new l)n++;_q=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)}}};_q(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 _Q.call(a)=="[object Array]";case Date:return _Q.call(a)=="[object Date]";case RegExp:return _Q.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 _Q=Object.prototype.toString;function typeOf(a){var b=typeof a;switch(b){case"object":return a==null?"null":typeof a.constructor!="function"?_2o.test(a)?"function":b:_Q.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 _R(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(_7.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 _1D=new Date(Date.UTC(2006,1,20));_1D.setUTCDate(15);if(_1D.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=_R(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=_7.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:_P,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=[];_P(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=_P;Array2.reduce=Enumerable.reduce;Array2.like=function(a){return typeOf(a)=="object"&&typeof a.length=="number"};var _2A=/^((-\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 _f={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14};var _g={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20};var Date2=_R(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 _f){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,_2A);if(c.length){var d=c[_f.Month];if(d)c[_f.Month]=String(d-1);if(c[_g.Hectomicroseconds]>=5)c[_f.Milliseconds]++;var e=c[_g.UTC]||c[_g.Hours]?"UTC":"";var f=new Date(b||0);if(c[_f.Date])f["set"+e+"Date"](14);for(var g in _f){var h=c[_f[g]];if(h){f["set"+e+g](h);if(f["get"+e+g]()!=c[_f[g]]){return NaN}}}if(c[_g.Hours]){var j=Number(c[_g.Sign]+c[_g.Hours]);var k=Number(c[_g.Sign]+(c[_g.Minutes]||0));f.setUTCMinutes(f.getUTCMinutes()+(j*60)+k)}return f.valueOf()}else{return Date.parse(a)}};var String2=_R(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(_2l,"").replace(_2m,"")};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(_2n,"\\$1")};var Function2=_R(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=_7.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=_7.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=_7.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=_7.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,_7.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(_16){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(!_19[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)}_19[b]=true}}return a},isBound:function(a){return!!_19[a.nodeType==1?a.uniqueID:a.base2ID]}});eval(this.imports);base2.DOM=pcopy(dom);base2.DOM.namespace+="var DOM=dom;";/*@cc_on @*/var _19={};var _8=document.createElement("span"),_r=_8.style;var _j=detect("(element.textContent)")?"textContent":"innerText";var _2B=/^(action|cite|codebase|data|href|longdesc|lowsrc|src|usemap)$/i,_2C=/^(type|value)$/i;var _k=detect("(element.parentElement)")?"parentElement":"parentNode";var _2D=/type="?([^\s">]*)"?/i,_2E=/value="?([^\s">]*)"?/i;function _1E(b){return extend(this.base(b),"removeEventListener",function(){var a=Array2.slice(arguments);a.unshift(this);EventTarget.removeEventListener.apply(EventTarget,a)})};var _1F=_8.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 _S={"class":"className","for":"htmlFor"};var _1G="accessKey,allowTransparency,cellPadding,cellSpacing,codeBase,codeType,colSpan,dateTime,frameBorder,longDesc,maxLength,noHref,noResize,noShade,noWrap,readOnly,rowSpan,tabIndex,useMap,vAlign";extend(_S,Array2.combine(_1G.toLowerCase().split(","),_1G.split(",")));var _2F=_8.getAttributeNode?function(a,b){return a.getAttributeNode(b)}:function(a,b){return a.attributes[b]||a.attributes[_S[b.toLowerCase()]]};var Interface=Module.extend(null,{forEach:function(c,d){forEach(this,function(a,b){if(typeOf(a)=="function"&&(this.prototype[b]||a._T)){c.call(d,a,b,this)}},this,Module)},implement:function(a){if(typeof a=="object"){_1H(this,a)}else if(Interface.ancestorOf(a)){for(var b in a){if(a[b]&&a[b]._T){this[b]=bind(b,a);this[b]._T=b}}}return this.base(a)}});function _1H(a,b){var c=a.toString().slice(1,-1);for(var d in b){var e=b[d];if(d.indexOf("@")==0){_1H(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._T=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=_1F(a);var d=_1F(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:_1E}});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=_2F(a,b),d=c&&c.specified;/*@if(@_jscript)if(a.nodeName=="INPUT"&&_2C.test(b)&&a.outerHTML){var e=a.outerHTML||"";with(e)e=slice(0,indexOf(">")+1);return match(e,b=="type"?_2D:_2E)[1]||null;}if((d&&_2B.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=_S[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=_S[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:_1E}});var Traversal=Module.extend({contains:function(a,b){a.nodeType;while(b&&(b=b[_k])&&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":_j:"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":_j:"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:_j,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 _z=1,_1I=2,_A=3;var _1J={"2":2,"4":1},_1K={focusin:"focus",focusout:"blur"},_1L=/^mouse(up|down)|click$/,_2G=/click$/,_1M=/^((before|un)?load|focus|blur|stop|(readystate|property|filter)change|losecapture)$/,_2H=/^((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)$/,_1a=/^(abort|error|load|scroll|(readystate|property|filter)change)$/;var _U={},_1N=extend({},{DOMContentLoaded:"base2ContentLoaded",mouseenter:"mouseover",mouseleave:"mouseout","@Gecko":{mousewheel:"DOMMouseScroll"}});function _l(a,b,c){var d=a+"#"+assignID(b);if(!_U[d]){_U[d]=c;}return _U[d];};function _2I(a,b){return _U[a+"#"+b.base2ID]||b;};function _s(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:_z,AT_TARGET:_1I,BUBBLING_PHASE:_A,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=!_1M.test(a.type);a.cancelable=_2H.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 _b=document.createElement(/^CSS/.test(document.compatMode)?"meta":"marquee"),_1b=_0.base2Event={};_b.base2Events=0;_b.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(_b);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?_1I:c;for(var h in g){_1b.event=b;_1b.target=f;_1b.listener=g[h];_b.base2Events++;if(b.returnValue===false){b.preventDefault();}}}}},handleEvent:function(a){a=Event.cloneEvent(Event.bind(a));var b=a.type;if(_1K[b]){b=a.type=_1K[b];a.bubbles=!_1M.test(b);}var c=this.state.events[b];if(c&&!_0.suppress[b]){if(_1L.test(b)){var d=_2G.test(b)?this.state._1c:a.button;a.button=_1J[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[_z];if(h)this.dispatch(f,a,_z,h);h=c[_A];if(h&&!a.cancelBubble){if(a.bubbles){f.reverse();}else{f.length=1;}this.dispatch(f,a,_A,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?_z:_A,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._1d=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?_z:_A];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=_l(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.bubbles=a.cancelable=false;EventTarget.removeEventListener(b,c,f,e);_s(this,f,a);});}else if(c=="mouseenter"||c=="mouseleave"){d=_l(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;_s(this,f,a);}});}this.base(b,_1N[c]||c,d,e);},removeEventListener:function(a,b,c,d){this.base(a,_1N[b]||b,_2I(b,c),d);},"@Gecko":{addEventListener:function(b,c,d,e){if(c=="mousewheel"){var f=d;d=_l(c,f,function(a){a=Event.cloneEvent(a);a.type=c;a.wheelDelta=(-a.detail*40)||0;_s(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=_l(c,f,function(a){try{if(a.target.nodeType==3){a=Event.cloneEvent(a);a.target=a.target.parentNode;}}catch(x){return;}_s(this,f,a);});}this.base(b,c,d,e);}},"@webkit[1-4]|KHTML[34]":{addEventListener:function(c,d,e,f){var g=e;if(_1L.test(d)){e=_l(d,g,function(a){var b=_1J[a.button]||0;if(a.button!=b){a=Event.cloneEvent(a);a.button=b;}_s(this,g,a);});}else if(typeof e=="object"){e=_l(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=_l(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){_s(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._T="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=_1O.bind({});for(var g in e){if(_1e.test(g)||_1f.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(_1f.test(c))d=_1P(d);return d;},"@!(document.defaultView.getComputedStyle)":{"@(element.currentStyle)":{getComputedPropertyValue:function(a,b,c){var d=b.currentStyle,e=d[c];if(e==null){c=_m(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(_1e.test(c)){if(_2J.test(e))return e;if(e=="auto")return"0px";if(c.indexOf("border")==0){if(d[c.replace("Width","Style")]=="none")return"0px";e=_2K[e]||e;if(typeof e=="number")return e+"px";}/*@if(@_jscript)if(_2L.test(e))return _2M(b,e);/*@end @*/}else if(_1f.test(c)){if(e=="transparent")return e;if(/^(#|rgb)/.test(e))return _1P(e);/*@if(@_jscript)return _2N(e);/*@end @*/}return e;}}}});var _2L=/\d/,_2J=/\dpx$/i,_1e=/(width|height|top|bottom|left|right|fontSize)$/i,_1f=/color$/i;var _2O=/\-/,_2P=/\-([a-z])/g,_1g=/[A-Z]/g;var _2K={thin:1,medium:2,thick:4};var _2Q={"@MSIE":{opacity:1,cursor:1}};var _m=function(c,d){if(c=="float"||c=="cssFloat"||c=="styleFloat"){return d?"float":_r.cssFloat==null?"styleFloat":"cssFloat";}if(_2O.test(c)){c=c.replace(_2P,_2R);}if(_r[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(_r[f]!=null){c=f;}}if(d){c=c.replace(_1g,_1h);}return c;};function _1h(a){return"-"+a.toLowerCase();};var _2R=flip(String2.toUpperCase),_1i=partial(parseInt,undefined,16);function _2M(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 _2N(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 _1P(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),_1i).join(", ")+")";};var _1O=Binding.extend({getPropertyValue:function(a,b){if(a[b]==null)b=_m(b);return a[b]||"";},"@MSIE5":{getPropertyValue:function(a,b){if(a[b]==null)b=_m(b);var c=a[b];if(b=="cursor"&&c=="hand"){c="pointer";}return c||"";}}});var CSSStyleDeclaration=_1O.extend({setProperty:function(a,b,c,d){if(a[b]==null)b=_m(b);if(d){this.base(a,b.replace(_1g,_1h),c,d);}else{a[b]=c;}},"@!(style['setProperty'])":{setProperty:function(a,b,c,d){if(a[b]==null)b=_m(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(_1g,_1h),c);}else{a[b]=c;}}}},{getPropertyName:_m,setProperties:function(a,b){b=extend({},b);for(var c in b){var d=b[c];if(a[c]==null)c=_m(c);if(typeof d=="number"&&_1e.test(c))d+="px";if(_2Q[c]){this.setProperty(a,c,d,"");}else{a[c]=d;}}}});AbstractView.implement(ViewCSS);var _1Q=detect("(input.getAttribute('type')=='text')")?/:visited|\[(type|value)|\b(object|param)\b/i:/:visited/;var _2S=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 _2T=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"|\\./g,_2U=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_2V=/(^|,)([^\s>+~])/g,_2W=/\s*([\^*~|$]?=|[\s>+~,]|^|$)\s*/g,_2X=/\s*([\])])/g,_2Y=/([\[(])\s*/g,_2Z=/\x01(\d+)\x01/g,_1R=/^ \*?/g,_30=/'/g;var _31=/#/g,_32=/[.:\[]/g,_33=/^\w|[\s>+~]\w/g;var _34=/^[\s>+~]$/;var _V=":(checked|disabled|enabled|selected|hover|active|focus|link|visited|target)",_t=_V+"|^(#[\\w\u00a1-\uffff\\-]+\\s*)?[\\w\u00a1-\uffff\\-]+$";if(detect("KHTML")){if(detect("WebKit5")){_t+="|nth\\-|,"}else{_t="."}}_V=new RegExp(_V);_t=new RegExp(_t);var _W=function(a,b){if(typeof a!="function"){a=new Selector(a).toDOMQuery(true)}return this.base(a,b)};function _1S(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 _1j,_1k;function _35(a,b){if(!_1k)_1k=new XPathParser;return"[not("+_1k.exec(trim(b)).replace(/\[1\]/g,"").replace(/^(\*|[\w\u00a1-\uffff\-\x01]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"};function _1l(a,b,c){return"["+_1S(a,b,c||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"};var id="base2"+Date2.now(),root=document.documentElement;_8.innerHTML='<a name="'+id+'"></a>';root.insertBefore(_8,root.firstChild);var _1T=document.getElementById(id)==_8.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(_8);var _B=1,_C={};function _36(a){if(_C._B!=_B){_C={_B:_B}}var b=a.sourceIndex>0,c=b?a.sourceIndex:a.uniqueID||assignID(a);if(!_C[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;_C[c]=d}return _C[c]};function _1U(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(_2S);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(!_1Q.test(b)){try{return this.base(a,b)}catch(x){}}return new Selector(b).exec(a,1)},querySelectorAll:function(a,b){if(!_1Q.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(_8.querySelectorAll){_8.innerHTML='<a id="X"></a>';if(_8.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._37=[];return String(b).replace(_2T,function(a){if(a.indexOf("\\")!=0){a=a.slice(1,-1).replace(_30,"\\'")}return"\x01"+c.push(a)+"\x01"})},format:function(a){return this.normalise(this.escape(a+""))},normalise:function(a){return a.replace(_2W,"$1").replace(_2X,"$1").replace(_2Y,"$1").replace(_2V,"$1 $2").replace(_2U,"$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._37;return c.replace(_2Z,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+=_1l(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()":_35,"nth-child()":_1l,"nth-last-child()":_1l,"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=_h.escape(this);if(a.indexOf(",")==-1){return match(a,_31).length*10000+match(a,_32).length*100+match(a,_33).length}else{return-1}},split:function(){return Array2.map(_h.escape(this).split(","),function(a){return new Selector(_h.unescape(a))})},test:function(a){return this.toDOMQuery(true)(a)},toDOMQuery:function(r){var C=_38[r?"test":"exec"];if(!C[this]){var u="",y=["e0,c"],A=[],B=(r?"":"_D.complete=false;")+"_B++;var r=[],l,d=e0.nodeType==9?e0:e0.ownerDocument||Traversal.getDocument(e0),t=d.getElementById?'toUpperCase':'toString',u,v={},k=0,p0;",z=[],D=[],L=_h.format(this).split(","),M=L.length>1,v=0;var H=function(d,e){var f="",g=_E[e?"test":"exec"],h,j,k=0;if(e)d=d.replace(_1R,"");var l=match(d,_39),n;if(e)l.reverse();for(var q=0;n=l[q];q++){var o="";j=false;if(_34.test(n)){h=n;o+=g[h];if(h==" "||h==">"){if(!e&&h==" "&&l[q+1].indexOf("*")==0){o=o.replace(/\bT\b/,"'*'")}v++;k++;if(!e){A.push(v)}}}else{var m=match(n,_3a),p=m[1]||"*",t=m[2]||"",w=p=="*";if(!w){z.push(p)}if(e){if(!w){o+="if(e.nodeName==t){"}}else{if(w){if(!_3b&&h=="~"){o+="if("+_1m+"){"}/*@if(@_jscript)if(h==" "||h==">"){o+="if(e.nodeName!='"+(@_jscript_version<5.6?"!":"#comment")+"'){"}@else @*/if(!_1V&&h==">"){o+="if(e.nodeType==1){"}/*@end @*/}else if(h!=" "){o+="if(e.nodeName==t){"}if((k>1&&h==" ")||h=="~"){o+=_3c;D.push(v);j=true}}o+=_h.exec(t)}f+=o.replace(_3d,function(a,b,c){if(c)return c;return b=="T"?"t"+z.length:b=="t"?b+(z.length-1):b=="E"?"e"+(v-1):b+v})}if(M){var s="";if(!j){s=_1W}if(!_X){if(F==0){s+="v[u]=1;"}else{s+="if(!v[u]){v[u]=1;"}}f+=format(s,v)}return f};var N=function(a){if(r){a+="return true;"}else{var b="if(c==1)return e%1;";if(M&&_X){b+="r[u]=e%1;k++;"}else{b+="r[k++]=e%1;"}b+="if(k===c){_D.state=[%state%];return r;";a+=format(b,v)}a+=Array(match(a,/\)\{/g).length+1).join("}");if(M&&!r&&!_X){a+="if(l&&r.length>l)r.unsorted=1;l=r.length;"}return a};_u=[];for(var F=0;F<L.length;F++){var G=L[F];if(F>0)u+="e"+v+"=e0;";var O=G.lastIndexOf("#");if(r||O==-1){u+=N(H(G,r))}else{var P=G.slice(0,O),Q=match(G.slice(O),_3e),R=Q[1]||"",S=Q[2]||"";var J=H(G,r);u+="if(!_1T||!d.getElementById||(e0!=d&&Node.compareDocumentPosition(e0,d)&1)){"+N(J)+"}";u+=format("else{var e%1=_1T(d,'%2');if(e%1&&(e0==d||Traversal.contains(e0,e%1))){",++v,R);var E="";if(P.replace(_1R,"")){var T=v;E="var q"+v+"=function(e0){";v=0;E+=H(P,true)+"return true";E+=Array(match(E,/\)\{/g).length+1).join("}")+";";v=T}J=E?"if(q"+v+"(e"+v+")){":"";J+=H(S);u+=E+N(J)+"}}"}}/*@if(@_jscript_version<5.6)u=u.replace(/getElementsByTagName\('\*'\)/g,"all");/*@end @*/B+="var reg=["+_u.join(",")+"];";B+=Array2.map(z,function(a,b){return"var t"+b+"='"+a+"'"+(a==a.toUpperCase()?";":"[t]();")}).join("");B+=Array2.map(D,function(a){return"var s"+a+"={};"}).join("");forEach(A,function(a,b){A[b]="i"+a;y.push("a"+a)});u=_h.unescape(B+u);u+=r?";return false":"_D.state=[%state%];_D.complete=true;return c==1?null:r";u=u.replace(/%state%/g,A.join(","));eval("var _D=function("+y.join(",")+"){"+u+"}");C[this]=_D}return C[this]},toXPath:function(){if(!_1j)_1j=new XPathParser;return _1j.parse(this)},"@(XPathResult)":{exec:function(a,b){if(_t.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"&&!_t.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=_1U(this,a||document,b);return b==1?c:new StaticNodeList(c)},test:function(a){this.base;return!!_1U(this,a)}}});var _X=detect("(element.sourceIndex)"),_1V=detect("(element.children)"),_3b=detect("(element.nextElementSibling)"),_1X=_X?"e.sourceIndex":"e.uniqueID||assignID(e)",_1W="u="+_1X.replace(/\be\b/g,"e%1")+";",_1m="e.nodeType==1",_3c="u="+_1X+";if(s[u])break;s[u]=1;",_3a=new RegExp("^(\\*|[\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_3e=new RegExp("^#([\\w\u00a1-\uffff\\-\\x01]+)?(.*)$"),_39=/[^\s>+]+(~=|n\+\d)[^\s>+]+|[^\s>+~]+|[\s>+~]/g,_3d=/\b([aeEijnpstT])\b|('[^']+')/g;/*@if(@_jscript_version<5.6)_1m+="&&e.nodeName!='!'";/*@end @*/var _u=[],_38={exec:{},test:{}};var _E={exec:extend({},{" ":"var i,e,p,n=E.getElementsByTagName(T);for(i=a||0;e=n[i];i++){",">":"var i,e,p,n=E."+(_1V?"children":"childNodes")+";for(i=a||0;e=n[i];i++){","+":"while((e=e.nextSibling)&&!("+_1m+"))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."+_k+")){",">":"var e=E."+_k+";if(e){"}};_E.test["+"]=_E.exec["+"].replace("next","previous");_E.test["~"]=_E.exec["~"].replace("next","previous");var _F=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"});_F["only-child"]=_F["first-child"]+"&&"+_F["last-child"];var _1n={"=":"%1=='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};_1n[""]="%1";var _h=new CSSParser({":not\\((\\*|[ID]+)?(([^\\s>+~]|~=)+)\\)":function(a,b,c){var d=(b&&b!="*")?"if(e.nodeName!='"+b+"'){":"";d+=_h.exec(c).replace(/if\(\(/g,"if(!(");return d},"#([ID]+)":"if(((e.submit?Element.getAttribute(e,'id'):e.id)=='$1')){","\\.([ID]+)":function(a,b){_u.push(new RegExp("(^|\\s)"+rescape(b)+"(\\s|$)"));return"if((e.className&®["+(_u.length-1)+"].test(e.className))){"},":nth(-last)?-child\\(([^)]+)\\)":function(a,b,c){return"p=_36(e.parentNode);"+format(_1W,"")+"var j=p[u];if(("+_1S(a,c,"j","p.length","!","&&","% ","==")+")){"},":([a-z\\-]+)(\\(([^)]+)\\))?":function(a,b,c,d){return"if(("+format(_F[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=_1n[c||""];if(instanceOf(g,RegExp)){_u.push(new RegExp(format(g.source,rescape(_h.unescape(d)))));g="reg[%2].test(%1)";d=_u.length-1}return"if(("+format(g,e,d)+")){"}});Document.implement(NodeSelector);Element.implement(NodeSelector);Selector.pseudoClasses=_F;Selector.operators=_1n;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 _3f(a)}if(!a.ownerDocument){a.ownerDocument=Traversal.getOwnerDocument(a)}/*@if(@_jscript)for(var b,c=0;b=_3g[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 _3g="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 _3f=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 _1Y=/^(TABLE|TH|TD)$/,_3h=detect("QuirksMode"),_1Z=detect("MSIE6"),_3i=detect("Webkit5")?_1Y:detect("Opera8")?{test:function(a){return!_1Y.test(a)}}:{test:False};var _6=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(!_1Z){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:_n(1),getBodyOffset:_n(2),getViewport:_n(3),getGeckoRoot:_n(4)}});function _n(c){return function(a){var b=c+(a.base2ID||assignID(a));if(!_n[b])_n[b]=this.base(a);return _n[b]}};var ElementView=Interface.extend({"@!(element.getBoundingClientRect)":{getBoundingClientRect:function(a){var b=a.ownerDocument;switch(a.nodeName){case"HTML":var c=_6.getViewport(b);break;case"BODY":c=_6.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(_3i.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=_6.getBodyOffset(c);if(!d.isAbsolute){d=_6.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=_6.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=_6.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"&&_6.getBodyClient(a.ownerDocument).position=="absolute"){var c=_6.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=_6.getBodyOffset(d);/*@if(@_jscript)if(_1Z&&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(_3h){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=_6.getBodyOffset(c);if(!d.isAbsolute){d=_6.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(!_6.getBodyClient(a.ownerDocument).isAbsolute){var c=_6.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._20=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._v},isActive:function(a){return Traversal.includes(a,this._o)},isHover:function(a){return Traversal.includes(a,this._20)},handleEvent:function(a){if(!a._1d){this["on"+a.type](a)}},onblur:function(a){delete this._v},onmouseover:function(a){this._20=a.target},onmousedown:function(a){this._o=a.target},onfocus:function(a){this._v=a.target},onmouseup:function(a){delete this._o},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._v}},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._G=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&&!_1a.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._21=function(a){var b=assignID(a);if(!d[b]){d[b]=true;_0.attachEvent(a,"onsubmit",this._G);_0.attachEvent(a,"onreset",this._G)}};var e=this;this._3j=function(a){if(e._o==a.target){e._1o=copy(a)}else{e._G(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._21,this);this.activate(this.document.activeElement)},onmousedown:function(a){this.base(a);this._1c=a.button},onmouseup:function(a){this.base(a);if(!a._1d&&this._1c==null){this.fireEvent("mousedown",a)}delete this._1c},aftermouseup:function(){if(this._1o){this._G(this._1o);delete this._1o}},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._G,e=this._3j;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._21(b.form)},ondblclick:function(a){if(!a._1d)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(_16){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=_22();/*@cc_on @*/ var _Y =/^on([a-z]{3,}|DOM[A-Z]\w+)$/,_3k=/^mouse(up|down)|click$/,_3C=/click$/,_23=/^mouse|click$/,_3l=/^mouse(enter|leave|over|out)$/,_3m=/^(attach|detach|(content|document)ready)$/,_3n=/^(key|text)/,_3o=/^(focus|blur)$/;var _1a=/^(abort|error|load|scroll|DOMAttrModified|mouse(enter|leave)|(readystate|property|filter)change)$/,_3p=/^(HTML|BODY)$/,_3q=/^[^12]$/;var _24=/\d+/g,_3r=/\d+%?/g;var _1p=detect("(document.createEvent('Events'))")?"Events":"UIEvents";var _H={};var _1i=partial(parseInt,undefined,16);function _25(a,b){return b.specificity-a.specificity};function _Z(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 _r=document.createElement("span").style;function _22(){var a=location.pathname,b=Array2.item(document.getElementsByTagName("script"),-1);if(b)a=b.src||a;return a.replace(/[\?#].*$/,"").replace(/[^\/]*$/,"")};var _26=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"&&_Y.test(q)){var o=q.slice(2);if(!j.jsbUseDelegation||_1a.test(o)){if(!l)l=[];l.push(o)}else if(!_3m.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(!_H[b])_H[b]=0;_H[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){_I(j,a,"attach")}if(j.oncontentready){if(_1.isContentReady(a)){_I(j,a,"contentready")}else{_1.contentReadyQueue.push({behavior:j,element:a})}}if(j.ondocumentready){if(_1.ready){_I(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]}_H[b]--;if(l){for(var c=0;o=l[c];c++){EventTarget.removeEventListener(a,o,n,false)}}}};var p=f.modifications={},t={};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>=(t[c]||0)){t[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,_1p);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=_26.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 _26;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 t=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=_Z(d.start),h=_Z(d.end),j=["Width","Style","Color"];forEach(h,function(a,b){var c=copy(d);c.start=g[b];c.end=a;t(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=_Z(d.start,true);h=_Z(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,t);function w(a,b){return _1.transitions.add(l,a,b)};var s=false;this.start=function(){forEach(m,function(a,b){var c=w(b,a);if(!s){a.start=c.start;a.duration=c.duration}});s=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,_24),Number);k=map(match(this.end,_24),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,t=0,w=~~(this.delay*1000),duration=~~(this.duration*1000),s=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&&!t){r=a-o;if(!p&&r>=w){p=a}if(p){r=Math.round(Math.min((a-p)*s,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)/s}};this.setSpeed=function(a){s=a;if(p){p=Date2.now()-r/s}};this.accelerate=function(a){this.setSpeed(s*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(_3r),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),_1i)}else{var g=Transition._O;if(!g){g=Transition._O=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._1q){this._1q=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._1q;if(this.size()>0){this._1q=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(_r[d]==undefined){d=CSSStyleDeclaration.getPropertyName(d)}if(_r[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"+_22()+"$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,_3o.test(a))}c[a].push(b)},handleEvent:function(a){var b=a.target;if(b.nodeType!=1)return;var c=a.type,d=_23.test(c),e=d&&_1.captureElement;if(e&&_3l.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(_H[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;_5.listener=a["on"+e];if(!_5.listener||_5.listener==Undefined)return;_5.behavior=a;_5.args=[b,c];if(_23.test(e)){if(e=="mousewheel"){_5.args.push(c.wheelDelta)}else{if(_3k.test(e)){if(a.jsbExtendedMouse){_5.args.push(c.button)}else{if(!_3q.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}_5.args.push(f,g,c.screenX,c.screenY)}}else if(_3n.test(e)){_5.args.push(c.keyCode,c.shiftKey,c.ctrlKey,c.altKey,c.metaKey)}else if(e=="propertychange"||e=="propertyset"||e=="transitionend"){_5.args.push(c.propertyName)}if(a.jsbUseDispatch&&(d||c.bubbles||c.eventPhase==Event.CAPTURING_PHASE)){if(_b){_b.jsbEvents++}else{var j=document.createEvent(_1p);j.initEvent("jsbEvents",false,false);document.dispatchEvent(j)}}else{_5.listener.apply(a,_5.args)}}});var _5=_0.jsbEvent={};if(detect.MSIE&&!detect("element.dispatchEvent")){var _b=document.createElement(/^CSS/.test(document.compatMode)?"meta":"marquee");_b.jsbEvents=0;_b.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(_b)}else{document.addEventListener("jsbEvents",function(){_5.listener.apply(_5.behavior,_5.args)},false)}var _w=DocumentEvent.createEvent(document,_1p);_w.initEvent("dummy",false,false);_w=Event.cloneEvent(_w);function _I(a,b,c){_w.target=b;_w.type=c;jsb.eventDispatcher.dispatch(a,b,_w,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._3s=_1._v;_1._v=null},onfocus:function(a){_1._v=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){_I(a.behavior,a.element,"documentready")},jsb.TIMEOUT,_1.parseComplete);_1.documentReadyQueue=[]}},isContentReady:function(a){if(_3p.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(_25);_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)){_I(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 t=c.length,k=0;if(t&&q.constructor==External){n.behavior=q.load()||q;delete m.state;c=null;a++}else{while(b<t&&(h-j<jsb.TIMEOUT)){q.attach(c[b++],n);if(k++<5||k%50==0)h=Date2.now()}if(b==t){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(_25);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(_Y.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._3s){behavior.releaseCapture();if(behavior.matchesSelector(b,":hover")){behavior.dispatchEvent(b,"mouseout")}}},false);behavior.addClass(document.documentElement,"jsb-enabled");eval(this.exports)};new function(_16){base2.global.chrome=new base2.Package(this,{name:"chrome",version:"0.9",imports:"Enumerable,Function2,dom,jsb",exports:"combobox,progressbar,slider,spinner,colorpicker,datepicker,weekpicker,monthpicker,timepicker,Popup,PopupWindow,MenuList,ToolTip,dropdown",parent:base2.jsb,getBehavior:function(a){return _1r[a.uniqueID]||null}});eval(this.imports);var PX="px";var _3t="\x5factive",_3u="\x5fhover",_10="\x5ffocus",_J="\x5ftimer";var _Y=/^on(DOM\w+|[a-z]+)$/,_j=Traversal.TEXT_CONTENT;var _1s=86400000;var _k=detect("(element.parentElement)")?"parentElement":"parentNode";var _1r={},_i={};var _27={onfocus:function(a,b){if(!a.onscroll){a.scrollTop=0;a.onscroll=_28}this.base(a,b)}};var _28=function(){this.scrollTop=0};function pad(a,b){return"0000".slice(0,(b||2)-String(a).length)+a};function wrap(c,d,e){return reduce(c,function(a,b){return a+="<"+d+" "+e+">"+b+"</"+d+">"},"")};var _9="clientWidth",_c="clientHeight";if(8==document.documentMode){jsb.clientWidth2={};Object.defineProperty(global.Element.prototype,"clientWidth2",{get:function(){return jsb.clientWidth2[this.uniqueID]||this.clientWidth}});jsb.clientHeight2={};Object.defineProperty(global.Element.prototype,"clientHeight2",{get:function(){return jsb.clientHeight2[this.uniqueID]||this.clientHeight}});_9="clientWidth2";_c="clientHeight2"}var locales={en:{days:"S,M,T,W,T,F,S",months:"January,February,March,April,May,June,July,August,September,October,November,December",firstDay:1},de:{days:"S,M,D,M,D,F,S",months:"Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember"},es:{days:"D,L,M,M,J,V,S",months:"Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre",firstDay:0},fr:{days:"D,L,M,M,J,V,S",months:"Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,Septembre,Octobre,Novembre,Décembre"},it:{days:"D,L,M,M,G,V,S",months:"Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre"},nl:{days:"zo,ma,di,wo,do,vr,za",months:"januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december"},ru:{days:"Вс,Пн,Вт,Ср,Чт,Пт,Сб",months:"Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь"}};var Locale=Base.extend({constructor:function(a){this.lang=a.slice(0,2);extend(this,locales[this.lang]);this.days=String2.csv(this.days);for(var b=0;b<this.firstDay;b++){this.days.push(this.days.shift())}this.months=String2.csv(this.months)}});extend(Locale.prototype,locales.en);chrome.locale=new Locale(navigator.language||navigator.systemLanguage);jsb.theme=new Base({detect:K("default"),"@Windows":{defaultTheme:"classic","@NT5\\.1":{defaultTheme:"luna/blue"},"@NT[6-9]":{defaultTheme:"aero"},detect:function(){var a=_29();return _3v[a.join("")]||_3w[a[0]]||_3x[a[1]]||this.defaultTheme},"@NT(6\\.1|[7-9])":{detect:K("aero/7")},"@Chrome|Arora":{detect:function(){var a=this.base();return!a||a=="classic"?this.defaultTheme:a}}},"@Linux":{detect:function(){return _3y[_29()[0]]}},"@Webkit([1-4]|5[01]|52[^89])|Camino|Mac":{detect:K("aqua"),"@(Chrome|Arora).+win":{detect:K("luna/blue")}}});var _3w={"#0054e3":"luna/blue","#8ba169":"luna/olive","#c0c0c0":"luna/silver","#335ea8":"royale","#5e81bc":"royale","#99b4d1":"aero","#c4cbde":"aero","#343434":"zune","#c09f79":"human","#83a67f":"smooth"},_3x={"#808080":"classic","#8d8961":"classic/brick","#a28d68":"classic/desert","#588078":"classic/eggplant","#5a4eb1":"classic/lilac","#489088":"classic/marine","#c6a646":"classic/maple","#786058":"classic/plum","#d7a52f":"classic/pumpkin","#4f657d":"classic/rainyday","#9f6070":"classic/rose","#558097":"classic/slate","#559764":"classic/spruce","#bcbc41":"classic/wheat"},_3v={"#0a246a#808080":"classic/standard","#0000ff#00ff00":"classic/contrast/high1","#00ffff#00ff00":"classic/contrast/high2","#800080#00ff00":"classic/contrast/black","#000000#00ff00":"classic/contrast/white"},_3y={"#c4c6c0":"clearlooks","#eae8e3":"clearlooks","#dfe4e8":"clearlooks","#eaeaea":"clearlooks","#edeceb":"clearlooks","#efebe7":"human"};var rgba=rgb;jsb.theme.toString=K(jsb.theme.detect()||"default");base2.userAgent+=";theme="+jsb.theme;function rgb(b,c,d){function e(a){return(a<16?"0":"")+a.toString(16)};return"#"+e(b)+e(c)+e(d)};function _29(){var b=document.createElement("input"),c=b.style,d=behavior.querySelector("body,head"),e=function(a){c.color=a;if(a.toLowerCase()==c.color.toLowerCase()){a=ViewCSS.getComputedPropertyValue(document.defaultView,b,"color")}else{a=c.color}if(/rgb/.test(a))a=eval(a);return a};d.appendChild(b);var f=[e("ActiveCaption"),e("GrayText")];d.removeChild(b);return f};var _11="window",_1t="highlight",_1u="highlighttext";if(detect("(Webkit([1-4]|5[01]|52[^89])|theme=aqua).+win")){_11="#ffffff";_1t="#427cd9";_1u="#ffffff"}var _2a={onfocus:function(d){this.base.apply(this,arguments);var e=this,f;if(!shim.control){shim.control=document.createElement(detect.MSIE5?"span":"x");document.body.insertBefore(shim.control,document.body.firstChild);shim.attach(shim.control)}shim.element=d;shim.behavior=e;var g=shim.control.style;g.display="none";g.position="absolute";g.fontSize="0";g.border="0";g.height=d.clientHeight+PX;g.width=e._12+PX;g.backgroundImage=this.getComputedStyle(d,"backgroundImage");shim.layout();var h=detect.MSIE&&!detect.MSIE5?"onfocusout":"onblur",j=detect.MSIE?"onpropertychange":"onkeydown",k=detect.MSIE?l:n;_0.attachEvent(d,j,k);_0.attachEvent(d,h,o);function l(a){if(a.propertyName=="value")n()};function n(){d.scrollLeft=9999};function q(){var a=ElementView.getOffsetFromBody(d),b=ElementView.getBoundingClientRect(d),c=detect.MSIE?b.right-b.left-d.offsetWidth:0;g.left=(a.left+c+d[_9]-e._12+d.clientLeft)+PX;g.top=(a.top+d.clientTop)+PX;f=null};function o(){if(document.activeElement==null){if(event.preventDefault)event.preventDefault()}else{_0.detachEvent(d,j,k,true);_0.detachEvent(d,h,o,true);_0.detachEvent(window,"onresize",m,true);g.display="none";n();delete shim.element}};function m(){if(!f)f=setTimeout(q,50)};_0.attachEvent(window,"onresize",m);q();setTimeout(function(){g.display="block"},1)},onmouseover:_2b,onmouseout:_2b,onmousedown:_1v,onmouseup:_1v,onkeydown:_1v,onkeyup:function(a,b,c){if(!PopupWindow.current&&c==35){a.scrollLeft=9999}else{this.base(a,b,c)}if(shim.element==a)shim.layout()},layout:function(a,b){this.base(a,b);if(a==shim.element){shim.layout()}},matchesSelector:function(a,b){return this.base(a,b)||(/^:(hover|active)$/.test(b)&&a==shim.element&&this.base(shim.control,b))}};var shim=behavior.extend({jsbExtendedMouse:true,onclick:_K,ondblclick:_K,onmousedown:_K,onmouseup:_K,onmousemove:_K,onmouseover:_2c,onmouseout:_2c,layout:function(){if(this.element){this.control.style.backgroundPosition=this.element.style.backgroundPosition}}});function _1v(a,b){this.base.apply(this,arguments);if(a==shim.element)shim.layout()};function _K(a,b){b.stopPropagation();if(b.type=="mousedown")b.preventDefault();this.dispatchEvent(this.element,b.type,b);this.layout()};function _2b(a,b,c,d){if(a!=shim.element||!b.relatedTarget||b.relatedTarget!=shim.control){this.base(a,b,c,d)}if(shim.element==a)shim.layout()};function _2c(a,b,c,d){b.stopPropagation();if(this.element&&b.relatedTarget!=this.element){b.target=this.element;this.behavior["on"+b.type](this.element,b,c,d)}this.layout()};var Popup=Base.extend({constructor:function(){var a=this.body=this.createBody();a.className="jsb-popup";var b=this.appearance;if(b&&b!="popup"){a.className+=" jsb-"+b}var c=this;for(var d in c){if(_Y.test(d)){EventTarget.addEventListener(a,d.slice(2),this,true)}}},appearance:"popup",element:null,body:null,width:"auto",height:"auto",position:"below",scrollX:false,scrollY:false,offsetX:0,offsetY:0,"@Gecko1\\.[^9]":{onmousedown:function(a){a.preventDefault()}},handleEvent:function(a){switch(a.type){case"mouseover":case"mouseout":if(a.target==this.body)return}this["on"+a.type](a)},createBody:function(){return document.createElement("div")},removeBody:function(){var a=this.body[_k];if(a)a.removeChild(this.body)},getRect:function(){var a=detect("QuirksMode|Gecko1\\.[0-3]")?document.body:document.documentElement,b=this.body,c=this.element,d=ElementView.getBoundingClientRect(c),e=0,f=this.position=="below"?c.offsetHeight-1:-1-c.offsetHeight,g=this.width,h=this.height,j=this.offsetX,k=this.offsetY;if(g=="base"){g=c.offsetWidth}if(g=="auto"||h=="auto"){if(h=="auto"){h=b.scrollHeight+2;var l=this.getUnitHeight();if(this.scrollY){h=Math.min(h,Math.max(a[_c]-d.bottom-2,d.top-2))}if(l>1)h=2+~~(h/l)*l}if(g=="auto"){g=b.scrollWidth+2;if(h<b.scrollHeight+2)g+=22;if(this.scrollX){g=Math.min(g,Math.max(a[_9]-d.left-2,d.right-2))}g=Math.max(g,c.offsetWidth)}}if(h>a[_c]-d.bottom&&h<d.bottom){f=-h;k*=-1}if(g>a[_9]-d.right&&g<d.right){e=c.offsetWidth-g;j*=-1}return new Rect(e+j,f+k,g,h)},getUnitHeight:K(1),hide:function(){this.removeBody()},isOpen:function(){return!!this.body[_k]},layout:Undefined,movesize:function(){document.body.appendChild(this.body);var a=this.getRect(),b=ElementView.getOffsetFromBody(this.element);behavior.setStyle(this.body,{left:b.left,top:b.top+a.top,width:Math.max(a.width-2,100),height:Math.max(a.height-2,22)})},querySelector:function(a){return NodeSelector.querySelector(this.body,a)},querySelectorAll:function(a){return NodeSelector.querySelectorAll(this.body,a)},render:function(a){this.body.innerHTML=trim(a)||""},setUnselectable:function(a){a.unselectable="on";behavior.setStyle(a,"userSelect","none")},show:function(a){this.element=a;this.render();this.style();this.movesize();this.layout();this.body.style.visibility="visible"},style:function(){var b=this.body.style;b.left="-999px";b.top="-999px";b.width="";b.height="";var c=behavior.getComputedStyle(this.element);forEach.csv("backgroundColor,color,fontFamily,fontWeight,fontStyle",function(a){b[a]=c[a]});if(b.fontFamily=="MS She"){b.fontFamily="MS Shell Dlg"}b.fontSize=parseInt(c.fontSize)+PX;if(b.backgroundColor=="transparent"){b.backgroundColor="white"}},"@MSIE(5.5|6)":{removeBody:function(){var a=Popup._1w;if(a[_k]){document.body.removeChild(a)}this.base()},createBody:function(){var a=Popup._1w;if(!a){a=Popup._1w=document.createElement("iframe"),a.style.cssText="position:absolute;z-index:999998!important";a.frameBorder="0";a.scrolling="no"}return this.base()},show:function(a){this.base(a);var b=Popup._1w,c=this.body,d=c.currentStyle;behavior.setStyle(b,{left:d.left,top:d.top,width:c.offsetWidth,height:c.offsetHeight,backgroundColor:d.backgroundColor});document.body.appendChild(b)}}});var PopupWindow=Popup.extend({constructor:function(a){this.base();this.owner=a},controls:null,owner:null,scrollX:true,scrollY:true,onkeydown:function(a){switch(a.keyCode){case 27:this.hide();this.element.focus();break;case 9:if(this.tab(a.shiftKey?-1:1))a.preventDefault();break}},isActive:function(){return this._e||Element.matchesSelector(this.body,":hover")},hide:function(){PopupWindow.current=null;forEach(this.controls,function(a){if(a.blur)a.blur()});this.base();ClassList.remove(document.body,"jsb-popupshowing")},render:function(a){this.base(a);this.controls=this.querySelectorAll("button,input,select,textarea")},show:function(a){ClassList.add(document.body,"jsb-popupshowing");this.base(a);PopupWindow.current=this},tab:function(d){if(!this.controls.length)return false;var e=this,f=e.element,g=this.controls.map(I),h=e.querySelector(":focus")||f;e._e=false;g.unshift(f);g.push(f);try{forEach(g,function(a,b){if(a==h){var c=g[b+d];e._e=c!=f;c.focus();if(c.select)c.select();throw StopIteration;}})}catch(error){}return true}},{current:null,init:function(){var d=true;EventTarget.addEventListener(window,"blur",e,true);EventTarget.addEventListener(document,"mousedown",e,true);EventTarget.addEventListener(document,"mouseup",function(){d=false},true);function e(a){var b=PopupWindow.current,c=a.target;if(a.type=="blur"&&d)return;d=a.type=="mousedown";if(b&&c!=document&&c!=b.element&&c!=shim.control&&!Traversal.includes(b.body,c)){b.hide()}}}});var MenuList=PopupWindow.extend({constructor:function(a){this.base(a);this.data={}},appearance:"menulist",onmouseup:function(a){this.select(this.currentItem)},onkeydown:function(a){switch(a.keyCode){case 13:this.select(this.currentItem);a.preventDefault();break;case 38:if(this.currentItem){this.highlight(Traversal.getPreviousElementSibling(this.currentItem))}else{this.highlight(Traversal.getFirstElementChild(this.body))}break;case 40:if(this.currentItem){this.highlight(Traversal.getNextElementSibling(this.currentItem))}else{this.highlight(Traversal.getFirstElementChild(this.body))}break;case 36:this.highlight(Traversal.getFirstElementChild(this.body));break;case 35:this.highlight(Traversal.getLastElementChild(this.body));break;default:this.base(a)}},onmouseover:function(a){this.highlight(a.target)},getUnitHeight:function(){var a=Traversal.getFirstElementChild(this.body);return a?a.offsetHeight:1},highlight:function(a){if(a){this.reset(this.currentItem);this.currentItem=a;with(a.style){backgroundColor=_1t;color=_1u}}},layout:function(){this.currentItem=null;var a=this.data[this.element.uniqueID];if(a)this.highlight(this.body.childNodes[a.index]);else this.highlight(Traversal.getFirstElementChild(this.body))},render:function(){var d=this.owner.get(this.element,"list"),e="";if(d){var f='role="listitem" unselectable="on"';if(d.nodeType==1){if(d.nodeName!="SELECT"){d=NodeSelector.querySelector(d,"select")}if(d){var g=d.innerHTML.split(/<\/option>/i).join("");e=trim(g).replace(/<option/gi,'</div><div '+f).slice(6)+'</div>'}}else{if(Array2.like(d)){e=wrap(d,"div",f)}else{e=reduce(d,function(a,b,c){return a+='<div '+f+' value="'+c+'">'+b+'</div>'})}}}this.base(e);this.body.setAttribute("role","list")},reset:function(a){if(a)with(a.style){backgroundColor="";color=""}},select:function(a){var b=Element.getAttribute(a,"value")||trim(a[_j]),c=this.element;this.data[c.uniqueID]={index:Traversal.getNodeIndex(a),value:b};this.owner.setValue(c,b);c.focus();this.hide()}});var ToolTip=Popup.extend({appearance:"tooltip",text:"",offsetX:2,offsetY:4,"@Safari":{offsetY:6},ontransitionend:function(a){if(a.propertyName=="opacity"&&a.target.style.opacity=="0"){this.removeBody()}},createBody:function(){var a=document.createElement("div");if(this.fadeIn!=Undefined){behavior.setStyle(a,"opacity",0)}return a},fadeIn:function(){behavior.animate(this.body,{opacity:1})},fadeOut:function(){behavior.animate(this.body,{opacity:0})},"@MSIE[56]":{fadeIn:Undefined,fadeOut:function(){this.removeBody()}},hide:function(){if(this.isOpen())this.fadeOut();delete this.element;ToolTip.current=null;clearTimeout(this._L)},render:function(){this.base('<div role="tooltip">'+this.text+'</div>')},show:function(a,b,c){c=c?c*1000:ToolTip.TIMEOUT;var d=ToolTip.current=this;d.text=b;if(d._L)clearTimeout(d._L);d._L=setTimeout(function e(){if(Element.matchesSelector(a,":hover")||Element.matchesSelector(d.body,":hover")){d._L=setTimeout(e,ToolTip.TIMEOUT/3)}else{delete d._L;d.hide()}c=ToolTip.TIMEOUT},c);this.base(a);this.fadeIn()}},{TIMEOUT:5000,current:null});var control=behavior.extend({_2d:"",_3D:0,_2e:1,_12:17,"@Gecko1\\.[0-3]":{_2d:"text"},states:{normal:0,hover:1,active:2,disabled:3,length:4},type:"text",appearance:"none",allowVertical:false,onattach:function(a){if(this.isNativeControl!=False&&this.isNativeControl(a)){this.detach(a,true)}else{_1r[a.uniqueID]=this;if(this.allowVertical&&a[_c]>a[_9]){this.setOrientation(a,this._2e)}if(a.name&&a.form){a.setAttribute("autocomplete","off")}this.layout(a,this.states[a.disabled?"disabled":"normal"])}},"@MSIE[567]":{onattach:function(a){if(this.appearance!="none"){ClassList.add(a,"jsb-"+this.appearance)}this.base(a)}},onlosecapture:function(a){delete control._e;delete control._1x;delete control._4;this.setUnselectable(a,false);this.layout(a)},onmousedown:function(a,b,c,d){control._e=a;if(!this.isEditable(a))return;control._4=this.hitTest(a,c,d);if(control._4){this.setCapture(a);control._1x=true;this.setTimeout("setUnselectable",1,a,true)}this.layout(a)},onmouseup:function(a,b){this.releaseCapture()},onmousemove:function(a,b,c,d){var e=this.hitTest(a,c,d);if(e!=control._d){control._d=e;this.layout(a)}if(control._1x){b.preventDefault()}},onmouseover:function(a,b,c,d){control._x=a;control._d=this.hitTest(a,c,d);this.layout(a)},onmouseout:function(a){delete control._4;delete control._d;delete control._x;this.layout(a)},onfocus:function(a){control._M=a;this.layout(a)},onblur:function(a){delete control._M;this.removeClass(a,this.appearance+_10);this.layout(a);if(control.tooltip&&control.tooltip.isOpen()){control.tooltip.hide()}},onpropertyset:function(a,b,c){if(/^(disabled|readOnly)$/.test(c)){this.layout(a)}},getCursor:function(a){return(control._4||control._d||a!=control._x||control._1x)?"default":this._2d},getState:K(0),getValue:function(a){return a.value},setValue:function(a,b){if(b!=a.value){a.value=b;this.dispatchEvent(a,"change");this.layout(a)}},hitTest:function(a,b){var c=false;return c?b<=this._12:b>=a[_9]-this._12},isActive:function(a){return control._4&&(control._4==control._d)},isEditable:function(a){return(!a.disabled&&!a.readOnly)||a==control._2f},isNativeControl:False,"@(hasFeature('WebForms','2.0'))":{isNativeControl:function(a){return a.nodeName=="INPUT"&&a.type==this.type}},layout:function(a,b){if(b==null){b=this.getState(a);this.syncCursor(a)}var c=a[_c],d=-this.states.length*(c/2*(c-1)),e=a.style;d-=c*b;var f="100% "+d+PX;if(e.backgroundPosition!=f){e.backgroundPosition=f}},setOrientation:function(a,b){if(b==this._2e){var c=this.getComputedStyle(a,"backgroundImage");this.setStyle(a,"backgroundImage",c.replace(/\.png/i,"-vertical.png"),true)}else if(a.style.backgroundImage){a.style.backgroundImage=""}},setUnselectable:Undefined,"@!Webkit":{setUnselectable:function(a,b){this.setStyle(a,"userSelect",b?"none":"")}},"@MSIE":{setUnselectable:function(a,b){if(b){a.unselectable="on"}else{a.removeAttribute("unselectable")}}},showToolTip:function(a,b,c){var d=control.tooltip;if(!d){d=control.tooltip=new ToolTip}setTimeout(function(){d.show(a,b,c)},1)},syncCursor:function(a){var b=this.getCursor(a),c=a.style;if(c.cursor!=b){c.cursor=b}},hasTimer:function(a,b){b=a.uniqueID+(b||_J);return!!_i[b]},startTimer:function(a,b,c){b=a.uniqueID+(b||_J);if(!_i[b]){_i[b]=this.setInterval(this.tick,100,a)}},stopTimer:function(a,b){b=a.uniqueID+(b||_J);if(_i[b]){clearInterval(_i[b]);delete _i[b]}},tick:Undefined,"@Opera":{syncCursor:Undefined}});var number={baseValue:0,block:10,max:"",min:"",step:"1",stepScale:1,"@(hasFeature('WebForms','2.0'))":{get:function(a,b){var c=this.base(a,b);if(a.type=="text"&&/^(max|min|step)$/.test(b)){if(c==="")return this[b]}return c}},onchange:function(a){this.setAttribute(a,"aria-valuenow",a.value);if(a.value==""||this.isValid(a)){this.removeClass(a,"jsb-error");this.removeAttribute(a,"aria-invalid")}else{this.addClass(a,"jsb-error");this.setAttribute(a,"aria-invalid",true)}},onmousewheel:function(a,b,c){if(this.isEditable(a)&&control._M==a){this.increment(a,~~(c/120));b.preventDefault()}},convertValueToNumber:parseFloat,convertNumberToValue:String,getDefaultValue:K(0),getValueAsNumber:function(a){return this.convertValueToNumber(a.value)},setValueAsNumber:function(a,b){this.setValue(a,this.convertNumberToValue(this.getValidValue(a,b)))},getValidValue:function(a,b,c){if(isNaN(b))b=this.getDefaultValue();var d=this.getProperties(a),e=d.min,f=d.max,g=d.scale,h=e||this.baseValue;b=b>f?f:b<e?e:b;b=h+Math[c||"floor"]((b-h)/g)*g;if(g<1)b=b.toFixed(String(d.step).replace(/^.*\.|^\d+$/,"").length);return b},getValueAsDate:function(a){var b=this.getValueAsNumber(a,true);return isNaN(b)?null:new Date(b)},setValueAsDate:function(a,b){this.setValueAsNumber(a,b.valueOf(),true)},isValid:function(a){var b=this.convertValueToNumber(a.value);return!isNaN(b)&&b==this.getValidValue(a,b)},getProperties:function(a){if(a==number._8){var b=number._3z}else{number._8=a;b=number._3z={};b.min=this.convertValueToNumber(this.get(a,"min")),b.max=this.convertValueToNumber(this.get(a,"max")),b.step=parseFloat(this.get(a,"step"))||1,b.scale=b.step*this.stepScale}return b},increment:function(a,b,c){var d=c?"Block":"Unit";b*=this["get"+d+"Increment"](a);this.setValueAsNumber(a,this.getValueAsNumber(a)+b)},getBlockIncrement:function(a){return this.getUnitIncrement(a)*this.block},getUnitIncrement:function(a){return(this.get(a,"step")||1)*this.stepScale}};var dropdown=control.extend({extend:function(a){var b=this.base(a);if(!PopupWindow.ancestorOf(b.Popup)){b.Popup=this.Popup.extend(b.Popup)}return b},"@MSIE.+win":_2a,_3A:/^(38|40)$/,appearance:"dropdown",Popup:PopupWindow,onblur:function(a,b){if(this.isOpen(a)&&!this.popup.isActive()){this.hidePopup()}this.base(a,b)},"@Opera(8|9.[0-4])":{onblur:function(a,b){if(this.isOpen(a)&&this.popup.isActive()){b.preventDefault()}else{this.base(a,b)}}},onkeydown:function(a,b,c){if(this.isEditable(a)){if(this._3A.test(c)&&!this.isOpen(a)){this.showPopup(a);b.preventDefault()}else if(this.isOpen(a)){this.popup.onkeydown(b)}}},onmousedown:function(a,b,c){this.base.apply(this,arguments);if(this.isEditable(a)){if(this.hitTest(a,c)){if(this.isOpen(a)){this.hidePopup()}else{this.showPopup(a)}}else{this.hidePopup()}}},getState:function(a){if(a.disabled){var b="disabled"}else if(a.readOnly&&a!=control._2f){b="normal"}else if(a==control._e&&control._4){b="active"}else if(a==control._x&&control._d){b="hover"}else{b="normal"}return this.states[b]},hidePopup:function(a){if(this.popup)this.popup.hide()},isOpen:function(a){var b=this.popup;return b&&b==PopupWindow.current&&b.element==a&&b.isOpen()},showPopup:function(a){if(!this.popup)this.popup=new this.Popup(this);this.popup.show(a)},"@theme=aqua":{"@!(style.borderImage)":{hitTest:function(a,b){return b>=a[_9]}},layout:function(a,b){if(b!=null)this.syncCursor(a)}}});var combobox=dropdown.extend({appearance:"combobox",list:"",get:function(a,b){var c=this.base(a,b);if(b=="list"&&c&&typeof c=="string"){return this.querySelector("#"+c)}return c},"@(hasFeature('WebForms','2.0'))":{isNativeControl:function(a){return a.nodeName=="INPUT"&&a.list}},Popup:MenuList});var range=control.extend({"implements":[number],_y:3000,"@Opera8":{_y:2000},min:"0",max:"100",allowVertical:true,type:"range","@MSIE(5.5|[^5])":_27,onpropertyset:function(a,b,c){if(/^(max|min|step|value)$/.test(c)){this.layout(a)}else{this.base(a,b,c)}},"@!theme=aqua":{onfocus:function(a,b){if(a!=control._e){this.addClass(a,this.appearance+_10)}this.base(a,b)}},onkeydown:function(a,b,c,d,e,f,g){if(!this.isEditable(a)||c<33||d||e||f||g)return;b.preventDefault();if(c>40)return;var h=1;switch(c){case 35:var j=1;case 36:this.setRelativeValue(a,j||0);return;case 33:var k=true;break;case 34:k=true;case 37:case 40:h=-1}this.increment(a,h,k)},getProperties:function(a){var b=this.base(a);b.relativeValue=((b.value=parseFloat(a.value)||0)-b.min)/(b.max-b.min);return b},getRelativeValue:function(a){return this.getProperties(a).relativeValue},setRelativeValue:function(a,b){var c=this.getProperties(a);this.setValueAsNumber(a,(c.max-c.min)*b)},getValidValue:function(a,b,c){return this.base(a,b,c||"round")},increment:function(a,b,c){var d=c?"Block":"Unit";b*=this["get"+d+"Increment"](a);this.setRelativeValue(a,this.getRelativeValue(a)+b)},getBlockIncrement:function(a){var b=this.getUnitIncrement(a);return Math.max(2*b,Math.round(0.1/b)*b)},getUnitIncrement:function(a){var b=this.getProperties(a);return b.step/(b.max-b.min)||this.base(a)},getCursor:K("")});var progressbar=range.extend({_N:1,"@theme=luna":{_N:10},appearance:"progressbar",onmouseover:null,onmousemove:null,onmouseout:null,hitTest:False,layout:function(a){var b=a[_9]-2,c=a[_c]-2,d=this.getProperties(a).relativeValue;if(c>b){var e=(-b/2)*(b+3)-2,f=~~(c*d);f=c-Math.round(f/this._N)*this._N}else{e=~~(b*d)-this._y;e=Math.round(e/this._N)*this._N;f=(-c/2)*(c+3)-2}a.style.backgroundPosition=++e+PX+" "+ ++f+PX}});var slider=range.extend({_2g:21,_2h:22,_a:11,_y:3000,"@Opera8":{_y:500},appearance:"slider",onmousedown:function(a,b,c,d,e,f){this.base.apply(this,arguments);if(a.disabled)return;if(a.type==this.type){b.preventDefault();if(a.readOnly)a.focus()}if(a.readOnly)return;if(control._4){var g=this.getThumbRect(a);slider._13={dx:e-g.left,dy:f-g.top};slider._p=true;b.preventDefault()}else{this.startTimer(a);slider._14=this.getValueByPosition(a,c-this._a/2,d-this._a/2);slider._15=slider._14<parseFloat(a.value)?-1:1;if(a.type==this.type){a.focus()}slider._p=false}},onlosecapture:function(a){delete slider._13;this.base(a)},onmouseup:function(a){this.base.apply(this,arguments);if(!this.isEditable(a))return;if(!slider._p)this.tick(a);this.stopTimer(a);delete slider._14;delete slider._15;delete slider._p},onmousemove:function(a,b,c,d,e,f){if(slider._13){this.setValueByPosition(a,e-slider._13.dx,f-slider._13.dy)}else{this.base.apply(this,arguments)}},getState:function(a){if(a.disabled){var b="disabled"}else if(a==control._e&&control._4){b="active"}else if(a==control._M||(!a.readOnly&&a==control._x&&control._d)){b="hover"}else{b="normal"}return this.states[b]},getThumbRect:function(a){var b=a[_9],c=a[_c],d=this.getProperties(a).relativeValue;if(c>b){return new Rect((b-this._2h)/2,(c-=this._a)-~~(c*d),this._2h,this._a)}else{return new Rect(~~((b-this._a)*d),~~((c-this._2g)/2),this._a,this._2g)}},getValueByPosition:function(a,b,c){var d=a[_9],e=a[_c],f=this.getProperties(a);if(d>=e){var g=d-this._a;var h=b}else{g=e-this._a;h=g-c}return(f.max-f.min)*(h/g)},hitTest:function(a,b,c){if(a.disabled||this.isNativeControl(a))return null;return this.getThumbRect(a).contains(b,c)},layout:function(a,b){if(b==null)b=this.getState(a);var c=this.getThumbRect(a),d=a.style,e=Math.ceil((this._y-this._a)/2)+b*this._y;if(a[_c]>a[_9]){var f=c.left,g=c.top-e}else{f=c.left-e;g=c.top}var h=f+PX+" "+g+PX;if(d.backgroundPosition!=h){d.backgroundPosition=h}},setValueByPosition:function(a,b,c){this.setValueAsNumber(a,this.getValueByPosition(a,b,c))},tick:function(a){var b=this.getProperties(a),c=this.getBlockIncrement(a)*(b.max-b.min);if(Math.abs(slider._14-a.value)<c){this.setValueAsNumber(a,slider._14);this.stopTimer(a)}else{this.increment(a,slider._15,true)}slider._p=true},"@theme=aqua":{onblur:function(a,b){if(a==slider._o){delete slider._o}this.base(a,b)},onmousedown:function(a,b,c,d){slider._o=a;this.base.apply(this,arguments);if(!this.isEditable(a))return;if(!control._4){this.setValueByPosition(a,c-this._a/2,d-this._a/2)}this.base.apply(this,arguments)},getState:function(a){if(a.disabled){var b="disabled"}else if(a==control._e&&control._4){b="active"}else if(a==control._M&&a!=slider._o){b="hover"}else{b="normal"}return this.states[b]},startTimer:Undefined}});var spinner=control.extend({"implements":[number],"@MSIE.+win":_2a,states:{normal:0,up_hover:1,up_active:2,down_hover:3,down_active:4,disabled:5,length:6},type:"number",appearance:"spinner",onkeydown:function(a,b,c){if(!this.isEditable(a))return;if(!/^(3[348]|40)$/.test(c))return;b.preventDefault();switch(c){case 34:var d=true;break;case 33:d=true;case 38:var e="up"}this.activate(a,e||"down",d)},onkeyup:function(a,b,c){if(!this.isEditable(a))return;if(!/^(3[348]|40)$/.test(c))return;this.deactivate(a)},onmousedown:function(a){this.base.apply(this,arguments);if(control._4){this.startTimer(a)}},onlosecapture:function(a,b){this.base(a,b);this.deactivate(a)},activate:function(a,b,c){control._4=control._d=b;this.layout(a);spinner._2i=c;this.startTimer(a)},deactivate:function(a){this.stopTimer(a);delete control._4;delete spinner._2i;this.layout(a)},getState:function(a){if(a.disabled){var b="disabled"}else if(a.readOnly&&a!=control._2f){b="normal"}else if((a==control._x||a==control._M)&&control._4){b=control._4+_3t}else if(a==control._x&&control._d){b=control._d+_3u}else{b="normal"}return this.states[b]},hitTest:function(a,b,c){if(!this.base(a,b))return null;return c<=(a[_c]/2)?"up":"down"},startTimer:function(a){if(!_i[a.uniqueID+_J]){spinner._15=(control._4=="up")?1:-1;spinner._2j=1;this.base(a)}},stopTimer:function(a){if(_i[a.uniqueID+_J]){this.base(a);if(!spinner._p)this.tick(a);delete spinner._p;if(a.select)a.select();this.syncCursor(a)}},tick:function(a){this.increment(a,~~(spinner._2j*spinner._15),!!spinner._2i);spinner._2j*=1.05;spinner._p=true}});var timepicker=spinner.extend({FORMAT:"hh:mm:ss",appearance:"timepicker",block:60,step:"60",stepScale:1000,type:"time",getDefaultValue:function(){var a=new Date;return Date.UTC(1970,0,1,a.getHours(),a.getMinutes(),0,0)},convertValueToNumber:function(a){return a==""?NaN:Date2.parse("1970-01-01T"+a+"Z")},convertNumberToValue:function(a){return isNaN(a)?"":Date2.toISOString(new Date(a)).slice(11,16)}});var datepicker=dropdown.extend({"implements":[number],FORMAT:"yyyy-mm-dd",type:"date",appearance:"datepicker",stepScale:_1s,showLocaleString:Undefined,"@(Date.prototype.toLocaleDateString)":{onchange:function(a){this.base(a);if(!this.hasClass(a,"jsb-error")&&a.value){this.showLocaleString(a)}},"@!Opera|Linux":{showLocaleString:function(a){this.showToolTip(a,new Date(Date2.parse(a.value+"T")).toLocaleDateString())}}},getDefaultValue:Date2.now,convertValueToNumber:function(a){return a==""?NaN:Date2.parse(a+"T00:00Z")},convertNumberToValue:function(a){return isNaN(a)?"":Date2.toISOString(new Date(a)).slice(0,10)},normalise:I,Popup:{appearance:"datepicker-popup",scrollX:false,scrollY:false,currentDate:0,state:{},render:function(){this.base(format('<div style="padding:4px!important"><table cellspacing="0"><tr><td><select>'+wrap(chrome.locale.months,"option")+'</select></td><td align="right"><input type="text" class="jsb-spinner" size="4"></td></tr><tr><td colspan="2"><table role="grid" class="jsb-datepicker-days" cellspacing="0"><tr>'+wrap(chrome.locale.days,"th",'%1')+'</tr>'+Array(7).join('<tr>'+Array(8).join('<td %1>0</td>')+'</tr>')+'</table></td></tr></table></div>','role="gridcell" unselectable="on"'));this.year=this.querySelector("input");this.month=this.querySelector("select");this.days=this.querySelector("table.jsb-datepicker-days");this.year.onscroll=_28;spinner.attach(this.year);this.month.selectedIndex=8;this.setUnselectable(this.days);this.render=Undefined},onblur:function(a){ClassList.add(this.days,"jsb-datepicker-days_focus")},onchange:function(a){if(this.currentMonth!=this.month.selectedIndex){this.increment("Month",this.month.selectedIndex-this.currentMonth)}else{this.increment("FullYear",this.year.value-this.currentYear)}a.stopPropagation()},onfocus:function(a){if(a.target!=this.days){ClassList.remove(this.days,"jsb-datepicker-days_focus")}},onkeydown:function(a){var b=a.keyCode,c=a.target,d=parseFloat(this.owner.get(this.element,"step"))||1;if(b==13){this.select(this.currentItem);a.preventDefault()}else if(/^(3[346789]|40)$/.test(b)){if(c==this.month){setTimeout(bind(function(){if(this.currentMonth!=this.month.selectedIndex){this.increment("Month",this.currentMonth-this.month.selectedIndex)}},this),1)}else if(c!=this.year){a.preventDefault();switch(b){case 36:this.highlighByDate(this.owner.getValueAsDate(this.element)||this.getDefaultDate());break;case 37:this.increment("Date",-d);break;case 39:this.increment("Date",d);break;case 38:this.increment("Date",-d*7);break;case 40:this.increment("Date",d*7);break;case 33:if(a.ctrlKey){this.increment("FullYear",-1)}else{this.increment("Month",-1)}break;case 34:if(a.ctrlKey){this.increment("FullYear",1)}else{this.increment("Month",1)}break}}}else{this.base(a)}},onmouseup:function(a){var b=a.target;if(b.className=="disabled"||!Traversal.contains(this.days,b))return;this.select(this.currentItem)},onmouseover:function(a){var b=a.target;if(b.currentItem!=b&&b.nodeName=="TD"&&b.className!="disabled"&&Traversal.contains(this.days,b)){this.highlight(b);this.currentDate=~~b[_j]}},onmousemove:function(a){this.onmouseover(a)},onmousewheel:function(a){a.preventDefault();this.increment("Month",~~(a.wheelDelta/120))},fill:function(){this.currentYear=this.year.value;this.currentMonth=this.month.selectedIndex;var a=this.currentMonth,b=new Date(Date.UTC(this.currentYear,a,1)),c=new Date(b),d=this.owner,e=d.getProperties(this.element),f=e.min||d.baseValue,g=e.step,h=e.scale,j=e.min,k=e.max,l=0,n=11,q;if(isNaN(j)){j=-Infinity}else{var o=new Date(j);if(this.currentYear==o.getUTCFullYear()){l=o.getUTCMonth()}}if(isNaN(k)){k=Infinity}else{var m=new Date(k);if(this.currentYear==m.getUTCFullYear()){n=m.getUTCMonth()}}for(var p=0;q=this.month.options[p];p++){var t=p<l||p>n;q.disabled=t;q.style.color=t?"graytext":""}b.setUTCDate(b.getUTCDate()-b.getUTCDay()+chrome.locale.firstDay);if(b>c){b.setUTCDate(b.getUTCDate()-7)}var w=this.days.rows,s,r,C;for(var p=1;s=w[p];p++){var u=s.cells,y,A=false;s.className="";if(d==weekpicker&&((g!=1&&(b-f)%h!=0)||b<j||b>k)){s.className="disabled"}for(var B=0;y=u[B];B++){var z=b.getUTCDate(),D=a==b.getUTCMonth();y.innerHTML=z;y.className="";y.style.fontStyle=D?"":"italic";if(D&&b>=j&&b<=k){C=y;if(this.currentDate==z)r=y;if(d==datepicker&&g!=1&&(b-f)%h!=0){y.className="disabled"}}else{y.className="disabled"}A|=D;b.setUTCDate(z+1)}s.style.visibility=A?"":"hidden"}this.highlight(r||C)},getDefaultDate:function(){var a=this.state[this.element.uniqueID];return new Date(this.owner.getValidValue(this.element,this.owner.getValueAsDate(this.element)||(a?new Date(a):new Date()),"round"))},getUTCDate:function(){return new Date(Date.UTC(this.year.value,this.month.selectedIndex,this.currentDate))},hide:function(){if(this.element){this.state[this.element.uniqueID]=this.getUTCDate()}this.base()},highlight:function(a){if(a){this.reset(this.currentItem);this.currentItem=a;ClassList.add(a,"selected");Element.setAttribute(a,"aria-selected",true)}},highlighByDate:function(a){a=this.owner.normalise(a);this.year.value=a.getUTCFullYear();this.month.selectedIndex=a.getUTCMonth();this.currentDate=a.getUTCDate();if(this.currentYear==this.year.value&&this.currentMonth==this.month.selectedIndex){var b=this.body.getElementsByTagName("td");this.highlight(b[14-b[14].innerHTML+this.currentDate])}else{this.fill()}},increment:function(a,b){var c=new Date(Date.UTC(this.currentYear,this.currentMonth,this.currentDate));c["setUTC"+a](c["getUTC"+a]()+b);c=new Date(this.owner.getValidValue(this.element,c,"round"));this.highlighByDate(c)},layout:function(){var a=this.owner.normalise(this.getDefaultDate());this.year.value=a.getUTCFullYear();this.month.selectedIndex=a.getUTCMonth();this.currentDate=a.getUTCDate();this.fill();spinner.layout(this.year)},movesize:function(){this.base();this.days.style.width=(parseInt(this.body.style.width)-10)+"px"},reset:function(a){if(a){Element.removeAttribute(a,"aria-selected");ClassList.remove(a,"selected")}},select:function(){var a=this.element;this.owner.setValueAsDate(a,this.getUTCDate());this.hide();a.focus()},show:function(a){this.base(a)},style:function(b){this.base(b);var c=this.body.style,d=this.month.style,e=this.year.style,f=this.days.style,g=this.body.getElementsByTagName("td");forEach.csv("fontFamily,fontSize,fontWeight,fontStyle,color",function(a){f[a]=d[a]=e[a]=c[a]});f.backgroundColor=e.backgroundColor=c.backgroundColor;this.highlight(g[14-g[14].innerHTML+this.currentDate]);ClassList.add(this.days,"jsb-datepicker-days_focus")}}});var weekpicker=datepicker.extend({FORMAT:"yyyy-Www",PATTERN:/^\d{4}-W([0-4]\d|5[0-3])$/,baseValue:Date.UTC(1969,11,29),type:"week",appearance:"weekpicker",stepScale:7*_1s,onfocus:function(a,b){this.base(a,b);a.setAttribute("spellcheck","false")},showLocaleString:Undefined,convertValueToNumber:function(a){if(!this.PATTERN.test(a))return NaN;var b=String(a).split("-W"),c=b[0],d=this.getFirstWeek(c),e=b[1],f=new Date(d.valueOf()+(e-1)*this.stepScale);return(e==53&&new Date(Date.UTC(c,0,1)).getUTCDay()!=chrome.locale.firstDay+3)?NaN:f.valueOf()},convertNumberToValue:function(a){var b=this.normalise(a),c=b.getUTCFullYear(),d=this.getFirstWeek(c),e=~~((b-d)/this.stepScale)+1;return pad(c,4)+"-W"+pad(e)},getFirstWeek:function(a){var b=new Date(Date.UTC(a,0,1)),c=b.getUTCDay()-chrome.locale.firstDay;if(c>3)c-=7;b.setUTCDate(b.getUTCDate()-c);return b},normalise:function(a){return new Date(this.baseValue+~~((a-this.baseValue)/this.stepScale)*this.stepScale+3*_1s)},Popup:{onkeydown:function(a){if(!/^(37|39)$/.test(a.keyCode)){this.base(a)}},onmouseover:function(a){var b=a.target;if(b.nodeName=="TD"){b=b.parentNode}if(b.nodeName=="TR"&&Traversal.contains(this.days,b)&&!ClassList.has(b,"disabled")){var c=NodeSelector.querySelector(b,"td:not(.disabled)");if(c){this.highlight(b);this.currentDate=~~c[_j]}}},onmouseup:function(a){var b=a.target;if(b.nodeName=="TD"){b=b.parentNode}if(b.nodeName=="TR"&&Traversal.contains(this.days,b)&&!ClassList.has(b,"disabled")){this.select()}},highlight:function(a){if(a&&a.nodeName=="TD"){a=a.parentNode}if(!ClassList.has(a,"disabled")){this.base(a)}}}});var monthpicker=spinner.extend({FORMAT:"yyyy-mm",type:"month",block:12,appearance:"monthpicker",convertValueToNumber:function(a){if(a==""||isNaN(Date2.parse(a+"-01T")))return NaN;a=a.split("-");return(a[0]*12)+parseInt(a[1],10)-1},convertNumberToValue:function(a){return isNaN(a)?"":Date2.toISOString(new Date(~~(a/12),a%12,12)).slice(0,7)},getDefaultValue:function(){var a=new Date;return a.getFullYear()*12+a.getMonth()},getValueAsNumber:function(a,b){return b?Date2.parse(a.value+"-01T00:00Z"):this.base(a)},setValueAsNumber:function(a,b,c){if(c){b=this.convertValueToNumber(Date2.toISOString(new Date(b)).slice(0,7))}this.base(a,b)}});var colorpicker=dropdown.extend({PATTERN:/^#[\da-f]{6}$/,type:"color",appearance:"colorpicker","@MSIE(5.5|[^5])":_27,"@Opera":{onattach:function(a){ClassList.add(a,"jsb-"+this.appearance);this.base(a)}},onkeydown:function(a,b,c,d,e,f,g){this.base(a,b,c);if(c<33||d||e||f||g)return;b.preventDefault()},"@!theme=aqua":{onfocus:function(a){if(a!=control._e){this.addClass(a,this.appearance+_10)}this.base(a)}},getState:function(a){if(this.hasClass(a,this.appearance+_10)){return this.states.hover}else{return this.base(a)}},layout:function(a){this.base(a);var b=a.value;if(!this.PATTERN.test(b))b="black";a.style.color=a.style.backgroundColor=b},hitTest:True,Popup:{appearance:"colorpicker-popup",onchange:function(c){var d=map(pluck(this.controls,"value"),Number);var e=reduce(d,function(a,b){return a+=pad(b.toString(16))},"#");this.owner.setValue(this.element,e);c.stopPropagation()},layout:function(){var c=map(this.element.value.slice(1).match(/(\w\w)/g),partial(parseInt,undefined,16));this.controls.forEach(function(a,b){a.value=c[b];slider.layout(a)})},render:function(){var a=': <input class="jsb-slider" min="0" max="255">';this.base(wrap(["R"+a,"G"+a,"B"+a],"div",'nowrap unselectable="on"'));this.controls.forEach(slider.attach);this.render=Undefined}}});var Rect=Base.extend({constructor:function(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d;this.right=a+c;this.bottom=b+d},contains:function(a,b){with(this)return a>=left&&a<=right&&b>=top&&b<=bottom}});var _2k=extend({},{color:"threedface","@theme=luna\\/blue":{color:"#7f9db9"},"@theme=luna\\/olive":{color:"#a4b97f"},"@theme=luna\\/silver":{color:"#a5acb2"},"@theme=royale":{color:"#a7a6aa"},"@theme=aero":{color:"#abadb3 #dbdfe6 #e3e9ef #e2e3ea"},"@theme=zune":{color:"#969696"}});jsb.theme.cssText=jsb.createStyleSheet({"*":{backgroundPosition:"9999px 9999px",backgroundAttachment:"scroll!",backgroundRepeat:"no-repeat!","@!theme=classic":{padding:"2px",border:"1px solid",borderColor:_2k.color},"@theme=aqua":{padding:"1px 2px 2px 2px",borderWidth:"2px 1px 1px 1px",borderColor:"#9e9e9e #b4b4b4 #dadada #b4b4b4"}},".jsb-dropdown,.jsb-combobox,.jsb-colorpicker,.jsb-datepicker,.jsb-weekpicker":{"@theme=aqua":{width:"10em",borderRadius:"5px",boxShadow:"0 1px 4px rgba(160, 160, 160, 0.5)","@(style.borderImage)":{borderImage:"url(%theme%/dropdown.png) 1 18 1 4!",borderStyle:"none!",borderWidth:"1px 18px 1px 4px!",padding:"1px"},"@!(style.borderImage)":{backgroundImage:"url(%theme%/bg-dropdown.png)!",backgroundPosition:"right center!",padding:"1px 22px 1px 4px!",border:"1px solid #545454!"}},"@!theme=aqua":{paddingRight:"19px!",backgroundImage:"url(%theme%/dropdown.png)!"}},".jsb-colorpicker,.jsb-datepicker,.jsb-weekpicker":{width:"8em"},".jsb-progressbar,.jsb-slider,.jsb-colorpicker":{cursor:"default",textIndent:"-10em!",userModify:"read-only!",MozUserSelect:"none!","@MSIE":{textIndent:0,"@MSIE(5.5|6|7)":{lineHeight:999},"@MSIE[^567]":{lineHeight:999,verticalAlign:"middle"}}},".jsb-progressbar,.jsb-slider":{verticalAlign:"middle"},".jsb-progressbar":{minHeight:"8px",borderColor:"threeddarkshadow",borderWidth:"1px",borderRadius:"5px",backgroundImage:"url(%theme%/progressbar.png)!","@Opera8":{backgroundImage:"url(themes/s/progressbar.png)!"}},".jsb-slider":{height:"21px",minHeight:"21px",padding:0,border:"none",backgroundColor:"transparent",backgroundImage:"url(%theme%/slider.png)!","@Opera8":{backgroundImage:"url(themes/s/slider.png)!"},"@Gecko1\\.[0-3]":{backgroundColor:"#f2f2f2"}},".jsb-popup":{visibility:"hidden",backgroundColor:_11,borderWidth:"1px!",position:"absolute!",zIndex:"999999!",cursor:"default",padding:"0!",margin:"0!","@Gecko|Opera|theme=aqua|Webkit":{borderColor:"threedshadow!",borderStyle:"outset!","@Opera":{borderStyle:"solid!"}},"@theme=classic":{borderColor:"threedshadow!",borderStyle:"solid!"}},".jsb-spinner":{"@!Opera[78]":{textAlign:"right"},width:"5em",paddingRight:"19px!",backgroundImage:"url(%theme%/spinner.png)!"},".jsb-timepicker,.jsb-monthpicker":{width:"8ex",paddingRight:"19px!",backgroundImage:"url(%theme%/spinner.png)!","@QuirksMode|Gecko1\\.[0-3]|Opera8":{width:"6em"}},".jsb-popup .jsb-datepicker-days":{userSelect:"none!",width:"100%!",margin:"2px 0 0 0!",padding:"2px!",backgroundColor:_11+"!",color:"windowtext!"}});jsb.theme.cssText+="\n"+jsb.createStyleSheet({".jsb-popup *":{margin:"0!",padding:"0!"},".jsb-popup option":{padding:"0 3px!"},".jsb-colorpicker":{width:"4em","@QuirksMode|Gecko1\\.[0-3]|Opera8":{width:"6em"}},".jsb-datepicker":{width:"12ex","@QuirksMode|Gecko1\\.[0-3]|Opera8":{width:"15ex"}},".jsb-weekpicker":{width:"11ex","@QuirksMode|Gecko1\\.[0-3]|Opera8":{width:"14ex"}},"@Webkit":{".jsb-slider:focus:not(.slider_focus)":{outline:"none!"}},"@!Webkit":{".progressbar_focus,.slider_focus,.colorpicker_focus":{outline:"1px dotted"}},".jsb-datalist":{display:"none!"},".jsb-menulist":{"@!MSIE":{overflow:"auto!"},"@MSIE":{overflowY:"auto!"}},".jsb-menulist div":{margin:"0!",padding:"1px 2px!",overflow:"hidden!",whiteSpace:"nowrap!"},".jsb-colorpicker-popup":{backgroundColor:"buttonface!",color:"buttontext!",fontSize:"11px!",padding:"4px!",overflow:"hidden!",whiteSpace:"nowrap!",userSelect:"none!","@Webkit([1-4]|5[01]|52[^89])|Chrome":{backgroundColor:"#ece9d8!"}},".jsb-colorpicker-popup input":{fontSize:"11px",margin:"4px 2px!",verticalAlign:"middle",width:"127px"},".jsb-datepicker-popup":{backgroundColor:"#fcfcfd!",overflow:"hidden!","@theme=classic":{backgroundColor:"threedface!"}},".jsb-datepicker-popup input":{width:"5ex!",marginLeft:"2px!",padding:"2px 19px 2px 2px!","@QuirksMode|Gecko1\\.[0-3]|Opera8":{width:"9ex!"},"@!MSIE[567]|Opera":{padding:"1px 19px 1px 2px!"}},".jsb-datepicker-popup th":{backgroundColor:"infobackground!",color:"infotext!",fontWeight:"normal!"},".jsb-datepicker-popup th,.jsb-datepicker-days td":{padding:"2px 0!",textAlign:"center!",width:"14%!"},".jsb-datepicker-days td.disabled,.jsb-datepicker-days tr.disabled td":{color:"graytext!"},".jsb-datepicker-days td.selected,.jsb-datepicker-days tr.selected td":{backgroundColor:"inactivecaptiontext!",color:"inactivecaption!",opacity:0.5},".jsb-datepicker-days_focus td.selected,.jsb-datepicker-days_focus tr.selected td":{backgroundColor:_1t+"!",color:_1u+"!",opacity:1},"@theme=luna\\/blue":{".jsb-datepicker-popup th":{backgroundColor:"#ffffe1!"}},"@theme=(human|clearlooks)":{".jsb-combobox,.jsb-datepicker,.jsb-weekpicker,.jsb-colorpicker":{"borderTopRightRadius":"5px","borderBottomRightRadius":"5px"}},"@theme=aqua":{".jsb-menulist":{opacity:0.95},".jsb-spinner,.jsb-timepicker,.jsb-monthpicker":{borderTopWidth:"1px",paddingTop:"2px",borderRightColor:"transparent",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"},".jsb-spinner[disabled],.jsb-spinner[readonly],.jsb-timepicker[disabled],.jsb-timepicker[readonly],.jsb-monthpicker[disabled],.jsb-monthpicker[readonly]":{borderColor:"#d6d6d6 #e0e0e0 #f0f0f0 #e0e0e0"},".jsb-combobox[readonly],.jsb-combobox[disabled],.jsb-datepicker[readonly],.jsb-datepicker[disabled],.jsb-weekpicker[readonly],.jsb-weekpicker[disabled]":{"@(style.borderImage)":{borderImage:"url(%theme%/dropdown-disabled.png) 1 18 1 4!"},"@!(style.borderImage)":{backgroundImage:"url(%theme%/bg-dropdown-disabled.png)!"}},"@(style.borderImage)":{".jsb-colorpicker":{borderImage:"url(%theme%/colorpicker.png) 1 18 1 4!"},".jsb-colorpicker[readonly],.jsb-colorpicker[disabled]":{borderImage:"url(%theme%/colorpicker-disabled.png) 1 18 1 4!"}},"@!(style.borderImage)":{".jsb-colorpicker":{backgroundImage:"url(%theme%/bg-colorpicker.png)!"},".jsb-colorpicker[readonly],.jsb-colorpicker[disabled]":{backgroundImage:"url(%theme%/bg-colorpicker-disabled.png)!"}},".jsb-combobox[disabled],.jsb-datepicker[disabled],.jsb-weekpicker[disabled],.jsb-colorpicker[disabled],.jsb-progressbar[disabled]":{color:"windowtext",opacity:0.5},".jsb-colorpicker-popup,.jsb-datepicker-popup":{backgroundColor:_11+"!",backgroundImage:"url(%theme%/metal.png)!",backgroundRepeat:"repeat!"},".jsb-datepicker":{width:"7em"},".jsb-weekpicker":{width:"6em"},".jsb-monthpicker":{width:"5em"},".jsb-datepicker-popup th":{backgroundColor:"#89acd5!",color:"white!"}},".jsb-tooltip":{borderColor:"graytext!",backgroundColor:"infobackground!",color:"infotext!",fontSize:"small!",boxShadow:"2px 4px 4px rgba(160, 160, 160, 0.5)","@MSIE.+QuirksMode":{fontSize:"x-small!"}},".jsb-tooltip div":{padding:"2px 3px 0 3px!"},"@(hasFeature('WebForms','2.0'))":{"input[list],input[type=number],input[type=date],input[type=time],input[type=month],input[type=week],input[type=range]":{backgroundImage:"none!"}},".jsb-error":{borderColor:"#ff5e5e",outlineColor:"#ff5e5e"},"@Safari.+win":{"@!theme=aqua":{"input,select":{outlineColor:_2k.color,"@theme=classic":{outlineColor:"threedface"}}}}});new Rule("html",{ondocumentready:function(){var d=document.createElement("span"),e;d.style.cssText="position:absolute;left:0;top:-9999px;";d.innerHTML=" ";document.body.appendChild(d);setTimeout(function f(){var c=e!=null&&e!=d.clientHeight;e=d.clientHeight;if(c){Array2.batch(document.getElementsByTagName("input"),function(a){var b=_1r[a.uniqueID];if(b)b.layout(a)},100,f)}else{setTimeout(f,200)}},200)}});if(detect("MSIE6")){document.execCommand("BackgroundImageCache",false,true)}chrome.rules=new RuleList({"input.jsb-colorpicker":colorpicker,"input.jsb-slider":slider,"input.jsb-progressbar":progressbar,"input.jsb-combobox":combobox,"input.jsb-spinner":spinner,"input.jsb-timepicker":timepicker,"input.jsb-datepicker":datepicker,"input.jsb-weekpicker":weekpicker,"input.jsb-monthpicker":monthpicker});if(jsb.clientWidth2)jsb.createStyleSheet("input[class*=jsb-]{behavior:url(dimensions.htc)}");eval(this.exports)};