  if(typeof Serv!='object'){var Serv={}}
 Serv.Message=function(message,type){Mo.Message(type?type:"info",'<div class="s"></div><div class="c">'+message+'</div><div class="e"></div>',3,{"unique":"message","center":true});};Serv.Manager={ date:{"时段":["01","02"],"分钟":["01","02"]}, profile:function(uid){new parent.Serv.Dialog('dialog','用户个人信息','<iframe src="'+Mo.store.base+'module/member/member.profile.php?uid='+uid+'" frameborder=0></iframe>','850','70%',{'remove':true,'draged':true,'create':true});}, Init:function(){if(Mo("#naver").size()){Serv.Naver(location.href,Mo.$("naver"),true);}
Mo(document).bind('click',function(ele,index,event){if(top!=self){top.Mo("#link").hide();top.Mo("#collect").hide();top.Serv.Apps.find(parent!=top?parent:self);}});}, Loaded:function(event){ if(Mo("#table").size()){ var mk=Mo.get("mark");if(mk){Mo.Tips(Mo.$("mark_"+mk),event,'',Mo("#mark_"+mk).attr("text"),'click',80,0,{"unique":"bubble"});}
 Mo("#table tr").bind('mousedown',function(ele,index,event){var target=Mo.Event(event).target();var mark=ele.getAttribute("mark");if(!ele.getAttribute("face")){ele.setAttribute("face",ele.className);}
 if(mark&&target.tagName=="TD"&&Mo("input[type=checkbox]",ele).size()){var obj=Mo("input[type=checkbox]",ele).item(0).click();}
}).bind('dblclick',function(ele,index,event){var edit=ele.getAttribute("edit");if(!edit){return false;};location.href=edit.replace('{jump}',encodeURIComponent(location.href));}); Mo("#table tr td input[type=checkbox]").bind('click',function(ele,index,event){var tr=ele.parentNode.parentNode;var face=tr.getAttribute("face");Mo(tr).attr({"className":(ele.checked?'choice':face)});});}
if(parent.parent.Mo.store.model=="classic"){Mo("a").each(function(ele,index){var hash=ele.getAttribute("ext-hash");var tget=ele.getAttribute("target");if(hash&&tget!='_blank'){Mo(ele).bind('click',function(){var url=this.href.replace(Mo.store.host,Mo.store.base);parent.parent.Serv.Interflow.setHash("V",url);parent.parent.Serv.Classic.Sidebar.find(url);});}});}
if(Mo("#saving button").size()&&((Mo.Browser.msie&&Mo.Browser.version>6)||Mo.Browser.name!="ie")){Mo("#saving").attr({"className":"adv"}).show();}
Mo("form").each(function(form,index){var len=form.elements.length;for(var i=0;i<len;i++){var ele=form.elements[i];var des=ele.getAttribute("fix_desc");if(!des)continue;(function(){var self=ele;var desc=des;if(!self.value){self.value=desc;self.className+=' desc';};self.onfocus=function(){if(this.value==desc){this.value='';this.className=this.className.replace(' desc','');}};self.onblur=function(){if(!this.value){this.value=desc;this.className+=' desc';}};})();}
if(form.getAttributeNode("verify")&&form.getAttributeNode("verify").nodeValue=="true"){form.onsubmit=function(){var result=Mo.Form(this,function(x){Mo.Message("wrong",'<div class="s"></div><div class="c">'+x+'</div><div class="e"></div>',3,{"unique":"message","center":true});},'desc');if(result){};return result;}}
if(form.getAttribute("mode")=="edit"){form.onkeydown=function(){parent.parent.Serv.Interflow.setMode(true);}}}); }};Mo.reader(Serv.Manager.Init);  Serv.Hello=function(){var h=new Date().getHours();var b=[6,12,14,18,24];var w=["清晨","上午","中午","下午","晚上"];var i=0;for(;h>=b[i++];);return w[i-1]+"好！";}
 Serv.Week=function(){return new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());}
 Serv.Naver=function(url,box,set){var tag=box.getElementsByTagName("A");var len=tag.length;for(var i=0;i<len;i++){var rel=tag[i].getAttribute("rel");var pos=Mo.url(url);if(url.indexOf(tag[i].href)>-1||(rel&&rel.indexOf(pos.file)>-1)){if(set){tag[i].parentNode.className="active";}else{tag[i].parentNode.className="";};continue;}}};function detectCapsLock(ele,index,event){var e=event||window.event;var o=e.target||e.srcElement; var keyCode=e.keyCode||e.which; var isShift=e.shiftKey||(keyCode==16)||false;if( ((keyCode>=65&&keyCode<=90)&&!isShift) ||((keyCode>=97&&keyCode<=122)&&isShift)){Mo.Message("wrong",'<div class="s"></div><div class="c">注意：Caps Lock 键已被按下</div><div class="e"></div>',3,{"unique":"message","center":true});}else{Mo("#bubble").remove();}}
 function getSelect2Select(Select1,Select2,ToSelect,ToValue){var _select1=new getSelect(Select1);var _select2=new getSelect(Select2);var _select3=$(ToSelect);var _input=$(ToValue);var _s=false;for(var i=0;i<_select3.length;i++){if(_select3[i].value==_select2.value){_s=true;}};if(_s||_select3.length>2)return true;var _value=_select1.value+","+_select2.value+"|";_select3[_select3.length]=new Option(_select1.text+" >> "+_select2.text,_value);_input.value+=_value;}
 function SelectAppend(ToSelect,Text,Value){var sel=document.getElementById(ToSelect);var add=true;var len=sel.length;for(var i=0;i<len;i++){if(sel[i].text==Text&&sel[i].value==Value){add=false;break;}};if(Text&&add)sel[sel.length]=new Option(Text,Value);}
 function SelectDelete(ToSelect,ToValue){var _select=document.getElementById(ToSelect);var _input=document.getElementById(ToValue);if(_select.selectedIndex>-1){_input.value=_input.value.replace(_select[_select.selectedIndex].value+",","");document.getElementById(ToSelect).remove(_select.selectedIndex);}}
 function SelectValue(list,to){var sel=document.getElementById(list);var ipt=document.getElementById(to);var str="";var len=sel.length;for(var i=0;i<len;i++){str+=sel[i].value+",";};ipt.value=str;}
 function SelectSort(list,to){var index=list.selectedIndex;var total=list.options.length-1;if(index==-1)return false;if(to==+1&&index==total)return false;if(to==-1&&index==0)return false;var items=new Array;var values=new Array;for(i=total;i>=0;i--){items[i]=list.options[i].text;values[i]=list.options[i].value;};for(i=total;i>=0;i--){if(index==i){list.options[i+to]=new Option(items[i],values[i],0,1);list.options[i]=new Option(items[i+to],values[i+to]);i--;}else{list.options[i]=new Option(items[i],values[i]);}};list.focus();}
Mo.folder={};Mo.folder.image=Mo.store.base+"image/";Mo.folder.icons=Mo.store.base+"image/icon/";Mo.Tools=function(s,v,args){switch(s){case"Top":Mo.write("<a href='javascript:window.scroll(0,0);' name='"+v+"'><img src='"+Mo.folder.image+"top.gif' alt='Go To Top!' align='absmiddle' style='float:right' /></a>");break; case"Tip":if(!v)return true;Mo.write("<img src='"+Mo.folder.image+"question.gif' align='absmiddle' onmouseover='this.src=this.src.replace(\"question.gif\",\"answer.gif\");Mo.Tips(this,event,\"tips\",\""+v+"\");' onmouseout='this.src=this.src.replace(\"answer.gif\",\"question.gif\");Mo(\"#tips\").hide();' /> ");break;case"RsURL":if(v.indexOf("?")>-1){v=v+"&";}else{v=v+"?";};v=v+"jump="+encodeURIComponent(location.href);Mo.write(" <a href='"+v+"'>"+args+"</a> ");break;case"RsFile":var t=v.split(".")[v.split(".").length-1];if(!v||Mo.Array(Serv.Upload.Format).indexOf(t)==-1){Mo.write("<img src='"+Mo.folder.image+"format/unknow.gif' title='未知文件:"+t+"'  align='absmiddle' /> ");}else{Mo.write("<a href='"+args+v+"' target='_blank'><img src='"+Mo.folder.image+"format/"+t+".gif' title='新窗口打开文件'  align='absmiddle' /></a> ");};break;case"RsType":var t=v.split(".")[v.split(".").length-1];if(!v||Mo.Array(Serv.Upload.Format).indexOf(t)==-1){Mo.write("<img src='"+Mo.folder.image+"format/unknow.gif' title='未知类型'  align='absmiddle' /> ");}else{if(args){Mo.write("<a href='"+args+t+"'><img src='"+Mo.folder.image+"format/"+t+".gif' title='"+t+"格式'  align='absmiddle' /></a> ");}else{Mo.write("<img src='"+Mo.folder.image+"format/"+t+".gif' title='"+t.toUpperCase()+"格式'  align='absmiddle' /> ");}};break;case"RsImage":if(!v){Mo.write("<img src='"+Mo.folder.image+"file.png' title='无图片'  align='absmiddle' /> ");}else{if(args){Mo.write("<a href='"+v+"' target='_blank'><img src='"+Mo.folder.image+"image.png' align='absmiddle' onmouseover='Mo.Tips(event,this,\"tips\",\"<img src="+v+" />\",this,\"mouseout\");' /></a> ");}else{Mo.write("<a href='"+v+"' target='_blank'><img src='"+Mo.folder.image+"/image.png' title='新窗口打开图片'  align='absmiddle' /></a> ");}};break;case"RsDelete":if(v.indexOf("?")>-1){v=v+"&";}else{v=v+"?";};v=v+"jump="+encodeURIComponent(location.href);var i=args==""?i="确定要删除这条记录吗?":i=args;Mo.write(" <a href='"+v+"' onclick='return confirm(&quot;"+i+"&quot;);'><img src='"+Mo.folder.icons+"trash.png' alt='删除' align='absmiddle' /> ");break;case"RsEdit":if(v.indexOf("?")>-1){v=v+"&";}else{v=v+"?";};v=v+"jump="+encodeURIComponent(location.href);Mo.write(" <a href='"+v+"'><img src='"+Mo.folder.icons+"pencil.png' alt='编辑' align='absmiddle' /></a> ");break;case"RsNew":Mo.write(" <a href='"+v+"'><img src='"+Mo.folder.icons+"plus.png' alt='添加内容' align='absmiddle' /></a> ");break;}}
 Mo.Status=function(parent,id,baseUrl,array,value,mx,my){if(!Mo(id).size()){mx=mx?mx:0;my=my?my:0;var obj=document.createElement("ul");obj.id=id;obj.className="select";var html='';for(var key in array){if(key!=value){html+="<li><a href='"+baseUrl+key+'&amp;jump='+encodeURIComponent(location.href)+"' title='"+array[key]+"'>○ "+array[key]+"</a></li>";}else{html+="<li>● "+array[key]+"</li>";Mo(parent).html(array[key]);}}
 obj.innerHTML=html;Mo(parent).append(obj);(function(){var o=obj;var p=parent;p.onmouseover=function(){var pos=Mo(p).position();var x=pos.left;var y=pos.top;with(o.style){left=x+mx+"px",top=y+my+"px",position="absolute",display="block"}};p.onmouseout=function(event){o.style.display="none";}})();}};
