(function(){if(window.NTES)return;var N,A=window.NTES=window.$=function($,B){if(null==$||$.$)return $;var C;if("string"===typeof $){B=B||(this.alert?document:this);C=R.query($,B)}else C=$;if(C&&!C.$)if(C.nodeType){if("unknown"!==typeof C.getAttribute)C=D(C,A.element)}else C=D(_(C),A.element);return C};A.version="1.0.1 Build 090826";var R={SPACE:/\s*([\s>~+,])\s*/g,ISSIMPLE:/^#?([\w\u00c0-\uFFFF_-]+)$/,IMPLIEDALL:/([>\s~\+,]|^)([#\.\[:])/g,ATTRVALUES:/=(["'])([^'"]*)\1]/g,ATTR:/\[\s*([\w\u00c0-\uFFFF_-]+)\s*(?:(\S?\=)\s*(.*?))?\s*\]/g,BEGINIDAPART:/^(?:\*#([\w\u00c0-\uFFFF_-]+))/,STANDARD:/^[>\s~\+:]/,STREAM:/[#\.>\s\[\]:~\+]+|[^#\.>\s\[\]:~\+]+/g,ISINT:/^\d+$/,tempAttrValues:[],tempAttrs:[],idName:"uniqueidforntes",id:0,query:function($,I){var A,G,D,C,B,J,K,F,H,L;$=$.trim();if(""===$)return;if(this.ISSIMPLE.test($))if(0===$.indexOf("#")&&typeof I.getElementById!=="undefined")return this.getElemById(I,$.substr(1));else if(typeof I.getElementsByTagName!=="undefined")return _(I.getElementsByTagName($));if(!Q(I))I=I.nodeType?[I]:_(I);G=$.replace(this.SPACE,"$1").replace(this.ATTRVALUES,this.analyzeAttrValues).replace(this.ATTR,this.analyzeAttrs).replace(this.IMPLIEDALL,"$1*$2").split(",");D=G.length;C=-1;A=[];while(++C<D){J=I;$=G[C];if(this.BEGINIDAPART.test($))if(typeof I[0].getElementById!=="undefined"){J=[this.getElemById(I[0],RegExp.$1)];if(!J[0])continue;$=RegExp.rightContext}else $=G[C];if($!==""){if(!this.STANDARD.test($))$=" "+$;K=$.match(this.STREAM)||[];F=K.length;B=0;while(B<F){H=K[B++];L=K[B++];J=this.operators[H]?this.operators[H](J,L):[];if(0===J.length)break}}E(A,J)}this.tempAttrValues.length=this.tempAttrs.length=0;return A.length>1?this.unique(A):A},analyzeAttrs:function(_,B,A,$){return"[]"+(R.tempAttrs.push([B,A,$])-1)},analyzeAttrValues:function($,A,_){return"="+(R.tempAttrValues.push(_)-1)+"]"},generateId:function(_){var B=this.idName,$;try{$=_[B]=_[B]||++this.id}catch(A){$=_.getAttribute(B);if(!$){$=++this.id;_.setAttribute(B,$)}}return $},unique:function(C){var A=[],D=0,B={},_,$;while(_=C[D++])if(1===_.nodeType){$=this.generateId(_);if(!B[$]){B[$]=true;A.push(_)}}return A},attrMap:{"class":"className","for":"htmlFor"},getAttribute:function($,A){var _=this.attrMap[A]||A,B=$[_];if("string"!==typeof B)if("undefined"!==typeof $.getAttributeNode){B=$.getAttributeNode(A);B=N==B?B:B.value}else if($.attributes)B=String($.attributes[A]);return null==B?"":B},getElemById:function(A,$){var _=A.getElementById($);if(_&&_.id!==$&&A.all){_=A.all[$];if(_){for(var B=0;B<_.length;B++)if(this.getAttribute(_[B],"id")===$)return _[B];_=N}}return _},getElemsByTagName:function(F,H,E,D,_){var A=[],I=-1,G=F.length,$,C,B;_=_||Number.MAX_VALUE;if(D!=="*")B=D.toUpperCase();while(++I<G){$=F[I][H];C=0;while($&&C<_){if($.nodeName===B||$.nodeName===D||(!B&&1===$.nodeType)){A.push($);C++}$=$[E]}}return A},getElemsByAttribute:function(B,D){var _=[],$,E=0,A=this.attrOperators[D[1]||""],C="~="===D[1]?" "+D[2]+" ":D[2];while($=B[E++])A(this.getAttribute($,D[0]),C)&&_.push($);return _},operators:{"#":function(_,$){return R.getElemsByAttribute(_,["id","=",$])}," ":function(A,_){var B=A.length;if(1===B)return A[0].getElementsByTagName(_);else{var $=[],C=-1;while(++C<B)E($,A[C].getElementsByTagName(_))}return $},".":function($,_){return R.getElemsByAttribute($,["class","~=",_])},">":function(_,$){return R.getElemsByTagName(_,"firstChild","nextSibling",$)},"[]":function($,_){_=R.tempAttrs[_];if(_){if(R.ISINT.test(_[2]))_[2]=R.tempAttrValues[_[2]];return R.getElemsByAttribute($,_)}else return $}},attrOperators:{"":function($){return $!==""},"=":function(_,$){return $===_},"~=":function(_,$){return(" "+_+" ").indexOf($)>=0},"!=":function(_,$){return $!==_}}};A.element={$:function($,_){return A.call(this,$,_)},addCss:function($){return A.style.addCss(this,$)},removeCss:function($){return A.style.removeCss(this,$)},addEvent:function(_,B,$){return A.event.addEvent(this,_,B,$)}};window.addEvent=document.addEvent=A.element.addEvent;var F={};A.util={isArray:function($){return Object.prototype.toString.call($)==="[object Array]"},toArray:function($){if(Q($))return $;else if($.toArray)return $.toArray();else{var _=[],A=$.length;while(A)_[--A]=$[A];return _}},merge:function(_,$){var B=$.length,A=_.length;while(--B>=0)_[A+B]=$[B];return _},parseTpl:function(B,$,A){var C=F[B];$=null==$?{}:$;if(!C){var _="var _=[],print=function(){_.push.apply(_,arguments);};with(obj){_.push('"+B.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("_.push('")+"');}return _.join('');";C=new Function("obj",_);if(null==A||true===A)F[B]=C}return C($)},extend:function($,A){for(var _ in A)$[_]=A[_];return $}};A.dom={eachNode:function(_,A,$){if(!_)return;if(_.nodeType||_.alert)A.apply(_,$);else{var C=-1,B=_.length;while(++C<B)A.apply(_[C],$)}return _}};var Q=A.util.isArray,_=A.util.toArray,E=A.util.merge,D=A.util.extend,I=document.createElement("div"),L=/\-([a-z])/gi,M=/(^|:|;)float(?=:|;|$)/gi,G=I.style.styleFloat!==N?"styleFloat":"cssFloat",$=/([^:;]+)/g,J=/\s+/,C=/\s*([:;\s])\s*/g,H=/([^:;]+)(?=:)/g;function O($,_){return _.toUpperCase()}function P($,A,_){return A+G+_}A.style={parse:function(B){B=B.replace(C,"$1");var A=B.indexOf(";")>=0,_=B.indexOf(":")>=0;if(A||_){B=B.replace(_?H:$,function($,_){return _.replace(L,O)});B=B.replace(M,P).match($);B.styleType="style";if(_&&B.length%2!==0)throw"invalid inline style"}else{B=B.split(J);B.styleType="class"}return B},addCss:function($,_){_=this.parse(_);return A.dom.eachNode($,"class"===_.styleType?function($,A){var _=" "+this.className+" ";for(var B=0;B<A;B++)if(-1===_.indexOf(" "+$[B]+" "))_+=($[B]+" ");this.className=_.trim()}:function($,_){var A=0;while(A<_)this.style[$[A++]]=$[A++].replace(/^NULL$/i,"")},[_,_.length])},removeCss:function($,_){_=this.parse(_);return A.dom.eachNode($,"class"===_.styleType?function($,A){var _=" "+this.className+" ";for(var B=0;B<A;B++)_=_.replace(" "+$[B]+" "," ");this.className=_.trim()}:function($,_){for(var A=0;A<_;A++)if(this.style[$[A]]!==N)this.style[$[A]]=""},[_,_.length])}};A.event={idName:"eventIdForNTES",eventsWrapper:"eventsForNTES",eventId:0,addEvent:function(B,_,C,$){return A.dom.eachNode(B,function(_,B){B=A.event.delegate(this,_,B,$);if(this.attachEvent)this.attachEvent("on"+_,B);else if(this.addEventListener)this.addEventListener(_,B,false)},[_,C])},delegate:function(_,D,F,C){var B=_[this.eventsWrapper]=_[this.eventsWrapper]||{},$=F[this.idName]=F[this.idName]||++this.eventId;B[D]=B[D]||{};var E=B[D][$];if(!E){E=function($){$=A.event.fix($);false===F.call(_,$,C||{})&&$.preventDefault()};B[D][$]=E}return E},fix:function(_){_.preventDefault=_.preventDefault||function(){_.returnValue=false};if(N===_.pageX&&N!==_.clientX){var A=document.documentElement,$=document.body;_.pageX=_.clientX+(A.scrollLeft||$.scrollLeft||0)-(A.clientLeft||0);_.pageY=_.clientY+(A.scrollTop||$.scrollTop||0)-(A.clientTop||0)}return _}};var B=navigator.userAgent.toLowerCase();A.browser={version:(B.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(B),opera:/opera/.test(B),msie:/msie/.test(B)&&!/opera/.test(B),mozilla:/mozilla/.test(B)&&!/(compatible|webkit)/.test(B)};A.ajax={createXhr:function(){var _;try{_=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}catch($){}if(!_)throw"failed to create an XMLHttpRequest object";return _},send:function(G,C,B,H,A){A=A||this.createXhr();var E;C=C.toUpperCase();C=C!=="GET"&&C!=="POST"?"GET":C;H=H||{};H.async="boolean"===typeof H.async?H.async:true;var _;if(B){_=[];for(var $ in B)if($!=null)_.push($+"="+encodeURIComponent(B[$]));_=_.join("&").replace(/%20/g,"+")}if(H.async&&!isNaN(H.timeout)&&H.timeout>0)setTimeout(function(){if(!E){A.abort();if(H.onTimeout)H.onTimeout(A)}},H.timeout);A.onreadystatechange=function(){if(4==A.readyState){E=true;var $=200==A.status?"onSuccess":"onError";H[$]&&H[$](A)}};if(_&&"GET"===C){G+=("?"+_);_=null}A.open(C,G,H.async,H.username,H.password);var D=[];if("POST"===C)D.push("application/x-www-form-urlencoded");if(H.headers)for(var F in H.headers)if("content-type"===F.toLowerCase())D.push(H.headers[F]);else A.setRequestHeader(F,H.headers[F]);if(D.length)A.setRequestHeader("Content-Type",D.join(";").replace(/;+/g,";").replace(/;$/,""));A.send(_);return A},importJs:function(B,$,_){var A=document.createElement("script");A.src=B;A.language="javascript";A.type="text/javascript";if(_)A.charset=_;A.onload=A.onreadystatechange=function(){if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){$&&$(this);A.onload=A.onreadystatechange=null;this.parentNode.removeChild(A)}};document.getElementsByTagName("head")[0].appendChild(A)}};A.cookie={encoder:window.encodeURIComponent,decoder:window.decodeURIComponent,get:function(B){B=A.cookie.encoder(B)+"=";var $=document.cookie,_=$.indexOf(B),C;if(-1===_)return"";_+=B.length;C=$.indexOf(";",_);if(C===-1)C=$.length;return A.cookie.decoder($.substring(_,C))},set:function(B,F,$,E,D,C){var _=[A.cookie.encoder(B)+"="+A.cookie.encoder(F)];if($){var G;if(!isNaN($)){G=new Date();G.setTime(G.getTime()+$*60*1000)}else G=$;_.push("expires="+G.toUTCString())}D!=null&&D!==""&&_.push("path="+D);E&&_.push("domain="+E);C&&_.push("secure");document.cookie=_.join(";")},del:function($,B,_){document.cookie=A.cookie.encoder($)+"="+(_!=null&&_!==""?";path="+_:"")+(B?";domain="+B:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};A.ui={};var K=function(_,$){return(_+1)%$};A.ui.Slide=function(_,C,F,E,B){if(!arguments.length)return;var $=this;$.total=C.length;if(_&&$.total!==_.length)throw"can not match ctrls("+_.length+") and contents("+$.total+")";$.constructor=arguments.callee;$._curIndex=-1;$._ctrls=_;$._contents=C;$._css=F;$._eventName=E;$.interval=B;$.playMode=K;if($._ctrls&&$._ctrls.length&&$._eventName){var D=function(_,$){this.show($);_.preventDefault()}.bind($);for(var G=$.total-1;G>=0;G--)A.event.addEvent($._ctrls[G],E,D,new Number(G))}$.interval&&$.play()};A.ui.Slide.prototype={show:function(_){var B=this;_=_<0?0:_>=B.total?B.total-1:_;var C=B._ctrls?B._ctrls[_]:null,$=B._contents[_];if(-1===B._curIndex)B._curIndex=0;A.style.removeCss(B._ctrls,B._css);A.style.removeCss(B._contents,B._css);A.style.addCss(C,B._css);A.style.addCss($,B._css);B.onShow&&B.onShow(_,C,$);B._curIndex=_},showNext:function(){this.show(this.playMode(this._curIndex,this.total))},play:function(B){var _=this;if(!isNaN(B))_.interval=parseInt(B);if(N===_._timerId){if(!_._hasEvent){var $=_.pause.bind(_),C=_.play.bind(_);A.event.addEvent(_._ctrls,"mouseover",$);A.event.addEvent(_._ctrls,"mouseout",C);A.event.addEvent(_._contents,"mouseover",$);A.event.addEvent(_._contents,"mouseout",C);_._hasEvent=1}_._timerId=setInterval(_.showNext.bind(_),_.interval)}},pause:function(){var _=this;if(_._timerId!==N){clearInterval(_._timerId);_._timerId=N;if(_.onStop){var $=_._curIndex;_.onStop($,_._ctrls[$],_._contents[$])}}}};String.prototype.trim=function($){return this.replace(null==$?/^\s+|\s+$/g:new RegExp("^"+$+"+|"+$+"+$","g"),"")};String.format=function($){var _=arguments,A=new RegExp("%([1-"+_.length+"])","g");return String($).replace(A,function($,A){return _[A]})};Array.prototype.indexOf=Array.prototype.indexOf||function($,_){var B=isNaN(_)||_<0?-1:_-1,A=this.length;while(++B<A)if(this[B]===$)return B;return-1};Function.prototype.bind=function(){if(!arguments.length)return this;var _=this,$=Array.prototype.slice.call(arguments),A=$.shift();return function(){return _.apply(A,$.concat(Array.prototype.slice.call(arguments)))}}})()
