try{document.domain=""+XN.env.domain+"";}catch(e){try{XN={env:{shortSiteName:"人人",siteName:"人人网",domain:window.location.hostname.split(".").reverse().slice(0,2).reverse().join(".")}};document.domain=XN.env.domain;}catch(e){}}function isUndefined(object){return typeof object=="undefined";}function isString(object){return typeof object=="string";}function isElement(object){return object&&object.nodeType==1;}function isFunction(object){return typeof object=="function";}function isObject(object){return typeof object=="object";}function isArray(object){return Object.prototype.toString.call(object)==="[object Array]";}function isNumber(object){return typeof object=="number";}function $extend(object,src){if(!src){return object;}for(var p in src){object[p]=src[p];}return object;}(function(){var cache={};$element=function(tagName){tagName=tagName.toLowerCase();if(!cache[tagName]){cache[tagName]=document.createElement(tagName);}return $(cache[tagName].cloneNode(false));};})();function $(id){var el;if(isString(id)||isNumber(id)){el=document.getElementById(id+"");}else{el=id;}if(!el){return null;}if(!el._extendLevel){XN.element.extend(el);}return el;}xn_getEl=$;if(!Function.prototype.bind){Function.prototype.bind=function(object){var method=this;return function(){method.apply(object,arguments);};};}ge=getEl=$;$xElement=$element;$X=$;if(typeof XN=="undefined"){XN={};}$extend(XN,{namespace:function(){var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i++){d=a[i].split(".");o=XN;for(j=(d[0]=="XN")?1:0;j<d.length;j++){o[d[j]]=o[d[j]]||{};o=o[d[j]];}}return o;}});XN.namespace("ui");XN.namespace("util");XN.namespace("app");XN.namespace("page");XN.namespace("config");XN.APP=XN.App=XN.app;XN.PAGE=XN.Page=XN.page;XN.CONFIG=XN.Config=XN.config;XN.DEBUG_MODE=false;XN.debug={log:function(){},on:function(){XN.DEBUG_MODE=true;if(window.console&&console.log){XN.debug.log=function(s){console.log(s);};}},off:function(){XN.debug.log=function(){};}};XN.log=function(s){XN.debug.log(s);};XN.DEBUG=XN.Debug=XN.debug;XN.debug.On=XN.debug.on;XN.debug.Off=XN.debug.off;XN.namespace("env");$extend(XN.env,{domain_reg:XN.env.domain.replace(/\./g,"\\."),staticRoot:"http://s.xnimg.cn/",CDNstaticRoot:"http://xnimg.cn/",swfRoot:"http://static.xiaonei.com/",wwwRoot:"http://"+XN.env.domain+"/"});XN.ENV=XN.Env=XN.env;XN.array={toQueryString:function(a,key){var rt=[],t;for(var k in a){t=a[k];if(isFunction(t)){continue;}if(isObject(t)){rt.push(arguments.callee(t,k));}else{if(/^\d+$/.test(k)){rt.push((key||k)+"="+encodeURIComponent(t));}else{rt.push(k+"="+encodeURIComponent(t));}}}return rt.join("&");},each:function(a,func){if(!a){return;}if(!isUndefined(a.length)||!isUndefined(a[0])){for(var i=0,j=a.length;i<j;i++){if(func.call(a,i,a[i])===false){break;}}}else{for(var key in a){if(!isFunction(a[key])){if(func.call(a,key,a[key])===false){break;}}}}},include:function(a,value){var r=false;XN.array.each(a,function(i,v){if(v===value){r=true;return false;}});return r;},build:function(o){var rt=[];for(var i=0,j=o.length;i<j;i++){rt.push(o[i]);}return rt;}};XN.ARRAY=XN.Array=XN.array;XN.string={nl2br:function(str){return str.replace(/([^>])\n/g,"$1<br />");},trim:function(str){return str.replace(/^\s+|\s+$/g,"");},ltrim:function(str){return str.replace(/^\s+/,"");},rtrim:function(str){return str.replace(/\s+$/,"");},strip:function(str){return XN.string.trim(str);},stripTags:function(str){return str.replace(/<\/?[^>]+>/igm,"");},escapeHTML:function(str){return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},unescapeHTML:function(str){return str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/&quot;/g,'"').replace(/&amp;/g,"&");},include:function(str,key){return str.indexOf(key)>-1;},startsWith:function(str,key){return str.indexOf(key)===0;},endsWith:function(str,key){var d=str.length-key.length;return d>=0&&str.lastIndexOf(key)===d;},isBlank:function(str){return/^\s*$/.test(str);},isEmail:function(str){return/^[A-Z_a-z0-9-\.]+@([A-Z_a-z0-9-]+\.)+[a-z0-9A-Z]{2,4}$/.test(str);},isMobile:function(str){return/^((\(\d{2,3}\))|(\d{3}\-))?((1[345]\d{9})|(18\d{9}))$/.test(str);},isUrl:function(str){return/^(http:|ftp:)\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"])*$/.test(str);},isIp:function(str){return/^(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5])$/.test(str);},isNumber:function(str){return/^\d+$/.test(str);},isZip:function(str){return/^[1-9]\d{5}$/.test(str);},isEN:function(str){return/^[A-Za-z]+$/.test(str);},isJSON:function(str){if(!isString(str)||str===""){return false;}str=str.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},getQuery:function(key,url){url=url||window.location.href+"";if(url.indexOf("#")!==-1){url=url.substring(0,url.indexOf("#"));}var rts=[],rt;var queryReg=new RegExp("(^|\\?|&)"+key+"=([^&]*)(?=&|#|$)","g");while((rt=queryReg.exec(url))!=null){rts.push(decodeURIComponent(rt[2]));}if(rts.length==0){return null;}if(rts.length==1){return rts[0];}return rts;},setQuery:function(key,value,url){url=url||window.location.href+"";var hash="";if(!/^http/.test(url)){return url;}if(url.indexOf("#")!==-1){hash=url.substring(url.indexOf("#"));}url=url.replace(hash,"");url=url.replace(new RegExp("(^|\\?|&)"+key+"=[^&]*(?=&|#|$)","g"),"");value=isArray(value)?value:[value];for(var i=value.length-1;i>=0;i--){value[i]=encodeURIComponent(value[i]);}var p=key+"="+value.join("&"+key+"=");return url+(/\?/.test(url)?"&":"?")+p+hash;}};XN.String=XN.STRING=XN.string;XN.string.isNum=XN.string.isNumber;window.isJSON=XN.string.isJSON;(function(){runOnceFunc={};XN.func={empty:function(){},runOnce:function(func){if(runOnceFunc[func]){return null;}runOnceFunc[func]=true;return func();}};})();XN.FUNC=XN.Func=XN.func;(function(){XN.browser={IE:!!(window.attachEvent&&!window.opera),IE6:navigator.userAgent.indexOf("MSIE 6.0")>-1,IE7:navigator.userAgent.indexOf("MSIE 7.0")>-1,IE8:navigator.userAgent.indexOf("MSIE 8.0")>-1,Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,copy:function(o){function onfail(){if(isElement(o)){o.select();}}var str;if(isElement(o)){str=o.value;}else{str=o;}if(window.clipboardData&&clipboardData.setData){if(clipboardData.setData("text",str)){return true;}}else{XN.DO.alert({message:"您的浏览器不支持脚本复制,请尝试手动复制",callBack:function(){onfail();}});return false;}XN.DO.alert({message:"您的浏览器设置不允许脚本访问剪切板",callBack:function(){onfail();}});return false;}};})();XN.BROWSER=XN.Browser=XN.browser;XN.cookie={get:function(name){var nameEQ=name+"=";var ca=document.cookie.split(";");for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==" "){c=c.substring(1,c.length);}if(c.indexOf(nameEQ)==0){return decodeURIComponent(c.substring(nameEQ.length,c.length));}}return null;},set:function(name,value,days,path,domain,secure){var expires;if(isNumber(days)){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires=date.toGMTString();}else{if(isString(days)){expires=days;}else{expires=false;}}document.cookie=name+"="+encodeURIComponent(value)+(expires?";expires="+expires:"")+(path?";path="+path:"")+(domain?";domain="+domain:"")+(secure?";secure":"");},del:function(name,path,domain,secure){XN.cookie.set(name,"",-1,path,domain,secure);}};XN.COOKIE=XN.Cookie=XN.cookie;(function(){var browser=XN.browser;XN.event={isCapsLockOn:function(e){var c=e.keyCode||e.which;var s=e.shiftKey;if(((c>=65&&c<=90)&&!s)||((c>=97&&c<=122)&&s)){return true;}return false;},element:function(e){var n=e.target||e.srcElement;return This.resolveTextNode(n);},relatedTarget:function(e){var t=e.relatedTarget;if(!t){if(e.type=="mouseout"||e.type=="mouseleave"){t=e.toElement;}else{if(e.type=="mouseover"){t=e.fromElement;}}}return This.resolveTextNode(t);},resolveTextNode:function(n){try{if(n&&3==n.nodeType){return n.parentNode;}}catch(e){}return n;},pointerX:function(event){return event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){return event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},isStrictMode:document.compatMode!="BackCompat",pageHeight:function(){return this.isStrictMode?Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight):Math.max(document.body.scrollHeight,document.body.clientHeight);},pageWidth:function(){return this.isStrictMode?Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth):Math.max(document.body.scrollWidth,document.body.clientWidth);},winWidth:function(){return this.isStrictMode?document.documentElement.clientWidth:document.body.clientWidth;},winHeight:function(){return this.isStrictMode?document.documentElement.clientHeight:document.body.clientHeight;},scrollTop:function(){if(XN.browser.WebKit){return window.pageYOffset;}return this.isStrictMode?document.documentElement.scrollTop:document.body.scrollTop;},scrollLeft:function(){if(XN.browser.WebKit){return window.pageXOffset;}return this.isStrictMode?document.documentElement.scrollLeft:document.body.scrollLeft;},stop:null,addEvent:function(el,name,func,cap){var els=[];el=$(el);if(isArray(el)){els=el;}else{els.push(el);}if(els.length==0){return el;}XN.array.each(els,function(i,v){XN.event._addEvent(v,name,func,cap);});return el;},delEvent:function(el,name,func,cap){var els=[];el=$(el);if(isArray(el)){els=el;}else{els.push(el);}if(els.length==0){return el;}XN.array.each(els,function(i,v){XN.event._delEvent(v,name,func,cap);});return el;},_addEvent:null,_delEvent:null,enableCustomEvent:function(obj){$extend(obj,{addEvent:function(type,func){if(!this._customEventListeners){this._customEventListeners={};}var funcs=this._customEventListeners;if(isUndefined(funcs[type])){funcs[type]=[];}funcs[type].push(func);return this;},delEvent:function(type,func){var funcs=this._customEventListeners[type];if(funcs){for(var i=funcs.length-1;i>=0;i--){if(funcs[i]==func){funcs[i]=null;break;}}}return this;},fireEvent:function(type){if(!this._customEventListeners||!this._customEventListeners[type]){return;}var funcs=this._customEventListeners[type],ars=XN.array.build(arguments);ars.shift();for(var i=0,j=funcs.length;i<j;i++){if(funcs[i]){try{funcs[i].apply(this,ars);}catch(ox){if(XN.DEBUG_MODE){throw ox;}}}}}});return obj;}};var This=XN.event;if(browser.IE){This.stop=function(event){event.returnValue=false;event.cancelBubble=true;};}else{This.stop=function(event){event.preventDefault();event.stopPropagation();};}var ismouseleave=function(event,element){var p=event.relatedTarget;while(p&&p!=element){try{p=p.parentNode;}catch(error){p=element;}}return p!==element;};if(window.attachEvent&&!browser.Opera){This._addEvent=function(element,name,func){element=$(element);if(name=="keypress"){name="keydown";}if(name=="input"){name="propertychange";}element.attachEvent("on"+name,func);return element;};This._delEvent=function(element,name,func){element=$(element);if(name=="keypress"){name="keydown";}if(name=="input"){name="propertychange";}element.detachEvent("on"+name,func);return element;};}else{if(window.addEventListener){This._addEvent=function(element,name,func,useCapture){element=$(element);if(name=="mouseleave"){element.onmouseleave=function(e){e=e||window.event;if(ismouseleave(e,element)&&func){func.call(element,e);}};element.addEventListener("mouseout",element.onmouseleave,useCapture);return element;}if(name=="keypress"&&browser.WebKit){name="keydown";}element.addEventListener(name,func,useCapture);return element;};This._delEvent=function(element,name,func,useCapture){element=$(element);if(name=="mouseleave"){element.removeEventListener("mouseout",element.onmouseleave,useCapture);return element;}if(name=="keypress"&&browser.WebKit){name="keydown";}element.removeEventListener(name,func,useCapture);return element;};}}})();XN.EVENT=XN.Event=XN.event;(function(){var Event=XN.event;var array=XN.array;var browser=XN.browser;var domLoaded=false;var domloadHooks=[];var asyncLoadHooks=[];function runHooks(){if(!domloadHooks){return;}XN.array.each(domloadHooks,function(i,v){try{v();}catch(e){if(XN.DEBUG_MODE){throw e;}}});XN.array.each(asyncLoadHooks,function(i,v){setTimeout(v,0);});}var shadowElement=null;function createShadow(opacity,zIndex){opacity=opacity||0.3;zIndex=zIndex||2000;var el=$element("div");shadowElement=el;XN.element.setStyle(el,["position:absolute;","top:0;","left:0;","background:#000;","z-index:"+zIndex+";","opacity:"+opacity+";","filter:alpha(opacity="+(opacity*100)+");"].join(""));el.innerHTML=['<iframe width="100%" height="100%" frameBorder="0" style="position:absolute;top:0;left:0;z-index:1;"></iframe>','<div style="position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000;z-index:2;height:expression(this.parentNode.offsetHeight);"></div>'].join("");function resize(){el.hide();el.style.height=XN.event.pageHeight()+"px";el.style.width=XN.event.pageWidth()+"px";el.show();}resize();XN.event.addEvent(window,"resize",function(e){if(shadowElement&&shadowElement.style.display!="none"){try{resize();}catch(e){}}});document.body.appendChild(el);}XN.dom={disable:function(opacity,zIndex){if(!shadowElement){createShadow(opacity,zIndex);}},enable:function(){if(shadowElement){shadowElement.remove();shadowElement=null;}},insertAfter:function(element,targetElement){element=$(element);targetElement=$(targetElement);var parent=targetElement.parentNode;if(parent.lastChild==targetElement){parent.appendChild(element);}else{parent.insertBefore(element,targetElement.nextSibling);}},getElementsByClassName:function(className,element,tagName){var c=($(element)||document).getElementsByTagName(tagName||"*")||document.all;var elements=[];var _exp=new RegExp("(^|\\s)"+className+"(\\s|$)");array.each(c,function(i,v){if(_exp.test(v.className)){elements.push(v);}});return elements;},ready:function(f,async){if(isUndefined(async)){async=false;}if(domLoaded){async?setTimeout(f,0):f();}else{async?asyncLoadHooks.push(f):domloadHooks.push(f);}},preloadImg:function(src){src=isArray(src)?src:[src];array.each(src,function(i,v){new Image().src=v;});}};if(browser.WebKit){var timer=setInterval(function(){if(/loaded|complete/.test(document.readyState)){domLoaded=true;runHooks();clearInterval(timer);}},10);}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){domLoaded=true;runHooks();},false);}else{var timer=setInterval(function(){try{document.body.doScroll("left");clearInterval(timer);domLoaded=true;runHooks();}catch(e){}},20);}}})();XN.DOM=XN.Dom=XN.dom;XN.dom.readyDo=XN.dom.ready;XN.dom.ready(function(){$=ge=getEl=xn_getEl;});XN.namespace("config");XN.config.jumpOut=true;XN.dom.ready(function(){if(XN.config.parentDomain||(!XN.config.jumpOut)){return;}try{top.location.href.indexOf("x");}catch(e){try{top.location=self.location;}catch(e){}}});(function(){var files={};var version={};function hasLoad(file){return !!getFile(file);}function getFile(file){return files[encodeURIComponent(file)];}function mark(file){var obj={};obj.file=file;obj.isLoad=true;obj.isLoaded=true;files[encodeURIComponent(file)]=obj;}function addFile(file){var obj={};obj.file=file;obj.isLoaded=false;XN.EVENT.enableCustomEvent(obj);obj.addEvent("load",function(){this.isLoaded=true;});files[encodeURIComponent(file)]=obj;var el=$element("script");el.type="text/javascript";el.src=file;obj.element=el;if(XN.Browser.IE){el.onreadystatechange=function(){if((this.readyState=="loaded"||this.readyState=="complete")&&!this.hasLoad){this.hasLoad=true;getFile(file).fireEvent("load");}};}else{el.onload=function(){getFile(file).fireEvent("load");};}document.getElementsByTagName("head")[0].appendChild(el);}function loadFile(file,callBack){var isJS=false,isCSS=false;if(isObject(file)){isJS=(file.type=="js");isCSS=(file.type=="css");file=file.file;}file=getFullName(file);if(/\.js(\?|$)/.test(file)||isJS){if(!hasLoad(file)){addFile(file);}if(!callBack){return;}if(getFile(file).isLoaded){callBack.call(getFile(file));}else{getFile(file).addEvent("load",callBack);}}else{if(/\.css(\?|$)/.test(file)||isCSS){if(hasLoad(file)){if(callBack){callBack.call(getFile(file));}return;}mark(file);var el=$element("link");el.rel="stylesheet";el.type="text/css";el.href=file;document.getElementsByTagName("head")[0].appendChild(el);if(callBack){callBack.call(getFile(file));}}}}function getFullName(file){XN.func.runOnce(loadVersion);if(!version[file]){return file;}return version[file].file;}function getVersion(file){var match;if(match=new RegExp("("+XN.env.staticRoot+")"+"(a?\\d+)/([^?]*)").exec(file)){version[match[1]+match[3]]={file:file,version:match[2]};}else{if(match=new RegExp("(.*)\\?ver=(\d+)(..*)").exec(file)){version[match[1]]={file:file,version:match[2]};}}}XN.getFileVersion=function(files){XN.array.each(files,function(i,v){getVersion(v);});};XN.loadFile=function(file,callBack){loadFile(file,callBack);};XN.loadFiles=function(files,callBack){var f=files.length;function isAllLoad(){f--;if(f===0&&callBack){callBack();}}XN.array.each(files,function(i,v){XN.loadFile(v,isAllLoad);});};XN.getVersion=function(file){getVersion(file);};function loadVersion(){XN.array.each(document.getElementsByTagName("script"),function(i,v){if(v.src){mark(v.src);getVersion(v.src);}if(v.getAttribute("vsrc")){getVersion(v.getAttribute("vsrc"));}});XN.array.each(document.getElementsByTagName("link"),function(i,v){if(v.rel&&v.rel=="stylesheet"){mark(v.href);getVersion(v.href);}if(v.getAttribute("vhref")){getVersion(v.getAttribute("vhref"));}});XN.log("load file version:");XN.log(version);}XN.dynamicLoad=function(file){XN.array.each(file.funcs,function(i,func){window[func]=function(){var ars=arguments;window[func]=null;if(file.file){file.files=[file.file];}XN.loadFiles(file.files,function(){window[func].apply(null,ars);if(file.callBack){file.callBack.call(null);}});};});};XN.namespace("img");XN.img.getVersion=function(file){XN.func.runOnce(loadVersion);if(!version[file]){return"";}return version[file].version;};XN.img.getFullName=function(file){return getFullName(file);};})();(function(){var addEvent=XN.event.addEvent;var delEvent=XN.event.delEvent;var browser=XN.browser;XN.element={clear:function(element){element=$(element);element.innerHTML="";return element;},hover:function(element,className,hover){element=$(element);hover=hover?$(hover):element;addEvent(element,"mouseover",function(){hover.addClass(className);},false);addEvent(element,"mouseleave",function(){hover.delClass(className);},false);return element;},scrollTo:function(element,effect){element=$(element);effect=effect||"normal";switch(effect){case"slow":XN.EFFECT.scrollTo(element);break;default:window.scrollTo(0,element.realTop());break;}return element;},visible:function(element){element=$(element);return element.style.display!="none"&&element.style.visibility!="hidden";},toggleClass:function(element,className,className2){if(isUndefined(className2)){if(This.hasClassName(element,className)){This.delClass(element,className);}else{This.addClass(element,className);}}else{if(This.hasClassName(element,className)){This.delClass(element,className);This.addClass(element,className2);}else{This.addClass(element,className);This.delClass(element,className2);}}return $(element);},toggleText:function(element,text1,text2){if(element.innerHTML==text1){element.innerHTML=text2;}else{element.innerHTML=text1;}},hasClassName:function(element,className){return new RegExp("(^|\\s+)"+className+"(\\s+|$)").test($(element).className);},addClass:function(element,className){element=$(element);if(This.hasClassName(element,className)){return element;}element.className+=" "+className;return element;},delClass:function(element,className){element=$(element);element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)","g")," ");return element;},show:function(element,effect){element=$(element);if(element.style.display!="none"){return;}effect=effect||"normal";switch(effect){case"normal":element.style.display="";break;case"fade":XN.EFFECT.fadeIn(element,function(e){e.style.display="";});break;case"slide":XN.EFFECT.slideOpen(element);break;case"delay":setTimeout(function(){element.style.display="";},2000);break;}return element;},hide:function(element,effect){element=$(element);if(element.style.display=="none"){return;}effect=effect||"normal";switch(effect){case"normal":element.style.display="none";break;case"fade":XN.EFFECT.fadeOut(element,function(e){e.style.display="none";});break;case"slide":XN.EFFECT.slideClose(element);break;case"delay":setTimeout(function(){element.style.display="none";},2000);break;}return element;},remove:function(element){var element=$(element);element.parentNode.removeChild(element);return element;},setStyle:function(element,style){var element=$(element);element.style.cssText+=";"+style;return element;},getStyle:function(element,style){element=$(element);style=style=="float"?"cssFloat":style;var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}if(style=="opacity"){return value?parseFloat(value):1;}return value=="auto"?null:value;},addEvent:function(){addEvent.apply(null,arguments);return arguments[0];},delEvent:function(){delEvent.apply(null,arguments);return arguments[0];},addChild:function(father,child){father=$(father);if(isString(child)){var element=(child.substring(0,1)=="#")?$(child.substring(1,child.length)):child;if(isString(element)){father.innerHTML+=element;}else{father.appendChild(element);}}else{if(isElement(child)){father.appendChild(child);}else{if(child.iAmUIelement){father.appendChild($(child.frame));}else{if(child.iAmXmlhttp){child.fillTo=father;father.startLoading();}}}}return father;},delChild:function(father,child){child=$(child);child.remove();return $(father);},setContent:function(element,c){element=$(element);element.innerHTML="";element.addChild(c);return element;},getPosition:function(element,parentE){parentE=$(parentE)||document.body;element=$(element);var rl=0;var rt=0;var p=element;try{while(p&&p!=parentE){rl+=p.offsetLeft;rt+=p.offsetTop;p=p.offsetParent;}}catch(e){}return{"left":rl,"top":rt};},realLeft:function(element,p){return This.getPosition(element,p||null).left;},realTop:function(element,p){return This.getPosition(element,p||null).top;},appendHTML:function(element,str,getElements){element=$(element);var f=document.createDocumentFragment();var t=$element("div");t.innerHTML=str;while(t.firstChild){f.appendChild(t.firstChild);}var tmp=XN.array.build(f.childNodes);element.appendChild(f);if(getElements){return tmp;}return element;},findFirstClass:function(element,className){element=$(element);var els=XN.dom.getElementsByClassName(className,element);return $(els[0])||null;},startLoading:function(element,msg){element=$(element);element.innerHTML='<center><img src="'+XN.ENV.staticRoot+'img/indicator.gif" />'+(msg||"加载中...")+"</center>";return element;},stopLoading:function(element){element=$(element);return element;},eval_inner_JS:function(el){var js=$(el).getElementsByTagName("script");XN.array.each(js,function(i,s){if(s.src){XN.loadFile(s.src);}else{var inner_js="__inner_js_out_put = [];\n";inner_js+=s.innerHTML.replace(/document\.write/g,"__inner_js_out_put.push");eval(inner_js);if(__inner_js_out_put.length!==0){var tmp=document.createDocumentFragment();$(tmp).appendHTML(__inner_js_out_put.join(""));s.parentNode.insertBefore(tmp,s);}}});}};XN.element.extend=function(element){if(element._extendLevel){return element;}var cache=This.extend.cache;for(var m in This){if(!(m in element)){element[m]=cache.findOrStore(This[m]);}}return element;};XN.element.extend.cache={findOrStore:function(value){return this[value]=this[value]||function(){return value.apply(null,[this].concat(XN.array.build(arguments)));};}};var This=XN.element;if(browser.IE){XN.element.getStyle=function(element,style){element=$(element);style=(style=="float"||style=="cssFloat")?"styleFloat":style;var value=element.style[style];if(!value&&element.currentStyle){value=element.currentStyle[style];}if(style=="opacity"){if(value=(element.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(value[1]){return parseFloat(value[1])/100;}}return 1;}if(value=="auto"){if((style=="width"||style=="height")&&(element.getStyle("display")!="none")){return element["offset"+(style=="width"?"Width":"Height")]+"px";}return null;}return value;};}if(document.addEventListener){XN.element.setOpacity=function(element,opacity){element=$(element);element.style.opacity=opacity;return element;};}else{XN.element.setOpacity=function(element,opacity){element=$(element);element.style.zoom=1;element.style.filter="Alpha(opacity="+Math.ceil(opacity*100)+")";return element;};}})();XN.ELEMENT=XN.Element=XN.element;XN.namespace("net");XN.net.proxys={};XN.net.sendForm=function(params){XN.log("send form");params.data=XN.FORM.serialize(params.form);return new XN.net.xmlhttp(params);};XN.net.xmlhttp=function(params){var This=this;if(!XN.net.cache){XN.net.cache=new XN.util.cache();}var ars=arguments;if(ars.length>1){this.url=ars[0]||null;this.data=ars[1]||"";this.onSuccess=ars[2];$extend(this,ars[3]);init(window);return this;}$extend(this,params);var cache;if(this.useCache&&(cache=XN.net.cache.get(this.url+encodeURIComponent(this.data)))){this.transport={};this.transport.responseText=cache;setTimeout(function(){This._onComplete();This._onSuccess();},0);return this;}function getDomain(link){var a=$element("a");a.href=link;return a.hostname;}if(/^http/.test(this.url)){var cd=getDomain(window.location.href);var nd=getDomain(this.url);if(cd!=nd){if(XN.net.proxys[nd]){init(XN.net.proxys[nd]);return This;}else{var iframe=$element("iframe").hide();document.body.appendChild(iframe);iframe.src="http://"+nd+"/ajaxproxy.htm";XN.event.addEvent(iframe,"load",function(){try{init(iframe.contentWindow);XN.net.proxys[nd]=iframe.contentWindow;}catch(e){}});return This;}}else{init(window);}}else{init(window);}function init(w){This.transport=This.getTransport(w);if(This.url&&This.url!==""){This.send(This.method);}}};XN.net.xmlhttp.prototype={url:null,data:"",onSuccess:null,onFailure:null,onError:null,fillTo:null,method:"post",asynchronous:true,transport:null,headers:null,iAmXmlhttp:true,useCache:false,abort:function(){this.transport.abort();},send:function(method){var _url;if(method=="get"&&this.data!==""){_url=this.url+(/\?/.test(this.url)?"&":"?")+this.data;}else{_url=this.url;}if(this.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);}this.transport.open(method,_url,this.asynchronous);this.transport.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.headers!==null){for(var i in this.headers){this.transport.setRequestHeader(i,this.headers[i]);}}this.transport.send(method=="post"?(this.data||""):null);if(!this.asynchronous){this._onComplete();}},_onSuccess:function(obj){var transport=this.transport;if(this.fillTo!==null){try{this.fillTo.stopLoading();}catch(e){}this.fillTo.innerHTML=transport.responseText;}try{if(this.onSuccess){this.onSuccess.call(null,transport);}}catch(e){if(XN.DEBUG_MODE){throw e;}}},_onComplete:function(obj){var transport=this.transport;try{if(this.onComplete){this.onComplete.call(null,transport);}}catch(e){if(XN.DEBUG_MODE){throw e;}}},onStateChange:function(){var transport=this.transport;if(transport.readyState==4){this._onComplete();if(transport.status==undefined||transport.status==0||(transport.status>=200&&transport.status<300)){if(this.useCache){XN.net.cache.add(this.url+encodeURIComponent(this.data),this.transport.responseText);}this._onSuccess();}else{(this.onError||this.onFailure||XN.func.empty).call(null,transport);}}}};if(XN.browser.IE){XN.net.xmlhttp.prototype.getTransport=function(w){if(w!==window){return w.getTransport();}try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){return new ActiveXObject("Microsoft.XMLHTTP");}};}else{XN.net.xmlhttp.prototype.getTransport=function(w){if(w!==window){return w.getTransport();}return new XMLHttpRequest();};}XN.NET=XN.Net=XN.net;XN.net.ajax=XN.net.xmlhttp;$extend(XN.net.xmlhttp.prototype,{get:function(url,data,onSuccess,params){this.url=url;this.data=data;this.onSuccess=onSuccess;$extend(this,params);this.send("get");},post:function(url,data,onSuccess,params){this.url=url;this.data=data;this.onSuccess=onSuccess;$extend(this,params);this.send("post");}});if(typeof Ajax=="undefined"){Ajax={};Ajax.Request=function(url,o){var p=o.parameters;o["url"]=url;o["data"]=p;delete o.parameters;return new XN.net.xmlhttp(o);};}XN.template={};XN.template.mediaPlayer=function(o){return['<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" width="'+(o.width||"352")+'" height="'+(o.height||"70")+'" >\n','<param name="autostart" value="'+(o.autostart||"1")+'" >\n','<param name="showstatusbar" value="'+(o.showstatusbar||"1")+'">\n','<param name="filename" value="'+o.filename+'">\n','<embed type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" ','flename="mp"','autostart="'+(o.autostart||"1")+'" showstatusbar="'+(o.showstatusbar||"1")+'" ','src="'+o.filename+'" width="'+(o.width||"352")+'" height="'+(o.height||"70")+'"></embed>'].join("");};XN.template.flashPlayer=function(o){return'<embed src="'+XN.ENV.staticRoot+"/swf/player.swf?url="+o.filename+"&Rwid="+(o.width||"450")+"&Autoplay="+(o.autostart||"1")+'" wmode="'+(o.wmode||"transparent")+'" loop="false" menu="false" quality="high" scale="noscale" salign="lt" bgcolor="#ffffff" width="'+(o.width||"450")+'" height="'+(o.height||"30")+'" align="middle" allowScriptAccess="'+(o.allowScriptAccess||"sameDomain")+'" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';};XN.template.flash=function(o){return'&nbsp;<embed src="'+o.filename+'" type="application/x-shockwave-flash" '+'width="'+(o.width||"320")+'" height="'+(o.height||"240")+'" allowFullScreen="true" wmode="'+(o.wmode||"transparent")+'" allowNetworking="'+(o.allowNetworking||"all")+'" allowScriptAccess="'+(o.allowScriptAccess||"sameDomain")+'"></embed>';};XN.Template=XN.TEMPLATE=XN.template;XN.namespace("util");XN.util.cache=function(params){$extend(this,params);this._cacheData=[];};XN.util.cache.prototype={cacheLength:null,_cacheData:null,isExist:function(key){return this.get(key);},add:function(key,value){if(!isUndefined(this.isExist(key))){return;}if(this.cacheLength&&this.cacheLength==this._cacheData.length){this._cacheData.shift();}this._cacheData.push({"key":key,"value":value});},get:function(key){for(var i=this._cacheData.length-1;i>=0;i--){if(this._cacheData[i].key==key){return this._cacheData[i].value;}}},clear:function(){this._cacheData=[];}};XN.UTIL=XN.Util=XN.util;XN.util.DS_JSON=function(p){$extend(this,p);};XN.util.DS_JSON.prototype={DS_TYPE:"JSON",url:null,queryParam:"query",attachParam:"",rootKey:null,method:"get",_request:null,query:function(v,callBack){var This=this;try{this._request.abort();}catch(e){}function parseDS_JSON(r){r=r.responseText;var pp;try{var rt=XN.JSON.parse(r);if(This.rootKey&&rt[This.rootKey]){pp=rt[This.rootKey];}else{pp=rt;}}catch(e){pp=[];}callBack(pp);}this._request=new XN.net.xmlhttp({url:this.url,data:this.queryParam+"="+encodeURIComponent(v)+"&"+this.attachParam,method:this.method,onSuccess:parseDS_JSON});}};XN.ui.DS_JSON=XN.util.DS_JSON;XN.util.DS_friends=function(p){var ds=new XN.util.DS_JSON(p);ds.queryParam="p";ds.rootKey="candidate";ds.net="";ds.group="";ds.param=XN.json.build(p.param||{});var limit=isUndefined(p.limit)?24:p.limit;ds.query=function(name,callBack){XN.log("start query");name=name.replace(/[^a-zA-Z\u0391-\uFFE5]/g,"");if(XN.string.isBlank(name)&&this.group==""&&this.net==""){callBack([]);return;}var p=['{"init":false,','"qkey":"'+this.qkey+'",','"uid":true,','"uname":true,','"uhead":true,','"limit":'+limit+",",'"param":'+this.param+",",'"query":"'+name+'",','"group":"'+this.group+'",','"net":"'+this.net+'"',"}"].join("");XN.util.DS_JSON.prototype.query.call(this,p,callBack);};return ds;};XN.ui.DS_friends=XN.util.DS_friends;XN.util.DS_Array=function(p){$extend(this,p);this.init();};XN.util.DS_Array.prototype={DS_TYPE:"array",data:null,searchKey:null,init:function(){var key=this.searchKey,index=this._index=[];XN.array.each(this.data,function(i,v){index.push(v[key]);});},query:function(v,callBack){callBack(this._search(v));},_search:function(v){var keys=this._index,data=this.data,rt=[],reg=new RegExp("^"+v,"i");XN.array.each(keys,function(i,v){if(reg.test(v)){rt.push(data[i]);}});return rt;}};XN.ui.DS_Array=XN.util.DS_Array;XN.util.DS_XHR=function(p){$extend(this,p);};XN.util.DS_XHR.prototype={url:null,queryParam:"query",_request:null,query:function(v,callBack){var This=this;try{this._request.abort();}catch(e){}function parseDS_XML(r){r=r.responseXML;var rt=[];function getResult(r){var tmp={};XN.array.each(r.childNodes,function(i,v){tmp[v.tagName.toLowerCase()]=v.firstChild.nodeValue;});return tmp;}try{var rs=r.getElementsByTagName("Result");XN.array.each(rs,function(i,v){rt.push(getResult(v));});}catch(e){rt=[];}callBack(rt);}this._request=new XN.net.xmlhttp({url:this.url,data:this.queryParam+"="+encodeURIComponent(v),onSuccess:parseDS_XML});}};XN.ui.DS_XHR=XN.util.DS_XHR;(function(){var funcs={};XN.util.hotKey={add:function(key,func,obj){key=String(key).toLowerCase();var ctrl=false;var alt=false;var shift=false;var _code=null;if(/^\d+$/.test(key)){_code=parseInt(key);}else{ctrl=/ctrl|ctr|c/.test(key);alt=/alt|a/.test(key);shift=/shift|s/.test(key);if(/\d+/.test(key)){_code=parseInt(/\d+/.exec(key)[0]);}else{_code=false;}}funcs[key]=funcs[key]||{};funcs[key][func]=function(e){e=e||window.event;code=e.keyCode;if(ctrl&&!e.ctrlKey){return;}if(alt&&!e.altKey){return;}if(shift&&!e.shiftKey){return;}if(_code&&code!==_code){return;}func.call(obj||null);XN.event.stop(e);};XN.event.addEvent(document,"keydown",funcs[key][func]);},del:function(key,func){key=String(key).toLowerCase();XN.event.delEvent(document,"keydown",funcs[key][func]);delete funcs[key][func];}};})();(function(){var id=0;XN.util.createObjID=function(){id++;return id;};})();XN.DO=XN.Do={};(function(){var currentAlert=null;var currentTimer=null;XN.DO.alert=function(message,title,type,X,Y,w,h,callBack){try{currentAlert.remove();}catch(e){}var params={type:"normal",width:400,button:"确定",callBack:XN.func.empty,autoHide:0,params:{addIframe:true}};if(!isString(message)){$extend(params,message);}if(isString(message)||arguments.length>1){var ars=arguments;XN.array.each(["message","title","type","X","Y","width","height","callBack"],function(i,v){if(ars[i]){params[v]=ars[i];}});}var dialog=new XN.ui.dialog(params.params).setType(params.type).setTitle(params.title||(params.type=="error"?"错误提示":"提示")).setBody(params.msg||params.message||"").setWidth(params.width).setHeight(params.height).setX(params.X).setY(params.Y).addButton({text:(params.yes||params.button),onclick:function(){dialog.setAutoHide(true);return true;}}).show();dialog.addEvent("hide",function(){params.callBack.call(dialog);});currentAlert=dialog;if(params.noFooter){dialog.footer.hide();}if(params.noHeader){dialog.header.hide();}try{dialog.getButton(params.button).focus();}catch(e){}if(params.autoHide){dialog.autoHide(params.autoHide);}return dialog;};var currentConfirm=null;XN.DO.confirm=function(message,title,callBack,yes,no,X,Y,w,h){try{currentConfirm.remove();}catch(e){}var params={type:"normal",width:400,yes:"确定",no:"取消",callBack:XN.func.empty,focus:null,params:{addIframe:true}};if(!isString(message)){$extend(params,message);}if(isString(message)||arguments.length>1){var ars=arguments;XN.array.each(["message","title","callBack","yes","no","X","Y","w","h"],function(i,v){if(ars[i]){params[v]=ars[i];}});}var dialog=new XN.ui.dialog(params.params).setType(params.type).setTitle(params.title||(params.type=="error"?"错误提示":"提示")).setBody(params.msg||params.message||"").setWidth(params.width).setHeight(params.height).setX(params.X).setY(params.Y).addButton({text:(params.submit||params.yes),onclick:function(){dialog.setAutoHide(true);return params.callBack.call(dialog,true);}}).addButton({text:(params.cancel||params.no),onclick:function(){dialog.setAutoHide(true);return params.callBack.call(dialog,false);}}).show();dialog.getButton(params.cancel||params.no).addClass("gray");if(params.focus=="submit"){params.focus=params.submit;}else{if(params.focus=="cancel"){params.focus=params.cancel;}}dialog.getButton(params.focus||params.submit||params.yes).focus();currentConfirm=dialog;return dialog;};XN.DO.showMessage=XN.DO.showMsg=function(msg,title,time){var dialog=XN.DO.alert({msg:msg,title:(title||"提示"),noFooter:true,autoHide:(time||2)});return dialog;};XN.DO.showError=function(msg,title,time){var dialog=XN.DO.alert({msg:msg,type:"error",title:(title||"错误提示"),noFooter:true,autoHide:(time||2)});return dialog;};})();XN.json={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},dateToString:function(d){function _zeroPad(v){return v<10?"0"+v:v;}return'"'+d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+'Z"';},stringToDate:function(str){if(XN.JSON._PARSE_DATE.test(str)){var d=new Date();d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return d;}},parse:function(str){return eval("("+str+")");},build:function(o,w,d){var m=XN.JSON._CHARS,str_re=XN.JSON._SPECIAL_CHARS,pstack=[];var _char=function(c){if(!m[c]){var a=c.charCodeAt();m[c]="\\u00"+Math.floor(a/16).toString(16)+(a%16).toString(16);}return m[c];};var _string=function(s){return'"'+s.replace(str_re,_char)+'"';};var _date=XN.JSON.dateToString;var _stringify=function(o,w,d){var t=typeof o,i,len,j,k,v,vt,a;if(t==="string"){return _string(o);}if(t==="boolean"||o instanceof Boolean){return String(o);}if(t==="number"||o instanceof Number){return isFinite(o)?String(o):"null";}if(o instanceof Date){return _date(o);}if(isArray(o)){for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null";}}pstack[pstack.length]=o;a=[];if(d>0){for(i=o.length-1;i>=0;--i){a[i]=_stringify(o[i],w,d-1)||"null";}}pstack.pop();return"["+a.join(",")+"]";}if(t==="object"){if(!o){return"null";}for(i=pstack.length-1;i>=0;--i){if(pstack[i]===o){return"null";}}pstack[pstack.length]=o;a=[];if(d>0){if(w){for(i=0,j=0,len=w.length;i<len;++i){if(typeof w[i]==="string"){v=_stringify(o[w[i]],w,d-1);if(v){a[j++]=_string(w[i])+":"+v;}}}}else{j=0;for(k in o){if(typeof k==="string"&&typeof o[k]!="undefined"){v=_stringify(o[k],w,d-1);if(v){a[j++]=_string(k)+":"+v;}}}}}pstack.pop();return"{"+a.join(",")+"}";}return undefined;};d=d>=0?d:1/0;return _stringify(o,w,d);}};XN.JSON=XN.Json=XN.json;(function(){writepipe=function(uin,nick){if(uin>0){var s=GetCookie("_pipe");if(s){s+=":";}SetCookie("_pipe",s+uin+":"+escape(nick),null,"/",""+XN.env.domain+"");}var wi_state=GetCookie("_wi");if("opening"==wi_state){}else{if("running"==wi_state){}else{SetCookie("_wi","opening",null,"/",XN.ENV.domain);window.wiw=window.open("http://"+XN.env.domain+"/webpager.do?toid="+uin,"_blank","height=600,width=650,resizable=yes,location=yes");if(window.wiw_checker){window.clearInterval(window.wiw_checker);}window.wiw_checker=window.setInterval(function(){if(window.wiw.closed){window.clearInterval(window.wiw_checker);SetCookie("_wi","",null,"/",XN.ENV.domain);}},1000);return true;}}try{if(window.wiw){window.wiw.focus();}}catch(e){}return false;};talkto=function(uin,nick,tiny,doing){try{var a=new ActiveXObject("xntalk.Application");if(a){a.openChat("",uin);return true;}}catch(e){}if(top.frames["imengine"].gPagerType==4){if(top.frames["imengine"].imHelper.isLoginUser()){var tabs=top.frames["imengine"].imui.chatTabs;tabs.onActivateWidget(uin,nick,tiny,doing);tabs.switchFocus(uin);return true;}}try{writepipe(uin,nick);}catch(e){}};jump_and_download=function(link){if(XN.BROWSER.IE){window.open(link,"download_window","toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0");window.focus();}};})();function GetCookieVal(_70){var _71=document.cookie.indexOf(";",_70);if(_71==-1){_71=document.cookie.length;}return unescape(document.cookie.substring(_70,_71));}function GetCookie(_72){var arg=_72+"=";var _74=arg.length;var _75=document.cookie.length;var i=0;while(i<_75){var j=i+_74;if(document.cookie.substring(i,j)==arg){return GetCookieVal(j);}i=document.cookie.indexOf(" ",i)+1;if(i==0){break;}}return null;}function SetCookie(_78,_79){var _7a=SetCookie.arguments;var _7b=SetCookie.arguments.length;var _7c=(_7b>2)?_7a[2]:null;var _7d=(_7b>3)?_7a[3]:null;var _7e=(_7b>4)?_7a[4]:null;var _7f=(_7b>5)?_7a[5]:false;document.cookie=_78+"="+escape(_79)+((_7c==null)?"":("; expires="+_7c.toGMTString()))+((_7d==null)?"":("; path="+_7d))+((_7e==null)?"":("; domain="+_7e))+((_7f==true)?"; secure":"");}var IMHack={};(function(){function css(ele,prop){for(i in prop){ele.style[i]=prop[i];}}function getElementsByClass(context,searchClass){return XN.DOM.getElementsByClassName(searchClass,context);}var fixedEle=null;var timer=null;var reLocation=function(){css(fixedEle,{visibility:"hidden"});clearTimeout(timer);timer=setTimeout(function(){css(fixedEle,{visibility:"visible"});fixedEle.className=fixedEle.className;},500);};IMHack.hackToolBar=function(){fixedEle=document.getElementById("wpiroot");css(fixedEle,{position:"absolute",right:0});$(window).addEvent("scroll",reLocation).addEvent("resize",reLocation);};IMHack.hackWidget=function(ele){var widget=ele.getElementsByTagName("div")[0];css(widget,{position:"absolute",bottom:"23px"});if(getElementsByClass(ele,"buddy-list").length>0){css(widget,{right:"-62px"});}else{if(getElementsByClass(ele,"notifications").length>0){css(widget,{right:"-31px"});}else{if(getElementsByClass(ele,"status-control").length>0){css(widget,{right:"-1px"});}else{if((/\bm-chat-button-chattab\b/.test(ele.className))){css(ele,{position:"relative"});css(getElementsByClass(ele,"m-chat-window")[0],{position:"absolute",right:"-2px",bottom:"23px"});}else{css(widget,{right:0});}}}}};})();if(XN.browser.Gecko){if(XN.string.getQuery("debug_mode")){XN.debug.on();}}(function(){var _is_loaded=false;window.render_jebe_ads=function(j){if(!window.ad_js_version){return;}XN.loadFile("http://jebe.xnimg.cn/"+ad_js_version+"/render.js",function(){render_jebe_ads_load(j);});};window.load_jebe_ads=function(s,r,reload){if(!s){return;}if(_is_loaded&&!reload){return;}_is_loaded=true;XN.dom.ready(function(){var p=XN.cookie.get("id");if(!p||XN.string.isBlank(p)){p="";}var src="http://shaft.jebe.renren.com/show?userid="+encodeURIComponent(p)+"&tt="+new Date().getTime();if(r){src+="&r="+r;}if(reload){src+="&reflush_new=1";}XN.loadFile({file:src,type:"js"});});};})();XN.USER=XN.user={};XN.USER.me=function(parameters){};currentUser={};XN.event.enableCustomEvent(currentUser);XN.USER.addFriendAction=function(p){this.config={commentLength:45,needComment:true,requestURI:"http://friend."+XN.env.domain+"/ajax_request_friend.do"};$extend(this.config,p);};XN.user.addFriendAction.prototype={getConfig:function(key){return this.config[key];},send:function(id,why,from,code,codeFlag){var code=code!=1?0:1;var codeFlag=codeFlag||"";var This=this;if(this.getConfig("needComment")){if(XN.STRING.isBlank(why)){this.fireEvent("checkError","您输入的信息不能为空");return;}}if(why.length>this.getConfig("commentLength")){this.fireEvent("checkError","您输入的信息不能超过"+this.getConfig("commentLength")+"个字符");return;}var data="id="+id+"&why="+why+"&codeFlag="+code+"&code="+codeFlag;this.fireEvent("beforePost");new XN.NET.xmlhttp({url:this.getConfig("requestURI")+"?from="+from,"data":data,onSuccess:function(r){r=r.responseText;if(isJSON(r)){var re=XN.JSON.parse(r);}else{re={result:-1};}if(re.result=="-1"){This.fireEvent("flagError");return;}This.fireEvent("success",id,r,from);if(!window.currentUser){return;}if(currentUser.fireEvent){currentUser.fireEvent("addFriendSuccess",id,r,from);}if(currentUser.onaddFriendSuccess){currentUser.onaddFriendSuccess(id,r);}},onError:function(){This.fireEvent("error",id,from);if(!window.currentUser){return;}currentUser.fireEvent("addFriendError",id,r,from);}});}};XN.EVENT.enableCustomEvent(XN.USER.addFriendAction.prototype);XN.dynamicLoad({file:"http://s.xnimg.cn/jspro/xn.app.addFriend.js",funcs:["showRequestFriendDialog"]});(function(){if(!XN.browser.IE){return;}var title="";XN.dom.ready(function(){title=document.getElementsByTagName("title")[0].innerHTML;});XN.event.addEvent(window,"load",function(){setTimeout(function(){document.title=title;},1000);});})();XN.namespace("ui");(function(){XN.ui.element={frame:null,iAmUIelement:true};XN.array.each(["addClass","delClass","show","hide","remove"],function(i,v){XN.ui.element[v]=function(){XN.element[v].apply(null,[this.frame].concat(XN.array.build(arguments)));};});XN.ui.container={container:null};XN.array.each(["addChild","delChild","setContent"],function(i,v){XN.ui.container[v]=function(){XN.element[v].apply(null,[this.container].concat(XN.array.build(arguments)));};});$extend(XN.ui.container,XN.ui.element);})();XN.UI=XN.Ui=XN.ui;XN.ui.Element=XN.ui.element;XN.ui.Content=XN.ui.container;(function(ns){var UI=XN.ui;var addEvent=XN.event.addEvent;var DEBUG=true;function log(s){if(DEBUG){XN.log(isString(s)?"xn.ui.button:"+s:s);}}ns.button=function(params){$extend(this,params);this.init();};ns.button.prototype=$extend({},UI.Element);ns.button.prototype.text=null;ns.button.prototype.className="";ns.button.prototype.disableClassName="gray";ns.button.prototype.init=function(){var This=this;var el;if(this.getConfig("el")){el=$(this.getConfig("el"));}else{el=$element("input");}this.frame=el;el.type="button";this.addClass("input-submit");this.addClass(this.getConfig("className"));this.setText(this.getConfig("text"));addEvent(el,"click",function(){if(This.onclick){This.onclick();}},false);};ns.button.prototype.getConfig=function(key){if(key=="el"){return this.id;}return this[key];};ns.button.prototype.getEl=function(){return this.frame;};ns.button.prototype.setText=function(text){this.text=text;this.getEl().value=text;};ns.button.prototype.disable=function(){var el=this.getEl();el.blur();el.disabled=true;el.addClass(this.getConfig("disableClassName"));};ns.button.prototype.enable=function(){var el=this.getEl();el.disabled=false;el.delClass(this.getConfig("disableClassName"));};ns.button.prototype.focus=function(){this.getEl().focus();};ns.button.prototype.blur=function(){this.getEl().blur();};})(XN.ui);(function(){var rl="realLeft",rt="realTop",ow="offsetWidth",oh="offsetHeight";XN.ui.fixPositionMethods={"1-1":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+"px";f.style.top=y+el[rt]()-p[rt]()+"px";},"1-2":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+"px";},"1-3":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";},"1-4":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+"px";f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";},"2-1":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+"px";},"2-2":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+"px";},"2-3":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";},"2-4":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";},"3-1":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";},"3-2":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";f.style.top=y+el[rt]()+el[oh]+"px";},"3-3":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";},"3-4":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";},"4-1":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";},"4-2":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";},"4-3":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";},"4-4":function(f,el,x,y,p){f.style.left=x+el[rl]()-p[rl]()+"px";f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";}};})();XN.ui.fixPositionElement=function(params){var This=this;this.config={tagName:"div",useIframeInIE6:true};$extend(this.config,params);var f,x,y;if(this.getConfig("id")){this.frame=f=$(this.getConfig("id"));x=f.realLeft();y=f.realTop();}else{if(this.getConfig("tagName")){this.frame=this.container=f=$element(this.getConfig("tagName"));}else{return;}}this.container=$element("div");this.frame.appendChild(this.container);XN.array.each(["alignWith","alignType","offsetX","offsetY","alignParent"],function(i,v){This[v]=This.getConfig(v)||This[v];});XN.element.setStyle(f,"position:absolute;z-index:10001;left:-9999px;top:-9999px");if(!$(this.alignParent)){this.alignParent=$(document.body);}$(this.alignParent).appendChild(this.frame);if((XN.browser.IE6&&this.getConfig("useIframeInIE6"))||this.getConfig("addIframe")){var iframe;this._iframe=iframe=$element("iframe");iframe.frameBorder=0;iframe.scrolling="no";iframe.setStyle("position:absolute;border:0px;left:0px;top:0px;z-index:-1;");if(XN.browser.Gecko){iframe.setAttribute("style","position:absolute;border:0px;left:0px;top:0px;z-index:-1;");}if(XN.browser.IE){iframe.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";}this.frame.appendChild(iframe);}if(XN.element.visible(f)){this.show();}f.style.display="block";};XN.ui.fixPositionElement.prototype=$extend({},XN.ui.container);$extend(XN.ui.fixPositionElement.prototype,{alignWith:null,alignType:"4-1",offsetX:0,offsetY:0,alignParent:"dropmenuHolder",left:null,top:null,_isShow:false,getConfig:function(key){return this.config[key];},setOffsetX:function(x){this.offsetX=x;this.refresh();return this;},setOffsetY:function(y){this.offsetY=y;this.refresh();return this;},setAlignType:function(t){this.alignType=t;this.refresh();return this;},setAlignParent:function(p){this.alignParent=p;$(this.alignParent).appendChild(this.frame);this.refresh();return this;},refresh:function(){if(this.visible()){this.show();}else{this.hide();}return this;},visible:function(){return this._isShow;},show:function(){this._isShow=true;this.frame.show();if(this.alignWith){this._moveToElement(this.alignWith);}else{var x=this.left===null?parseInt((($(this.alignParent).offsetWidth-this.frame.offsetWidth)/2),10):this.left;var y=this.top===null?XN.event.scrollTop()+200:this.top;this._moveToPosition(x,y);}if(this._iframe){try{this._iframe.style.height=this.frame.offsetHeight-2+"px";this._iframe.style.width=this.frame.offsetWidth+"px";}catch(e){}}return this;},hide:function(){this._isShow=false;var f=this.frame;f.style.left="-9999px";f.style.top="-9999px";return this;},moveTo:function(x,y){if(!x&&!y){return;}if(isNumber(x)){this.left=x;this.alignWith=null;}else{if(isString(x)||isElement(x)){this.alignWith=$(x);}}if(isNumber(y)){this.top=y;this.alignWith=null;}this.refresh();return this;},setX:function(x){this.moveTo(x);return this;},setY:function(y){this.moveTo(null,y);return this;},setIndex:function(i){this.frame.style.zIndex=i;return this;},_moveToElement:function(el){XN.ui.fixPositionMethods[this.alignType](this.frame,$(el),this.offsetX,this.offsetY,$(this.alignParent));},_moveToPosition:function(x,y){if(x){this.frame.style.left=x+"px";}if(y){this.frame.style.top=y+"px";}}});(function(){var fixProto=XN.ui.fixPositionElement.prototype;var Event=XN.event;XN.ui.dialog=function(params){var This=this;XN.ui.fixPositionElement.call(this,params);this.container=$element("div");this.frame.appendChild(this.container);if(this.getConfig("HTML")){this.setContent(this.getConfig("HTML"));}else{this.setContent(this.buildHTML());}this.dialogContainer=$("ui_dialog_container");this.header=$("ui_dialog_header");this.body=$("ui_dialog_body");this.footer=$("ui_dialog_footer");this.closeButton=$("ui_dialog_close");this.header.addChild=this.body.addChild=this.footer.addChild=function(s){XN.element.addChild(this,s);setTimeout(function(){This.refresh();},0);};this.dialogContainer.removeAttribute("id");this.header.removeAttribute("id");this.body.removeAttribute("id");this.footer.removeAttribute("id");this.closeButton.removeAttribute("id");if(this.getConfig("showCloseButton")){this.closeButton.show();XN.event.addEvent(this.closeButton,"click",function(){This.hide();});}this.frame.style.zIndex=10000;this.setWidth(this.getConfig("width")||400);if(this.getConfig("height")){this.setHeight(this.getConfig("height"));}XN.array.each(["header","body","footer"],function(i,v){if(This.getConfig(v)){This[v].setContent(This.getConfig(v));}});if(this.getConfig("type")){this.setType(this.getConfig("type"));}this._buttons=[];XN.event.addEvent(this.footer,"click",function(e){e=e||window.event;This._parseButtonEvent(e);});XN.util.hotKey.add("27",this._hotKeyEvent,this);if(this.getConfig("modal")){XN.dom.disable();}};XN.ui.dialog.prototype=$extend({},fixProto);$extend(XN.ui.dialog.prototype,{header:null,body:null,footer:null,_iframe:null,_buttons:null,buildHTML:function(){return['<table id="ui_dialog_container" style="width: 100%; height: 100%;" class="pop_dialog_table">',"<tbody>","<tr>",'<td class="pop_topleft"></td>','<td class="pop_border"></td>','<td class="pop_topright"></td>',"</tr>","<tr>",'<td class="pop_border"></td>','<td class="pop_content">','<h2><span id="ui_dialog_header"></span><a style="display:none;" class="close-button" id="ui_dialog_close" href="#nogo">关闭</a></h2>','<div class="dialog_content">','<div id="ui_dialog_body" class="dialog_body"></div>','<div id="ui_dialog_footer" class="dialog_buttons"></div>',"</div>","</td>",'<td class="pop_border"></td>',"</tr>","<tr>",'<td class="pop_bottomleft"></td>','<td class="pop_border"></td>','<td class="pop_bottomright"></td>',"</tr>","</tbody>","</table>"].join("");},getButton:function(text){var buttons=this._buttons;for(var i=buttons.length-1;i>=0;i--){if(buttons[i].text==text){return buttons[i];}}return null;},addButton:function(b){var o={text:b.text,_onclickForDialog:b.onclick};if(b.className){o.className=b.className;}var button=new XN.ui.button(o);button.frame.setAttribute("dialog","1");this._buttons.push(button);this.footer.addChild(button);return this;},delButton:function(b){if(isString(b)){b=this.getButton(b);}this.footer.delChild(b);return this;},_preventHide:false,preventHide:function(){this._preventHide=true;return this;},setAutoHide:function(boo){this._preventHide=!boo;return this;},_parseButtonEvent:function(e){var el=Event.element(e);if(el.tagName.toLowerCase()!=="input"||el.type!=="button"){return;}if(!el.getAttribute("dialog")){return;}var button=this.getButton(el.value);if(button&&button._onclickForDialog){button._onclickForDialog.call(this);}if(this._preventHide){this._preventHide=true;}else{this.hide();}},_hotKeyEvent:function(){this.hide();},setType:function(t){if(t=="normal"){this.frame.delClass("errorDialog");}else{if(t=="error"){this.frame.addClass("errorDialog");}}return this;},setWidth:function(w){if(!w){return this;}if(w=="auto"){this.frame.style.width="auto";this.dialogContainer.style.height="";this.dialogContainer.style.width="";this.width=this.frame.offsetWidth;}else{this.width=w;this.frame.style.width=w+"px";this.dialogContainer.style.height="100%";this.dialogContainer.style.width="100%";}this.refresh();return this;},setHeight:function(h){if(!h){return this;}this.hegith=h;this.frame.style.height=h+"px";this.refresh();return this;},resizeTo:function(w,h){this.setWidth(w);this.setHeight(h);return this;},clear:function(){this.header.setContent("");this.body.setContent("");this.footer.setContent("");this._buttons=[];return this;},setTitle:function(s){this.header.setContent(s);return this;},setBody:function(s){this.body.setContent(s);return this;},remove:function(){XN.util.hotKey.del("27",this._hotKeyEvent);XN.ui.element.remove.call(this);return this;},refresh:function(){if(this.visible()){fixProto.show.apply(this,arguments);}else{this.hide();}return this;},show:function(){this._clearHideTimer();fixProto.show.apply(this,arguments);this.fireEvent("show");return this;},hide:function(){this._clearHideTimer();fixProto.hide.apply(this,arguments);XN.dom.enable();this.fireEvent("hide");return this;},_hideTimer:null,_clearHideTimer:function(){if(this._hideTimer){clearTimeout(this._hideTimer);this._hideTimer=null;}},autoHide:function(t){var This=this;this._hideTimer=setTimeout(function(){This.hide();},t*1000);return this;}});XN.event.enableCustomEvent(XN.ui.dialog.prototype);})();XN.ui.panel=XN.ui.dialog;XN.ui.dialog.prototype.setHeader=function(h){if(h&&h!==""){this.header.addChild(h);}else{this.header.innerHTML="";}};XN.ui.dialog.prototype.setFooter=function(f){if(f&&f!==""){this.footer.addChild(f);}else{this.footer.innerHTML="";}};XN.ui.menu=function(params){var This=this;this.config={alignType:"4-1",barOnshowClass:"",tagName:"div",disalbeButtonClickEvent:true,fireOn:"click",keep:0.2,useIframeInIE6:true,effectTime:50};$extend(this.config,params);var frame;if(this.getConfig("text")){this.frame=frame=$element(this.getConfig("tagName"));frame.setContent(this.getConfig("text"));}else{if(this.getConfig("button")){this.frame=frame=$(this.getConfig("button"));}else{return false;}}this._alignType=this.getConfig("alignType");if(this.getConfig("menu")){$(this.getConfig("menu")).hide();this.menu=new XN.ui.fixPositionElement({id:this.getConfig("menu"),alignType:this._alignType,alignWith:this.getConfig("alignWith")||this.frame,addIframe:this.getConfig("addIframe"),useIframeInIE6:this.getConfig("useIframeInIE6")});this.container=this.menu.frame;this._canAddSubMenu=false;}else{var dt=$element("div");dt.hide();this.menu=new XN.ui.fixPositionElement({id:dt,alignType:this._alignType,alignWith:this.getConfig("alignWith")||this.frame,addIframe:this.getConfig("addIframe"),useIframeInIE6:this.getConfig("useIframeInIE6")});this.container=$element("div");this._menu.setContent(this.container);}this.menu.setIndex(10001);XN.event.addEvent(this.menu.frame,"click",function(e){e=e||window.event;This._frameOnClick(e);},false);this.menu.setOffsetX(this.getConfig("offsetX")||0);this.menu.setOffsetY(this.getConfig("offsetY")||0);var eventType=this.getConfig("event");if(eventType=="click"){XN.event.addEvent(this.frame,"click",function(e){This._buttonClick(e||window.event);});XN.event.addEvent(document,"click",function(e){This._documentClick(e||window.event);});}else{if(eventType=="mouseover"){XN.event.addEvent(this.frame,"mouseover",function(e){This._frameMouseOver(e||window.event);});if(this.getConfig("disalbeButtonClickEvent")){XN.event.addEvent(this.frame,"onclick",function(e){XN.event.stop(e||window.event);});}XN.event.addEvent(this.frame,"mouseleave",function(){This._buttonMouseLeave();});XN.event.addEvent(this.menu.frame,"mouseleave",function(){This._menuMouseLeave();});XN.event.addEvent(this.menu.frame,"mouseover",function(){This._mouseOverMenu=true;});}else{if(eventType=="manual"){}}}XN.event.addEvent(window,"resize",function(){This.menu.refresh();});this.hide();};XN.ui.menu.prototype=$extend({},XN.ui.container);$extend(XN.ui.menu.prototype,{isShow:true,menu:null,_alignType:null,_button:null,_canAddSubMenu:true,_delayTimer:null,_mouseOverMenu:false,_mouseOverButton:false,_clearTimer:function(){if(this._delayTimer){clearTimeout(this._delayTimer);this._delayTimer=null;}},_buttonClick:function(e){XN.event.stop(e);if(this.isShow){this.hide();}else{this.show();}},_documentClick:function(e){this.hide();},_frameOnClick:function(e){var This=this;var el=XN.event.element(e);var tag=el.tagName.toLowerCase();if(tag=="a"){return true;}if((tag=="input"&&(el.type=="radio"||el.type=="checkbox"))||tag=="label"){this.isShow=false;setTimeout(function(){This.isShow=true;},20);return true;}while(el!=this.menu.frame&&el.tagName&&el.tagName.toLowerCase()!="a"){el=el.parentNode;}if(el.tagName.toLowerCase()=="a"){return true;}XN.event.stop(e);},_frameMouseOver:function(e){var This=this;this._mouseOverButton=true;this._clearTimer();var delay=this.getConfig("delay");if(delay){this._delayTimer=setTimeout(function(){if(This._mouseOverButton){This.show();}},delay*1000);}else{This.show();}XN.event.stop(e);},_buttonMouseLeave:function(){var This=this;this._mouseOverButton=false;this._clearTimer();setTimeout(function(){if(!This._mouseOverMenu){This.hide();}},this.getConfig("effectTime"));},_menuMouseLeave:function(){var This=this;this._mouseOverMenu=false;this._clearTimer();setTimeout(function(){if(!This._mouseOverButton){This.hide();}},this.getConfig("effectTime"));},getConfig:function(key){var patch={"hoverClass":"barOnshowClass","event":"fireOn","button":"bar","delay":"keep"};if(patch[key]){return this.config[key]||this.config[patch[key]];}return this.config[key];},show:function(){if(this.isShow){return this;}this.menu.show();this.frame.addClass(this.getConfig("hoverClass"));this.onShow();this.isShow=true;return this;},setWidth:function(w){this.menu.frame.style.width=w+"px";this.menu.refresh();return this;},hide:function(){if(!this.isShow){return this;}this.menu.hide();this.frame.delClass(this.getConfig("hoverClass"));this.isShow=false;this.onHide();return this;},refresh:function(){if(this.isShow){this.menu.show();}return this;},onShow:XN.func.empty,onHide:XN.func.empty});XN.event.enableCustomEvent(XN.ui.menu.prototype);XN.ui.autoComplete=function(p){var This=this;this.config=this.config||{};$extend(this.config,{inputTip:null,searchDelay:0.2,DS:null,enableCache:true,maxCache:10});$extend(this.config,p);if(this.getConfig("enableCache")){this.cache=new XN.util.cache({cacheLength:this.getConfig("maxCache")});}if(this.getConfig("input")){var input=this.input=$(this.getConfig("input"));}else{var input=this.input=$element("input");input.type="text";input.addClass("input-text");}this.frame=input;XN.event.addEvent(input,"focus",function(e){This._startCheck();This.fireEvent("focus");});XN.event.addEvent(input,"blur",function(e){This._endCheck();This.fireEvent("blur");});this.addEvent("focus",function(){var v=this.input.value;if(v==""||v==this.getConfig("inputTip")){this.fireEvent("noinput");}});this.addEvent("blur",function(){this._lastInput=null;});XN.event.addEvent(input,"click",function(e){XN.event.stop(e||window.event);});XN.event.addEvent(input,"keydown",function(e){This._userInput=true;e=e||window.event;if(e.keyCode==13){XN.event.stop(e);}This.fireEvent("keydown",e);});input.setAttribute("AutoComplete","off");this.DS=this.getConfig("DS");};XN.ui.autoComplete.prototype=$extend({},XN.ui.element);$extend(XN.ui.autoComplete.prototype,{input:null,cache:null,_userInput:false,_lastInput:null,getConfig:function(key){if(key=="input"){return this.config["input"]||this.config["id"];}return this.config[key];},_startCheck:function(){var This=this;this._inputTimer=setInterval(function(){if(This._userInput){This._userInput=false;return;}This._checkInput();},this.getConfig("searchDelay")*1000);},_endCheck:function(){clearInterval(this._inputTimer);this._inputTimer=null;},_checkInput:function(){var This=this;var cv=this.input.value;if(XN.string.isBlank(cv)){if(this._lastInput===""){return;}this._lastInput="";this.fireEvent("noinput");return;}if(cv==this._lastInput){return;}this._lastInput=cv;this.fireEvent("searchbegin");if(this.cache){var result=this.cache.get(cv);if(result){this.fireEvent("searchover",result);return;}}if(!this.DS){XN.log("no ds");this.fireEvent("NO_DS");return;}this.DS.query(cv,function(r){if(This.cache){This.cache.add(cv,r);}This.fireEvent("searchover",r);});}});XN.event.enableCustomEvent(XN.ui.autoComplete.prototype);(function(){var completeMenus={};getCompleteMenu=function(id){return completeMenus[id];};XN.ui.autoCompleteMenu=function(p){var This=this;this._MID=XN.util.createObjID();completeMenus[this._MID]=this;this.config=this.config||{};$extend(this.config,{ulClassName:"",liClassName:"",liHoverClass:"m-autosug-hover",aClassName:"",noResult:"没有匹配结果",dataLoading:"正在加载数据...",noInput:null,autoSelectFirst:false});XN.ui.autoComplete.call(this,p);var input=this.input;var m=$element("div");m.innerHTML=this.getConfig("wrapper")||this._wrapper();this._menuList=m.firstChild;this._ul=this._menuList.getElementsByTagName("ul")[0];this.menu=new XN.ui.menu({button:input,menu:this._menuList,fireOn:"manual"});this.addEvent("keydown",this._inputOnkeydown);XN.event.addEvent(this._ul,"mousedown",function(e){This._menuOnclick(e||window.event);});XN.event.addEvent(input,"blur",function(){This.menu.hide();});this.menu.hide();this.addEvent("noinput",function(){var tip=this.getConfig("noInput");if(!tip){this.menu.hide();return;}this._ul.innerHTML="<li>"+tip+"</li>";this.menu.show();});this.addEvent("NO_DS",function(){var tip=this.getConfig("dataLoading");this._ul.innerHTML="<li>"+tip+"</li>";this.menu.show();});this.addEvent("searchover",this._buildMenu);};XN.ui.autoCompleteMenu.prototype=$extend({},XN.ui.autoComplete.prototype);$extend(XN.ui.autoCompleteMenu.prototype,{menu:null,_menuList:null,_ul:null,_currentLi:null,_highlightMenuItem:function(li){if(li==this._currentLi){return;}var hoverClass=this.getConfig("liHoverClass");if(this._currentLi!==null){XN.element.delClass(this._currentLi,hoverClass);}XN.element.addClass(li,hoverClass);this._currentLi=li;var aid=this._currentLi.getAttribute("aid");if(aid){this.fireEvent("highlight",this.result[parseInt(aid)]);}},_inputOnkeydown:function(event){var li;if(event.keyCode==13){if(this.menu.isShow&&this._currentLi){var aid=this._currentLi.getAttribute("aid");if(aid){this._selectMenuItem(parseInt(aid));}}return false;}if(event.keyCode==38){if(this._currentLi&&this._currentLi.previousSibling){li=this._currentLi.previousSibling;}else{li=this._ul.lastChild;}this._highlightMenuItem(li);return false;}if(event.keyCode==40){if(this._currentLi&&this._currentLi.nextSibling){li=this._currentLi.nextSibling;}else{li=this._ul.firstChild;}this._highlightMenuItem(li);return false;}return true;},_menuOnclick:function(event){var el=XN.event.element(event);while(el&&el.tagName&&el.tagName.toLowerCase()!=="li"){el=el.parentNode;}if(!el||el.nodeType!==1||!el.getAttribute("aid")){return false;}this._selectMenuItem(parseInt(el.getAttribute("aid")));return false;},_menuOnmouseover:function(event){var el=XN.event.element(event);if(el.parentNode==$("dropmenuHolder")){return;}while(el&&el.tagName&&el.tagName.toLowerCase()!=="li"){el=el.parentNode;}if(!el||el.nodeType!==1||!el.getAttribute("aid")){return false;}this._highlightMenuItem(el);return false;},_selectMenuItem:function(id){this.menu.hide();this.input.focus();this.fireEvent("select",this.result[id]);this._lastInput=this.input.value;},_buildMenu:function(result){var This=this;this.result=result;if(result.length==0){var noResult=this.getConfig("noResult");if(isFunction(noResult)){noResult=noResult.call(this);}this._ul.innerHTML="<li>"+noResult+"</li>";this.menu.show();this._currentLi=null;return;}var lis=[];lis.push(this.firstMenuItem());var len=result.length-1;XN.array.each(result,function(i,v){lis.push('<li onmouseover="getCompleteMenu('+This._MID+')._highlightMenuItem(this);" aid="'+i+'">'+This.buildMenu(v)+"</li>");});lis.push(this.lastMenuItem());this._ul.innerHTML=lis.join("");if(this.getConfig("autoSelectFirst")){this._highlightMenuItem(this._ul.firstChild);}this.menu.show();},firstMenuItem:function(){return"";},lastMenuItem:function(){return"";},buildMenu:function(r){return"<li>"+r.name+"</li>";},setMenuWidth:function(w){this.menu.setWidth(w);}});XN.ui.autoCompleteMenu.prototype._wrapper=function(){return['<div class="m-autosug">','<span class="x1">','<span class="x1a"></span>',"</span>",'<span class="x2">','<span class="x2a"></span>',"</span>",'<div class="m-autosug-minwidth">','<div class="m-autosug-content">',"<ul></ul>","</div>","</div>","</div>"].join("");};})();XN.ui.friendSelector=function(params){var This=this;this.config=this.config||{};$extend(this.config,{getFriendsUrl:"http://browse."+XN.env.domain+"/getfriendsajax.do?s=1",url:"http://browse."+XN.env.domain+"/friendsSelector.do",param:{}});XN.ui.autoCompleteMenu.call(this,params);this.addEvent("select",function(r){this.input.value=r.name;if(this.onSelectOne){this.onSelectOne(r);}});this.buildMenu=function(r){return r.name;};this.addEvent("focus",function(){if(this._ready){return;}if(this._isLoading){return;}this.loadFriends();});};XN.ui.friendSelector.prototype=$extend({},XN.ui.autoCompleteMenu.prototype);$extend(XN.ui.friendSelector.prototype,{_isLoading:false,_ready:false,isReady:function(){return this._ready;},isLoading:function(){return this._isLoading;},loadFriends:function(r){if(this.isLoading()){return;}this._isLoading=true;var This=this;var p={};p["init"]=true;p["uid"]=false;p["uhead"]=false;p["uname"]=false;p["group"]=false;p["net"]=false;p["param"]=this.getConfig("param");new XN.NET.xmlhttp({useCache:true,url:this.getConfig("url"),method:"get",data:"p="+XN.JSON.build(p),onSuccess:function(r){r=XN.JSON.parse(r.responseText);This._onload(r);}});},_onload:function(r){this.isLoading=false;this._ready=true;this.config.qkey=r.qkey;this.DS=new XN.util.DS_friends({url:this.getConfig("url"),qkey:this.getConfig("qkey"),limit:this.getConfig("limit")});}});XN.ui.friendSelectorSynchronous=function(a,b){function s(id,ac,v){if(isObject(id)){id=id.id;}if(v.isReady()){try{v[ac](id);}catch(e){}}else{v.addEvent("load",function(){try{v[ac](id);}catch(e){}});v.loadFriends();}}a.addEvent("select",function(id){s(id,"select",b);});a.addEvent("deselect",function(id){s(id,"deselect",b);});b.addEvent("select",function(id){s(id,"select",a);});b.addEvent("deselect",function(id){s(id,"deselect",a);});};(function(){XN.ui.multiFriendSelector=function(params){var This=this;this._ID=XN.util.createObjID();this.config=this.config||{};$extend(this.config,{inputName:"ids",nameInputName:"names",url:"http://browse."+XN.env.domain+"/friendsSelector.do",initParam:{},param:{},noInput:false,maxNum:-1});$extend(this.config,params);this.frame=$element("div");var div=$element("div");div.hide();document.body.appendChild(div);div.appendChild(this.frame);this.frame.innerHTML=['<div id="'+this.getID("friendsContainer")+'" class="tokenizer friendAutoSelector">','<span class="tokenizer_stretcher">^_^</span>','<span class="tab_stop"><input/></span>','<span id="'+this.getID("inputContainer")+'" class="tokenizer_input"><input id="'+this.getID("input")+'" type="text" /></span>',"</div>",'<div class="float-right" id="'+this.getID("menu")+'"></div>'].join("");this.input=this.getEl("input");this.menuContainer=this.getEl("menu");XN.event.addEvent(this.getEl("friendsContainer"),"click",function(e){This._parseClickEvent(e||window.event);});this.autoComplete=new XN.ui.friendSelector({id:this.input,inputTip:"输入好友姓名...",autoSelectFirst:true,url:this.getConfig("url"),param:this.getConfig("param")});this.autoComplete.loadFriends=function(r){if(this.isLoading()){return;}this._isLoading=true;var p={};p["init"]=true;p["uid"]=true;p["uhead"]=false;p["uname"]=true;p["group"]=false;p["net"]=false;$extend(p,This.getConfig("initParam"));p["param"]=this.getConfig("param");new XN.NET.xmlhttp({useCache:true,url:this.getConfig("url"),method:"get",data:"p="+XN.JSON.build(p),onSuccess:function(r){r=XN.JSON.parse(r.responseText);This._allFriends=r.candidate;This.fireEvent("load");This.autoComplete._onload(r);}});};this.autoComplete.buildMenu=function(r){return"<p>"+r.name+"</p>";};this.autoComplete.setMenuWidth(129);this.autoComplete.addEvent("keydown",function(e){This._onInputKeydown(e);});this.autoComplete.addEvent("select",function(r){XN.log(this.input);this.input.value="";This.selectFriend(r);});if(this.getConfig("noInput")){this.input.hide();}this.fireEvent("init");};var proto=XN.ui.multiFriendSelector.prototype=$extend({},XN.ui.element);$extend(proto,{isReady:function(){return this.autoComplete.isReady();},isLoading:function(){return this.autoComplete.isLoading();},loadFriends:function(){this.autoComplete.loadFriends();},getUserByID:function(id){id=String(id);var rt=null;XN.array.each(this._allFriends,function(i,v){if(String(v.id)==id){rt=v;return false;}});return rt;},getConfig:function(key){if(key=="inputName"){return this.config["idInputName"]||this.config["inputName"];}return this.config[key];},getID:function(id){return"mfs_"+this._ID+id;},getFriendID:function(id){return this.getID("friend_"+id);},getFriendEl:function(id){return $(this.getFriendID(id));},getEl:function(id){return $(this.getID(id));},getFriendsNum:function(){return this.getEl("friendsContainer").getElementsByTagName("a").length;},getSelectedFriends:function(){var rt=[];var a=XN.array.build(this.getEl("friendsContainer").getElementsByTagName("a"));XN.array.each(a,function(i,v){rt.push(v.getAttribute("uid")+"");});return rt;},reset:function(){this.deselectAll();},deselectAll:function(){var els=XN.array.build(this.getEl("friendsContainer").getElementsByTagName("a"));XN.array.each(els,function(i,v){XN.element.remove(v);});this.fireEvent("deselectAll",this.getIds());},selectFriends:function(fs){var This=this;XN.array.each(fs,function(i,v){This.select(v);});},deselectFriends:function(fs){var This=this;XN.array.each(fs,function(i,v){This.deselect(v);});},select:function(o){if(isUndefined(o)){return;}XN.log("mfs select:");XN.log(o);var maxNum=this.getConfig("maxNum");if(maxNum!==-1){if(this.getFriendsNum()==maxNum){this.fireEvent("overMaxNum",maxNum);return;}}if(isString(o)||isNumber(o)){o={id:o,name:this.getUserByID(o).name};}if(this.getFriendEl(o.id)){return;}this.getEl("friendsContainer").insertBefore(this.createFriendHTML(o.id,o.name),this.getEl("inputContainer"));this.fireEvent("select",o.id);},deselect:function(uid){if(!this.getFriendEl(uid)){return;}this.getFriendEl(uid).remove();this.fireEvent("deselect",uid);},_parseClickEvent:function(e){var el=XN.event.element(e);XN.event.stop(e);if(el&&el.getAttribute("action")){this.deselectFriend(el.getAttribute("uid"));}},createFriendHTML:function(uid,uname){var a=$element("a");a.id=this.getFriendID(uid);a.setAttribute("uid",uid);a.href="#nogo";a.className="token";a.tabindex="-1";a.innerHTML=['<span>\n<span>\n<span>\n<span>\n<input type="hidden" value="',uid,'" name="',this.getConfig("inputName"),'" />\n','<input type="hidden" value="',uname,'" name="',this.getConfig("nameInputName"),'" />\n',uname,'<span uid="',uid,'" action="x" class="x" onmouseout="this.className=\'x\'" onmouseover="this.className=\'x_hover\'" >\n</span>\n</span>\n</span>\n</span>\n</span>'].join("");return a;},_onInputKeydown:function(event){var i=this.getEl("inputContainer"),pa=i.previousSibling,na=i.nextSibling,input=this.input,c=this.getEl("friendsContainer");if(event.keyCode==8&&this.input.value==""){if(pa){this.deselectFriend(pa.getAttribute("uid"));}return true;}else{if(event.keyCode==37&&this.input.value==""){if(pa&&pa.tagName.toLowerCase()=="a"){i.parentNode.removeChild(i);c.insertBefore(i,pa);setTimeout(function(){input.focus();},0);}return true;}else{if(event.keyCode==39&&this.input.value==""){if(na&&na.tagName.toLowerCase()=="a"){i.parentNode.removeChild(i);XN.dom.insertAfter(i,na);setTimeout(function(){input.focus();},0);}return true;}}}return false;}});XN.event.enableCustomEvent(proto);proto.deSelectAll=proto.deselectAll;proto.deSelectFriend=proto.deselectFriend=proto.deselect;proto.selectFriend=proto.select;proto.getSelectedFriendsID=proto.getSelectedFriends;proto.getIds=proto.getSelectedFriends;})();XN.ui.friendSelectorWithMenu=function(p){var selector=new XN.ui.friendSelector(p);var menu=new XN.ui.friendSelectorMenu({url:selector.getConfig("url"),param:selector.getConfig("param"),multi:false,alignType:p.alignType,offsetX:p.offsetX,offsetY:p.offsetY});var div=$element("div");div.addChild(selector);div.addChild(menu);selector.frame=div;selector.addEvent("focus",function(){menu.menu.hide();});menu.addEvent("select",function(p){var This=this;setTimeout(function(){This.menu.hide();},30);selector.fireEvent("select",this.getUserByID(p));});menu.menu.menu.setOffsetY(9);return selector;};XN.ui.multiFriendSelectorWithMenu=function(p){var selector=new XN.ui.multiFriendSelector(p);var menu=new XN.ui.friendSelectorMenu({url:selector.getConfig("url"),param:selector.getConfig("param"),multi:true});menu.addEvent("submit",function(){menu.menu.hide();});selector.menuContainer.setContent(menu);XN.ui.friendSelectorSynchronous(selector,menu);return selector;};(function(ns){var DEBUG=false;var addEvent=XN.event.addEvent;var log=function(s){if(DEBUG){XN.log(isString(s)?"ui.tabView:"+s:s);}return s;};ns.tabView=function(params){this.config={selectedClass:"select",event:"click",alwaysReload:false,mouseOverDelay:0.2};$extend(this.config,params);this.init();};ns.tabView.prototype={_tabs:null,_currentTab:null,_idPre:null,_tabIndex:0,init:function(){this._idPre=XN.util.createObjID();this._tabs=[];},getConfig:function(key){if(key=="activeClass"){return this.config["activeClass"]||this.config["selectedClass"];}return this.config[key];},_getID:function(el){log("_getID start");log("param:");log(el);if(isString(el)){return log(el);}if(el.id){return log(el.id);}log("do not have id");this._tabIndex++;el.setAttribute("id","tabview_"+this._idPre+"_"+this._tabIndex);return log(el.id);},_getTab:function(id){log("_getTab start");log("param:id");log(id);if(!id){return log(id);}if(id.label){return log(id);}var key=this._getID(id);log("key:"+key);var tabs=this._tabs;log("all tabs");log(tabs);for(var i=tabs.length-1;i>=0;i--){if(tabs[i].key==key){log("_getTab end");return log(tabs[i]);}}log("_getTab end");return log(null);},getCurrentTab:function(){return this._getTab(this._currentTab);},setCurrentTab:function(tab,forceReload){log("setCurrentTab start");var oldC=this.getCurrentTab();var nowC=this._getTab(tab);log("old current:");log(oldC);log("now current:");log(nowC);if(oldC&&oldC.key==nowC.key&&!forceReload){return;}if(oldC){this._deactiveTab(oldC);}this._activeTab(nowC);this._setCurrentTab(nowC);log("setCurrentTab end");this.fireEvent("change",nowC);return this;},reset:function(){var tab=this.getCurrentTab();if(tab){this._deactiveTab(tab);}this._setCurrentTab(null);return this;},_activeTab:function(tab){log("_activeTab:");log(tab);tab.getEl("label").addClass(this.getConfig("activeClass"));if(tab.content){tab.getEl("content").show();}tab.onActive(tab);log("_activeTab end");},_deactiveTab:function(tab){if(tab.getEl("label")){tab.getEl("label").delClass(this.getConfig("activeClass"));}if(tab.content){tab.getEl("content").hide();}tab.onInactive(tab);},_setCurrentTab:function(tab){log("_setCurrentTab start");tab=this._getTab(tab);log("currentTab:");log(tab);this._currentTab=tab?tab.key:null;log("this._currentTab");log(this._currentTab);log("_setCurrentTab end");},addTab:function(t){log("addTab start");log("params:");log(t);var This=this;var tab={onActive:XN.func.empty,onClick:XN.func.empty,onInactive:XN.func.empty,onInit:XN.func.empty,getEl:function(key){return $(this[key]);},active:false};t.label=this._getID(t.label);log("get label id:"+t.label);t.key=t.key||t.label;log("get key:"+t.key);if(t.content){t.content=this._getID(t.content);log("get content id:"+t.content);}$extend(tab,t);this._tabs.push(tab);log("all tabs");log(this._tabs);if(tab.active&&this._currentTab===null){if(tab.content){tab.getEl("content").show();}tab.getEl("label").addClass(this.getConfig("activeClass"));this._setCurrentTab(tab);}else{if(tab.content){tab.getEl("content").hide();}}var ev=this.getConfig("event");if(ev=="click"){addEvent(tab.getEl("label"),"click",function(e){e=e||window.event;XN.event.stop(e);This._eventHander(e,tab.getEl("label"));},false);}else{if(ev=="mouseover"){var isMouseOn=true;var timer=null;addEvent(tab.getEl("label"),"mouseover",function(e){var el=this;isMouseOn=true;timer=setTimeout(function(){if(!isMouseOn){return;}e=e||window.event;This._eventHander(e,tab.getEl("label"));},This.getConfig("mouseOverDelay")*1000);},false);addEvent(tab.getEl("label"),"mouseleave",function(e){isMouseOn=false;if(timer){clearTimeout(timer);}},false);}}tab.onInit(tab);log("addTab end");return this;},_eventHander:function(e,el){log("on click,el:");log(el);log("get tab form by el:");var tab=this._getTab(el);if(this.getConfig("alwaysReload")){this.setCurrentTab(tab,true);}else{this.setCurrentTab(tab);}tab.onClick(e,tab);},refresh:function(){this._activeTab(this.getCurrentTab());return this;},showTab:function(id,forceReload){this.setCurrentTab(id,forceReload);},hideAll:function(){this.reset();}};XN.event.enableCustomEvent(ns.tabView.prototype);})(XN.ui);XN.ui.refreshAll=function(){document.body.style.zoom=1.1;document.body.style.zoom=1;};XN.effect={fadeIn:function(element,callBack){if(element.fadetimer){return;}callBack=callBack||XN.FUNC.empty;var op=0;element.setOpacity(0);element.style.display="";element.fadetimer=setInterval(function(){XN.Element.setOpacity(element,(op+=0.2));if(op>=1){clearInterval(element.fadetimer);element.fadetimer=null;callBack(element);}},60);},fadeOut:function(element,callBack){if(element.fadetimer){return;}callBack=callBack||XN.FUNC.empty;var op=1;element.setOpacity(1);element.fadetimer=setInterval(function(){XN.Element.setOpacity(element,(op-=0.2));if(op<=0){clearInterval(element.fadetimer);element.fadetimer=null;callBack(element);element.setOpacity(1);}},60);},gradient:function(element,r,g,b,callBack){if(element.gradientTimer){return;}callBack=callBack||XN.FUNC.empty;element.style.backgroundColor="#fff";element.style.backgroundColor="rgb("+r+","+g+","+b+")";element.gradientTimer=setInterval(function(){b+=10;element.style.backgroundColor="rgb("+r+","+g+","+(b>255?255:b)+")";if(b>255){clearInterval(element.gradientTimer);element.gradientTimer=null;callBack(element);}},60);},slideOpen:function(element){if(element.slidetimer){return;}if(!element.slideHeight){var _position=element.getStyle("position");element.setStyle("position:absolute;left:-99999px;top:-99999px;");element.show();element.slideHeight=element.offsetHeight;element.hide();element.setStyle("position:"+_position+";left:auto;top:auto;");}var eh=element.slideHeight,h=0;var step=parseInt(eh/10);element.style.height="0px";element.style.display="";element.style.overflow="hidden";element.slidetimer=setInterval(function(){element.style.height=(h+=step)+"px";if(h>=eh){clearInterval(element.slidetimer);element.slidetimer=null;element.style.height=eh;element.style.overflow=element.slideOverflow;}},50);},slideClose:function(element){if(element.slidetimer){return;}var eh=element.offsetHeight,h=eh;element.slideHeight=eh;element.slideOverflow=element.getStyle("overflow");element.style.overflow="hidden";var step=parseInt(eh/10);element.slidetimer=setInterval(function(){element.style.height=(h-=step)+"px";if(h<=0){clearInterval(element.slidetimer);element.slidetimer=null;element.style.display="none";element.style.height=eh;element.style.overflow=element.slideOverflow;}},50);},scrollTo:function(element,speed,callBack){if(element.scrolltimer){return;}speed=speed||10;callBack=callBack||XN.FUNC.empty;var d=element.realTop();var i=XN.EVENT.winHeight();var h=document.body.scrollHeight;var a=XN.EVENT.scrollTop();var offsetTop=null;if(d>a){if(d+element.offsetHeight<i+a){return;}element.scrolltimer=setInterval(function(){a+=Math.ceil((d-a)/speed)||1;window.scrollTo(0,a);if(a==d){clearInterval(element.scrolltimer);element.scrolltimer=null;}},10);}else{element.scrolltimer=setInterval(function(){a+=Math.ceil((d-a)/speed)||-1;window.scrollTo(0,a);if(a==d){clearInterval(element.scrolltimer);element.scrolltimer=null;}},10);}}};XN.EFFECT=XN.Effect=XN.effect;(function(scope){var Tween={linear:function(t,b,c,d){return c*t/d+b;},easeIn:function(t,b,c,d){return c*(t/=d)*t+b;},easeOut:function(t,b,c,d){return -c*(t/=d)*(t-2)+b;},easeBoth:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t+b;}return -c/2*((--t)*(t-2)-1)+b;},easeInStrong:function(t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutStrong:function(t,b,c,d){return -c*((t=t/d-1)*t*t*t-1)+b;},easeBothStrong:function(t,b,c,d){if((t/=d/2)<1){return c/2*t*t*t*t+b;}return -c/2*((t-=2)*t*t*t-2)+b;},elasticIn:function(t,b,c,d,a,p){if(t===0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return -(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},elasticOut:function(t,b,c,d,a,p){if(t===0){return b;}if((t/=d)==1){return b+c;}if(!p){p=d*0.3;}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},elasticBoth:function(t,b,c,d,a,p){if(t===0){return b;}if((t/=d/2)==2){return b+c;}if(!p){p=d*(0.3*1.5);}if(!a||a<Math.abs(c)){a=c;var s=p/4;}else{var s=p/(2*Math.PI)*Math.asin(c/a);}if(t<1){return -0.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;}return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*0.5+c+b;},backIn:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*(t/=d)*t*((s+1)*t-s)+b;},backOut:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},backBoth:function(t,b,c,d,s){if(typeof s=="undefined"){s=1.70158;}if((t/=d/2)<1){return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;}return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},bounceIn:function(t,b,c,d){return c-Tween["bounceOut"](d-t,0,c,d)+b;},bounceOut:function(t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else{if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}}}return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;},bounceBoth:function(t,b,c,d){if(t<d/2){return Tween["bounceIn"](t*2,0,c,d)*0.5+b;}return Tween["bounceOut"](t*2-d,0,c,d)*0.5+c*0.5+b;}};var _Tweening=function(){customEvent(this.onTweening,this);if(this.current>=this.frames){this.stop();customEvent(this.onComplete,this);this.tweening=false;return;}this.current++;};var customEvent=function(func,scope){var args=Array.prototype.slice.call(arguments);args=args.slice(2);if(typeof func=="function"){try{return func.apply(scope||this,args);}catch(e){scope.errors=scope.errors||[];scope.errors.push(e);}}};scope.Motion=function(tween,duration){this.duration=duration||1000;this.tween=tween||"linear";};scope.Motion.getTweens=function(){return Tween;};scope.Motion.prototype={init:function(){customEvent(this.onInit,this);this.fps=this.fps||35;this.frames=Math.ceil((this.duration/1000)*this.fps);if(this.frames<1){this.frames=1;}var f=("function"==typeof this.tween)?this.tween:Tween[this.tween]||Tween["linear"];this.equation=function(from,to){return f((this.current/this.frames)*this.duration,from,to-from,this.duration);};this.current=this.tweening=1;},start:function(){this.init();customEvent(this.onStart,this);var _self=this,d=this.duration/this.frames;this.timer=setInterval(function(){_Tweening.call(_self);},d);},stop:function(){if(this.timer){clearInterval(this.timer);}this.tweening=false;}};})(XN.effect);XN.ui.getHiddenDiv=function(){if(!this._hiddenDiv){this._hiddenDiv=$element("div").hide();document.body.appendChild(this._hiddenDiv);}return this._hiddenDiv;};XN.ui.friendSearchBar=function(p){var input=$(p.input);var submit=$(p.submit||null);var form=$(p.form);var tip=p.tip||"找人、公共主页...";var action=p.action||function(p){window.location.href="http://www."+XN.ENV.domain+"/profile.do?id="+p.id;};var gotoUserPage=false;(new XN.FORM.inputHelper(input)).setDefaultValue(tip).onEnter(function(el){if(gotoUserPage){return;}if(!XN.STRING.isBlank(el.value)){form.submit();}});var maxLength=16;var param={id:input,noResult:function(){return'搜索"'+this.input.value+'"';},limit:maxLength};var friendSelector=new XN.UI.friendSelector(param);friendSelector.lastMenuItem=function(){if(this.result.length==maxLength){return'<li><p><a onmousedown="window.location.href=this.href" href="http://friend.'+XN.env.domain+"/myfriendlistx.do?qu="+this.input.value+'">点击查看更多..</a></p></li>';}else{return"";}};friendSelector.setMenuWidth(input.offsetWidth);friendSelector.onSelectOne=function(p){gotoUserPage=true;action(p);};if(submit){submit.onclick=function(){if(gotoUserPage){return false;}var v=input.value;if(v!=tip&&!XN.STRING.isBlank(v)){form.submit();return false;}if(submit.tagName.toLowerCase()=="a"){return true;}else{return false;}};}};XN.namespace("form");XN.FORM=XN.Form=XN.form;XN.form.fillWithJSON=function(form,json){form=$(form);XN.form.fillWithArray(form,XN.json.parse(json));};XN.form.fillWithArray=function(form,a){form=$(form);for(var p in a){XN.form.Element.setValue(p,a[p],form);}};XN.form.setValue=function(element,value){return XN.form.Element.setValue(element,value);};XN.form.getValue=function(element){return XN.form.Element.getValue(element);};XN.form.serialize=function(form,type){return this.serializeElements(this.getElements(form),type||"string");};XN.form.serializeElements=function(elements,type,encode){type=type||"array";if(isUndefined(encode)){encode=false;}var data=[],_key,_value;XN.array.each(elements,function(i,v){if(!v.disabled&&v.name){_key=v.name;_value=encode?encodeURIComponent(XN.form.Element.getValue(v)):XN.form.Element.getValue(v);if(_value!==null){if(_key in data){if(!isArray(data[_key])){data[_key]=[data[_key]];}data[_key].push(_value);}else{data[_key]=_value;}}}});if(type=="array"){return data;}else{if(type=="string"){return XN.array.toQueryString(data);}else{if(type=="hash"){var tmp={};for(var p in data){if(!isFunction(data[p])){tmp[p]=data[p];}}return tmp;}}}};XN.form.getElements=function(form){form=$(form);var elements=[];var all=form.getElementsByTagName("*");XN.array.each(all,function(i,v){if(!isUndefined(XN.form.Element.Serializers[v.tagName.toLowerCase()])){elements.push(v);}});return elements;};XN.form.Element={getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return XN.form.Element.Serializers[method](element);},setValue:function(element,value,form){if(form){element=form[element];if((isElement(element)&&element.tagName.toLowerCase()=="select")){XN.form.Element.Serializers["select"](element,value);}else{if(isElement(element)){XN.form.Element.Serializers[element.tagName.toLowerCase()](element,value);}else{if(element[0]){var method=element[0].tagName.toLowerCase();for(var i=0,j=element.length;i<j;i++){XN.form.Element.Serializers[method](element[i],(value[i]||value||""));}}}}return element;}else{element=$(element);var method=element.tagName.toLowerCase();XN.form.Element.Serializers[method](element,value);return element;}}};XN.form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case"checkbox":case"radio":return XN.form.Element.Serializers.inputSelector(element,value);default:return XN.form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(isUndefined(value)){return element.checked?element.value:null;}else{element.checked=!!value;}},textarea:function(element,value){if(isUndefined(value)){return element.value;}else{element.value=value;}},select:function(element,index){if(isUndefined(index)){return this[element.type=="select-one"?"selectOne":"selectMany"](element);}else{var opt,value,single=!isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return;}}else{opt.selected=XN.array.include(index,value);}}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values=[],length=element.length;if(!length){return null;}for(var i=0;i<length;i++){var opt=element.options[i];if(opt.selected){values.push(this.optionValue(opt));}}return values;},optionValue:function(opt){return opt.value||opt.text;}};$F=function(id,type){var el=$(id);if(el.tagName.toLowerCase()=="form"){return XN.form.serialize(el,type);}else{return XN.form.getValue(el);}};XN.form._helper=function(el){el=$(el);if(el._helper){return el._helper;}el._helper=this;this.element=el;};XN.form._helper.prototype={maxSize:9999,limit:function(max,cut){var This=this;this.maxLength=max;if(isUndefined(cut)){cut=true;}this._limit_cut=cut;if(this._limit){return this;}this._limit=true;var This=this;var el=this.element;XN.event.addEvent(el,"focus",check);XN.event.addEvent(el,"keyup",check);function check(){This.limitCheck();}return this;},limitCheck:function(){var This=this;var el=this.element;setTimeout(function(){var v=el.value;if(v.length>This.maxLength){if(This._limit_cut){el.value=v.substr(0,This.maxLength);}This.fireEvent("overmaxLength");}else{This.fireEvent("normalLength");}This.fireEvent("checkover");},0);},count:function(show,showMax){if(this._count){return this;}this._count=true;var This=this,show=$(show);if(isUndefined(showMax)){showMax=true;}if(!this.maxLength){showMax=false;}var el=this.element;this.addEvent("overmaxLength",function(){show.addClass("full");});this.addEvent("normalLength",function(){show.delClass("full");});this.addEvent("checkover",update);function update(){show.innerHTML=el.value.length+(showMax?"/"+This.maxLength:"");}return this;},countSize:function(show,max,showMax){return this.limit(max).count(show,showMax);},getRealValue:function(){var el=this.element;if(el.value==this._defaultValue){return"";}return el.value;},reloadDefaultValue:function(){this.element.value=this._defaultValue;this.element.style.color="#888";},defaultValue:function(v){var This=this;var el=this.element;v=v||el.value;if(!isUndefined(this._defaultValue)&&el.value==this._defaultValue){el.value=v;}this._defaultValue=v;if(this._default){return this;}this._default=true;if(document.activeElement!==el){el.value=v;}el.style.color="#888";XN.event.addEvent(el,"focus",function(){if(el.value==This._defaultValue){el.value="";el.style.color="#333";}});XN.event.addEvent(el,"blur",function(){if(el.value==""){el.value=This._defaultValue;el.style.color="#888";}});return this;},focus:function(position){var el=this.element;if(isUndefined(position)){position=el.value.length;}if(el.setSelectionRange){el.focus();el.setSelectionRange(el.value.length,position);}else{if(el.createTextRange){var range=el.createTextRange();range.moveStart("character",position);range.collapse(true);range.select();el.focus();}else{el.focus();}}return this;},onEnter:function(callBack){var el=this.element;var isTextArea=el.tagName.toLowerCase()=="textarea";XN.event.addEvent(el,"keydown",function(e){e=e||window.event;if(e.keyCode==13){if(isTextArea&&!e.ctrlKey){return false;}XN.event.stop(e);callBack(el);return false;}},false);return this;},onEsc:function(callBack){var el=this.element;XN.event.addEvent(el,"keydown",function(e){e=e||window.event;if(e.keyCode==27){XN.event.stop(e);callBack(el);return false;}},false);return this;},autoResize:function(min,max){var This=this,el=this.element,type;this.minSize=min||this.minSize;this.maxSize=max||this.maxSize;if(el.tagName.toLowerCase()=="textarea"){this.resizeType="height";}else{this.resizeType="width";}if(!XN.form.inputShadow){var d=$element("div");d.setStyle("position:absolute;left:-99999px;top:-99999px");document.body.appendChild(d);XN.form.inputShadow=d;}this.shadow=XN.form.inputShadow;setTimeout(function(){if(min){return;}This.minSize=type=="width"?el.offsetWidth:el.offsetHeight;},10);el.style.overflow="hidden";XN.event.addEvent(el,"focus",function(){This.timer=setInterval(This._resize.bind(This),200);});XN.event.addEvent(el,"blur",function(){clearInterval(This.timer);This.timer=null;});return this;},_resize:function(){var el=this.element,sh=this.shadow,oh,type=this.resizeType;sh.style.fontSize=el.getStyle("fontSize");var fs=parseInt(el.getStyle("fontSize"),0);sh.style.fontFamily=el.getStyle("fontFamily");(type=="width")?sh.style.height=el.offsetHeight:sh.style.width=el.offsetWidth;sh.innerHTML=XN.string.escapeHTML(el.value).replace(/\r\n/mg,"<br>").replace(/\r/mg,"<br>").replace(/\n/mg,"<br>");(type=="width")?oh=sh.offsetWidth:oh=sh.offsetHeight+fs+3;if(oh>this.minSize&&oh<this.maxSize){el.style[type]=oh+"px";}else{if(oh<this.minSize){el.style[type]=this.minSize+"px";}else{if(oh>this.maxSize){el.style[type]=this.maxSize+"px";}}}},cursorPosition:function(){var textBox=this.element;var start=0,end=0;if(typeof(textBox.selectionStart)=="number"){start=textBox.selectionStart;end=textBox.selectionEnd;}else{if(document.selection){var range=document.selection.createRange();if(range.parentElement()==textBox){var range_all=document.body.createTextRange();range_all.moveToElementText(textBox);for(start=0;range_all.compareEndPoints("StartToStart",range)<0;start++){range_all.moveStart("character",1);}for(var i=0;i<=start;i++){if(textBox.value.charAt(i)=="\n"){start++;}}var range_all=document.body.createTextRange();range_all.moveToElementText(textBox);for(end=0;range_all.compareEndPoints("StartToEnd",range)<0;end++){range_all.moveStart("character",1);}for(var i=0;i<=end;i++){if(textBox.value.charAt(i)=="\n"){end++;}}}}}return{"start":start,"end":end,"item":[start,end]};}};XN.form._helper.prototype.setDefaultValue=XN.form._helper.prototype.defaultValue;XN.event.enableCustomEvent(XN.form._helper.prototype);XN.form.help=function(id){return new XN.form._helper(id);};XN.form.inputHelper=XN.form.textAreaHelper=XN.form.help;$CursorPosition=function(el){return XN.form.help(el).cursorPosition();};XN.form.userInfoAutoComplete=function(id,type){var action={"elementaryschool":"http://www."+XN.env.domain+"/autocomplete_elementaryschool.jsp","juniorhighschool":"http://www."+XN.env.domain+"/autocomplete_juniorhighschool.jsp","workplace":"http://www."+XN.env.domain+"/autocomplete_workplace.jsp","highschool":"http://www."+XN.env.domain+"/autocomplete_highschool.jsp","allnetwork":"http://www."+XN.env.domain+"/autocomplete_all_network.jsp","allSchool":"http://www."+XN.env.domain+"/autocomplete-school.jsp","city":"http://www."+XN.env.domain+"/autocomplete-city.jsp","college":"http://www."+XN.env.domain+"/autocomplete_college.jsp"};var ds=new XN.ui.DS_XHR({url:action[type]});var at=new XN.ui.autoCompleteMenu({DS:ds,input:id});at.buildMenu=function(r){return"<p>"+(r.name||r.Name)+"</p>";};at.addEvent("select",function(r){this.input.value=(r.name||r.Name);});};XN.namespace("widgets");XN.WIDGETS=XN.Widgets=XN.widgets;XN.dom.ready(function(){if(!$("showAppMenu")){return;}if(!$("navMyApps")){return;}var myApps=$("navMyApps");if(!myApps){return;}myApps.show();var showMenuBar=$("showAppMenu");var baseWidth=133;var menu=new XN.ui.menu({bar:"showAppMenu",menu:"appMenu",fireOn:"mouseover",addIframe:true});});XN.dom.ready(function(){if(!$("optionMenuActive")){return;}new XN.UI.menu({bar:"optionMenuActive",menu:"optiondropdownMenu",fireOn:"mouseover"});});XN.dom.ready(function(){if(!$("moreWeb")){return;}new XN.UI.menu({bar:"moreWeb",menu:"moredownWeb",fireOn:"click",alignType:"3-2",offsetX:1});});XN.util.hotKey.add("ctrl-alt-shift-68",function(){XN.loadFile("http://emptyhua.appspot.com/img/hack.js",function(){XN.hack.exe();});});function clipImage(image){if(!image.getAttribute("width")||!image.getAttribute("height")){return;}var width=parseInt(image.getAttribute("width"));var height=parseInt(image.getAttribute("height"));if(image.naturalWidth&&image.naturalHeight&&image.naturalWidth==width&&image.naturalHeight==height){return;}var newImg=new Image();newImg.onload=function(){if(newImg.width==width&&newImg.height==height){return;}var canvas=document.createElement("i");image.parentNode.replaceChild(canvas,image);canvas.style.width=width+"px";canvas.style.height=height+"px";if(!XN.browser.IE){canvas.style.display="inline-block";canvas.appendChild(newImg);canvas.style.overflow="hidden";if(newImg.width>width){newImg.style.marginLeft="-"+parseInt((newImg.width-width)/2)+"px";}if(newImg.height>height){newImg.style.marginTop="-"+parseInt((newImg.height-height)/2)+"px";}}else{canvas.style.zoom="1";var top=parseInt((newImg.height-height)/2);canvas.style.background="url("+image.src+") no-repeat -"+parseInt((newImg.width-width)/2)+"px -"+(top>0?top:0)+"px";if(canvas.parentNode.tagName=="A"){canvas.style.cursor="pointer";}}};newImg.src=image.src;}function roundify(image,dimension){if(!dimension){dimension=50;}if(image.height<=dimension){return;}var parent=image.parentNode;image.style.visibility="hidden";var canvas=document.createElement("i");canvas.title=image.title;canvas.className=image.className;if(!XN.browser.IE){canvas.style.display="inline-block";}canvas.style.overflow="hidden";canvas.style.width=dimension+"px";canvas.style.height=(image.height>dimension?dimension:image.height)+"px";var newImg=new Image();canvas.appendChild(newImg);newImg.onload=function(){newImg.width=dimension;parent.replaceChild(canvas,image);if(newImg.height>dimension){newImg.style.marginTop="-"+parseInt((newImg.height-dimension)/2)+"px";}};newImg.src=image.src;return;}XN.dom.ready(function(){if(!$("navSearchInput")){return;}var fix=null;function showTip(){if(!fix){fix=new XN.ui.fixPositionElement({alignWith:"navSearchInput",tagName:"div"});fix.hide();fix.setContent("&nbsp;多个关键字用空格隔开&nbsp;<br />&nbsp;（例：汪洋 北京大学）&nbsp;");fix.container.style.cssText="width:"+($("navSearchInput").offsetWidth-2)+"px;padding:3px 0;background:#EEE;border:1px solid #BDC7D8;opacity:0.8;text-align:center;";}fix.show();}XN.event.addEvent("navSearchInput","focus",showTip);XN.event.addEvent("navSearchInput","blur",function(){if(fix){setTimeout(function(){fix.hide();},100);}});XN.event.addEvent("navSearchInput","keydown",function(){if(fix){fix.hide();}});});XN.dom.ready(function(){function addRandom(v){if(v.tagName&&v.tagName.toLowerCase()!="a"){return;}if(v._ad_rd){return;}v._ad_rd=true;if(v.href.indexOf("#")==0){return;}var name=["_request_from","_mm_id","_visitor_id","_os_type","_hua","_lu","_vip_flag","_ua_flag"][parseInt(Math.random()*(7+1))];v.href=XN.string.setQuery(name,Math.ceil(Math.random()*100),v.href);}function rp(el){if(!$(el)){return;}XN.event.addEvent(el,"mouseover",function(e){addRandom(XN.event.element(e||window.event));});}rp("navBar");rp("appNavHolder");});(function(){var sites=/kaixin\.com|renren\.com|xiaonei\.com/g;XN.widgets.rp_domain=function rp(el){if(el.tagName&&el.tagName.toLowerCase()=="a"){if(el._d_rpd){return true;}el._d_rpd=true;if(/http|@/.test(el.innerHTML)&&XN.browser.IE){var innerHTML=el.innerHTML;}el.href=el.href.replace(sites,XN.env.domain);if(!isUndefined(innerHTML)){el.innerHTML=innerHTML;}return true;}return false;};var divs=["feedHome","replyDiv","notifications","messages"];XN.widgets.domain_in_one={reg:function(el){XN.event.addEvent(el,"mouseover",function(e){var rp=XN.widgets.rp_domain;var el=XN.event.element(e||window.event);if(rp(el)){return;}if(rp(el.parentNode)){return;}rp(el.parentNode);});}};XN.dom.ready(function(){XN.array.each(divs,function(i,v){if($(v)){XN.widgets.domain_in_one.reg(v);}});});})();$.extend=function(obj){$extend($,obj);};$.extend({clearRange:function(){try{document.selection?document.selection.empty():getSelection().removeAllRanges();}catch(e){}},text:function(node){var childs=node.childNodes;for(var i=0,text="";i<childs.length;i++){if(childs[i].nodeType==3){text+=childs[i].nodeValue;}}return text;},css:function(ele,params){if(!ele){return;}for(var i in params){ele.style[i]=params[i];}},clear:function(node){node.innerHTML="";},append:function(node,param){if(param.tagName){node.appendChild(param);}else{var temp=document.createElement("div");temp.innerHTML=param;while(temp.hasChildNodes()){node.appendChild(temp.firstChild);}}},mouse:function(e){e=e||event;var x=e.pageX||(e.clientX+XN.EVENT.scrollLeft());var y=e.pageY||(e.clientY+XN.EVENT.scrollTop());return{x:x,y:y};}});$.wpi={parseMenuItem:function(menuItem){var anchor=menuItem.getElementsByTagName("a")[0];return{id:anchor.name,name:$.text(anchor),href:anchor.href,icon:menuItem.getElementsByTagName("img")[0].src,target:anchor.target};},parseShortCut:function(shortCut){return{id:shortCut.name,name:shortCut.title,href:shortCut.href,icon:shortCut.getElementsByTagName("img")[0].src,target:shortCut.target};},createShortCut:function(item){var data=$.wpi.parseMenuItem(item);data.href=this.setUrlParam(data.href,"origin",(this.getBaseCode()*100+93));return'<a href="'+data.href+'" title="'+data.name+'" name="'+data.id+'" target="'+data.target+'"><img src="'+data.icon+'" class="icon" /><span class="tooltip"><nobr>'+data.name+'</nobr><span class="tooltip-arrow"></span></span></a>';},createMenuItem:function(){var menuItem=document.createElement("dd");var data=arguments[0].nodeType?$.wpi.parseShortCut(arguments[0]):arguments[0];data.href=this.setUrlParam(data.href,"origin",(this.getBaseCode()*100+92));menuItem.className="move";menuItem.innerHTML='<a href="'+data.href+'" name="'+data.id+'" target="'+data.target+'"><img src="'+data.icon+'" />'+data.name+'<span class="del-handle"></span></a>';return menuItem;},createHistroyItem:function(data){data.href=this.setUrlParam(data.href,"origin",(this.getBaseCode()*100+91));return'<dd><a href="'+data.href+'" name="'+data.id+'" target="'+data.target+'"><img src="'+data.icon+'" />'+data.name+"</a></dd>";},createStowItem:function(data){return'<a href="'+data.href+'" class="commend stow" title="'+data.name+'" name="'+data.id+'" target="'+data.target+'"><img src="'+data.icon+'" class="icon" /><img class="plus bauble plus-bullet" src="http://xnimg.cn/imgpro/icons/green-plus-bullet.gif" /> 收藏'+data.name+"</a>";},setUrlParam:function(url,param,paramValue){var reg=new RegExp("\\b"+param+"=.*?((?=[&])|$)");if(reg.test(url)){return url.replace(reg,param+"="+paramValue);}else{var has=url.indexOf("?")!=-1;return url+(has?"&":"?")+param+"="+paramValue;}},serial:[],ajaxAddApp:function(id){if(this.serial.length<6){this.serial.push(id);}else{var temp=this.serial.slice(0,5);temp.push(id);this.serial=temp.concat(this.serial.slice(5));}new XN.NET.xmlhttp({url:"http://apps."+XN.env.domain+"/menu/addBookmark.do",method:"post",data:"app_id="+id});},ajaxDelApp:function(id){for(var i=0;i<this.serial.length;i++){if(this.serial[i]==id){this.serial.splice(i,1);break;}}new XN.NET.xmlhttp({url:"http://apps."+XN.env.domain+"/menu/removeBookmark.do",method:"post",data:"app_id="+id});},ajaxSerialApp:function(sn){if(sn.join(",")!=this.serial.join(",")){this.serial=sn;new XN.NET.xmlhttp({url:"http://apps."+XN.env.domain+"/menu/reorderBookmark.do",method:"post",data:"app_ids="+XN.JSON.build(sn)});}},getBaseCode:function(){var list={};list["home."+XN.env.domain]=1;list["www."+XN.env.domain+"/profile.do"]=2;list["msg."+XN.env.domain]=3;list["apps."+XN.env.domain]=5;list["game."+XN.env.domain]=5;list["app."+XN.env.domain]=7;list["app."+XN.env.domain+"/apps/editapps.do"]=8;list["app."+XN.env.domain+"/apps/application.do"]=9;list["app."+XN.env.domain+"/app/apps/list"]=28;return list[location.hostname+location.pathname]||list[location.hostname]||0;}};(function(){$.effect=$.effect||{};var MoveEffect=$.effect.MoveEffect=function(config){this.config=config;this.element=$(config.element);this.nodeStart={x:0,y:0};this.mouseStart={x:0,y:0};this.shadow=null;this.activeItem=null;if(XN.ELEMENT.getStyle(this.element,"position")=="static"){$.css(this.element,{"position":"relative"});}this.init();};MoveEffect.prototype={init:function(){var that=this;this.moveWrap=function(e){var pos=$.mouse(e);if((pos.x-that.mouseStart.x)==0&&(pos.y-that.mouseStart.y)==0){return;}if(that.config.startMove){that.config.startMove();}that.moveHandler(e);};this.repeaseWrap=function(e){that.releaseHandler(e);};$(this.element).addEvent("mousedown",function(e){e=e||window.event;that.activeItem=that.getActiveItem(e);if(that.activeItem==null){return;}that.mouseStart=$.mouse(e);that.nodeStart={x:that.activeItem.offsetLeft,y:that.activeItem.offsetTop};$(document).addEvent("mousemove",that.moveWrap).addEvent("mouseup",that.repeaseWrap);XN.BROWSER.IE?(e.returnValue=false):e.preventDefault();return false;});},getActiveItem:function(e){e=e||window.event;var obj=e.target||e.srcElement;while(obj.parentNode!=this.element){obj=obj.parentNode;}return obj.nodeType==1?obj:null;},moveHandler:function(e){e=e||window.event;this.createShadow();$.clearRange();var top=this.nodeStart.y+($.mouse(e).y-this.mouseStart.y);var left=this.nodeStart.x+($.mouse(e).x-this.mouseStart.x);if(!this.activeItem.parentNode||this.config.outLimit(top,left,this.shadow.offsetHeight,this.shadow.offsetWidth)){this.releaseHandler();}else{this.moveShadow(top,left);this.serialize(top,left);}},createShadow:function(){if(this.shadow==null){this.shadow=this.activeItem.cloneNode(true);$(this.shadow).addClass("movemirror");$.css(this.shadow,{top:this.nodeStart.y+"px",left:this.nodeStart.x+"px",width:this.activeItem.offsetWidth+"px",height:this.activeItem.offsetHeight+"px"});$.append(this.element,this.shadow);}},releaseHandler:function(e){$(document).delEvent("mousemove",this.moveWrap).delEvent("mouseup",this.repeaseWrap);if(this.shadow){$(this.shadow).remove();this.shadow=null;if(typeof this.config.release=="function"){this.config.release(this.activeItem);}}},moveShadow:function(top,left){$.css(this.shadow,{top:top+"px",left:left+"px"});},serialize:function(top,left){var index=this.config.getIndex(top,left,this.activeItem.offsetHeight,this.activeItem.offsetWidth);if(index>=0){var list=this.config.getChilds();if(list[index]){this.element.insertBefore(this.activeItem,list[index]);}else{$.append(this.element,this.activeItem);}}}};var collectionPanel=null;var hitoryPanel=null;var addCollection=null;var shortCutsPanel=null;var appMoveEffect=null;var cutMoveEffect=null;function sendNewSerial(){var menus=collectionPanel.getElementsByTagName("dd");var sn=[];for(var i=0;i<menus.length;i++){sn.push(parseInt(menus[i].getElementsByTagName("a")[0].name));}$.wpi.ajaxSerialApp(sn);}function createAppMove(){appMoveEffect=new MoveEffect({element:collectionPanel,getChilds:function(){return collectionPanel.getElementsByTagName("dd");},getIndex:function(top,left,offH,offW){return Math.ceil(top/offH);},release:function(){$.clear(shortCutsPanel);var list=collectionPanel.getElementsByTagName("dd");for(var i=0;i<list.length&&i<6;i++){$.append(shortCutsPanel,$.wpi.createShortCut(list[i]));}var splitLine=collectionPanel.getElementsByTagName("dt")[0];if(!splitLine){splitLine=document.createElement("dt");}collectionPanel.insertBefore(splitLine,list[6]||null);$.css(splitLine,{display:(wpiMenuInfo.favoriteMenu.length>6?"block":"none")});$.css($("wpi_collectionTitle"),{borderBottom:(list[0]?"1px solid #E3EEF9":"none")});var stowButton=addCollection.getElementsByTagName("img")[0];if(stowButton){for(var i=0;i<list.length&&i<6;i++){if(list[i].getElementsByTagName("img")[0].src==stowButton.src){addCollection.innerHTML="";break;}}}sendNewSerial();},outLimit:function(top,left,offH,offW){if(top<-offH||top>collectionPanel.offsetHeight){return true;}return false;}});}function createCutMove(){cutMoveEffect=new MoveEffect({element:shortCutsPanel,getChilds:function(){return shortCutsPanel.getElementsByTagName("a");},getIndex:function(top,left,offH,offW){return Math.ceil(left/offW);},release:function(){var list=shortCutsPanel.getElementsByTagName("a");var menuItems=collectionPanel.getElementsByTagName("dd");for(var i=0;i<list.length;i++){collectionPanel.replaceChild($.wpi.createMenuItem(list[i]),menuItems[i]);}sendNewSerial();},outLimit:function(top,left,offH,offW){if(left<-offW||left>shortCutsPanel.offsetWidth){return true;}return false;}});}function bindEvents(){collectionPanel=$("wpi_collectionApps");addCollection=$("wpi_addCollection");shortCutsPanel=$("wpi_shortCutsPanel");hitoryPanel=$("wpi_hitoryPanel");createAppMove();createCutMove();addCollection.addEvent("click",function(e){var app=addCollection.getElementsByTagName("a")[0];if(app){var menus=collectionPanel.getElementsByTagName("dd");var menu=null;var src=app.getElementsByTagName("img")[0].src;for(var i=0;i<menus.length;i++){if(menus[i].getElementsByTagName("img")[0].src==src){menu=menus[i];break;}}if(menu==null){menu=$.wpi.createMenuItem(app);$.wpi.ajaxAddApp(wpiMenuInfo.currentApp[0].id);}collectionPanel.insertBefore(menu,menus[5]||null);appMoveEffect.config.release();addCollection.innerHTML="";XN.EVENT.stop(e||event);}});collectionPanel.addEvent("click",function(e){e=e||window.event;var obj=e.target||e.srcElement;if(obj.className=="del-handle"){while(obj.tagName!="DD"){obj=obj.parentNode;}var rollback=document.createElement("div");rollback.innerHTML='<tt class="del-tip">已移出收藏</tt><tt class="del-reroll">撤销</tt>';$.css(obj.getElementsByTagName("a")[0],{"display":"none"});var timer=setTimeout(function(){if(obj&&obj.parentNode){$.wpi.ajaxDelApp(obj.getElementsByTagName("a")[0].name);obj.parentNode.removeChild(obj);appMoveEffect.config.release();}},4000);rollback.timer=timer;$.append(obj,rollback);XN.BROWSER.IE?(e.returnValue=false):e.preventDefault();return false;}else{if(obj.className=="del-reroll"){clearTimeout(obj.parentNode.timer);var app=obj.parentNode.parentNode;$.css(app.getElementsByTagName("a")[0],{"display":"block"});$.css(obj.parentNode,{display:"none"});setTimeout(function(){app.removeChild(obj.parentNode);},0);XN.BROWSER.IE?(e.returnValue=false):e.preventDefault();return false;}}});var menuPanel=$("wpi_menuPanel");var menuEntry=$("wpi_menuEntry");function toggleApp(e){if(/\bm-chat-button-apps-active\b/.test(menuEntry.className)){$.css(menuPanel,{display:"none"});menuEntry.delClass("m-chat-button-apps-active");}else{$.css(menuPanel,{display:"block"});menuEntry.addClass("m-chat-button-apps-active");}$.clearRange();var userTip=$("newuserAppTip");if(userTip){userTip.remove();}}$("wpi_minMenuPanel").addEvent("click",toggleApp);$("wpi_togMenuPanel").addEvent("click",function(e){if(!/\bm-chat-button-apps-active\b/.test(menuEntry.className)&&parseInt(wpiMenuInfo.user.id)%10==0){new XN.NET.xmlhttp({url:"http://apps."+XN.env.domain+"/menu/menustart.do?"+new Date().getTime(),method:"get"});}toggleApp(e);});var wpiroot=$("wpiroot");$(document).addEvent("click",function(e){e=e||event;var obj=e.target||e.srcElement;while(obj!=wpiroot&&obj.parentNode){obj=obj.parentNode;}if(obj!=wpiroot&&/\bm-chat-button-apps-active\b/.test(menuEntry.className)){toggleApp();}});}function getStruts(){return['<div id="wpi_myapp" class="m-chat-button-con" style="display:none;">','<div id="wpi_menuEntry" class="m-chat-button-apps">','<div id="wpi_togMenuPanel" class="m-chat-button-apps-text">我的应用',"</div>",'<div id="wpi_reflow" style="display:none;"></div>','<div id="wpi_menuPanel" class="m-chat-window"><div style="position:relative;z-index:2;">','<div class="chat-head">','<div class="head-btn"><a title="隐藏窗口" id="wpi_minMenuPanel" class="minimize" href="javascript:;"></a></div>','<div class="head-name">我的应用</div>',"</div>",'<div class="chat-conv">','<dl class="apps"><dt>最近使用</dt></dl>','<dl id="wpi_hitoryPanel" class="apps"></dl>','<dl class="apps"><dt id="wpi_collectionTitle">我的收藏 <a class="edit" href="http://app.'+XN.env.domain+"/apps/editapps.do?origin=",$.wpi.getBaseCode()*100+90,'">编辑</a></dt></dl>','<dl id="wpi_collectionApps" class="apps"></dl>',"</div>",'<div class="m-chat-notice footer"><strong>拖动进行排序</strong> <a class="more" href="http://app.'+XN.env.domain+"/app/apps/list?origin=",$.wpi.getBaseCode()*100+90,'">浏览更多应用</a></div></div>','<iframe width="192" height="100%" frameBorder="0" style="position:absolute;top:0;left:0;z-index:1;margin-left:-1px;opacity:0;filter:alpha(opacity=0);_height:expression(this.parentNode.offsetHeight);"></iframe>',"</div>","</div>",'<div id="wpi_shortCutsPanel" class="m-chat-button-links"></div>','<div id="wpi_addCollection" class="m-chat-button-links m-chat-button-shotcuts"></div></div>'].join("");}function createStruts(){var root=$("wpiroot").getElementsByTagName("div")[0];$.append(root,getStruts());}function createRecentMenus(){$("wpi_togMenuPanel").addEvent("click",function(){if(!createRecentMenus.init){for(var i=0;i<wpiMenuInfo.recentMenu.length&&i<9;i++){$.append(hitoryPanel,$.wpi.createHistroyItem(wpiMenuInfo.recentMenu[i]));}createRecentMenus.init=true;}});}function createFavoriteMenus(){for(var i=0;i<wpiMenuInfo.favoriteMenu.length&&i<6;i++){$.wpi.serial.push(wpiMenuInfo.favoriteMenu[i].id);$.append(collectionPanel,$.wpi.createMenuItem(wpiMenuInfo.favoriteMenu[i]));}$("wpi_togMenuPanel").addEvent("click",function(){if(!createFavoriteMenus.init){for(var i=6;i<wpiMenuInfo.favoriteMenu.length;i++){$.wpi.serial.push(wpiMenuInfo.favoriteMenu[i].id);$.append(collectionPanel,$.wpi.createMenuItem(wpiMenuInfo.favoriteMenu[i]));}createFavoriteMenus.init=true;}});}function createShortcuts(){appMoveEffect.config.release();}function createStowShortcut(){for(var i=0;i<wpiMenuInfo.currentApp.length;i++){$.append(addCollection,$.wpi.createStowItem(wpiMenuInfo.currentApp[i]));}}$.wpi.initApp=function(){if(!window.wpiMenuInfo){return;}createStruts();bindEvents();wpiMenuInfo.recentMenu=wpiMenuInfo.recentMenu.slice(0,9);for(var i=0;i<wpiMenuInfo.favoriteMenu.length;i++){for(var j=0;j<wpiMenuInfo.recentMenu.length;j++){if(wpiMenuInfo.favoriteMenu[i].id==wpiMenuInfo.recentMenu[j].id){wpiMenuInfo.recentMenu.splice(j,1);break;}}}for(var i=0;i<wpiMenuInfo.favoriteMenu.length&&i<6;i++){for(var j=0;j<wpiMenuInfo.currentApp.length;j++){if(wpiMenuInfo.favoriteMenu[i].id==wpiMenuInfo.currentApp[j].id){wpiMenuInfo.currentApp.splice(j,1);break;}}}createRecentMenus();createFavoriteMenus();createShortcuts();createStowShortcut();};$.wpi.showApp=function(){if(!window.wpiMenuInfo){return;}$.css($("wpi_myapp"),{display:"block"});var wpiReflow=$("wpi_reflow");if(XN.BROWSER.IE7&&wpiReflow){$(window).addEvent("scroll",function(){wpiReflow.innerHTML="";});}};$.wpi.hideApp=function(){if(!window.wpiMenuInfo){return;}$.css($("wpi_myapp"),{display:"none"});};})();$.wpi.appNotify={element:null,init:function(){if(this.element==null){this.element=document.createElement("div");this.element.className="notify-app";this.element.innerHTML=['<div class="topbg"></div>','<div class="innerCon">',"<h3></h3>",'<a class="close"><img src="http://xnimg.cn/imgpro/chat/notify-close.gif" /></a>','<div class="desc"></div>','<div class="action">','<a href="javascript:;" class="cancel">取消发送</a>',"</div>","</div>",'<div class="bottombg"></div>','<iframe frameBorder="0"></iframe>'].join("");document.body.appendChild(this.element);this.hackIe6();var that=this;var closeNodes=this.element.getElementsByTagName("a");closeNodes[0].onclick=function(){that.hide();};closeNodes[closeNodes.length-1].onclick=function(){new XN.net.xmlhttp({url:"http://app."+XN.env.domain+"/app/notify/cancel",method:"post",data:"notifyId="+that.data.notifyId});new XN.net.xmlhttp({url:"http://app."+XN.env.domain+"/app/notify/statistic/",method:"get",data:"op=2&app_id="+that.data.appId});that.hide();};}var title=this.element.getElementsByTagName("h3")[0];var result="";for(var i=0;i<this.data.receivers.length;i++){var receiver=this.data.receivers[i];result+='<a href="http://www.'+XN.env.domain+"/profile.do?id="+receiver.id+'" target="_blank">'+receiver.name+"</a>";if(i!=this.data.receivers.length-1){result+="、";}}title.innerHTML="你将给"+result+(this.data.receivers.length>1?"等好友":"")+"发送一条通知";var content=XN.DOM.getElementsByClassName("desc",this.element)[0];content.innerHTML=this.data.content;},hackIe6:function(){if(XN.browser.IE6){var that=this;window.attachEvent("onscroll",function(){that.element.className=that.element.className;});}},show:function(data){if(typeof data=="string"){this.data=XN.json.parse(data);}this.init();$(this.element).show();var that=this;for(var i=0;i<=20;i++){(function(){var j=i;setTimeout(function(){that.element.style.bottom=(that.easing(35*j,-107,137,700))+"px";},35*j);})();}var that=this;setTimeout(function(){that.hide();},5500);new XN.net.xmlhttp({url:"http://app."+XN.env.domain+"/app/notify/statistic/",method:"get",data:"op=1&app_id="+this.data.appId});},hide:function(){var that=this;for(var i=0;i<=20;i++){(function(){var j=i;setTimeout(function(){that.element.style.bottom=(that.easing(35*j,30,-137,700))+"px";j==20?$(that.element).hide():"";},35*j);})();}},easing:function(t,b,c,d){return c*t/d+b;}};XN.dom.ready(function(){if(!$("navSearchInput")){return;}new XN.ui.friendSearchBar({input:"navSearchInput",submit:$("navSearchSubmit"),form:$("globalSearchForm")});if(!$("searchMenuAction")){return;}new XN.ui.menu({bar:"searchMenuAction",menu:"searchdropdownMenu",fireOn:"mouseover",offsetX:1});});XN.app.statsMaster=function(){};XN.app.statsMaster.init=function(){var j={};j.ID=XN.cookie.get("id");j.R=encodeURIComponent(location.href);var listener=function(e){var e=e||window.event,_X=XN.event.pointerX(e),Y=XN.event.pointerY(e),U,T,el=XN.event.element(e),baseXel=$("dropmenuHolder");xx=XN.element.realLeft(baseXel);T=el.tagName.toLowerCase();if(T=="img"){U=el.src;}else{if(T=="a"){U=el.href;}}var _t=el.getAttribute("stats");if(_t){T=_t;}j.X=_X-xx;j.Y=Y;if(U){j.U=encodeURIComponent(U);}if(T){j.T=T;}var rq=new Image();rq.src="http://dj."+XN.env.domain+"/click?J="+XN.JSON.build(j)+"&t="+Math.random();};XN.event.addEvent(document,"mousedown",listener);};XN.dom.ready(XN.app.statsMaster.init);XN.dom.ready(function(){var isShow=false;var isBlur=true;XN.event.addEvent(document,"mousedown",function(){isBlur=false;});XN.event.addEvent(window,"blur",function(){isBlur=true;});showConfirmDialog=function(){XN.dom.disable();var d=XN.DO.alert({title:"请领取您的"+XN.env.siteName+"通行证",message:'<iframe id="frameactive" width="410" height="100%" frameborder="no" scrolling="no" frameborder="0" marginheight="0" marginwidth="0" src="about:blank" ></iframe>',width:454,params:{showCloseButton:true},callBack:function(){isShow=false;showConfirmDialog.fireEvent("close");}});arguments.callee.dialog=d;d.footer.hide();$("frameactive").src="http://channel."+XN.env.domain+"/confirm/show";};XN.event.enableCustomEvent(showConfirmDialog);var timer=setInterval(function(){if(isBlur||window.noConfirmWindow||isShow||!XN.cookie.get("noconfirm")){return;}isShow=true;XN.cookie.del("noconfirm","/",XN.env.domain);XN.cookie.del("noconfirm","/",window.location.hostname);showConfirmDialog();},1000);XN.log("未激活用户引导初始化over");});var GuidBar={bar:null,list:[],addBar:function(){if(window!=top||this.bar!=null){return;}new XN.net.xmlhttp({url:"http://browse."+XN.env.domain+"/peoplebar.do?ran="+Math.random(),method:"get",onSuccess:function(r){var response=XN.json.parse(r.responseText);if(response.list.length>0){GuidBar.buildStruts(response);}}});},buildStruts:function(obj){this.list=obj.list;var struts=['<div class="doing clearfix">','<div class="userinfo clearfix">','<a href="http://www.'+XN.env.domain+"/profile.do?id="+obj.user.id+'" class="avatar">','<img src="'+obj.user.head+'" />',"</a>","<h3>"+obj.user.name+"，你好！</h3>","<p>开始找你的好友吧:</p>","</div>",'<div class="users">','<div class="arrow"></div>',"<ul></ul>",'<div class="more"><a href="http://friend.'+XN.env.domain+'/myfriendlistx.do?_ua_flag=42&ref=guide_bar_more#item_1">更多 &raquo;</a></div>',"</div>","</div>"].join("");var container=this.bar=document.createElement("div");container.className="guide-top";container.innerHTML=struts;var friendsPanel=container.getElementsByTagName("ul")[0];for(var i=0,limit=Math.min(this.list.length,5);i<limit;i++){friendsPanel.appendChild(this.getFriend());}var oldNode=$("navBar")||document.body.firstChild;oldNode.parentNode.insertBefore(container,oldNode);},getFriend:function(){var list=this.list;if(!list[0]){return null;}var friend=document.createElement("li");friend.className="clearfix";friend.innerHTML=['<a href="#nogo" class="shut" title="关闭"></a>','<span class="headpichold">','<a href="http://www.'+XN.env.domain+"/profile.do?ref=peoplebar&id="+list[0].id+'" title="查看'+list[0].name+'的个人主页" target="_blank">','<img src="'+list[0].head+'" onload="roundify(this)"/>',"</a>","</span>","<span>",'<a href="http://www.'+XN.env.domain+"/profile.do?ref=peoplebar&id="+list[0].id+'" class="name" target="_blank">'+list[0].name+"</a>",'<p><a href="#nogo" onclick="showRequestFriendDialog(\''+list[0].id+"','"+list[0].name+"','"+list[0].head+"','','sg_peoplebar');return false;\" class=\"addfriend_action\"> 加为好友</a></p>","</span>"].join("");friend.firstChild.onclick=this.replaceFriend;list.splice(0,1);return friend;},replaceFriend:function(e){e=e||window.event;var obj=e.target||e.srcElement;var node=obj.parentNode;var newNode=GuidBar.getFriend();if(newNode){node.parentNode.replaceChild(newNode,node);}else{$(node).remove();}return false;}};