$(function(){$("#div_dialogtitle",parent.document).html("发布节点"+(nodename?"--":"")+nodename);});//设置标题
var $timeout=8000;
function formsubmit(butt)
{
	var jp= new monor_jsonp();
	jp.url='http://'+cfg_remote_host+"/co_main.php?eb5707348=eminershow&t=" + Math.random()+"&callback=?";
	jp.default_errmaininfo='您的身份标识验证失败，请再重试一次或联系官网客服';
	jp.default_sucmaininfo='身份标识验证成功，现在开始工作中！';
	$("#go").html("<img class='os' src='images/loading.gif' />&nbsp;&nbsp;工作进行中。。。");
	jp.callbackfunc=function(data) {
		jp.localloginfinish=true;
		$("#infotable").hide();
		$("#repaircostart").show();		
		if(data.status=='success'){
			var c='co_pub_action.php';
			if(parseInt(butt.form.ed71d6017.value)!=0 && parseInt(butt.form.ed71d6017.value) < parseInt(butt.form.e48eaf84f.value)){alert("记录发布超时时间不能小于发布的间隔时间");return;}
			if(document.form1.efaccb973.checked==true)efaccb973=1;else efaccb973=0;
			if(document.form1.edeff5b43.checked==true)var_edeff5b43=1;
			//else efaccb973=0;
			var formpostdata=$(document.form1).serialize();
			var eminer0 = new co_pub();
			eminer0.ed70276a8=true;
			eminer0.efabd4b3b='发布进行中。。。';
			eminer0.efaccb973 = document.form1.efaccb973.checked;
			$("div#pubdataconsolearea input#b116").bind('click',{'owner':eminer0},eminer0.togglecopub);

			if($paramarr["cfg_eminercoerr_allownum"])eminer0.eminercoerr_allownum=$paramarr["cfg_eminercoerr_allownum"];
			if($paramarr["cfg_eminerpuberr_allownum"])eminer0.eminerpuberr_allownum=$paramarr["cfg_eminerpuberr_allownum"];
			var tipinfo='';
			if(data.info)tipinfo=data.info;
			else tipinfo=jp.default_sucmaininfo;
			$("#go").html(tipinfo);
			c += "?e9d2722af=1&action=robot&kw_g=1&ecab1c4fe=1&e6dd1f3ba=1&eabd06204=1&ec7fca41a=1&e05ca0eb9=1&e66756569=1&donow=1&temp_origin=1&"+formpostdata
			eminer0.eminerpub(c);
		}else{
			jp.err_handle(data);
		}
	};
	jp.err_handle=function(data) {
		jp.localloginfinish=true;
		$("#infotable").hide();
		$("#repaircostart").show();
		if(!data)data={};
		if(!data.info ) $("#go").html(jp.default_errmaininfo);
		else{
			$("#go").html(infos[0]);
		}
	};	
	jp.do_locallogin();
}

function showtitletypechange(radio){
	if($(radio).val()=='0'){
		$(radio).closest("tr").find(".pagesizesetarea").hide();
		if(parseInt($("input.sptime").val())<1 || $("input.sptime").val()=="")$("input.sptime").val(1);
		
		$('input#edeff5b43').attr('disabled',false);
	}else{
		$(radio).closest("tr").find(".pagesizesetarea").show();
		$('input#edeff5b43').attr('disabled',true);$('input#edeff5b43').attr('checked',false);
	}
}
function editcodata_click(box)
{
	if(box.checked==true){
		$("input[name='ea2af08d0'][value='1']").attr("disabled",true).attr("checked",false);
		$("input[name='ea2af08d0'][value='0']").attr("disabled",false).attr("checked",true);
		$("input[name='ea2af08d0']").click();
		
	}else{
		$("input[name='ea2af08d0']").attr("disabled",false);
	}
	$('input#efaccb973').attr('disabled',box.checked);
	if(box.checked)$('input#efaccb973').attr('checked',false);
	
	
}
function savesetting(butt)
{
	if(em_usrrank<10 && $("#eaaed87de").val()=='emusr1') {
		alert("此节点为公共示例节点，不能修改！");
		return false;
	}
	var formpostdata=$(butt.form).serialize();
	 var s = $.ajax({
		type: "GET",
		url: "?ajax=1&eb5707348=savesetting&pid="+butt.form.pid.value+"&setting="+encodeURIComponent(formpostdata)+"&t=" + Math.random(),
		data: null,
		dataType: "json" ,
		cache: false,
		async: false,
		success: function(data){
			alert(data.info);
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			alert("设置故障，未保存成功,故障原因："+textStatus);
		}
	});	
}
//每改一次参数后，修改值将会体现在以后的每次访问中，除非以后专门进行修改

function getCheckboxItem()
{
	var d = [];
	$("input[name='tid[]']:checked").each(function(){
		d.push($(this).val());
	});
	
	if(d.length>1){
		//$.dialog({title:null,content:"一次只能选择一个栏目！",time:2000});
		return false;
	}
	if(d.length==1) return d[0];
}