/*
 * NetEase Javascript Library v1.2.1
 *
 * Modified from
 *		jRaiser Javascript Library v1.3.1
 *		http://code.google.com/p/jraiser/
 *		Copyright 2008-2010 Heero.Luo (http://heeroluo.net/)
 *
 * licensed under MIT license
 *
 * Creation date: 2008/2/6
 * Modified date: 2010/3/17
 */
(function(R,g){var c="1.2.1 Build 201003171651",_="NTES";if(R[_]&&R[_].version>=c)return;var A=R.$,d=R.document,T=R[_]=R.$=function($,_){if(!$)return $;"string"===typeof $&&($=L($,_));return M($)};T.one=function($,_){return M(L($,_,1))};T.all=function($,_){return M(L($,_,0))};function L(_,B,$){var A=s.exec(_,B||d);if($!==g)if(A){var C=T.util.isArray(A);if(1===$&&C)return A[0];else if(0===$&&!C)return[A]}else if(0===$)return[];return A}function M(A){if(A&&!A[_])if(A.nodeType){if("unknown"!==typeof A.getAttribute)for(var $ in T.element)g===A[$]&&(A[$]=T.element[$])}else A=T.util.extend(T.util.toArray(A),T.element);return A}T.version=c;T.resume=function(){A=R.$;R.$=R[_]=T;return T};T.retire=function(){R.$=A;return A};var s={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,PSEUDOSEQ:/\(([^\(\)]*)\)$/g,BEGINIDAPART:/^(?:\*#([\w\u00c0-\uFFFF_-]+))/,STANDARD:/^[>\s~\+:]/,STREAM:/[#\.>\s\[\]:~\+]+|[^#\.>\s\[\]:~\+]+/g,ISINT:/^\d+$/,tempAttrValues:[],tempAttrs:[],idName:_+"UniqueId",id:0,exec:function($,H){var _,F,D,B,A,I,J,E,G,K,C=this;$=$.trim();if(""===$)return;if(C.ISSIMPLE.test($))if(0===$.indexOf("#")&&typeof H.getElementById!=="undefined")return C.getElemById(H,$.substr(1));else if(typeof H.getElementsByTagName!=="undefined")return T.util.toArray(H.getElementsByTagName($));H=H.nodeType?[H]:T.util.toArray(H);F=$.replace(C.SPACE,"$1").replace(C.ATTRVALUES,C.analyzeAttrValues).replace(C.ATTR,C.analyzeAttrs).replace(C.IMPLIEDALL,"$1*$2").split(",");D=F.length;B=-1;_=[];while(++B<D){I=H;$=F[B];if(C.BEGINIDAPART.test($))if(typeof H[0].getElementById!=="undefined"){I=[C.getElemById(H[0],RegExp.$1)];if(!I[0])continue;$=RegExp.rightContext}else $=F[B];if($!==""){if(!C.STANDARD.test($))$=" "+$;J=$.match(C.STREAM)||[];E=J.length;A=0;while(A<E){G=J[A++];K=J[A++];I=C.operators[G]?C.operators[G](I,K):[];if(0===I.length)break}}T.util.merge(_,I)}C.tempAttrValues.length=C.tempAttrs.length=0;return _.length>1?C.unique(_):_},analyzeAttrs:function(_,B,A,$){return"[]"+(s.tempAttrs.push([B,A,$])-1)},analyzeAttrValues:function($,A,_){return"="+(s.tempAttrValues.push(_)-1)+"]"},generateId:function(_){var B=this.idName,$;try{$=_[B]=_[B]||new Number(++this.id)}catch(A){$=_.getAttribute(B);if(!$){$=new Number(++this.id);_.setAttribute(B,$)}}return $.valueOf()},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=g==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[$]:g;if(_)for(var B=0;B<_.length;B++)if(this.getAttribute(_[B],"id")===$)return _[B]}else return _},getElemsByTagName:function(F,H,E,D,_){var A=[],I=-1,G=F.length,$,C,B;D!=="*"&&(B=D.toUpperCase());while(++I<G){$=F[I][H];C=0;while($&&(!_||C<_)){if(1===$.nodeType){($.nodeName.toUpperCase()===B||!B)&&A.push($);C++}$=$[E]}}return A},checkElemPosition:function(G,H,J,A){var $=[];if(!isNaN(H)){var C=G.length,D=-1,_={},B,E,I,F;while(++D<C){B=G[D].parentNode;E=this.generateId(B);if(g===_[E]){I=0;F=B[J];while(F){1===F.nodeType&&I++;if(I<H)F=F[A];else break}_[E]=F===g?0:F}else F=_[E];G[D]===F&&$.push(G[D])}}return $},getElemsByPosition:function(A,C,_){var D=C,B=A.length,$=[];while(D>=0&&D<B){$.push(A[D]);D+=_}return $},getElemsByAttribute:function(B,D){var _=[],$,E=0,A=this.attrOperators[D[1]||""],C="~="===D[1]?" "+D[2]+" ":D[2];if(A)while($=B[E++])A(this.getAttribute($,D[0]),C)&&_.push($);return _},operators:{"#":function(_,$){return s.getElemsByAttribute(_,["id","=",$])}," ":function(A,_){var B=A.length;if(1===B)return A[0].getElementsByTagName(_);else{var $=[],C=-1;while(++C<B)T.util.merge($,A[C].getElementsByTagName(_));return $}},".":function($,_){return s.getElemsByAttribute($,["class","~=",_])},">":function(_,$){return s.getElemsByTagName(_,"firstChild","nextSibling",$)},"+":function(_,$){return s.getElemsByTagName(_,"nextSibling","nextSibling",$,1)},"~":function(_,$){return s.getElemsByTagName(_,"nextSibling","nextSibling",$)},"[]":function($,_){_=s.tempAttrs[_];if(_){if(s.ISINT.test(_[2]))_[2]=s.tempAttrValues[_[2]];return s.getElemsByAttribute($,_)}else return $},":":function(_,A){var $;if(s.PSEUDOSEQ.test(A)){$=parseInt(RegExp.$1);A=RegExp.leftContext}return s.pseOperators[A]?s.pseOperators[A](_,$):[]}},attrOperators:{"":function($){return $!==""},"=":function(_,$){return $===_},"~=":function(_,$){return(" "+_+" ").indexOf($)>=0},"!=":function(_,$){return $!==_},"^=":function(_,$){return _.indexOf($)===0},"$=":function(_,$){return _.substr(_.length-$.length)===$},"*=":function(_,$){return _.indexOf($)>=0}},pseOperators:{"first-child":function($){return s.checkElemPosition($,1,"firstChild","nextSibling")},"nth-child":function(_,$){return s.checkElemPosition(_,$,"firstChild","nextSibling")},"last-child":function($){return s.checkElemPosition($,1,"lastChild","previousSibling")},"nth-last-child":function(_,$){return s.checkElemPosition(_,$,"lastChild","previousSibling")},"odd":function($){return s.getElemsByPosition($,0,2)},"even":function($){return s.getElemsByPosition($,1,2)},"lt":function(_,$){return s.getElemsByPosition(_,$-1,-1)},"gt":function(_,$){return s.getElemsByPosition(_,$+1,1)}}};T.element={get:function($){return this.nodeType===g?this[$]:(0==$?this:g)},$:function($){return T("number"===typeof $?this.get(i):$,this)},hasClass:function($){return T.style.hasClass(this,$)},addCss:function($){return T.style.addCss(this,$)},removeCss:function($){return T.style.removeCss(this,$)},addEvent:function(_,A,$){return T.event.addEvent(this,_,A,$)},removeEvent:function($,_){return T.event.removeEvent(this,$,_)},attr:function(A,B){var _=this;A=s.attrMap[A]||A;if(B!==g)return T.dom.eachNode(_,function($,_){this[$]=T.util.isFunction(_)?_.call(this):_},arguments);else{var $=this.get(0);return $?$[A]:g}},each:function($){return T.dom.eachNode(this,$)}};T.element[_]=T.element.$;R.addEvent=d.addEvent=T.element.addEvent;R.removeEvent=d.removeEvent=T.element.removeEvent;var X={},r=Array.prototype.slice,S=Object.prototype.toString;T.util={isArray:function($){return S.call($)==="[object Array]"},isFunction:function($){return S.call($)==="[object Function]"},toArray:function($){if(T.util.isArray($))return $;var A;try{A=r.call($)}catch(_){A=[];var B=$.length;while(B)A[--B]=$[B]}return A},merge:function(_,$){var B=$.length,A=_.length;while(--B>=0)_[A+B]=$[B];return _},parseTpl:function(A,$,_){var B=X[A];null==$&&($={});if(!B){B=new Function("obj","var _=[];with(obj){_.push('"+A.replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("_.push('")+"');}return _.join('');");(null==_||true===_)&&(X[A]=B)}return B($)},extend:function($,A){for(var _ in A)$[_]=A[_];return $},each:function(A,_,$){var D=-1,B=A.length,C=B===g||T.util.isFunction(A);if($){if(C){for(D in A)if(false===_.apply(A[D],$))break}else while(++D<B)if(false===_.apply(A[D],$))break}else if(C){for(D in A)if(false===_.call(A[D],D,A[D]))break}else while(++D<B)if(false===_.call(A[D],D,A[D]))break;return A}};T.parseTpl=T.util.parseTpl;T.each=T.util.each;var W=[],C,$;if(d.addEventListener)$=function(){d.removeEventListener("DOMContentLoaded",$,false);k()};else if(d.attachEvent)$=function(){if("complete"===d.readyState){d.detachEvent("onreadystatechange",$);k()}};function Y(){if(T.dom.isReady)return;try{d.documentElement.doScroll("left")}catch($){setTimeout(Y,1);return}k()}function k(){if(!T.dom.isReady){if(!d.body)return setTimeout(k,13);T.dom.isReady=true;if(W){var _=-1,$=W.length;while(++_<$)W[_].call(d,T);W=null}}}function Q(){if(C)return;if("complete"===d.readyState)return k();if(d.addEventListener){d.addEventListener("DOMContentLoaded",k,false);R.addEventListener("load",k,false)}else if(d.attachEvent){d.attachEvent("onreadystatechange",k);R.attachEvent("onload",k);var _;try{_=R.frameElement==null}catch($){}d.documentElement.doScroll&&_&&Y()}C=true}T.dom={wrapByArray:function($){if($)if($.nodeType!==g||$.setInterval)return[$];else if($.length)return T.util.toArray($);return[]},eachNode:function(_,A,$){T.each(T.dom.wrapByArray(_),A,$);return _},ready:function($){Q();if(T.dom.isReady)$.call(d,T);else W.push($);return this}};T.ready=T.dom.ready;var O=d.createElement("div"),l=/\s*([:;])\s*/g,b=/[^:;]+?(?=:)/g,J=/[^:;]+/g,e=/[^\s]+/g,E=/-([a-z])/gi,a=O.style.styleFloat!==g?"styleFloat":"cssFloat",p=/^float$/i;function u($,B,_){if(this.className){var A=" "+this.className+" ",C=-1;while(++C<B)-1===A.indexOf(" "+$[C]+" ")&&(A+=($[C]+" "));this.className=A.trim()}else this.className=_}function t(_,A,$){if(!this.style.cssText&&$)this.style.cssText=$;else{var B=0;while(B<A)this.style[_[B++]]=_[B++].replace(/^NULL$/i,"")}}function j($,B,_){switch(this.className){case _:this.className="";break;case"":return;break;default:var A=" "+this.className+" ",C=-1;while(++C<B)A=A.replace(" "+$[C]+" "," ");this.className=A.trim();break}}function n($,_){for(var A=0;A<_;A++)this.style[$[A]]!==g&&(this.style[$[A]]="")}T.style={fixStyleName:function($){return p.test($)?a:$.replace(E,function(_,$){return $.toUpperCase()})},hasClass:function(_,$){_=T.dom.wrapByArray(_);var A=_.length;if(A>0){$=" "+$+" ";while(--A>=0)if((" "+_[A].className+" ").indexOf($)>=0)return true}return false},parse:function(C){var $;if("string"===typeof C){var B=C.indexOf(";")>=0,A=C.indexOf(":")>=0;if(B||A){$=C.trim().replace(l,"$1").replace(A?b:J,T.style.fixStyleName).match(J);if(A&&$.length%2!==0)throw"invalid inline style";$.type="style"}else{$=C.match(e)||[];$.type="class"}}else{$=[];for(var _ in C)$.push(T.style.fixStyleName(_),C[_]);$.type="style"}return $},addCss:function(_,A){var $=T.style.parse(A);return T.dom.eachNode(_,"class"===$.type?u:t,[$,$.length,"string"===typeof A?A:g])},removeCss:function(_,A){var $=T.style.parse(A);return T.dom.eachNode(_,"class"===$.type?j:n,[$,$.length,A])},getCurrentStyle:function(A,_,$){if(!A)return g;!A.nodeType&&(A=A[0]);return(A.currentStyle||($||R).getComputedStyle(A,null))[T.style.fixStyleName(_)]}};function o(A,B,_){var $=this;B=T.event.delegate($,A,B,_);if($.attachEvent)$.attachEvent("on"+A,B);else if($.addEventListener)$.addEventListener(A,B,false)}function h(_,A){var $=this;A=T.event.getDelegate($,_,A);if($.detachEvent)$.detachEvent("on"+_,A);else if($.removeEventListener)$.removeEventListener(_,A,false)}var H=/\s*,\s*/,D=0;T.event={idName:_+"EventId",eventsWrapper:_+"Events",addEvent:function(_,A,C,$){A=A.split(H);var B=A.length;while(--B>=0)T.dom.eachNode(_,o,[A[B],C,$]);return _},removeEvent:function($,_,B){_=_.split(H);var A=_.length;while(--A>=0)T.dom.eachNode($,h,[_[A],B]);return $},delegate:function(_,E,G,C){var A=T.event,B=_[A.eventsWrapper]=_[A.eventsWrapper]||{},$=G[A.idName]=G[A.idName]||++D;B[E]=B[E]||{};var F=B[E][$];if(!F){F=function($){$=A.fix($);false===G.call(_,$,C||{})&&$.preventDefault()};B[E][$]=F}return F},getDelegate:function($,B,C){var A=T.event;try{return $[A.eventsWrapper][B][C[A.idName]]}catch(_){}return C},fix:function(_){if(!_.target)_.target=_.srcElement||d;if(3==_.target.nodeType)_.target=_.target.parentNode;_.timestamp=_.timeStamp||Date.now();_.preventDefault=_.preventDefault||function(){_.returnValue=false};if(g===_.pageX&&g!==_.clientX){var A=d.documentElement,$=d.body;_.pageX=_.clientX+(A.scrollLeft||$.scrollLeft||0)-(A.clientLeft||0);_.pageY=_.clientY+(A.scrollTop||$.scrollTop||0)-(A.clientTop||0)}if(!_.which)_.which=_.charCode||_.keyCode;if(!_.which&&_.button)_.which=(_.button&1?1:(_.button&2?3:(_.button&4?2:0)));return _}};var V=R.navigator.userAgent.toLowerCase();T.browser={version:(V.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(V),opera:/opera/.test(V),msie:/msie/.test(V)&&!/opera/.test(V),mozilla:/mozilla/.test(V)&&!/(compatible|webkit)/.test(V)};T.ajax={createXhr:function(){var _;try{_=R.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()}catch($){}if(!_)throw"failed to create XMLHttpRequest object";return _},send:function(G,C,B,H,A){A=A||T.ajax.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)B[$]!=null&&_.push($+"="+encodeURIComponent(B[$]));_=_.join("&").replace(/%20/g,"+");if("GET"===C){G+=("?"+_);_=g}}H.async&&!isNaN(H.timeout)&&H.timeout>0&&setTimeout(function(){if(!E){A.abort();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)}};A.open(C,G,H.async,H.username,H.password);var D=[];"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]);D.length&&A.setRequestHeader("Content-Type",D.join(";").replace(/;+/g,";").replace(/;$/,""));A.send(_);return A},importJs:function(C,$,A,_){_=_||d;var B=_.createElement("script");B.language="javascript";B.type="text/javascript";if(A)B.charset=A;B.onload=B.onreadystatechange=function(){if(!B.readyState||"loaded"==B.readyState||"complete"==B.readyState){$&&$();B.onload=B.onreadystatechange=null;B.parentNode.removeChild(B)}};B.src=C;_.getElementsByTagName("head")[0].appendChild(B)}};var v=/[smhdMy]$/,K={s:1,m:60,h:60*60,d:24*60*60,M:30*24*60*60,y:365*24*60*60};T.cookie={encoder:R.encodeURIComponent,decoder:R.decodeURIComponent,get:function(B,D){var _=T.cookie;B=_.encoder(B)+"=";var $=d.cookie,A=$.indexOf(B),C;if(-1===A)return D?g:"";A+=B.length;C=$.indexOf(";",A);if(C===-1)C=$.length;return _.decoder($.substring(A,C))},set:function(C,G,A,F,E,D){var _=T.cookie,B=[_.encoder(C)+"="+_.encoder(G)];if(A){var H,$;if("[object Date]"===S.call(A))H=A;else{if("string"===typeof A&&v.test(A)){A=A.substring(0,A.length-1);$=RegExp.lastMatch}if(!isNaN(A)){H=new Date();H.setTime(H.getTime()+A*K[$||"m"]*1000)}}H&&B.push("expires="+H.toUTCString())}E&&B.push("path="+E);F&&B.push("domain="+F);D&&B.push("secure");d.cookie=B.join(";")},del:function($,A,_){d.cookie=T.cookie.encoder($)+"="+(_?";path="+_:"")+(A?";domain="+A:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};var N=/^\s+|\s+$/g;String.prototype.trim=String.prototype.trim||function(){return this.replace(N,"")};String.prototype.left=function($){return this.substr(0,$)};String.prototype.right=function($){return this.slice(-$)};String.format=function($){var _=arguments,A=new RegExp("%([1-"+_.length+"])","g");return String($).replace(A,function(A,$){return _[$]})};Function.prototype.bind=function(){if(!arguments.length)return this;var _=this,$=r.call(arguments),A=$.shift();return function(){return _.apply(A,$.concat(r.call(arguments)))}};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};Array.prototype.remove=function($){$>=0&&this.splice($,1);return this};function B($){return $<10?"0"+$:$}var U,F,q,P,Z,G;function m($){switch($){case"yyyy":return U;case"yy":return U.toString().slice(-2);case"MM":return B(F);case"M":return F;case"dd":return B(q);case"d":return q;case"HH":return B(P);case"H":return P;case"hh":return B(P>12?P-12:P);case"h":return P>12?P-12:P;case"mm":return B(Z);case"m":return Z;case"ss":return B(G);case"s":return G;default:return $}}Date.now=Date.now||function(){return+new Date};Date.prototype.format=function($){U=this.getFullYear();F=this.getMonth()+1;q=this.getDate();P=this.getHours();Z=this.getMinutes();G=this.getSeconds();return $.replace(/y+|m+|d+|h+|s+|H+|M+/g,m)};T.ui={};function f(_,$){return(_+1)%$}function I(_,$){return _<=0?$-1:(_-1)%$}T.ui.Slide=function(_,B,E,D,A){if(!arguments.length)return;var $=this;$.total=B.length;if(_&&$.total!==_.length)throw"can not match ctrls("+_.length+") and contents("+$.total+")";$.constructor=arguments.callee;$._curIndex=-1;$._ctrls=_;$._contents=B;$._css=E;$._eventName=D;$.interval=A;$.playMode=f;$.rollbackMode=I;if($._ctrls&&$._ctrls.length&&$._eventName){var C=function(_,$){this.show($);_.preventDefault()}.bind($);for(var F=$.total-1;F>=0;F--)NTES.event.addEvent($._ctrls[F],D,C,new Number(F))}$.interval&&$.play()};T.ui.Slide.prototype={show:function(_){var A=this;_=_<0?0:_>=A.total?A.total-1:_;var B=A._ctrls?A._ctrls[_]:null,$=A._contents[_];if(-1===A._curIndex)A._curIndex=0;NTES.style.removeCss(A._ctrls,A._css);NTES.style.removeCss(A._contents,A._css);NTES.style.addCss(B,A._css);NTES.style.addCss($,A._css);A.onShow&&A.onShow(_,B,$);A._curIndex=_},showNext:function(){this.show(this.playMode(this._curIndex,this.total))},showPrevious:function(){this.show(this.rollbackMode(this._curIndex,this.total))},play:function(A){var _=this;if(!isNaN(A))_.interval=parseInt(A);if(g===_._timerId){if(!_._hasEvent){var $=_.pause.bind(_),B=_.play.bind(_);NTES.event.addEvent(_._ctrls,"mouseover",$);NTES.event.addEvent(_._ctrls,"mouseout",B);NTES.event.addEvent(_._contents,"mouseover",$);NTES.event.addEvent(_._contents,"mouseout",B);_._hasEvent=1}_._timerId=setInterval(_.showNext.bind(_),_.interval)}},pause:function(){var _=this;if(_._timerId!==g){clearInterval(_._timerId);_._timerId=g;if(_.onStop){var $=_._curIndex;_.onStop($,_._ctrls[$],_._contents[$])}}}};O=null})(window)
