(function(){window.$=window.$||{},undefined;if(!$.ui)$.ui={};$.ui.version="0.1.4 Build 090917";$.ui.Template={_cache:{},get:function($){return this._cache[$]==null?"":this._cache[$]},parse:function(A,_){return $.util.parseTpl(this.get(A),_)},load:function(){var _=$("#templates > div"),A=_.length;while(--A>=0)this._cache[_[A].title]=_[A].innerHTML.replace(/(?:^\s*<!--)|(?:-->\s*$)/g,"")}};$.ui.PopupLayer=function(E,_,C,D){if(!arguments.length)return;var A=this;A.constructor=arguments.callee;A._ctrl=E;A._content=_;A.delay=isNaN(D)?300:D;var B=A.delayHide.bind(A),F=A.clearDelay.bind(A);$.event.addEvent(E,C,A.show.bind(A));$.event.addEvent(E,"mouseout",B);$.event.addEvent(E,"mouseover",F);$.event.addEvent(_,"mouseover",F);$.event.addEvent(_,"mouseout",B)};$.ui.PopupLayer.prototype={show:function(){$.style.addCss(this._content,"display:block;");this.onShow&&this.onShow()},hide:function(){$.style.addCss(this._content,"display:none;");this.onHide&&this.onHide()},delayHide:function(){if(this._timerId===undefined)this._timerId=setTimeout(this.hide.bind(this),this.delay)},clearDelay:function(){if(this._timerId!==undefined){clearTimeout(this._timerId);this._timerId=undefined}}};var A={left:function(_){var $=this;$._wrapper.scrollLeft+=_;if($._copy.offsetWidth-$._wrapper.scrollLeft<=0)$._wrapper.scrollLeft-=$._body.offsetWidth},right:function(_){var $=this,A;if($._wrapper.scrollLeft<=0)$._wrapper.scrollLeft+=$._body.offsetWidth;A=$._wrapper.scrollLeft-_;$._wrapper.scrollLeft=A<0?$._body.offsetWidth+A:A},top:function(_){var $=this;$._wrapper.scrollTop+=_;if($._copy.offsetHeight-$._wrapper.scrollTop<=0)$._wrapper.scrollTop-=$._body.offsetHeight},bottom:function(_){var $=this,A;if($._wrapper.scrollTop<=0)$._wrapper.scrollTop+=$._body.offsetHeight;A=$._wrapper.scrollTop-_;$._wrapper.scrollTop=A<0?$._body.offsetHeight+A:A}};$.ui.Marquee=function($,A,B,C){if(!arguments.length)return;var _=this;_.constructor=arguments.callee;_._body=$;_._wrapper=$.parentNode;_._copy=document.createElement($.tagName);_._copy.className=$.className;_._copy.innerHTML=$.innerHTML;_._wrapper.appendChild(_._copy);_._wrapper=_._wrapper.parentNode;A=A?A.toLowerCase():"left";_.setDirection(A);_.fps=isNaN(B)?15:B;_.lpf=isNaN(C)?1:C;_._timerIds=[]};$.ui.Marquee.prototype={setDirection:function($){this.move=A[$];if(!this.move)throw"not such direction"},_scroll:function(B){var $=this,A=$.lpf,_;if(!$._isPause)if(B.length!==0){if(B.length>0){A=Math.min(B.length,A);B.length-=A}$.move(A)}else{$.stop();B.callback&&B.callback()}},start:function(){var $=this;if(0===$._timerIds.length){var C,A,B,_=arguments;switch(typeof _[0]){case"number":C=_[0];if("string"===typeof _[1]){A=_[1];B=_[2]}else B=_[1];break;case"string":A=_[0];C=_[1];B=_[2];break}if(A)$.setDirection(A);var D={length:isNaN(C)?-1:parseInt(C)};if(D.length>0)D.callback="[object Function]"===Object.prototype.toString.call(B)?B:undefined;$._currentScroll=$._scroll.bind($,D);$._timerIds.push(setInterval($._currentScroll,$.fps))}},stop:function(){var $=this;while($._timerIds.length)clearInterval($._timerIds.pop());$._currentScroll=undefined},speedUp:function(){var $=this;if($._timerIds.length)$._timerIds.push(setInterval($._currentScroll,$.fps))},slowDown:function(){if(this._timerIds.length>1)clearInterval(this._timerIds.pop())},go:function(){this._isPause=false},stay:function(){this._isPause=true}};var _=[31,28,31,30,31,30,31,31,30,31,30,31];$.ui.Calendar=function(_,$){this.constructor=arguments.callee;this.setDate(_,$)};$.ui.Calendar.prototype={getYear:function(){return this._year},getMonth:function(){return this._month+1},setDate:function(A,_){var $=new Date();this._year=isNaN(A)?$.getFullYear():A;this._month=isNaN(_)?$.getMonth():_-1},build:function(){var E=NTES.ui.Calendar.getDayCount(this._year,this._month+1),A=new Date(this._year,this._month,1),_=new Date(),$=A.getDay(),C={year:this._year,month:this._month+1,weeks:[]},G,B,D,F=[];_.setHours(0,0,0,0);_=_.getTime();while($-->0)F.push({value:""});for(G=1;G<=E;G++){A.setDate(G);D=A.getTime();if(D>_)B=1;else if(D<_)B=-1;else B=0;F.push({value:G,state:B});if(F.length===7){C.weeks.push(F);F=[]}}if(F.length%7!==0){while(F.length<7)F.push({value:""});C.weeks.push(F)}return C}};$.ui.Calendar.getDayCount=function(A,$){return 2==$?(0==A%4&&0!=A%100||0==A%400?29:28):_[$-1]}})()