var Base=function(){if(arguments.length){if(this==window){Base.prototype.extend.call(arguments[0],arguments.callee.prototype)}else{this.extend(arguments[0])}}};Base.version="1.0.2";Base.prototype={extend:function(B,H){var G=Base.prototype.extend;if(arguments.length==2){var F=this[B];if((F instanceof Function)&&(H instanceof Function)&&F.valueOf()!=H.valueOf()&&/\bbase\b/.test(H)){var A=H;H=function(){var K=this.base;this.base=F;var J=A.apply(this,arguments);this.base=K;return J};H.valueOf=function(){return A};H.toString=function(){return String(A)}}return this[B]=H}else{if(B){var I={toSource:null};var D=["toString","valueOf"];if(Base._prototyping){D[2]="constructor"}for(var E=0;(C=D[E]);E++){if(B[C]!=I[C]){G.call(this,C,B[C])}}for(var C in B){if(!I[C]){G.call(this,C,B[C])}}}}return this},base:function(){}};Base.extend=function(B,F){var G=Base.prototype.extend;if(!B){B={}}Base._prototyping=true;var E=new this;G.call(E,B);var D=E.constructor;E.constructor=this;delete Base._prototyping;var A=function(){if(!Base._prototyping){D.apply(this,arguments)}this.constructor=A};A.prototype=E;A.extend=this.extend;A.implement=this.implement;A.toString=function(){return String(D)};G.call(A,F);var C=D?A:E;if(C.init instanceof Function){C.init()}return C};Base.implement=function(A){if(A instanceof Function){A=A.prototype}this.prototype.extend(A)};var Lib={};