﻿
root = typeof root == 'undefined' ? '' : root;
var BBSMAX={AvatarDefault:root+'/Images/SystemAvatars/notset.gif',ImageDefault:root+'/common/images/NotFound.gif',CodeUrl:'ValidateCode.aspx?type=',CodeLoadingImage:root+'/Themes/default/img/bullet/loading.gif',MessageSoundPath:root+'/common/sound/',SpaceImage:root+'/Common/Editor/images/transparent.gif'}

$Defined('Global');var Global={PATH:'/'};Global.GetObject=function($_){var d=document;return(d.all&&d.all($_))||(d.getElementById&&d.getElementById($_))||null;}
Global.GetDocWidth=function(d){d=d||document;return Math.max(this.GetClientWidth(d),d.body.offsetWidth);};Global.GetDocHeight=function(d){d=d||document;return Math.max(this.GetClientHeight(d),d.body.offsetHeight);};Global.GetScrollLeft=function(d){d=d||document;return(d.documentElement?d.documentElement.scrollLeft:d.body.scrollLeft);};Global.GetScrollTop=function(d){d=d||document;return(d.documentElement?d.documentElement.scrollTop:d.body.scrollTop);};Global.GetClientWidth=function(d){d=d||document;return(window.innerWidth||d.documentElement&&d.documentElement.clientWidth||d.body.clientWidth);};Global.GetClientHeight=function(d){d=d||document;return(window.innerHeight||d.documentElement&&d.documentElement.clientHeight||d.body.clientHeight);};Global.GetOffsetTop=function(el,p){var _t=el.offsetTop;while(el=el.offsetParent){if(el==p)break;_t+=el.offsetTop;}
return _t;};Global.GetOffsetLeft=function(el,p){var _l=el.offsetLeft;while(el=el.offsetParent){if(el==p)break;_l+=el.offsetLeft;}
return _l;};Global.Random=function(){return(new Date().getTime()+'_'+Math.floor(Math.random()*10000000));};Global.IsLocal=function(){return location.href.indexOf('file:///')==0;};Array.prototype.push||(Array.prototype.push=function(arg){this[this.length]=arg;});function ToArray(obj,index){return Array.prototype.slice.apply(obj).slice(index||0);}
function TypeOf(obj){var type=obj.constructor.toString();var arr=/function\s+(.+)\s*\(/i.exec(type);return(arr&&arr[1]?arr[1].toLowerCase():'string');};function $(){var $_=arguments;if($_.length==1){$_=typeof $_[0]=='string'?Global.GetObject($_[0]):$_[0];}
else if($_.length>1){for(var i=0;i<$_.length;i++){$_[i]=typeof $_[i]=='string'?Global.GetObject($_[i]):$_[i];}}
else{$_=null;}
return $_;}
function $E(e,win){win=win||window;return win.event||e||null;}
function $EO(e,win){return e&&(e.target||e.srcElement);}
function $Defined(cls){if(typeof eval(cls)!='undefined')
alert('变量'+cls+' 重定义。');}
function $USE(lib){document.write('<script type="text/javascript" src="'+Global.PATH+lib+'"><'+'/'+'script>');}
window.onerror=function(){};String.prototype.Contains=function(str){return(this.indexOf(str)>-1);};String.prototype.Trim=function(){return this.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,'');};String.prototype.LTrim=function(){return this.replace(/^[ \t\n\r]*/g,'');};String.prototype.RTrim=function(){return this.replace(/[ \t\n\r]*$/g,'');};String.prototype.HtmlToStr=function(){return this.replace(/&/g,'&amp;').replace(/>/g,'&gt;').replace(/</g,'&lt;');};String.Space=function(num,htmlEntity){var meta=htmlEntity?'&nbsp;':'\x20';var str='';for(var i=0;i<num;i++)str+=meta;return str;};$Defined('Browser');var Browser={s:navigator.userAgent.toLowerCase()};(function(b){b.IsIE=b.s.Contains('msie');b.IsIE5=b.s.Contains('msie 5');b.IsIE6=b.s.Contains('msie 6');b.IsIE7=b.s.Contains('msie 7');b.IsIE56=!b.IsIE7&&(b.IsIE6||b.IsIE5);b.IsGecko=b.s.Contains('gecko');b.IsSafari=b.s.Contains('safari');b.IsOpera=b.s.Contains('opera');b.IsMac=b.s.Contains('macintosh');b.IsIELike=(b.IsIE||b.IsOpera);b.IsGeckoLike=(b.IsGecko||b.IsSafari);})(Browser);$Defined('Events');var Events={};Events.AttachEvent=function(obj,eventName,func,useCapture,_window){obj=$(obj);if(!obj)return;useCapture=useCapture?true:false;eventName=eventName.toLowerCase();if(obj.addEventListener){obj.addEventListener(eventName,func,useCapture);}
else{var E=this;this._AttachEvent(obj,eventName,func);obj['on'+eventName]=function(e){E._FireEvent(obj,eventName,e,_window);};}};Events.RemoveEvent=function(obj,eventName,func,useCapture){obj=$(obj);if(!obj)return;useCapture=useCapture?true:false;eventName=eventName.toLowerCase();if(obj.removeEventListener){obj.removeEventListener(eventName,func,useCapture);}
else{if(obj.events&&obj.events[eventName]){var evts=obj.events[eventName];for(var i=0,len=evts.length;i<len;i++){if(evts[i]&&func&&evts[i]===func){evts.splice(i,1);break;}}}}};Events._AttachEvent=function(obj,eventName,func){eventName=eventName.toLowerCase();if(!obj.events)obj.events={};if(!obj.events[eventName])obj.events[eventName]=[];var evts=obj.events[eventName];evts[evts.length]=func;};Events._FireEvent=function(obj,eventName,e,_window){e=_window?_window.event:$E(e);eventName=eventName.toLowerCase();if(!obj||!obj.events||!obj.events[eventName])return;var evts=obj.events[eventName];for(var i=0,len=evts.length;i<len;i++)
evts[i]&&evts[i].call(obj,e,obj);};Events.CancelBubble=function(e){if(!e)return;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();};Events.CancelEvent=function(e){if(!e)return;e.returnValue=false;if(e.preventDefault)e.preventDefault();};Events.CancelAll=function(e){this.CancelBubble(e);this.CancelEvent(e);};Events.Button=function(e){if(e.button!=undefined)return e.button;else if(e.which!=undefined)return e.which;};$Defined('oNode');var oNode={};oNode.IsNode=function(el){if(el&&typeof el=='object'&&el.nodeType==1)
return true;return false;};oNode.IsTextNode=function(el){if(el&&typeof el=='object'&&el.nodeType==3)
return true;return false;};oNode.CreateNode=function(tag){return document.createElement(tag);};oNode.CreateTextNode=function(str){return document.createTextNode(str);};oNode.AddNode=function(node,target){target=target||document.body;if(this.IsNode(node)||this.IsTextNode(node)){if(node.parentNode&&this.IsNode(node.parentNode))return false;target.appendChild(node);}
else{this.AddNode(this.CreateTextNode(node.toString()),target);}
return true;};oNode.RemoveNode=function(node,target){if(!node||!node.parentNode||(node.parentNode&&node.parentNode.nodeType!=1))return;return node.parentNode.removeChild(node);};oNode.InsertBefore=function(node,target){target.parentNode.insertBefore(node,target);};oNode.CreateIframe=function(name){var el;try{el=this.CreateNode('<iframe name="'+name+'">');}
catch(e){el=this.CreateNode('iframe');el.name=name;}
el.id=name;return el;};oNode.CreateForm=function(name,method,enctype){var el;try{el=this.CreateNode('<form name="'+name+'"'+(enctype?'enctype="'+enctype+'"':'')+(method?' method="'+method+'"':'')+'>');}
catch(e){el=this.CreateNode('form');method&&(el.method=method);enctype&&(el.enctype=enctype);el.name=name;}
return el;};oNode.CreateInput=function(name){var el;try{el=this.CreateNode('<input name="'+name+'">');}
catch(e){el=this.CreateNode('input');el.name=name;}
return el;};

// css
$Defined('CSS');var CSS={LEFT:'left',RIGHT:'right',BOTH:'both'};CSS.GetRe=function(c){return new RegExp('^\\s*'+c+'\\s+|\\s+'+c+'\\s*$|\\s+'+c+'\\s+|^\\s*'+c+'\\s*$','');};CSS.AddClass=function(el){if(!oNode.IsNode(el))return;var list=arguments;for(var i=1,len=list.length;i<len;i++){var c=list[i];if(typeof c!='string'||c=='')continue;var re=this.GetRe(c);if(!re.test(el.className)){el.className+=((el.className?'\x20':'')+c).replace(/\s{2,}/g,'\x20');}}};CSS.RemoveClass=function(el){if(!oNode.IsNode(el))return;var list=arguments;for(var i=1,len=list.length;i<len;i++){var c=list[i];if(typeof c!='string'||c=='')continue;var re=this.GetRe(c);if(re.test(el.className)){el.className=el.className.replace(re,'\x20').replace(/^\s{2,}$/,'\x20');}}};CSS.ReplaceClass=function(el,replaced,replacing){this.RemoveClass(el,replaced);this.AddClass(el,replacing);};CSS.HasClass=function(el,c){if(!oNode.IsNode(el))return false;if(typeof c!='string'||c=='')return false;return this.GetRe(c).test(el.className);};CSS.SetAlpha=function(el,opacity){if(Browser.IsIE){try{el.filters[0].Opacity=opacity;}
catch(e){el.style.filter='alpha(Opacity='+opacity+')';}}
else{el.style.MozOpacity=opacity/100;el.style.opacity=opacity/100;}};CSS.GetAlpha=function(el){if(Browser.IsIE){try{return el.filters[0].Opacity;}
catch(e){return 100;}}
else{return el.style.opacity*100;}};CSS.SetDisplay=function(el,display,unset){el.style.display=!!display?(unset?'block':''):'none';};CSS.SetVisible=function(el,visible){el.style.visibility=!!visible?'visible':'hidden';};CSS.SetFloat=function(el,dir){el.style.styleFloat=dir;el.style.cssFloat=dir;};CSS.AddClear=function(el,clear){var node=oNode.CreateNode('div');oNode.AddNode(node,el);node.style.overflow='hidden';node.style.clear=clear;return node;};CSS.SelectOn=function(doc){doc=doc||document;doc.body.style.MozUserSelect='';doc.body.style.KhtmlUserSelect='';doc.onselectstart=null;};CSS.SelectOff=function(doc){doc=doc||document;doc.body.style.MozUserSelect='none';doc.body.style.KhtmlUserSelect='none';doc.onselectstart=function(){return false};};
CSS.AddBack=function(el,insertBefore){var BG=oNode.CreateNode('div');if(el)el.$BG=BG;el&&insertBefore?oNode.InsertBefore(BG,el):oNode.AddNode(BG);with(BG.style){position='absolute';zIndex=1;left='0px';top='0px';background = 'transparent url(' + BBSMAX.SpaceImage + ') repeat 0 0';}
BG.Show=function(){this.style.width=Global.GetDocWidth()-(Browser.IsGecko&&!Browser.IsSafari?18:0)+'px';this.style.height=Math.max(Global.GetDocHeight(),Global.GetClientHeight())+'px';CSS.SetVisible(this,true);};BG.Hide=function(){CSS.SetVisible(this,false);with(this.style){width='1px';height='1px';}};BG.Show();return BG;};CSS.AddStyle=function(cssText){var s=oNode.CreateNode('style');s.type='text/css';if(s.styleSheet){s.styleSheet.cssText=cssText;}
else{oNode.AddNode(cssText,s);}
oNode.AddNode(s,document.getElementsByTagName('head')[0]);return s;};

// oajax
function oAjax(){this.req=null;this.url='';this.content='';this.type='text';this.encode='';this.asyn=true;this.action='get';this.error=false;}
oAjax.prototype.init=function(){if(window.XMLHttpRequest){this.req=new XMLHttpRequest();}
else if(window.ActiveXObject){try{this.req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{this.req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){this.req=false;}}}
var self=this;if(this.req){this.req.onreadystatechange=function(){self.listener()};}};oAjax.prototype.listener=function(){if(this.req.readyState==4){if(this.req.status==200){try{this.callback(Browser.IsIE&&this.encode=='gb2312'?oAjax.gb2utf8(this.req.responseBody):(this.type=='text'?this.req.responseText:this.req.responseXML));}
catch(e){this.halt('[callback] '+e.name+':'+e.message);}}
else{this.halt('[callback error] '+this.req.status);}}};oAjax.prototype.send=function(url){this.init();url=this.url=url||this.url||'';this.content=!!this.content?this.content:'';this.encode=this.encode?this.encode.toLowerCase():'';this.asyn=this.asyn==undefined?true:!!this.asyn;this.action=(this.action==undefined||this.action=='get')?'Get':'Post';this.error=this.error==undefined?false:!!this.error;if(!url&&this.error){alert('Ajax请求URL不能为空。');return;}
try{this.req.open(this.action,url,this.asyn);}
catch(e){this.halt('[open] '+e.name+':'+e.message);return;}
try{this.req.setRequestHeader('Connection','close');this.req.setRequestHeader('Accept-Encoding','gzip, deflate');this.req.setRequestHeader('Content-Type','application/x-www-form-urlencoded'+(this.encode?';charset='+this.encode:''));if(this.req.overrideMimeType&&this.encode){this.req.overrideMimeType('text/xml'+(this.encode?';charset='+this.encode:''));}
this.req.send(this.content);}
catch(e){this.halt('[open] '+e.name+':'+e.message+'\n** 检查是否为跨域访问。');}};oAjax.prototype.callback=function(content){};oAjax.prototype.abort=function(){this.req.abort();};oAjax.prototype.halt=function(description){this.error&&alert(description);};oAjax.gb2utf8=function(data){var glbEncode=[];gb2utf8_data=data;execScript("gb2utf8_data = MidB(gb2utf8_data, 1)","VBScript");var t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");t=t.split("@");var i=0,j=t.length,k;while(++i<j){k=t[i].substring(0,4);if(!glbEncode[k]){gb2utf8_char=eval("0x"+k);execScript("gb2utf8_char = Chr(gb2utf8_char)","VBScript");glbEncode[k]=escape(gb2utf8_char).substring(1,6);}
t[i]=glbEncode[k]+t[i].substring(4);}
gb2utf8_data=gb2utf8_char=null;return unescape(t.join("%"));}
Function.prototype.Bind=function(obj){var method=this;temp=function(){return method.apply(obj,arguments);};return temp;};Function.prototype.Extends=function(Class){if(!Class||!Class.constructor)return;var re=/^function\s+(\S+)\s*\(/;var c=re.exec(Class.constructor.toString());var _Class;if(Class=c&&c[1]&&(_Class=eval(c[1])).prototype){if(!_Class.__super__)_Class.__super__={};c=re.exec(this.toString());if(_Class.__super__[c[1]])return;_Class.__super__[c[1]]=this;this.apply(Class);for(var item in this.prototype){if(!Class[item]){Class[item]=this.prototype[item];}}}};Function.prototype.Rebuild=function(args,addon){var r=';var r_'+Math.floor(r=Math.random())+'='+r+';';var f=(f=this.toString()).substring(f.indexOf('{')+1,f.lastIndexOf('}'));var args=args.length>0?"'"+args.join("','")+"',":'';return eval('new Function ('+args+'addon + ";" + f + r)');};$Defined('Url');var Url={l:location};Url.Get=function(){var $_=arguments;if($_.length==1){($_=($_[0]in this.QS())?this.QS()[$_[0]]:'');}
else if($_.length>1){for(var i=0;i<$_.length;i++){$_[i]=$_[i]in this.QS()?this.QS()[$_[i]]:'';}}
else{$_='';}
return $_;}
Url.Set=function(name,value){this.QueryString[name]=value;};Url.Retrieve=function(){var _url='';for(var item in this.QueryString){var cur=this.QueryString[item];if(_url!='')_url+='&';if(typeof(cur)=='object'){for(var i=0,len=cur.length;i<len;i++){if(_url!='')_url+='&';_url+=item+'='+encodeURIComponent(cur[i]);}}
else{_url+=item+'='+encodeURIComponent(cur);}}
return _url;}
Url.QS=function(){if(typeof this.QueryString=='undefined'){this.QueryString={};var query=this.l.search;query=query.substr(1);query=query.split('&');for(var i=0,len=query.length;i<len;i++){var item=query[i].split('=');var name=item[0];var value=decodeURIComponent(item[1]||'');if(typeof this.QueryString[name]=='undefined'){this.QueryString[name]=value;}
else if(typeof(this.QueryString[name])=='object'){this.QueryString[name].push(value);}
else{var _value=this.QueryString[name];this.QueryString[name]=[_value,value];}}}
return this.QueryString;}
Url.Reload=function(url){var href=this.ClearAnchor(this.l.href);var arr=/^http(?:s)?:\/\/[^\/]+\:(\d+)\//i.exec(this.l.href);var _url='://'+this.l.host+(arr&&arr[1]?':'+arr[1]:'')+url;var sameUrl=0;(this.ClearAnchor('http'+_url)==href&&(sameUrl=1))||(this.ClearAnchor('https'+_url)==href&&(sameUrl=2))
_url=sameUrl!=0&&((sameUrl==1?'http':'https')+_url);if(sameUrl){var anchor=this.GetAnchor(_url);anchor&&this.GotoAnchor(anchor);this.l.reload(true);}
else{this.l.href=url;}};Url.ClearAnchor=function(url){var index;url=url||this.l.href;if((index=url.indexOf('#'))>-1){url=url.substring(0,index);}
return url;};Url.GetAnchor=function(url){url=url||this.l.href;var index=url.lastIndexOf('#');if(index==-1)return'';return url.substr(index+1);};Url.GotoAnchor=function(name){if(name=='')return;this.l.hash=name;};Url.Add=function(url,name,value){if(!value)return url;if(url.indexOf('?')>-1)
url+='&';else
url+='?';url+=name+'='+encodeURIComponent(value);return url;};Url.QS();$Defined('PopUp');
var PopUp={};PopUp.Index=1;PopUp.Panel=function(item,w,h,p){var leaf=oNode.IsNode(item)&&item.parentNode;var panel=leaf?item:oNode.CreateNode('div');panel.tabIndex="-1";panel.style.position='absolute';panel.style.left='-10000px';panel.style.top='-10000px';panel.style.zIndex=2;if(leaf)panel.$Parent=panel.parentNode;panel.Center=function(center){if(center||p){if(leaf){panel.style.display='block';w=panel.offsetWidth;h=panel.offsetHeight;}
w=w||panel.offsetWidth;h=h||panel.offsetHeight;panel.$P=p;panel.style.left=((Global.GetClientWidth()||Global.GetDocWidth())-w)/2+'px';panel.style.top=Global.GetScrollTop()+((Global.GetClientHeight()||Global.GetDocHeight())-h)/2+'px';function move(){if(w!=panel.offsetWidth)w=panel.offsetWidth;if(h!=panel.offsetHeight)h=panel.offsetHeight;panel.style.left=((Global.GetClientWidth()||Global.GetDocWidth())-w)/2+'px';panel.style.top=Global.GetScrollTop()+((Global.GetClientHeight()||Global.GetDocHeight())-h)/2+'px';if(panel.$D){panel.$D.Show();}
if(panel.$M){panel.$M.style.left=panel.style.left;panel.$M.style.top=panel.style.top;}}
panel.$Move=move;}};panel.Center();if(typeof item!='string'){if(!leaf)oNode.AddNode(item,panel);}
else{panel.innerHTML=item;}
return panel;};PopUp.AddPopUp=function(node,modal,target){oNode.AddNode(node,target);if(modal)var D=node.$D=CSS.AddBack(node,true);};PopUp.AddMask=function(node){if(!Browser.IsIE56)return;var M=node.$M=oNode.CreateNode('iframe');oNode.InsertBefore(M,node);M.frameBorder=0;M.scrolling='no';with(M.style){position='absolute';left=node.style.left;top=node.style.top;width=node.offsetWidth+'px';height=node.offsetHeight+'px';opacity=0;filter='alpha(opacity=0)';}};PopUp.RemovePopUp=function(node,target){target=target||document.body;if(node.parentNode!=target)return false;oNode.RemoveNode(node,target);if(node.$D)oNode.RemoveNode(node.$D,node.$D.parentNode);if(node.$M)oNode.RemoveNode(node.$M,node.parentNode);if(node.$BG)oNode.RemoveNode(node.$BG);if(node.$P)Events.RemoveEvent(window,'resize',node.$Move);};PopUp.RestorePopUp=function(node){node.style.left='-10000px';node.style.top='-10000px';PopUp.RemovePopUp(node,node.parentNode);node.$Parent&&oNode.AddNode(node,node.$Parent);};PopUp.SetXY=function(node,x,y){node.style.left=typeof x=='string'?x:x+'px';node.style.top=typeof y=='string'?y:y+'px';if(node.$M){node.$M.style.left=node.style.left;node.$M.style.top=node.style.top;}};PopUp.ResetXY=function(node){if(node.$M){node.$M.style.left=node.style.left;node.$M.style.top=node.style.top;}}
PopUp.SetSize=function(node,w,h){this.SetSizeW(node,w);this.SetSizeH(node,h);};PopUp.SetSizeW=function(node,w){w=typeof w=='string'?w:w+'px';node.style.width=w;this.ResetSize(node);};PopUp.SetSizeH=function(node,h){h=typeof h=='string'?h:h+'px';node.style.height=h;this.ResetSize(node);};PopUp.ResetSize=function(node){if(node.$M){node.$M.style.width=node.offsetWidth+'px';node.$M.style.height=node.offsetHeight+'px';}};PopUp.SetVisible=function(node,visible){visible=visible?'visible':'hidden';node.style.visibility=visible;if(node.$D)node.$D.style.visibility=visible;if(node.$M)node.$M.style.visibility=visible;if(node.$BG)node.$BG.style.visibility=visible;};PopUp.SetDisplay=function(node,display){display=display?'block':'none';node.style.display=display;if(node.$D)node.$D.style.display=display;if(node.$M)node.$M.style.display=display;if(node.$BG)node.$BG.style.display=display;};PopUp.HideModal=function(node){if(node.$D)CSS.SetAlpha(node.$D,0);}
$Defined('Effects');

// Effects
var Effects={};Effects.Switch=function(list,butFocusCss,butBlurCss){for(var i=0,len=list.length;i<len;i++){if(!oNode.IsNode(list[i][0]))list[i][0]=$(list[i][0]);if(!oNode.IsNode(list[i][1]))list[i][1]=$(list[i][1]);}
var cur=0;function _click(e,th){th=th||this;if(cur==th.index)return;var cur_but=list[cur][0];CSS.RemoveClass(cur_but,butFocusCss);CSS.AddClass(cur_but,butBlurCss);list[cur][1].style.display='none';cur_but=list[th.index][0];CSS.RemoveClass(cur_but,butBlurCss);CSS.AddClass(cur_but,butFocusCss);list[th.index][1].style.display='';cur=th.index;Events.CancelAll(e);}
for(var i=0,len=list.length;i<len;i++){var _cur=list[i];var cur_but=_cur[0];cur_but.index=i;Events.AttachEvent(cur_but,'click',_click);_cur[1].style.display=i==0?'':'none';}
list[0][1].style.display='';};
Effects.Move=function(bar,panel,arg){var is_down=false;var X=0,Y=0;var x=0,y=0;var z_index=10000;var topmost=false,modal=false,move,top,right,bottom,left,width,height,down_func,move_func,up_func;if(arg){topmost=arg.topmost;modal=arg.modal;move=arg.move==undefined?true:arg.move;top=arg.top;right=arg.right;bottom=arg.bottom;left=arg.left;width=arg.width;height=arg.height;down_func=typeof arg.downFunc=='function'?arg.downFunc:null;move_func=typeof arg.moveFunc=='function'?arg.moveFunc:null;up_func=typeof arg.upFunc=='function'?arg.upFunc:null;}
var back=null;function mouse_down(e){panel.focus();is_down=true;x=e.clientX+Global.GetScrollLeft();y=e.clientY+Global.GetScrollTop();X=parseInt(panel.style.left);Y=parseInt(panel.style.top);down_func&&down_func(e);if(!panel.$D){if(!back)back=CSS.AddBack(panel);CSS.SetAlpha(back,0);back.Show();}
Events.CancelAll(e);}
function mouse_move(e){if(is_down){var xy=getXY(e);if(modal){var modal_panel=panel.modal_panel;if(!modal_panel){modal_panel=panel.modal_panel=oNode.CreateNode('div');oNode.AddNode(modal_panel,panel.parentNode);with(modal_panel.style){position='absolute';move?(cursor='move'):'';zIndex=panel.style.zIndex;width=panel.offsetWidth+'px';height=panel.offsetHeight+'px';border='1px dotted #000';}
panel.blur();}
if(topmost&&!panel.zIndex){panel.zIndex=panel.style.zIndex;modal_panel.style.zIndex=z_index;}
modal_panel.style.left=xy[0];modal_panel.style.top=xy[1];}
else{if(topmost&&!panel.zIndex){panel.zIndex=panel.style.zIndex;panel.style.zIndex=z_index;}
panel.style.left=xy[0];panel.style.top=xy[1];}
move_func&&move_func(e);}}
function mouse_up(e){if(is_down){is_down=false;if(modal&&panel.modal_panel){if(topmost){panel.zIndex=0;}
panel.style.left=panel.modal_panel.style.left;panel.style.top=panel.modal_panel.style.top;oNode.RemoveNode(panel.modal_panel,panel.parentNode);panel.modal_panel=null;}
else{if(topmost){panel.style.zIndex=panel.zIndex;panel.zIndex=0;}
var xy=getXY(e);panel.style.left=xy[0];panel.style.top=xy[1];}
panel.focus();PopUp.ResetXY(panel);back&&back.Hide();up_func&&up_func(e);}
else{}}
function getXY(e){var x_t=X+e.clientX-x;var y_t=Y+e.clientY-y;var w_t=panel.offsetWidth-Global.GetClientWidth();var h_t=panel.offsetHeight-Global.GetClientHeight();if(w_t>0){left=-w_t*2;right=w_t;}
else{left=0;right=-w_t;}
if(h_t>0){top=-h_t*2;bottom=h_t;}
else{top=0;bottom=-h_t;}
var mw=Math.min(panel.offsetWidth,Global.GetClientWidth());var mh=Math.min(panel.offsetHeight,Global.GetClientHeight());if(Math.abs(left)>mw){left=-Math.abs(left)/2;right=-left;}
if(Math.abs(top)>mh){top=-Math.abs(top)/2;bottom=-top;}
if(x_t<left)x_t=left;else if(x_t>right)x_t=right;if(y_t<top)y_t=top;else if(y_t>bottom)y_t=bottom;x_t=x_t+Global.GetScrollLeft()+'px';y_t=y_t+Global.GetScrollTop()+'px';return[x_t,y_t];}
Events.AttachEvent(bar,'mousedown',mouse_down);Events.AttachEvent(document,'mousemove',mouse_move);Events.AttachEvent(bar,'mouseup',mouse_up);panel.remove_event=function(){Events.RemoveEvent(bar,'mousedown',mouse_down);Events.RemoveEvent(document,'mousemove',mouse_move);Events.RemoveEvent(bar,'mouseup',mouse_up);}
if(panel.style.position!='absolute'){var _l=Global.GetOffsetLeft(panel);var _t=Global.GetOffsetTop(panel);panel.style.position='absolute';panel.style.zIndex=1;panel.style.left=_l+'px';panel.style.top=_t+'px';}
if(move&&bar)bar.style.cursor='move';}

// common
function userMsg(){var user_msg=$('user_msg');if(!user_msg)return;var tip=user_msg.tip;if(!tip){if(!$('user_message')||!$('user_msg_close'))return;$('user_message')._html=$('user_message').innerHTML;$('user_message').innerHTML='';var content=$('user_message')._html;tip=user_msg.tip=PopUp.Panel(content);PopUp.AddPopUp(tip,false,document.forms[0]);PopUp.AddMask(tip);function user_msg_resize(){var l=Global.GetOffsetLeft(user_msg)-287+75;var t=Global.GetOffsetTop(user_msg)+15;PopUp.SetXY(tip,l,t);}
user_msg_resize();Events.AttachEvent(window,'resize',user_msg_resize);var close=userMsg.close=function(e){Events.RemoveEvent(window,'resize',user_msg_resize);Events.RemoveEvent($('user_msg_close'),'click',close);PopUp.RemovePopUp(tip,tip.parentNode);e&&Events.CancelAll(e);}
Events.AttachEvent($('user_msg_close'),'click',close);}}
function userMsgReply(th,messageId){var p=th.parentNode.parentNode;var reply=$('user_message_reply');oNode.RemoveNode(reply,reply.parentNode);if(th.parentNode.parentNode.nextSibling){oNode.InsertBefore(reply,th.parentNode.parentNode.nextSibling);}
else{oNode.AddNode(reply,p.parentNode);}
reply.style.display='';$('topHiddenMessageID').value=messageId;}
BindPopup.currentMenu=null;BindPopup.back=null;function BindPopup(binderId,popupId,align,offsetX,offsetY){var binder=$(binderId);if(!binder)return;var popup=$(popupId);if(!popup)return;popup.style.position='absolute';popup.style.visibility='visible';popup.style.zIndex=10;if(!offsetX)offsetX=0;if(!offsetY)offsetY=0;var back=BindPopup.back;if(Browser.IsIE56&&!back){back=BindPopup.back=oNode.CreateNode('iframe');oNode.InsertBefore(back,popup);back.style.position='absolute';back.style.left='-1000px';back.style.top='-1000px';CSS.SetAlpha(back,0);}
var interval;Events.AttachEvent(binder,'mouseover',function(){if(interval)clearTimeout(interval);if(BindPopup.currentMenu&&BindPopup.currentMenu!=popup)
BindPopup.currentMenu.hide();popup.style.zIndex=10;popup.style.display='';move();BindPopup.currentMenu=popup;});Events.AttachEvent(binder,'mouseout',function(){hide();});Events.AttachEvent(popup,'mouseover',function(){clearTimeout(interval);});Events.AttachEvent(popup,'mouseout',function(){hide();});function move(){popup.style.top=Global.GetOffsetTop(binder)+binder.offsetHeight+'px';var left=Global.GetOffsetLeft(binder);align=align||'left';switch(align.toString().toLowerCase()){case'left':break;case'center':left+=(binder.offsetWidth-popup.offsetWidth)/2;break;case'right':left+=binder.offsetWidth-popup.offsetWidth;break;}
popup.style.left=left+offsetX+'px';if(back){back.style.left=popup.style.left;back.style.top=popup.style.top;back.style.width=popup.offsetWidth+'px';back.style.height=popup.offsetHeight+'px';}}
function hide(){interval=setTimeout(_hide,500);}
function _hide(){popup.style.display='none';popup.style.zIndex=1;if(back){back.style.left='-1000px';back.style.top='-1000px';}
Events.RemoveEvent(window,'resize',move);}
popup.hide=_hide;}
function resetPopup(el){if(el.tagName.toLowerCase()=='div')
return el;var c=document.createElement('div');c.innerHTML=el.innerHTML;oNode.RemoveNode(el);oNode.AddNode(c);c.style.display='none';return c;}
function Switch(num,tag){for(var x=1;x<num;x++){var list=[];var heads=$('head_'+x).getElementsByTagName('a');var bodys=$('body_'+x).getElementsByTagName(tag?tag[x-1]:'ul');for(var i=0,len=heads.length;i<len;i++){list[i]=[heads[i],bodys[i]];}
Effects.Switch(list,'current','');}}
function FormSubmit(th){setTimeout(function(){th.disabled=true},100);return true;}
function itemClick(th){try{var p=th.parentNode.parentNode;th.checked?CSS.AddClass(p,'current'):CSS.RemoveClass(p,'current');}
catch(e){}}
function imageScale(th,dw,dh,nonMargin){var ow=th.offsetWidth,oh=th.offsetHeight;th.ow=ow;th.oh=oh;if(ow/oh>dw/dh){if(ow>dw){th.style.width=dw+'px';th.style.height=dw/ow*oh+'px';nonMargin||(th.style.marginTop=(dh-dw/ow*oh)/2+'px');}
else{nonMargin||(th.style.marginTop=(dh-oh)/2+'px');}}
else{if(oh>dh){th.style.height=dh+'px';th.style.width=dh/oh*ow+'px';}
else{nonMargin||(th.style.marginTop=(dh-oh)/2+'px');}}}
function imageTip(pCss){var tip=new Tip();tip.Condition=function(e){var obj=$EO(e);while(obj){if(obj.className&&obj.className.indexOf(pCss)>-1)break;obj=obj.parentNode;}
if(obj)obj=$EO(e);if(!obj||obj.tagName.toLowerCase()!='img'){this.display=false;}
else{if(imageTip.src!=obj.src){imageTip.src=obj.src;this.text='<img src="'+obj.src+'" />';}
this.display=true;}
return true;};tip.Change=function(e,flow){var imgs=flow.getElementsByTagName('img');if(imgs&&imgs[0]){var ow=imgs[0].width,oh=imgs[0].height;var w=300;if(w<ow){imgs[0].width=w-20;imgs[0].height=(w-20)/ow*oh;}}};tip.Create();tip.css.tip='image-tip';}
function clearEditorContent(str){str=str.replace(/(<img[^>]+?)onload="[^"]+?"([^>]*?>)/gi,'$1$2');str=str.replace(/(<img[^>]+?)onerror="[^"]+?"([^>]*?>)/gi,'$1$2');return str;}
function validateClear(validate_id,input_name,panel_id){validateReset(validate_id);input_name=document.getElementsByName(input_name);input_name.length>0&&(input_name[0].value='');AjaxRequest.Clear('ap_checkvcode');}
function validateReset(id){var p=$(id);if(!p)return;var img=p.getElementsByTagName('img')[0];if(!img)return;if(!img._src)img._src=img.src;img.src=img._src+'&rnd='+Math.random();}
function reloadImage(th){if(!th._src)th._src=th.src;var src=th._src+(th._src.indexOf('?')>-1?'&':'?');th.src=src+'rnd='+Math.random();}
DomEvent.events={};DomEvent.list=[];DomEvent.saved=true;DomEvent.EventExecuteAble=true;DomEvent.EventExecuteFunc=new Function();function DomEvent(){var isShift,isCtrl,isAlt;var type=0;function keyEvent(e){var num=0;var EnterNum=0;isShift=e.shiftKey;isCtrl=e.ctrlKey;isAlt=e.altKey;var es=DomEvent.events;for(var item in es){if((!es[item][0].isShift&&!es[item][0].isCtrl&&!es[item][0].isAlt&&!isShift&&!isCtrl&&!isAlt&&es[item][0].keyCode==e.keyCode&&e.keyCode==13&&(type=1))||(isShift&&isShift==es[item][0].isShift&&es[item][0].keyCode==e.keyCode&&(type=2))||(isCtrl&&isCtrl==es[item][0].isCtrl&&es[item][0].keyCode==e.keyCode&&(type=3))||(isAlt&&isAlt==es[item][0].isAlt&&es[item][0].keyCode==e.keyCode&&(type=4))){num++;if(type==1&&!DomEvent.EventExecuteAble){DomEvent.EventExecuteFunc&&DomEvent.EventExecuteFunc();return false;}
if(type==1&&$EO(e).tagName.toLowerCase()=='textarea'){(Widget.InfoNum==1)&&Events.CancelAll(e);DomEvent.DefaultClose();return false;}
if(Widget.InfoNum==1){DomEvent.DefaultClose();Events.CancelAll(e);return false;}
else{if(type==1&&es[item][2]&&$(es[item][2])&&$(es[item][2]).type=='submit')
continue;if(es[item][2]&&$(es[item][2]))
es[item][1].call($(es[item][2]));else
es[item][1]();}}}}
if(Browser.IsOpera)
Events.AttachEvent(document,'keypress',keyEvent);else
Events.AttachEvent(document,'keydown',keyEvent);DomEvent.AttachDefault();}
DomEvent.AttachDefault=function(){DomEvent.events['InfoClose_'+Global.Random()]=[{isShift:false,isCtrl:false,isAlt:false,keyCode:13},DomEvent.DefaultClose];};DomEvent.DefaultClose=function(){Widget&&Widget.InfoClose();AjaxRequest.IsSubmited=false;};DomEvent.Clear=function(retrieve){this.events={};this.saved=false;if(retrieve){this.saved=true;for(var i=0,len=this.list.length;i<len;i++){var l=this.list[i];setShortcut.apply(null,l);}}
DomEvent.AttachDefault();};function setShortcut(buttonName,eventName,shortcut,func){buttonName=buttonName&&buttonName.id||buttonName;this.saved&&this.list.push([buttonName,eventName,shortcut,func]);if(typeof shortcut=='string')shortcut=[shortcut.toLowerCase()];for(var i=0,len=shortcut.length;i<len;i++){var arr=/(shift|ctrl|alt)\+([a-z0-9]+)/i.exec(shortcut[i]);if(!arr&&shortcut[i]!='enter')return;if(shortcut[i]=='enter')arr=['','','enter'];arr[1]=arr[1].toLowerCase();arr[2]=arr[2].toLowerCase();var _shortcut={isShift:arr[1]=='shift',isCtrl:arr[1]=='ctrl',isAlt:arr[1]=='alt',keyCode:arr[2]=='enter'?13:arr[2].charCodeAt(0)};if(_shortcut.keyCode>=97&&_shortcut.keyCode<=121){_shortcut.keyCode-=32;}
var hasAttach=false;for(var item in DomEvent.events){if(!item[1])continue;if(item[1].toString()==func.toString()&&item[0].isShift==_shortcut.isShift&&item[0].isCtrl==_shortcut.isCtrl&&item[0].isAlt==_shortcut.isAlt&&item[0].keyCode==_shortcut.key){hasAttach=true;break;}}
if(!hasAttach)
DomEvent.events[buttonName+'_'+Global.Random()]=[_shortcut,func,buttonName];}
var but=buttonName&&$(buttonName);but&&Events.AttachEvent(but,eventName,func);}
function ubbCopy(th){var txt=th.parentNode.parentNode.getElementsByTagName('code')[0].innerHTML;txt = txt.replace(/&lt;/g,'<');txt = txt.replace(/&gt;/g,'>');txt = txt.replace(/&amp;/g,'&');copyToClipboard(txt);}
function ubbRun(th){var txt=th.parentNode.parentNode.getElementsByTagName('code')[0].innerHTML;var win=window.open('about:blank');txt=txt.replace(/&lt;/g,'<');txt=txt.replace(/&gt;/g,'>');txt=txt.replace(/&amp;/g,'&');win.document.open();win.document.write(txt);win.document.close();}
function hideMenu(menu){Events.AttachEvent(menu,'click',function(){this.style.visibility='hidden';Events.AttachEvent(this,'click',arguments.callee);});}
function selectedMenuItem(){var sidebar=$('sidebar_content');if(!sidebar)return;var links=sidebar.getElementsByTagName('a');for(var i=links.length-1;i>-1;i--){if(location.href.indexOf(links[i].href)>-1){CSS.AddClass(links[i],'current');break;}}}
function undisabledSubmit(){var inputs=document.getElementsByTagName('input');for(var i=0,len=inputs.length;i<len;i++){if(inputs[i].type=='submit')inputs[i].disabled=false;}}
function postTo(url){document.forms[0].action=url;document.forms[0].submit();}
function go(url){location.href=url;}
function Reload(url){var href=Url.ClearAnchor(location.href);var arr=/^http(?:s)?:\/\/[^\/]+\:(\d+)\//i.exec(href);var _url='://'+location.host+(arr&&arr[1]?':'+arr[1]:'')+Url.ClearAnchor(url);if(href=='http'+_url||href=='https'+_url){if(url.indexOf('#')==-1){location.href=url;}
else{location.href='/go.aspx?url='+encodeURIComponent(url);}}
else{location.href=url;}}
function QQChat(qq){openFile('Tencent://Message/?menu=yes&exe=&uin='+qq+'&websiteName=bbsmax&info=');}
function WLMChat(msn){openFile('msnim:chat?contact='+msn);}
function WangWang(id){openFile('wangwang:SendIM?'+id+'&uid_t='+id);}
function Skype(id){openFile('skype:'+id+'?call');}
function Gtalk(gmail){openFile('gtalk:chat?jid='+gmail);}
function openFile(url){var self=arguments.callee;var frame=self.frame;if(!frame){frame=self.frame=oNode.CreateIframe('im_'+Global.Random());oNode.AddNode(frame);frame.style.display='none';}
window.open(url,frame.name);}
Events.AttachEvent(window,'load',function(){if(typeof(pageID)!='undefined')
pageID=pageID.toLowerCase();DomEvent();selectedMenuItem();undisabledSubmit();});onlineUserTip.xOffset=2;onlineUserTip.yOffset=2;onlineUserTip.Event=false;onlineUserTip.flow=null;onlineUserTip.hasOver=false;onlineUserTip.nonHideUser=false;onlineUserTip.interval=0;onlineUserTip.delay=200;onlineUserTip.userLoading=false;onlineUserTip.userLoaded=false;onlineUserTip.guestLoading=false;onlineUserTip.guestLoaded=false;function onlineUserTip(th,id){var isUser=false,isGuest=false;var _id=id;if(/.{32}/.test(id)){isGuest=true;id='online_guest_'+id;}
else{isUser=true;id='online_user_'+id;}
if(isUser&&!onlineUserTip.userLoading){onlineUserTip.userLoading=true;AjaxRequest.Render('','ap_online_users',function(){onlineUserTip.userLoaded=true;onlineUserTip(th,_id);});}
if(isGuest&&!onlineUserTip.guestLoading){onlineUserTip.guestLoading=true;AjaxRequest.Render('','ap_online_guests',function(){onlineUserTip.guestLoaded=true;onlineUserTip(th,_id);});}
if(!onlineUserTip.userLoaded&&isUser||!onlineUserTip.guestLoaded&&isGuest)
return;var flow=onlineUserTip.flow;if(!flow){flow=onlineUserTip.flow=PopUp.Panel($('online_tip'));PopUp.AddPopUp(flow);PopUp.AddMask(flow);flow.onmouseover=function(){clearTimeout(onlineUserTip.interval)};flow.onmouseout=function(){onlineUserTip.interval=setTimeout(function(){onlineUserTip.hide(flow);},onlineUserTip.delay)};}
var obj=$(id);if(!obj)return;if(isUser&&!obj.isChange){obj.isChange=true;var userName=obj.getElementsByTagName('li')[0];oNode.RemoveNode(userName);if(userName.innerHTML.Trim()!=''){obj.isShow=true;var li=oNode.CreateNode('li');oNode.AddNode(li,obj);CSS.AddClass(li,'member-info-buttons');li.innerHTML=$('online_tip_btn').innerHTML.replace(/\{nickname\}/gi,userName.innerHTML);var info=li.getElementsByTagName('a')[2];if(info)info.href=info.href.replace(/userid=\d+/i,'UserID='+_id);else li.style.display='none';}}
onlineUserTip.nonHideUser=isUser&&obj.isShow;flow.getElementsByTagName('ul')[0].innerHTML=obj.innerHTML;if(!th.isCreate){th.isCreate=true;th.onmouseout=function(){onlineUserTip.hasOver=false;if(onlineUserTip.nonHideUser){onlineUserTip.interval=setTimeout(function(){onlineUserTip.hide(flow);},onlineUserTip.delay);}
else{onlineUserTip.hide(flow);}};}
onlineUserTip.hasOver=true;onlineUserTip.hasShow=false;clearTimeout(onlineUserTip.interval);if(!onlineUserTip.Event){onlineUserTip.Event=true;flow.style.display='';Events.AttachEvent(document,'mousemove',function(e){if(!onlineUserTip.hasOver)return;var obj=$EO(e);var isOver=false;while(obj){if(obj.onmouseover&&/onlineUserTip/.test(obj.onmouseover.toString())){isOver=true;break;}
obj=obj.parentNode;}
if(!isOver)return;onlineUserTip.hasShow||onlineUserTip.show(e,onlineUserTip.flow);if(onlineUserTip.nonHideUser)
onlineUserTip.hasShow=true;});}}
onlineUserTip.show=function(e,flow){var x=e.clientX+onlineUserTip.xOffset;var y=e.clientY+onlineUserTip.yOffset;var W=Global.GetClientWidth();var H=Global.GetClientHeight();var w=flow.offsetWidth;var h=flow.offsetHeight;if(x+w>W){x=e.clientX-w-onlineUserTip.xOffset;}
if(x<0)x=0;if(y+h>H){y=e.clientY-h-onlineUserTip.yOffset;}
if(y<0)y=0;x+=Global.GetScrollLeft();y+=Global.GetScrollTop();PopUp.SetXY(flow,x,y);};onlineUserTip.hide=function(flow){flow.style.left='-1000px';flow.style.top='-1000px';};function sameSetting(th,tagId){$(tagId).style.display=!th.checked?'':'none';}
function copyToClipboard(txt){if(window.clipboardData){window.clipboardData.clearData();window.clipboardData.setData("Text",txt);}
else if(navigator.userAgent.indexOf("Opera")!=-1){window.location=txt;}
else if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
catch(e){alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");return;}
var clip=Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if(!clip)
return;var trans=Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if(!trans)
return;trans.addDataFlavor('text/unicode');var str=new Object();var len=new Object();var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);var copytext=txt;str.data=copytext;trans.setTransferData("text/unicode",str,copytext.length*2);var clipid=Components.interfaces.nsIClipboard;if(!clip)
return false;clip.setData(trans,null,clipid.kGlobalClipboard);}
alert("复制成功！");}
function AvatarLoaded(th,nonMargin){th.onload=null;th.onerror=null;setTimeout(function(){if(th.width==0||th.height==0){th.style.width='auto';th.style.height='auto';return;}
var w=th.width,h=th.height;th.style.width='auto';th.style.height='auto';imageScale(th,w,h,!!nonMargin);th.parentNode&&(th.parentNode.style.backgroundImage='url(' + BBSMAX.SpaceImage + ')');th.style.visibility='visible';},10);}
function AvatarError(th){th.onload=null;th.onerror=null;th.src=BBSMAX.SpaceImage;th.parentNode&&(th.parentNode.style.background='url('+BBSMAX.AvatarDefault+') no-repeat center center');}
function ImageLoaded(th,w,h){th.onload=null;th.onerror=null;th.style.backgroundImage='url('+BBSMAX.SpaceImage+')';setTimeout(function(){w=th.width;h=th.height;},100);th.onclick=function(){var panel=PopUp.Panel($('image_viewer'));PopUp.AddPopUp(panel,true);PopUp.AddMask(panel);$('image_viewer_img').innerHTML='<img src="'+th.src+'" width="'+w+'" height="'+h+'" />';panel.Center(true);panel.$D.style.background='#000';CSS.SetAlpha(panel.$D,10);document.body.style.overflow='hidden';Effects.Move($('image_viewer_move'),panel,{modal:false});$('image_viewer_move').style.width=panel.offsetWidth+'px';$('image_viewer_move').style.height=panel.offsetHeight+'px';PopUp.ResetSize(panel);$('image_viewer_close').onclick=function(){panel.remove_event();mw.RemoveEvent();PopUp.RestorePopUp(panel);document.body.style.overflow='auto';};var _w=w,_h=h;var mw=new MouseWheel();mw.Handle=function(delta){if(delta<0){if(_w<w/2||_h<h/2)return;_w-=_w*0.1;_h-=_h*0.1;}
else{if(_w>2*w||_h>2*h)return;_w+=_w*0.1;_h+=_h*0.1;}
var img=$('image_viewer_img').getElementsByTagName('img')[0];img.style.width=_w+'px';img.style.height=_h+'px';panel.style.left=(Global.GetClientWidth()-_w)/2+'px';panel.style.top=Global.GetScrollTop()+(Global.GetClientHeight()-_h)/2+'px';$('image_viewer_move').style.width=panel.offsetWidth+'px';$('image_viewer_move').style.height=panel.offsetHeight+'px';PopUp.ResetSize(panel);};};}
function ImageError(th){th.error=true;th.onload=null;th.onerror=null;th.src=BBSMAX.ImageDefault;th.style.width='auto';th.style.height='auto';th.style.background='url()';}
function showAttachment(th){var tip=$('attachment');if(!tip.ispopup){tip.ispopup=true;PopUp.Panel(tip);PopUp.AddPopUp(tip);}
tip.style.display='block';tip.style.left=Global.GetOffsetLeft(th)+'px';tip.style.top=Global.GetOffsetTop(th)+20+'px';function mouseout(){tip.style.display='none';Events.RemoveEvent(th,'mouseout',mouseout);}
Events.AttactEvent(th,'mouseout',mouseout);}
showVCode.c=null;showVCode.current=null;showVCode.tip=null;function showVCode(th,src){var c=showVCode.c;if(c&&showVCode.current!=th){showVCode.current=th;showVCode.tip.style.display='';c.src=BBSMAX.CodeUrl+src;c._src='';reloadImage(c);}
if(!c){c=showVCode.c=oNode.CreateNode('img');oNode.AddNode(c);c.style.position='absolute';c.style.cursor='pointer';c.style.left='-100px';c.style.top='-100px';c.title='看不清，点击刷新';c.src=BBSMAX.CodeUrl+src;Events.AttachEvent(c,'click',function(){reloadImage(c);});c.onload=function(){c.style.border='1px solid #ccc';showVCode.show(c,th);showVCode.tip.style.display='none';};var mousedown=showVCode.mousedown=function(e){var obj=$EO(e);if(obj==showVCode.current||obj==showVCode.c)return;showVCode.hide();};Events.AttachEvent(document,'mousedown',mousedown);}
var tip=showVCode.tip;if(!tip){tip=showVCode.tip=oNode.CreateNode('div');oNode.AddNode(tip);CSS.AddClass(tip,'validcode-loader');tip.style.position='absolute';tip.style.zIndex=11;tip.innerHTML='载入验证码...';tip.style.left=Global.GetOffsetLeft(th)+'px';tip.style.top=Global.GetOffsetTop(th)-tip.offsetHeight+'px';c.style.display='none';}
if(showVCode.current!=th){reloadImage(c);showVCode.current=th;}
c.style.zIndex=10;showVCode.show(c,th);}
showVCode.show=function(){c=showVCode.c;th=showVCode.current;c.style.display='block';c.style.left=Global.GetOffsetLeft(th)+'px';c.style.top=Global.GetOffsetTop(th)-c.offsetHeight+'px';};showVCode.hide=function(){this.c.style.display='none';};showVCode.clear=function(){this.c=null;this.current=null;this.tip&&oNode.RemoveNode(this.tip);this.tip=null;this.mousedown&&Events.RemoveEvent(document,'mousedown',this.mousedown);};function selectListAll(th,name){var list=document.getElementsByName(name);for(var i=0,len=list.length;i<len;i++){list[i].checked=th.checked;var p=list[i].parentNode.parentNode;list[i].c=th;th.checked?CSS.AddClass(p,'current'):CSS.RemoveClass(p,'current');}}
function selectListOne(th){var p=th.parentNode.parentNode;th.checked?CSS.AddClass(p,'current'):CSS.RemoveClass(p,'current');th.c&&(th.c.checked=false);}
function cancelSelected(){$('selecteAll').checked=false;}
function ImageView(){var bg,panel,img,mw;var w,h,_w,_h,x,y;var moveObj;var isDown=false;function mousedown(e){var obj=$EO(e);if(Events.Button(e)!=1&&Events.Button(e)!=0)return;while(isDown&&obj){if(obj==moveObj){x=e.clientX;y=e.clientY;return;}
obj=obj.parentNode;}
if(isDown){isDown=false;close_view();return;}
obj=$EO(e);while(obj){if(obj.className&&obj.className.indexOf('post-content')>-1)break;obj=obj.parentNode;}
if(!obj)return;obj=$EO(e);if(obj.tagName.toLowerCase()=='img'&&!obj.error){isDown=true;open_view(obj.src);Events.AttachEvent(window,'resize',resize);mw=new MouseWheel();mw.Handle=function(delta){if(delta<0){if(_w<w/2||_h<h/2)return;_w-=_w*0.1;_h-=_h*0.1;}
else{if(_w>2*w||_h>2*h)return;_w+=_w*0.1;_h+=_h*0.1;}
img.style.width=moveObj.style.width=_w+'px';img.style.height=moveObj.style.height=_h+'px';panel.style.left=moveObj.style.left=(Global.GetClientWidth()-_w)/2+'px';panel.style.top=moveObj.style.top=Global.GetScrollTop()+(Global.GetClientHeight()-_h)/2+'px';};}}
Events.AttachEvent(document,'mousedown',mousedown);Events.AttachEvent(document,'mouseup',function(e){if(isDown&&x==e.clientX&&y==e.clientY){isDown=false;close_view();x=0;y=0;}});function resize(){bg.Show();}
function open_view(src){bg=CSS.AddBack();CSS.SetAlpha(bg,50);bg.style.background='#000';bg.style.top='0px';panel=oNode.CreateNode('div');oNode.AddNode(panel);panel.style.position='absolute';panel.style.zIndex=2;img=oNode.CreateNode('img');oNode.AddNode(img,panel);img.src=src;moveObj=CSS.AddBack();w=_w=img.offsetWidth;h=_h=img.offsetHeight;if(_w>Global.GetClientWidth()||_h>Global.GetClientHeight()){_w=w*0.5;_h=h*0.5;img.style.width=_w+'px';img.style.height=_h+'px';Effects.Move(moveObj,moveObj,{moveFunc:function(e){panel.style.left=moveObj.style.left;panel.style.top=moveObj.style.top;Events.CancelAll(e);}});Events.AttachEvent(moveObj,'click',function(){isDown=false;close_view();});}
panel.style.left=moveObj.style.left=(Global.GetClientWidth()-_w)/2+'px';panel.style.top=moveObj.style.top=Global.GetScrollTop()+(Global.GetClientHeight()-_h)/2+'px';moveObj.style.width=_w+'px';moveObj.style.height=_h+'px';}
function close_view(){mw.RemoveEvent();Events.RemoveEvent(window,'resize',resize);oNode.RemoveNode(bg);oNode.RemoveNode(panel);oNode.RemoveNode(moveObj);}}
PostViewStyle.current_css='';function PostViewStyle(th,css){var current_css=PostViewStyle.current_css;while(th){if(th.tagName.toLowerCase()=='table'){th=th.getElementsByTagName('div');for(var i=0,len=th.length;i<len;i++){if(th[i].className.indexOf('post-content')>-1){CSS.RemoveClass(th[i],current_css);CSS.AddClass(th[i],css);PostViewStyle.current_css=css;break;}}
break;}
th=th.parentNode;}}
function ImageScalePost(){var posts=[];var divs=document.getElementsByTagName('div');for(var i=0,len=divs.length;i<len;i++){if(divs[i].className.indexOf('post-content')>-1){posts.push(divs[i]);}}
for(i=0,len=posts.length;i<len;i++){var imgs=posts[i].getElementsByTagName('img');for(var j=0,_len=imgs.length;j<_len;j++){imgs[j].w=imgs[j].offsetWidth;imgs[j].h=imgs[j].offsetHeight;imgs[j].width=1;}}
for(i=0,len=posts.length;i<len;i++){var W=posts[i].offsetWidth;var H=posts[i].offsetHeight;var imgs=posts[i].getElementsByTagName('img');for(var j=0,_len=imgs.length;j<_len;j++){var w,h;if(imgs[j].w<=600){w=imgs[j].w;h=imgs[j].h;}
else{w=W*0.9;h=imgs[j].h*W/imgs[j].w*0.9;}
imgs[j].width=w;imgs[j].height=h;}}}
function showMemberInfo(th){if(th.display)return;th.display=true;if(Browser.IsIE){th.parentNode.style.height=th.parentNode.offsetHeight+'px';}
else{th.parentNode.style.border='1px solid #fff';th.parentNode.style.height=th.parentNode.offsetHeight-2+'px';}
th.parentNode.style.position='relative';th.style.zIndex=10;CSS.AddClass(th,'author-infolist-expand');th.onmouseout||(th.onmouseout=function(){th.display=false;th.style.zIndex=0;th.parentNode.style.position='static';CSS.RemoveClass(th,'author-infolist-expand');th.parentNode.style.height='auto';})
return;showMemberInfo.tip&&(showMemberInfo.tip.style.visibility='hidden');Events.RemoveEvent(document,'mousemove',showMemberInfo.mousemove);var url=th.getElementsByTagName('a');if(!url||!url[0])return;url=url[0].href;var arr=/userid=(\d+)/i.exec(url);var id=arr&&arr[1]?arr[1]:0;if(!id)return;var tip=showMemberInfo.tip=$('userid_'+id);if(!tip.ispopup){tip.ispopup=true;oNode.RemoveNode(tip,tip.parentNode);oNode.AddNode(tip,document.body);PopUp.Panel(tip);PopUp.AddPopUp(tip);}
tip.display=true;tip.style.visibility='visible';tip.style.left=Global.GetOffsetLeft(th)-10+'px';tip.style.top=Global.GetOffsetTop(th)-4+'px';var mousemove=showMemberInfo.mousemove=function(e){if(!tip.display)return;var obj=$EO(e);while(obj){if(obj==tip){break;}
obj=obj.parentNode;}
if(!obj){tip.display=false;tip.style.visibility='hidden';Events.RemoveEvent(document,'mousemove',mousemove);}
Events.CancelAll(e);}
setTimeout(function(){Events.AttachEvent(document,'mousemove',mousemove)},10);}
function scrollFaceTitle(){var list=$('face_title_list');if(!list)return;var w=0;var titles=list.getElementsByTagName('div');for(var i=0;i<titles.length;i++){if(i==0){titles[i].className='focus';viewGroup.current=titles[i];}
w+=titles[i].offsetWidth+2;}
w+=2;list.style.width=w+'px';list.style.left='0';$('face_title').style.overflow='hidden';var scope=$('face_title').offsetWidth-$('control').offsetWidth;if(w<scope){$('face_prev').style.display='none';$('face_next').style.display='none';return;}
var dir;var step=5;var interval=0;function startMove(){var l=parseInt(list.style.left);if(dir){if(l-step+w<scope)l=scope-w;else l-=step;}
else{if(l+step>0)l=0;else l+=step;}
list.style.left=l+'px';interval=setTimeout(startMove,30);}
function stopMove(){clearTimeout(interval);}
$('face_prev').onmouseover=function(){dir=0;startMove();};$('face_prev').onmouseout=function(){stopMove();};$('face_next').onmouseover=function(){dir=1;startMove();};$('face_next').onmouseout=function(){stopMove();};}
function viewGroup(th,url){if(viewGroup.current)
viewGroup.current.className='';viewGroup.current=th;th.className='focus';AjaxRequest.Render(url);}
function addFace(src){var enableHtml=$('enableHtml');var enableMaxCode=$('enableMaxCode');var str='';if(enableMaxCode&&enableMaxCode.checked){str='[img]'+src+'[/img]'}
else if(enableHtml&&enableMaxCode.checked){str='<img src="'+src+'" />';}
if(str){var editor=$('Editor')
editor&&(editor.value+=str);}}
function showPreview(th,src){var preview=$('face_preview');var container=$('preview_container');var img=oNode.CreateNode('img');oNode.AddNode(img,container);img.onload=function(){if(!this.parentNode)return;AvatarLoaded(this);preview.style.visibility='visible';};img.width=preview.offsetWidth;img.height=preview.offsetHeight;img.src=src;var l=Global.GetOffsetLeft(th,$('face_list'));preview.style.left=l>100?'10px':'auto';preview.style.right=l>100?'auto':'10px';th.onmouseout||(th.onmouseout=hidePreview);}
function hidePreview(){$('preview_container').innerHTML='';$('face_preview').style.visibility='hidden';}

// AjaxRequest
var AjaxRequest={FormIndex:0};AjaxRequest.SetFormIndex=function(index){if(typeof index=='number'){this.FormIndex=index;}
else if(index=='last'){this.FormIndex=document.forms.length-1;}};AjaxRequest.Callback=function(content,url,callback,ButtonName){var arr;var op_state='',op_content='',defaultRedirect={index:-1,url:'',time:0};if(/^\[(success|error|alert|url)\][\s\S]+?\[returnurl(?:=\d+)?\][\s\S]+?/i.test(content)){arr=/\[(success|error|alert|url)\]([\s\S]+?)\[returnurl(?:=\d+)?\]([\s\S]+?)\{.{8}\-.{4}\-.{4}\-.{4}\-.{12}\}/.exec(content);if(!arr)arr=/\[(success|error|alert|url)\]([\s\S]+?)\[returnurl(?:=\d+)?\]([\s\S]+)/.exec(content);op_state=arr[1];var index;var returnurl=content.match(/\[returnurl(?:=\d+)?\]/gi);for(var i=0,len=returnurl.length;i<len;i++){var item=/\[returnurl=(\d+)\]/i.exec(returnurl[i]);if(item){defaultRedirect={index:i,url:'',time:item[1]};break;}}
var _arr=arr[3].split(/\[returnurl(?:=\d+)?\]/i);for(var i=0,len=_arr.length;i<len;i++){var item=_arr[i].split('|');op_content+=('<a href="'+item[1]+'"');if(item[1].indexOf('javascript:')!=0)
op_content+=(' onclick="Url.Reload(this.href);return false;"');op_content+=('>'+item[0]+'</a><br />');if(i==defaultRedirect.index)defaultRedirect.url=item[1];}
op_content=arr[2]+'<p>'+op_content+'</p>';Widget.InfoCloseAble=false;DomEvent.EventExecuteAble=false;DomEvent.EventExecuteFunc=function(){Url.Reload(_arr[0].split('|')[1]);}}
else{if(/\{.{8}\-.{4}\-.{4}\-.{4}\-.{12}\}/.test(content)){arr=/^\[(success|error|alert|url)\]([\s\S]+?)\{.{8}\-.{4}\-.{4}\-.{4}\-.{12}\}/i.exec(content);var len=0;if(arr){op_state=arr[1];op_content=arr[2];len=op_state.length+2+op_content.length;}
content=content.substr(len);}
else{arr=/^\[(success|error|alert|url)\]([\s\S]*)/i.exec(content);if(arr){op_state=arr[1];op_content=arr[2];}
content='';}}
if(op_state=='url'){Url.Reload(op_content);return;}
Widget.HideLoading();content=content==''?[]:content.split(content.substr(0,38));for(var i=0,len=content.length;i<len;i++){if(content[i]){var index=content[i].indexOf('|');var id='ajaxpanel_'+content[i].substr(0,index);var obj=$(id);if(!obj)continue;obj.innerHTML=content[i].substr(index+1).replace(/\r|\n/g,'').replace(/ +/g,' ');}}
if(defaultRedirect.index>-1)
setTimeout(function(){Url.Reload(defaultRedirect.url);},defaultRedirect.time*1000);callback?callback(op_state,op_content,ButtonName):Widget.Auto(op_state,op_content,ButtonName);if(content=='')return;for(var i=0,len=document.forms.length;i<len;i++){url&&(document.forms[i].action=url);}};AjaxRequest.Render=function(url,id){if(Widget.InfoNum)return;var ids=ToArray(arguments,1);var callback=ids[ids.length-1];if(typeof callback=='function')ids=ids.slice(0,ids.length-1);else callback=null;var _ids=ids.length>0?ids.join(','):'*';url=url||(document.forms[this.FormIndex]&&document.forms[this.FormIndex].action)||this.ClearUrl(location.href);var ajax=new oAjax();ajax.url=url;ajax.content='_AjaxPanelId='+_ids;ajax.action='post';ajax.error=!true;ajax.callback=function(content){setTimeout(function(){AjaxRequest.Callback(content,url,callback);for(var i=0,len=ids.length;i<len;i++){var obj=$('ajaxpanel_'+ids[i]);if(!obj)continue;var loading=$('ajaxloading_'+obj.loadingid);loading&&(loading.style.display='none');}},0);};ajax.send();for(var i=0,len=ids.length;i<len;i++){var obj=$('ajaxpanel_'+ids[i]);if(!obj)continue;if(!obj._lastupdate)obj._lastupdate=0;obj._lastupdate2=new Date().getTime();}};AjaxRequest.IsSubmited=false;AjaxRequest.Submit=function(ButtonName,id){if(Widget.InfoNum)return;this.IsSubmited=true;var f=document.forms[this.FormIndex];if(!f)return;var ids=Array.prototype.slice.apply(arguments).slice(1);var callback=ids[ids.length-1];if(typeof callback=='function')ids=ids.slice(0,ids.length-1);else callback=null;var _ids=ids.length>0?ids.join(','):'*';var list;if(this.FormIndex){for(var i=0;i<2;i++){var _list=this.GetFieldEnum(document.forms[i]);for(var item in _list){if(!list)
list=_list;else
list[item]=_list[item];}}}
else{list=this.GetFieldEnum(f);}
if(ButtonName!=''){ButtonName=list['ButtonProxy']=[ButtonName=='*'?this.GetFirstSubmit(f):ButtonName];ButtonName=ButtonName[0];}
AjaxRequest.DisableButton(ButtonName,true);var query='';for(var item in list){for(var i=0,len=list[item].length;i<len;i++){if(query!='')query+='&';query+=item+'='+encodeURIComponent(list[item][i]);}}
var url=f.action||this.ClearUrl(location.href);var ajax=new oAjax();ajax.url=url;ajax.content=query+'&_AjaxPanelId='+_ids;ajax.action='post';ajax.error=false;ajax.callback=function(content){setTimeout(function(){AjaxRequest.Callback(content,url,callback,ButtonName);},0);};ajax.send();for(var i=0,len=ids.length;i<len;i++){var obj=$('ajaxpanel_'+ids[i]);if(!obj)continue;if(!obj._lastupdate)obj._lastupdate=0;obj._lastupdate2=new Date().getTime();}};AjaxRequest.GetFieldEnum=function(f){var list={};for(var i=0,len=f.elements.length;i<len;i++){var item=f.elements[i];var name=item.name;if(item.disabled)continue;if(!list[name])list[name]=[];switch(item.tagName.toLowerCase()){case'input':switch(item.type){case'text':case'hidden':case'password':list[name].push(item.value);case'radio':case'checkbox':if(item.checked)list[name].push(item.value);break;}
break;case'textarea':list[name].push(item.value);break;case'select':list[name].push(item.options[item.selectedIndex].value);break;}}
return list;};AjaxRequest.GetFirstSubmit=function(f){var inputs=f.getElementsByTagName('input');for(var i=0,len=inputs.length;i<len;i++){if(inputs[i].type=='submit'||inputs[i].type=='image')
return inputs[i].name;}
return'';};AjaxRequest.DisableButton=function(ButtonName,disabled){try{var but=ButtonName&&$(ButtonName);if(!but)return;but.disabled=disabled;if(disabled){but._onclick||(but._onclick=but.onclick);but._href||(but._href=but.href);but.onclick=function(){};but.href='javascript:void(0);';}
else{but.onclick=but._onclick;but.href=but._href;}}
catch(e){}};AjaxRequest.ClearUrl=function(url){url=url.substring(0,url.indexOf('#'))||url;return url;};AjaxRequest.Clear=function(){for(var i=0,len=arguments.length;i<len;i++){var obj=$('ajaxpanel_'+arguments[i]);obj&&(obj.innerHTML='');}};var Request={FormIndex:0};Request.Submit=function(ButtonName,Target){var f=document.forms[this.FormIndex];if(!f)return;Target&&(f.target=Target);if(!f.elements['ButtonProxy']){var but=oNode.CreateInput('ButtonProxy');but.type='hidden';oNode.AddNode(but,f);}
f.elements['ButtonProxy'].value=[ButtonName||AjaxRequest.GetFirstSubmit(f)];f.method='post';f.submit();this.FormIndex=0;};

// Widget
var Widget={InfoNum:0,InfoCloseAble:true,Success:function(t,c,callback){var p=this.Info(t,c,callback);var p_canel=$('popup_info_canel');CSS.RemoveClass(p,'error','alert');CSS.AddClass(p,'valid');CSS.SetDisplay(p_canel,false);},Error:function(t,c,callback){var p=this.Info(t,c,callback);var p_canel=$('popup_info_canel');CSS.RemoveClass(p,'valid','alert');CSS.AddClass(p,'error');CSS.SetDisplay(p_canel,false);},Alert:function(t,c,callback){var p=this.Info(t,c,callback);var p_canel=$('popup_info_canel');CSS.RemoveClass(p,'valid','error');CSS.AddClass(p,'alert');CSS.SetDisplay(p_canel,false);},Confirm:function(t,c,func,callback){var p=this.Info(t,c,function(){if($('popup_info')._returnValue)func();callback&&callback();});CSS.RemoveClass(p,'valid','error');CSS.AddClass(p,'alert');var p_canel=$('popup_info_canel');CSS.SetDisplay(p_canel,true);},Info:function(title,content,callback){var p=$('popup_info');var p_bar=$('popup_info_bar');var p_title=$('popup_info_title');var p_content=$('popup_info_content');var p_close=$('popup_info_close');var p_confirm=$('popup_info_confirm');var p_canel=$('popup_info_canel');if(p._display)PopUp.RestorePopUp(p);p._returnValue=false;p_title.innerHTML=title;content&&(p_content.innerHTML=content);if(this.InfoCloseAble){function _confirm(){p._returnValue=true;_close();}
var _close=Widget.InfoClose=function(e){p._display=false;Widget.InfoNum=0;e&&Events.CancelAll(e);PopUp.RestorePopUp(p);Events.RemoveEvent(p_close,'click',_close);Events.RemoveEvent(p_canel,'click',_close);Events.RemoveEvent(p_confirm,'click',_confirm);Events.RemoveEvent(window,'scroll',scroll);callback&&callback();};Events.AttachEvent(p_close,'click',_close);Events.AttachEvent(p_canel,'click',_close);Events.AttachEvent(p_confirm,'click',_confirm);p_confirm.parentNode.style.display='';}
else{p_close.style.display='none';p_confirm.parentNode.style.display='none';}
Effects.Move(p_bar,p,{modal:!true});PopUp.Panel(p,0,0,true);PopUp.AddPopUp(p,true);PopUp.AddMask(p);p.style.zIndex=10;p._display=true;function scroll(){PopUp.SetXY(p,p.style.left,Global.GetScrollTop()+(Global.GetClientHeight()-p.offsetHeight)/2);}
Events.AttachEvent(window,'scroll',scroll);this.InfoNum=1;return p;},InfoClose:function(){},ContentNum:0,Content:function(title,content,width,callback){DomEvent.Clear();AjaxRequest.SetFormIndex(1);this.ContentNum=1;var w=$('popup_win');var w_bar=$('popup_win_bar');var w_title=$('popup_win_title');var w_content=$('popup_win_content');var w_close=$('popup_win_close');w.style.width=(width||350)+'px';if(oNode.IsNode(content)){if(!content._innerHTML){content._innerHTML=content.innerHTML;content.innerHTML='';}
content=content._innerHTML;}
if(w._display)PopUp.RestorePopUp(w);title&&(w_title.innerHTML=title);content&&(w_content.innerHTML=content);w._close=function(e){DomEvent.Clear(true);Widget.ContentNum=0;AjaxRequest.FormIndex=0;callback&&callback();w._display=false;e&&Events.CancelAll(e);w_content.innerHTML='';PopUp.RestorePopUp(w);Events.RemoveEvent(w_close,'click',w._close);};this.Close=w._close;Events.AttachEvent(w_close,'click',w._close);PopUp.Panel(w,0,0,true);PopUp.AddPopUp(w,true);PopUp.AddMask(w);w._display=true;Effects.Move(w_title,w,{modal:!true});this.Focus(w);return w;},Focus:function(w){w=w||$('popup_win');var inputs=w.getElementsByTagName('input');if(inputs&&inputs[0]&&inputs[0].type=='text')inputs[0].focus();},Resize:function(){$('popup_win').$Move();},Show:function(){PopUp.SetVisible($('popup_win'),true);},Hide:function(){PopUp.SetVisible($('popup_win'),false);},Close:function(){},Auto:function(state,content,ButtonName){AjaxRequest.DisableButton(ButtonName,false);if(state=='success'){try{Widget.Close();}
catch(e){}}
switch(state){case'success':Widget.Success('操作成功',content);break;case'error':Widget.Error('错误',content);break;case'alert':Widget.Alert('警告',content);break;}},LoadingNum:0,ShowLoading:function(id,p){id=id||'popup_loading';var w=$(id);if(!w)return;this.HideLoading();this.LoadingNum++;var w_close=$(id+'_close');var w_back=$(id+'_back');var w_retry=$(id+'_retry');if(w&&w_close&&w_back&&w_retry){PopUp.Panel(w,0,0,true);PopUp.AddPopUp(w,true);PopUp.AddMask(w);p&&PopUp.SetXY(w,Global.GetOffsetLeft($(p)),Global.GetOffsetTop($(p)));var HideLoading=this.HideLoading=function(){this.HideLoading1(w);};Events.AttachEvent(w_close,'click',HideLoading);}
else{w.style.display='';if(p){w.style.left=Global.GetOffsetLeft($(p))+'px';w.style.top=Global.GetOffsetTop($(p))+'px';}
this.HideLoading=function(){this.HideLoading2(w);};}},HideLoading:function(){},HideLoading1:function(w){this.LoadingNum--;if(this.LoadingNum>1&&this.HideLoading==this.HideLoading1)return;this.LoadingNum=0;w&&PopUp.RestorePopUp(w);w=null;},HideLoading2:function(w){this.LoadingNum--;w.style.display='none';}};

// Roll
$Defined('Roll');var Roll={};Roll.Left=function(el,content){};Roll.Right=function(el,content){};Roll.Top=function(el,content,args){if(!el||!content)return;if(typeof args!='object')args={};if(typeof args.scrollamount!='number')
args.scrollamount=30;if(typeof args.scrolldelaymin!='number')
args.scrolldelaymin=50;if(typeof args.scrolldelaymax!='number')
args.scrolldelaymax=2000;CSS.AddClass(el,'roll');var one;if(oNode.IsNode(content)){one=content;}
else{one=oNode.CreateNode('div');oNode.AddNode(one,el);one.innerHTML=content;}
CSS.AddClass(one,'top-one');one.style.top=0;if(Math.floor(one.offsetHeight/args.scrollamount)<2)return;var childs=one.getElementsByTagName('li');for(var i=0,len=childs.length;i<len;i++){childs[i].style.height=args.scrollamount+'px';}
var two=one.cloneNode(true);oNode.AddNode(two,el);CSS.AddClass(one,'top-two');two.style.top=one.offsetHeight+'px';var mouseover=false;var overState=0;var delay1=args.scrolldelaymin;var delay2=args.scrolldelaymax;var amount1=args.scrollamount||20;var amount2=0;var interval;function roll(){if(amount2==0){overState=1;if(mouseover)return;if(parseInt(one.style.top)<-one.offsetHeight){one.style.top=parseInt(two.style.top)+two.offsetHeight+'px';}
if(parseInt(two.style.top)<-two.offsetHeight){two.style.top=parseInt(one.style.top)+one.offsetHeight+'px';}
amount2=amount1;interval=setTimeout(roll,delay2);return;}
overState=0;amount2--;one.style.top=parseInt(one.style.top)-1+'px';two.style.top=parseInt(two.style.top)-1+'px';interval=setTimeout(roll,delay1);}
roll();Events.AttachEvent(el,'mouseover',function(){mouseover=true;if(overState==1)
clearTimeout(interval);});Events.AttachEvent(el,'mouseout',function(){mouseover=false;if(overState==1){clearTimeout(interval);interval=setTimeout(roll,delay2);}});};Roll.Bottom=function(el,content){};

// oImage
$Defined('oImage');var oImage={};oImage.Scale=function(ow,oh,dw,dh,mt){var s={w:0,h:0,mt:0};if(ow/oh>dw/dh){if(ow>dw){s.w=dw;s.h=dw/ow*oh;mt&&(mt=(dh-dw/ow*oh)/2);}
else{s.w=ow;s.h=oh;mt&&(mt=(dh-oh)/2);}}
else{if(oh>dh){s.h=dh;s.w=dh/oh*ow;}
else{s.w=ow;s.h=oh;mt&&(mt=(dh-oh)/2);}}
mt&&(s.mt=Math.floor(mt));return s;}
