 Mo.ready(function(){Serv.Classic.Init();});Serv.Classic={ action:"ajax.php", editMode:false, frame:null, Sidebar:{ toggle:function(closed,marked){if(closed||Mo("#sidebar").style('display')!="none"){Mo("#sidebar").hide();Mo("#control").attr({'class':'left'});Mo("#container").style({'marginLeft':'0'});if(marked)Mo.Cookie.set("__sidebar","false");}else{Mo("#sidebar").show();Mo("#control").attr({'class':''});Mo("#container").style({'marginLeft':Mo("#sidebar").position().width});if(marked)Mo.Cookie.set("__sidebar","true");}
Serv.Classic.resize();}, splay:function(o){var _dis,_cls,_in;if(o.className.indexOf("active")>-1){_dis="none";_cls="";_in="展开全部菜单";}else{_dis="block";_cls="active";_in="收缩全部菜单";};o.title=_in;o.className=_cls;Mo("#menu-link ul").style({'display':_dis});Mo("#menu-link div").style({'display':_cls});}, change:function(obj,self){Mo("#menu-link ul").hide();Mo("#menu-link div").style({'display':''}).attr({'class':''});if(obj){Mo(obj).toggle();self.scrollIntoView(true);if(self.className=="active"){self.className=""}else{self.className="active"};}}, open:function(obj,url){if(Serv.prefix.editMode){if(Serv.Interflow.setMode(!confirm("您的操作尚未结束，离开或刷新页将会放弃所作的操作。\n\n是否同意放弃保存操作？"))){return;}};Serv.Classic.setBox(url);Serv.Interflow.setHash("V",url);Serv.Classic.Sidebar.find(url); }, find:function(url){if(!Mo("#menu-link").size())return false;Mo("#menu-link li").attr({'class':''});var url=decodeURIComponent(url);Mo('#menu-link a').each(function(ele){if(this.getAttribute('href',2)==url){Mo(ele).parent().attr({'class':'active'});Mo(ele).parent(2).show();}});}},setBox:function(url){Serv.Classic.frame.location.href=decodeURIComponent(url);}, Init:function(){Mo("#control").bind('mouseover',function(){Serv.Tip('伸缩侧边栏',this)}).bind('mouseout',function(){Serv.Tip();}).bind('click',function(){Serv.Classic.Sidebar.toggle(null,true);});Mo("#bind_splay").bind('mouseover',function(){Serv.Tip('伸缩菜单',this)}).bind('mouseout',function(){Serv.Tip();}).bind('click',function(){Serv.Classic.Sidebar.splay(this);});Mo("#bind_start").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/admin.start.php');});Mo("#bind_attach").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/data.attach.php');});Mo("#bind_licence").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/system.licence.php');});Mo("#bind_admin").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/admin.list.php');});Mo("#bind_system").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/serve.control.php');});Mo("#bind_module").bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/module.control.php');});Mo("#bind_account").unbind('click').bind('click',function(){Serv.Classic.Sidebar.open(this,'module/system/admin.edit.php?action=edit&id='+Mo.store.aid);});Mo("#bind_logout").unbind('mouseover');Mo("#header-search form").bind('submit',function(){Mo('#q').value(Mo('#q').attr('defaultValue')==Mo('#q').value()?'':Mo('#q').value());Serv.Classic.Sidebar.open(this,'module/system/serve.search.php?q='+Mo('#q').value());return false;});Mo("#header-search input").bind('focus',function(){this.value=(this.defaultValue==this.value?'':this.value);this.className='active';});Mo("#header-search input").bind('blur',function(){this.value=(this.defaultValue!=this.value?this.value:this.defaultValue);this.className='';});Serv.Classic.frame=window.frames["column"];Serv.Classic.Links.save();var url=Mo.get('V');var url=Mo.store.account?(url?url:'module/system/admin.start.php'):'dialog/blank.html';Serv.Classic.setBox(url);if(Mo('#menu-link').size()){Serv.Classic.Sidebar.change();Serv.Classic.Sidebar.find(url);Mo("#menu-link div").bind('click',function(ele){Serv.Classic.Sidebar.change('#mod_'+ele.getAttribute('data-appid'),this);});Mo("#menu-link ul a").bind('click',function(ele){Serv.Classic.Sidebar.open(this,this.getAttribute('href',2),true);return false;});if(Mo.Cookie.get("__sidebar")=='false'){Serv.Classic.Sidebar.toggle(true,true);}}}, resize:function(){Serv.prefix.top=Mo("#header").position().height-10;Serv.prefix.left=0;Serv.prefix.width=Mo.document.clientWidth;Serv.prefix.height=Math.abs(Mo.document.clientHeight-Mo("#header").position().height);Mo.store.login&&Mo.store.login.Center();var body=document.documentElement;var header=Mo.$("header");var sidebar=Mo.$("sidebar");try{if(Mo.store.account){Mo('#menu-link').style({'height':Math.abs(body.clientHeight-header.offsetHeight-20-Mo.$("menu-title").offsetHeight-Mo.$("sidebar-search").offsetHeight)+"px"})}else{Mo('#sidebar').style({'height':Math.abs(body.clientHeight-header.offsetHeight-12)+"px"})};Mo('#column').style({'width':Math.abs(body.offsetWidth-sidebar.offsetWidth-5)+"px",'height':Math.abs(body.clientHeight-header.offsetHeight-5)+"px"});}catch(err){window.status=err.description;}}, Links:{ save:function(){if(Mo("#header-links").size()){Mo.store.links=new Object();Mo.store.links.i=0;Mo.store.links.links=new Array();Mo("#header-links a").each(function(ele,index){Mo.store.links.links[index]='<a href="'+ele.href+'" title="'+ele.title+'" target="_blank">'+ele.innerHTML+'</a>';});Serv.Classic.Links.slice();window.setInterval(Serv.Classic.Links.slice,4000);}}, slice:function(){var links=Mo.store.links.links;Mo("#header-links").html('<img src="image/ad.gif" /> '+links[Mo.store.links.i]);Mo.store.links.i++;if(Mo.store.links.i>=links.length){Mo.store.links.i=0;}}}};Serv.resize=Serv.Classic.resize;
