var debug=false;
jQuery.extend({poping:function(a,k,l,h,o,e){var j;
var i="",n=500;
i="absolute";
var g={position:i,width:n+"px","margin-left":"0px","margin-top":"0px",textAlign:"left","border-style":"solid","border-width":"2px","border-color":"#999",height:"auto"};
var f={title:{},main:{}};
if(a.overlayCSS){$.extend($.blockui.defaults.overlayCSS,a.overlayCSS);
delete a.overlayCSS;
}$.extend(g,a);
$.extend(f,k);
$.extend($.blockui.defaults.overlayCSS,{backgroundColor:"#000",opacity:"0.6",cursor:"default"});
$.extend($.blockui.defaults.pageMessageCSS,g);
_titleinfo=l||"Loading...";
_maininfo=h||('<img class="os" src="images/loading.gif" />正在操作中...');
var m="";
if(g.restormaxbutt){m='<a href="javascript:void(0);" class="close"><img class="wicon" onclick="emwchange(this)" src="images/emwmax.png"></a>;';
}$.blockui('<div id="blockuititle" class="title"><span id="poptitleinfo">'+_titleinfo+'</span><a href="javascript:void(0);" onclick="$.unblockui();"  class="close">×</a>'+m+'</div><div id="popmaininfo" class="main">'+_maininfo+"</div>",{cursor:"default"});
$("div.blockMsg .title").css(f.title);
$("div.blockMsg .main").css(f.main);
if(o){setTimeout(function(){if(e){e();
}$.unblockui();
return false;
},o);
}var b=true;
if(b){var c=$2("poping");
var d=$2("blockuititle");
d.style.cursor="move";
d.onmousedown=function(p){dragMenu(c,p,1);
};
}},posts:function(c,d){if(typeof c=="object"){var a=c||{};
}else{var b=d||{};
var a={url:c,params:b,opts:{},pops:{}};
}$.poping(a.opts,a.pops);
$.post(a.url,a.params,function(e){if(debug){alert(e);
}$.updatepop(e);
});
},loading:function(c,d){if(typeof c=="object"){var a=c||{};
}else{var b=d||{};
var a={url:c,params:b,opts:{},pops:{}};
}$.poping(a.opts,a.pops);
$.get(a.url,a.params,function(e){if(debug){alert(e);
}$.updatepop(e);
});
},updatepop:function(a){if((typeof a)=="string"){a=$.parseJSON(a);
}$("div#poping .title span").html(a.title);
$("div#poping .main").html(a.main);
$("div#poping .close").click(function(){$.unblockui();
return false;
});
if(a.url){setTimeout(function(){location.href=a.url;
},3000);
}if(!a.notclose){setTimeout(function(){$.unblockui();
},3000);
}},submitajax:function(m,c,a,k,l,g,f){if(typeof m=="object"){var j=m||{};
}else{var h=c||{};
var j={url:m,params:h,opts:{},pops:{}};
}var e=a||{};
var d=k||{};
if(j.opts){$.extend(e,j.opts);
}if(j.pops){$.extend(d,j.pops);
}var i=l||"";
i=i||j.titleinfo;
i=i||"提交中...";
var b=g||"";
b=b||j.maininfo;
$.poping(e,d,i,b);
$.ajax({type:"POST",url:j.url,timeout:9000000,cache:false,timedelay:j.timedelay?j.timedelay:2500,data:typeof(j.params)=="undefined"?"":j.params,dataType:"json",success:function(o){if(o.status=="error"){$("div#poping .title span#poptitleinfo").html(o.title||"操作失败");
$("div#poping .main").html(o.info||"操作失败，请关闭本窗口返回检查原因！");
if(o.info&&o.info.indexOf("|")>0){var q=o.info.split("|");
if(q){$("div#popmaininfo").html(q[0]);
$("#"+q[1]+"_tipBox div").hide();
$("#"+q[1]+"_tipBox div.errorTip").show().html(q[0]);
$("input[name='"+q[1]+"']").focus();
}}}else{if(o.status=="success"){var p=true,n="";
if(!p){n="但未能同步本地数据更新，请返回检查原因！";
$("div#poping .title span#poptitleinfo").html(o.title||"操作故障");
$("div#poping .main").html(o.info||n);
}else{if(f){p=f(o);
}$("div#poping .title span#poptitleinfo").html(o.title||"操作成功");
$("div#poping .main").html(o.info||"操作成功，请关闭本窗口！");
}}}setTimeout(function(){$.unblockui();
if(o.data&&o.data=="reload"){document.location.reload();
}if(o.url){location.href=o.url;
}else{if(o.data&&typeof o.data=="string"&&o.data.indexOf(".php")>0){location.href=o.data;
}}},o.timedelay?o.timedelay:this.timedelay);
},error:function(n,p,o){$("span#poptitleinfo").html("出现故障");
$("div#poping .main").html("服务器或网络故障，请返回检查原因再试！"+p);
setTimeout(function(){$.unblockui();
},this.timedelay);
}});
}});
$(function(){$(".main tr,.lz_table tr").hover(function(){$(this).addClass("selected");
},function(){$(this).removeClass("selected");
});
$(".diymenu li,.logo").each(function(a){$(this).hover(function(){$("ul",this).show();
},function(){$("ul",this).hide();
});
});
});
var monor_jsonp=function(){this.timedelay=5000;
this.trycount=1000;
this.default_suctitle="操作成功";
this.default_errtitle="操作失败";
this.default_errmaininfo="已成功远程操作，但未能通过本地验证，请返回检查原因！";
this.default_sucmaininfo="操作成功，请关闭本窗口！";
this.localloginfinish=false;
this.sh=false;
this.senddata={};
this.url="";
this.num=0;
this.now=(new Date()).getTime();
this.do_locallogin=function(b){$.getJSON(this.url,this.senddata,this.callbackfunc);
var a=this;
this.sh=setInterval(function(){a.lasthandle(a);
},200);
};
this.lasthandle=function(a){a.num++;
if(typeof(this.localloginfinish)!="undefined"&&this.localloginfinish==true){clearInterval(a.sh);
}else{if(a.num>a.trycount){clearInterval(a.sh);
a.err_handle();
}}};
this.err_handle=function(a){if(!a){a={};
}$("div#poping .title span#poptitleinfo").html(a.title||this.default_errtitle);
if(!a.info){$("div#poping .main").html(this.default_errmaininfo);
}else{var b=a.info.split("|");
$("div#poping .main").html(b[0]);
if(b[1]){$("#"+b[1]+"_tipBox div").hide();
$("#"+b[1]+"_tipBox div.errorTip").show().html(b[0]);
$("input[name='"+b[1]+"']").focus();
}}setTimeout(function(){$.unblockui();
},this.timedelay);
};
};
function BUIe1434c60dCallback(a,e,c,b){var d={};
if(c="alert"){alert(e);
}else{d.info=e;
d.status=a;
d.title=a=="success"?"操作成功":"操作失败";
d.data=c;
d.url=b;
$.updatepop(d);
}}function showTab(a){$("ul.menu li").attr("class","");
$("ul.menu li:eq("+a+")").attr("class","selected");
$("#handlearea0,#handlearea1,#handlearea2").hide();
$("#handlearea"+a).show();
var b=0;
$("ul.menu a").each(function(){$(this).attr("href","javascript:showTab("+b+");");
b++;
});
$("ul.menu li:eq("+a+") a").attr("href","javascript:void(0);");
}function addconode(){var a=$("div#addnodequery").html();
$.poping({height:"auto",width:"580px"},{},"添加采集节点",a);
}function IsNum(a,c){if(!c){c=0;
}var b=/^[0-9]+.?[0-9]*$/;
if((c&&a.value==="")||!b.test(a.value)){alert("请在该输入框中输入整数数字");
$(a).focus();
return false;
}return true;
}