/*
* author: Lin Xiao Dong <1071322670@qq.com>
* update: 2018.07.16
* website: http://www.openwbs.com/
*/
function openwbsAdminIndexInit(){var a=$(".top-menu"),b=$("#top-admin"),c=$("#top-admin-sub");a.find("li.m").hover(function(){$(this).addClass("hover"),$(this).find("div.sub-wrapper").show()},function(){$(this).removeClass("hover"),$(this).find("div.sub-wrapper").hide()}),a.find(".sub-wrapper li").hover(function(){$(this).addClass("hover"),$(this).find(".sub2-wrapper").show()},function(){$(this).removeClass("hover"),$(this).find(".sub2-wrapper").hide()}),a.find("li[class!='m']").click(function(){}),a.find(".sub2-wrapper > ul").each(function(){OW.isNull($(this).html())&&$(this).parent().parent().remove()}),a.find(".submenu").each(function(){OW.isNull($(this).html())&&$(this).remove()}),a.find(".sub-wrapper").each(function(){OW.isNull($(this).html())&&$(this).parent().remove()}),b.hover(function(){$(this).addClass("hover"),c.show()},function(){$(this).removeClass("hover"),c.hide()}),c.find("li:last-child").find("a").css("border-bottom","none"),$("#edit_password").click(function(){OWDialog({id:"d_edit_password",title:"修改密码",iframe:"index.asp?ctl=setting&act=edit_my_password&t="+parseInt(1e3*Math.random()),padding:"0px 0px",height:300,width:620})}),$("a[name='update']").click(function(){Admin.update()}),$("a[name='about']").click(function(){Admin.about()})}function getLeftpannelHtml(){Admin.ajax({url:"index.asp?ctl=index&act=view_all&subact=category_list&r="+OW.random(),success:function(){var a=unescape(Admin.ajaxData.html);$("#leftpannel").html(a),leftpannelInit()},failed:function(a){$dialog.error("获取数据失败，请重新刷新整个后台页面！",a).timeout(1)}})}function leftpannelInit(){var a=OW.int(OW.cookie.getCookie("leftmenutype"));$("div.websites").hover(function(){$("div.websites-sub").show()},function(){$("div.websites-sub").hide()}),$("ul.left-menu li").hover(function(){$(this).addClass("hover");var a=$(this).find("div.sub-menu"),b=$(this).offset().top,c=a.height()+b,d=1;c>=OW.webScreenHeight()&&(d=c-OW.webScreenHeight(),d>b&&(d=b)),a.css("top","-"+d+"px"),a.show()},function(){$(this).removeClass("hover"),$(this).find("div.sub-menu").hide()}).click(function(){$(".left-menu li").removeClass("current"),$(this).addClass("current")}),OW.tabSwitch({tabbar:$(".l-tabbar"),container:$("#tabs_container"),current:a}),APIndexSet(),window.onresize=function(){APIndexSet()}}function APIndexSet(){var e,f,a=$("#mainFrame"),b=$("#mainFrameBox"),c=OW.webScreenHeight(),d=OW.webScreenWidth();900>=d&&(d=900),e=c-parseInt($("div.header").height()),f=d-parseInt($("#left-menu").width()),$("#left-menu").height(e),a.css({height:e+"px",width:f+"px"}),b.css({height:e+"px",width:f+"px"}),$(".ow-navigator-edit").find("a").click(function(){$("#tabs_container").find("li.current").removeClass("current")})}function autoFixIfm(){var a,b=$("#mainFrame");a=b.attr("src"),a=a.toLowerCase(),"index.asp"==a&&b.attr("src","index.asp?ctl=index&act=destop")}function indexDestopInit(){Admin.goBackHide(),$("div[name='label']>a").click(function(){OWDialog({id:"d_label_manage",title:""+$(this).attr("title")+" - 内容管理",height:OW.webScreenHeight()-60,width:OW.webScreenWidth()-60,padding:"0px",iframe:"index.asp?ctl=label&act=edit&id="+$(this).attr("label_id")+"&r="+OW.random()})}),$("div[name='position']>a").click(function(){var a="";a="0"==$(this).attr("is_shop")?"position_data":"shop_position_data",OWDialog({id:"d_label_manage",title:""+$(this).attr("title")+" - 内容管理",height:OW.webScreenHeight()-60,width:OW.webScreenWidth()-60,padding:"0px",cancel:!0,cancelValue:"关闭",iframe:"index.asp?ctl="+a+"&act=list&pos_id="+$(this).attr("pos_id")+"&r="+OW.random()})}),$("div[name='from']>a").click(function(){OWDialog({id:"d_label_manage",title:""+$(this).attr("title")+" - 内容管理",height:OW.webScreenHeight()-60,width:OW.webScreenWidth()-60,padding:"0px",cancel:!0,cancelValue:"关闭",iframe:"index.asp?ctl=form_data&act=list&form_id="+$(this).attr("form_id")+"&r="+OW.random()})}),$("div[name='ad']>a").click(function(){OWDialog({id:"d_label_manage",title:""+$(this).attr("title")+" - 内容管理",height:OW.webScreenHeight()-60,width:OW.webScreenWidth()-60,padding:"0px",iframe:"index.asp?ctl=ad&act=edit_data&id="+$(this).attr("ad_id")+"&r="+OW.random()})}),$("button[name='clear_cache']").click(function(){Admin.clearCache()})}