(function(){if(window.NTES){var _=window.NTES;_.Util=_.Util||_.util;_.Event=_.Event||_.event;_.Browser=_.Browser||_.browser;_.Ajax=_.Ajax||_.ajax;_.Cookie=_.Cookie||_.cookie;_.UI=_.UI||_.ui;return}var D,A=window.NTES=window.$=function(_,B){if(null==_||_.$)return _;var C;if("string"===typeof _){B=B||(this.alert?document:this);C=H.query(_,B)}else C=_;if(C&&!C.$)if(C.nodeType){if("unknown"!==typeof C.getAttribute)C=A.Util.extend(C,A.Element)}else C=A.Util.extend($(C),A.Element);return C};A.version="0.9.6.5 Build 200908051005";var H={SPACE:/\s*([\s>~+,])\s*/g,ISSIMPLE:/^#?([\w\u00c0-\uFFFF_-]+)$/,IMPLIEDALL:/([>\s~\+,]|^)([#\.\[:])/g,ATTRALUES:/=(["'])([^'"]*)\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(_,J){var A,H,D,C,B,K,L,F,I,M;_=_.trim();if(""===_)return;if(this.ISSIMPLE.test(_))if(0===_.indexOf("#")&&typeof J.getElementById!=="undefined")return this.getElemById(J,_.substr(1));else if(typeof J.getElementsByTagName!=="undefined")return $(J.getElementsByTagName(_));if(!G(J))J=J.nodeType?[J]:$(J);H=_.replace(this.SPACE,"$1").replace(this.ATTRALUES,this.analyzeAttrValues).replace(this.ATTR,this.analyzeAttrs).replace(this.IMPLIEDALL,"$1*$2").split(",");D=H.length;C=-1;A=[];while(++C<D){K=J;_=H[C];if(this.BEGINIDAPART.test(_))if(typeof J[0].getElementById!=="undefined"){K=[this.getElemById(J[0],RegExp.$1)];if(!K[0])continue;_=RegExp.rightContext}else _=H[C];if(_!==""){if(!this.STANDARD.test(_))_=" "+_;L=_.match(this.STREAM)||[];F=L.length;B=0;while(B<F){I=L[B++];M=L[B++];K=this.operators[I]?this.operators[I](K,M):[];if(0===K.length)break}}E(A,K)}this.tempAttrValues.length=this.tempAttrs.length=0;return A.length>1?this.unique(A):A},analyzeAttrs:function(_,B,A,$){return"[]"+(H.tempAttrs.push([B,A,$])-1)},analyzeAttrValues:function($,A,_){return"="+(H.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=D==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[$];for(var B=0;B<_.length;B++)if(this.getAttribute(_[B],"id")===$)return _[B];_=null}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++])if(A(this.getAttribute($,D[0]),C))_.push($);return _},operators:{"#":function(_,$){return H.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 H.getElemsByAttribute($,["class","~=",_])},">":function(_,$){return H.getElemsByTagName(_,"firstChild","nextSibling",$)},"[]":function($,_){_=H.tempAttrs[_];if(_){if(H.ISINT.test(_[2]))_[2]=H.tempAttrValues[_[2]];return H.getElemsByAttribute($,_)}else return $}},attrOperators:{"":function($){return $!==""},"=":function(_,$){return $===_},"~=":function(_,$){return(" "+_+" ").indexOf($)>=0},"!=":function(_,$){return $!==_}}};A.Element={$:function($,_){return A.call(this,$,_)},addCss:function($){$=I.parse($);return this.each("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($){$=I.parse($);return this.each("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]]!=null)this.style[$[A]]=""},[$,$.length])},addEvent:function(A,B){var _,$;if(window.attachEvent){_=function($,_){this.attachEvent($,_)};$=["on"+A,B]}else if(window.addEventListener){_=function($,_){this.addEventListener($,_,false)};$=arguments}return this.each(_,$)},each:function(_,$){if(G(this)){var B=-1,A=this.length;while(++B<A)_.apply(this[B],$)}else _.apply(this,$);return this},toArray:function(){if(G(this))return this;else return[this]}};var I={NAMETOFIX:/\-([a-z])/gi,FIXFLOAT:/(^|:|;)float(?=:|;|$)/gi,FLOATNAME:document.createElement("div").style.styleFloat!=null?"styleFloat":"cssFloat",SPLITER:/([^:;]+)/g,SPACE:/\s*([:;\s])\s*/g,STYLENAME:/([^:;]+)(?=:)/g,CLASSSPLITER:/\s+/,parse:function(A){A=A.trim().replace(this.SPACE,"$1");var _=A.indexOf(";")>=0,$=A.indexOf(":")>=0;if(_||$){A=A.replace($?this.STYLENAME:this.SPLITER,function($,_){return _.replace(I.NAMETOFIX,I.fixName)});A=A.replace(this.FIXFLOAT,this.fixFloat).match(this.SPLITER);A.styleType="Style";if($&&A.length%2!==0)throw"invalid inline style"}else{A=A.split(this.CLASSSPLITER);A.styleType="Class"}return A},fixName:function($,_){return _.toUpperCase()},fixFloat:function($,A,_){return A+I.FLOATNAME+_}},G=function($){return Object.prototype.toString.call($)==="[object Array]"},F=/#@(\w+)#/g;A.Util={toArray:function($){if(G($))return $;else if($.toArray)return $.toArray();else{var _=[],A=$.length;while(A)_[--A]=$[A];return _}},parseTpl:function(_,$,A){return $?String(_).replace(A||F,function(_,A){return $[A]!=null?$[A]:_}):_},extend:function($,A){for(var _ in A)$[_]=A[_];return $},merge:function(A,_){var C=0,$,B=A.length;while(($=_[C++])!=null)A[B++]=$;return A}};var $=A.Util.toArray,E=A.Util.merge,C=navigator.userAgent.toLowerCase();A.Browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};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(F,C,B,G,A){A=A||this.createXhr();var D;C=C.toUpperCase();C=C!=="GET"&&C!=="POST"?"GET":C;G=G||{};G.async="boolean"===typeof G.async?G.async:true;var _;if(B){_=[];for(var $ in B)_.push($+"="+encodeURIComponent(B[$]));_=_.join("&").replace(/%20/g,"+")}if(G.async&&!isNaN(G.timeout)&&G.timeout>0)setTimeout(function(){if(!D){A.abort();if(G.onTimeout)G.onTimeout(A)}},G.timeout);A.onreadystatechange=function(){if(4==A.readyState){D=true;var $=200==A.status?"onSuccess":"onError";if(G[$])G[$](A)}};if(_&&"GET"===C){F+=("?"+_);_=null}A.open(C,F,G.async,G.username,G.password);if(G.headers)for(var E in G.headers)A.setRequestHeader(E,G.headers[E]);if("POST"===C)A.setRequestHeader("Content-Type","application/x-www-form-urlencoded");A.send(_);return A},importJs:function(C,$,_){var B=document.getElementsByTagName("head")[0],A=document.createElement("script");A.src=C;A.language="javascript";A.type="text/javascript";if(_)A.charset=_;A.onload=A.onreadystatechange=function(){if(!this.readyState||this.readyState=="loaded"||this.readyState=="complete"){if($)$(this);A.onload=A.onreadystatechange=null;this.parentNode.removeChild(A)}};B.appendChild(A)}};A.Cookie={encoder:escape,decoder:unescape,get:function(A){A=this.encoder(A)+"=";var $=document.cookie,_=$.indexOf(A);if(-1===_)return"";_+=A.length;var B=$.indexOf(";",_);if(B===-1)B=$.length;return this.decoder($.substring(_,B))},set:function(A,E,$,D,C,B){var _=[this.encoder(A)+"="+this.encoder(E)];if($){var F;if(!isNaN($)){F=new Date();F.setTime(F.getTime()+$*60*1000)}else F=$;_.push("expires="+F.toUTCString())}if(C!=null&&C!=="")_.push("path="+C);if(D)_.push("domain="+D);if(B)_.push("secure");document.cookie=_.join(";")},del:function($,A,_){document.cookie=this.encoder($)+"="+(_!=null&&_!==""?";path="+_:"")+(A?";domain="+A:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}};A.Event={fix:function(_){_.preventDefault=_.preventDefault||function(){_.returnValue=false};if(null==_.pageX&&null!=_.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=function(_,$){return(_+1)%$};A.UI={Slide:function(O,D,S,P,C){var $=D.length;if(O&&$!==O.length)throw"can not match ctrls("+O.length+") and contents("+$+")";var K=-1,_,G,Q,F=B,R,I,H,N;O=A(O||[]);D=A(D);this.setPlayMode=function($){F=$};this.setOnShow=function($){Q=$};I=this.show=function(A){if(A>=0&&A<$&&A!=K){var B=O[A],_=D[A];O.removeCss(S);D.removeCss(S);if(B)B.addCss(S);_.addCss(S);K=A;if(Q)Q(A,B,_)}};G=this.showNext=function(){if(-1==K)K=0;I(F(K,$))};H=this.play=function($){if(!isNaN($))C=$;if(null==_){if(!R){O.addEvent("mouseover",N);O.addEvent("mouseout",H);D.addEvent("mouseover",N);D.addEvent("mouseout",H);R=true}_=setInterval(G,C)}};N=this.pause=function(){if(_!=null){clearInterval(_);_=null}};var E=function(_){I(this);var $=A.Event.fix(_);$.preventDefault();$.cancelBubble=true};for(var J,M,L=D.length-1;L>=0;L--){J=O[L];D[L]=A(D[L]);if(J){O[L]=A(J);if(P)J.addEvent(P,E.bind(new Number(L)))}}if(C>0)H()}};String.prototype.trim=function($){return this.replace(null==$?/^\s+|\s+$/g:new RegExp("^"+$+"+|"+$+"+$","g"),"")};String.prototype.has=function($,_){return"string"===typeof _?(_+this+_).indexOf(_+$+_)>=0:this.indexOf($)>=0};String.format=function($){var _=arguments,A=new RegExp("%([1-"+_.length+"])","g");return String($).replace(A,function($,A){return _[A]})};Function.prototype.bind=function(){if(!arguments.length||null==arguments[0])return this;var _=this,$=Array.prototype.slice.call(arguments),A=$.shift();return function(){return _.apply(A,$.concat(Array.prototype.slice.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};window.toArray=document.toArray=function(){return[this]};window.each=document.each=function(_,$){_.apply(this,$);return this};window.addEvent=document.addEvent=A.Element.addEvent})()
