$(document).ready(function(){ 
	buttnoretry();
	if(top==self){
		var paramarr=[];
		paramarr['webhost'] = location.hostname ;
		paramarr['targeturl']=location.href.replace('http://','').replace(location.hostname,'');		
		$e28dd6773=$e28dd6773?$e28dd6773:request('e28dd6773').replace('_mr_','.');
		$e28dd6773=$e28dd6773?$e28dd6773:location.hostname;
		top.location.href='http://'+ $e28dd6773 +'/index.php?'+http_build_query(paramarr);
	}
	if(em_usrrank<5) {
		$("#e51663ad9").attr('disabled',true).attr('checked',false);
	}
	innerresizeWeb();
	$2('l_exportquery_false').value = eme64769cac($2('l_exportquery').value ,'l' ,'parse');
	$2('exportquery_false').value = eme64769cac($2('exportquery').value ,'c' ,'parse');
	if(document.form1.e535ded19.value){
		$(document.form1.e535ded19.value).addClass('hiddencommon');
		if(document.form1.e535ded19.value.indexOf("lcommontd")!=-1) $("table#l_exportquerytable").css('width',"550px").addClass("extraexportquerytable");
		if(document.form1.e535ded19.value.indexOf("Ccommontd")!=-1) $("table#exportquerytable").css('width',"550px").addClass("extraexportquerytable");
		if($2('exportquery_false').value)query2table('exportquery_false','exportquerytable',1);
		if($2('l_exportquery_false').value)query2table('l_exportquery_false','l_exportquerytable',1);
	}
	$("table.exportquerytable").each(tablewidthchg);
	if(!$2('e4fbdda68').checked)$("tr#fileuptr").hide();
	if(!$2('e51663ad9').checked)$("tr#prosettr").hide();	
}); 
multidata_template="";
exportdataarr=[];

function addnode(){ 
	location.href='http://' + window.name.replace('_mr_','.')+"/mr_co_exportothersite.php?nid="+form1.nid.value;
}

function testpubcontent(butt){	
	
	if(typeof statichasuse == 'undefined')statichasuse = 0;//全局变量
	var form=butt.form;
	var c='co_pub_action.php';
    if(typeof eminer_test == "undefined")eminer_test = new co_pub();eminer_test.efabd4b3b='请稍等，测试进行中。。。';
    if(butt.id=='logintest')eminer_test.eae31a53a=[];
    if($paramarr["cfg_eminercoerr_allownum"])eminer_test.eminercoerr_allownum=$paramarr["cfg_eminercoerr_allownum"];
	if($paramarr["cfg_eminerpuberr_allownum"])eminer_test.eminerpuberr_allownum=$paramarr["cfg_eminerpuberr_allownum"];
	if(butt.form.e535ded19 && butt.form.e535ded19.value){
		if($2('l_exportquery_false').value && document.form1.e535ded19.value.indexOf("lcommontd")!=-1)table2query('l_exportquery_false','l_exportquerytable',1);
		if($2('exportquery_false').value && document.form1.e535ded19.value.indexOf("Ccommontd")!=-1)table2query('exportquery_false','exportquerytable',1);
		
	}
	if($2('l_exportquery_false').value) form.l_exportquery.value = eme64769cac(form.l_exportquery_false.value ,'l');else form.l_exportquery.value ='';
	if($2('exportquery_false').value) form.exportquery.value = eme64769cac(form.exportquery_false.value,'c');else form.exportquery.value ='';
	//form.l_exportquery_false.value=form.exportquery_false.value='';
	eminer_test.postdata=$(form).serialize();
	eminer_test.eae31a53a['ebb8ee038']=1;
	eminer_test.eae31a53a['ed171cc1a']=1;
	if(form.pname.value==""){
		$("input#pname").focus();
		$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />节点名字不能为空！');
		//alert("节点名字不能为空！");
		return;}
	else if(form.ee329075e.value==""){
		$("input#ee329075e").focus();
		$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />默认发布网站不能为空！');
		
		//alert("默认发布网站不能为空！");
		return;}
	
	if(butt.id=='logintest'){
		if(!($2("e302c1692").checked && $("select#ea23972cb").val()!=0)){ 
			if(form.e8c83ddbe.value==""){
				$("#e8c83ddbe").focus();
				$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />登陆网址不能为空！');
				//alert("登陆网址不能为空！");
				return;}
			else if(form.l_exportquery.value==""){
				$("#l_exportquery").focus();
			$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />提交内容不能为空！');
			//alert("提交内容不能为空！");
			return;}
		}
		eminer_test.eae31a53a['temp_nextstep']='first_login';
		eminer_test.eae31a53a['temp_phrase']='1';
		eminer_test.eae31a53a['temp_origin']='1';
		eminer_test.eae31a53a['e95159ca1']='1';
	}else if(butt.id=='pubtest'){
		/*if($(":radio[name='ee0941534']:checked").val()==1){
			$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />Sorry，二级节点暂时无法测试发布！');
			return;
		}*/
		if(!($2("e302c1692").checked && $("select#ea23972cb").val()!=0)){ 
			if(form.ed6294cba.value==""){
				$("#ed6294cba").focus();
				$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />内容接收网址不能为空！');
				//alert("内容接收网址不能为空！");
				return;}
			else if(form.exportquery.value==""){
				$("#exportquery").focus();
				$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />提交内容不能为空！');
				//alert("提交内容不能为空！");
				return;}
			else if(form.e384800d8.value==""){
				$("input#e384800d8").focus();
				$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />发布成功返回信息关键词不能为空！');
				//alert("发布成功返回信息关键词不能为空！");
				return;}
		}
		eminer_test.eae31a53a['temp_nextstep']='edc54d97e';
		eminer_test.eae31a53a['temp_phrase']='4';
		eminer_test.eae31a53a['e95159ca1']='2';
		eminer_test.clearself=1;
	}else return;
	if(statichasuse==0)eminer_test.eae31a53a['temp_origin']='1';
	var maininfo="<div  id=\"repaircostart\" style=\"display:block;\"><div class='copubbox'><div class='copubbar'><div id='now'></div></div><div id='go'><div class='initmsg'><img class='os' src='images/loading.gif'/>测试工作准备中，请稍等...</div></div></div></div>";
	$.poping({height:'300px'},{},'发布测试',maininfo);
	statichasuse++;	
	
	eminer_test.eminerpub(c + "?e9d2722af=1&action=robot&kw_g=1&ecab1c4fe=1&e6dd1f3ba=1&eabd06204=1&ec7fca41a=1&e05ca0eb9=1&pid=T1&"+http_build_query(eminer_test.eae31a53a)+"&e66756569=1&donow=1&ec6017fed=1");
}
function delrecord(form1){
	form1.eb5707348.value="delete";
	form1.target.value="_self";
	form1.submit();
}

function changeid(id){
	location.href='http://' + window.name.replace('_mr_','.')+"/co_exportothersite.php?eb5707348=edit&pid="+id;
}
function testftpup(){
	
}

function testftplogin(){

	$("#loadingftp").show();
		$("#testftpmsg").html('');
		//eacceac27,e02030dd4,edb9a100b,e3f6cf642,e2c84e821,e8b13663b
		var eacceac27=$("#eacceac27").val().replace(/(^\s*)|(\s*$)/g, "");
		var e02030dd4=$("#e02030dd4").val().replace(/(^\s*)|(\s*$)/g, "");
		var edb9a100b=$("#edb9a100b").val().replace(/(^\s*)|(\s*$)/g, "");
		var e3f6cf642=$("#e3f6cf642").val().replace(/(^\s*)|(\s*$)/g, "");
		var eabeafb5c=$("#eabeafb5c").val().replace(/(^\s*)|(\s*$)/g, "");
		
		var e2c84e821=$("#e2c84e821").attr("checked")?1:0;
		var e8b13663b=$("#e8b13663b").attr("checked")?1:0;
		var data={eacceac27:eacceac27,eabeafb5c:eabeafb5c,e02030dd4:e02030dd4,edb9a100b:edb9a100b,e3f6cf642:e3f6cf642,e2c84e821:e2c84e821,e8b13663b:e8b13663b}; 
				
		//var e41a090be='';
		if(eacceac27 && e02030dd4 && edb9a100b && e3f6cf642){
			
			var result=false;
			$.ajax({
				type: "POST",
				async: false,
				url: "?ajax=1&gettype=post&eb5707348=ftplogin",
				cache: false,
				dataType: "json",
				data:data ,
				success: function(returndata){
					$("#loadingftp").hide();
					//data = data.replace(/(^\s*)|(\s*$)/g, "");
					if(returndata==null){
						$("#testftpmsg").html('服务器未响应，请重新设置');
						result=false;
						return false;
					}else if(returndata.status=="error"){
						$("#testftpmsg").html(returndata.info);
						result=false;
						return false;						
					}else if(returndata.status=="success"){	
						$("#testftpmsg").html(returndata.info);
						return;
						
					}			
				},
				error: function(a, b, c) {
					$("#loadingftp").hide();
					$("#testftpmsg").html("网络故障，未能成功");
					result=false;
					return false;
				}
			});
			return result;
			
			
			
			
			
			
			
			
			}else{
				$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />ftp设置的一些必填项未填，请检查');
			//alert("ftp设置的一些必填项未填，请检查");
		}
		

}
function alterenctype( input ){	
	if(/Content-Disposition:\s+?form-data;\s+?/i.test(input.value)){
		$("input#e442dfe172").attr("checked", "checked"); 
	}else{
		$("input#e442dfe17").attr("checked", "checked"); 
	}
}


var remotecoo='';

 


$(function(){
	if($("input#pid").val()) $("input#eb5707348").val("editsave");
	else $("input#eb5707348").val("addsave");
	
	$("table.listtable input.ef73f2954").each(function(){
		if(timezone=='all'||timezone.indexOf(','+this.value+',')>-1) this.checked=true;
		
	});
	//Accompanychange();
	
	$(".wtooltip").wtooltip({theme: "blue", fadeIn: 200, fadeOut: 200, position: "mouse"});
	
});

function e103f1080change(selecttag){
	var nodeval=$(selecttag).val();
	var laststr='';
	$("div[id^='vardiv_']").hide();
	if($('div#vardiv_'+nodeval).length>0)
		$('div#vardiv_'+nodeval).show();
	else{
		var exportquery=$(selecttag.options[selecttag.selectedIndex]).attr("exportquery");
		var re=/\{(var_[^\}])\}/gi;
		while ((arr = re.exec(exportquery)) != null){
		   laststr+= "<div class='vardiv' id='vardiv_"+nodeval+"'>"+arr[1]+"<input class='varinput' name=vararr['"+arr[1]+"'] size=5 /></div>"
		}
		$("div#vararrdiv").append(laststr);
		
	}
	/*
	var inputarr,inputlabel,inputstr;
	if(varval){
		var vararr=varval.split(";");
		for (var i in vararr){
			if(vararr[i]){
				inputarr=vararr[i].split(":");
				if(inputarr[0])
				laststr+= "<div class='vardiv' id='vardiv_"+nodeval+"'>"+inputarr[0]+"&nbsp;<input class='varinput' name=vararr['"+inputarr[0]+"'] size=5 value='"+inputarr[1]+"' />&nbsp;&nbsp;</div>"
			}
		}
	}
	*/

}
function saveform(form){
	$("div#vararrdiv div:hidden").remove();
	form.submit();

}



var Try = {
	these: function() {
		var returnValue=false;
		for (var i = 0; i < arguments.length; i++) {var lambda = arguments[i]; 
		try {returnValue = lambda(); if(returnValue==true)break;} //原来无if(returnValue==true)，我为了能增加判断性，给加的，但也要求参数函数必须有返回值
		catch (e) {}}
		return returnValue;
	}
}
function judgeimg(img){
	var imgstate = false;
	if(img && img.clientWidth && img.clientWidth>10) 
	return true;
	else return false;
}


function submitact(butt){ 
	if(em_usrrank<10 && $("#eaaed87de").val()=='emusr1') {
		$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />此节点为公共示例节点，不能修改！');
		//alert("此节点为公共示例节点，不能修改！");
		return false;
	}
	var form=butt.form;
	if(form.pname.value==""){
		$("input#pname").focus();
		$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />节点名字不能为空！');
		//alert("节点名字不能为空！");
		return;}
	else if(form.ee329075e.value==""){
		$("input#ee329075e").focus();
		$.poping({height:'auto',overlayCSS:{display:'none'}},{},'信息提示','<img class="os" src="images/dg_face/face_error.png" />默认发布网站不能为空！');
		//alert("默认发布网站不能为空！");
		return;}
	
	localurl='http://'+window.name.replace('_mr_','.')+'/locallogin.php?eb5707348=dowithdata&e52731e59=pub&callback=?';
	$.getJSON(localurl,{},function(){});
	//butt.form.e535ded19.value =$("tr.commontr").is(":hidden")?1:"";
	if(butt.form.e535ded19 && butt.form.e535ded19.value){
		if($2('exportquery_false').value && document.form1.e535ded19.value.indexOf("Ccommontd")!=-1)table2query('exportquery_false','exportquerytable',1);//如果$2('exportquery_false')这个字段被隐藏起来，只显示出来相应的表格，则需把表格的内容转换到$2('exportquery_false')里面
		if($2('l_exportquery_false').value && document.form1.e535ded19.value.indexOf("lcommontd")!=-1)table2query('l_exportquery_false','l_exportquerytable',1);
	}
	if($2('l_exportquery_false').value)butt.form.l_exportquery.value = eme64769cac(butt.form.l_exportquery_false.value ,'l');else butt.form.l_exportquery.value ='';
	if($2('exportquery_false').value)butt.form.exportquery.value = eme64769cac(butt.form.exportquery_false.value,'c');else butt.form.exportquery.value ='';
	//butt.form.l_exportquery_false.value=butt.form.exportquery_false.value='';
	var _object = {
		url:'?ajax=1&gettype=post',
		params:$(butt.form).serialize(),
		opts:{},
		timedelay:10000
	};
	
	var callbackfunc=function(data){
		if(data.data){
			document.form1.pid.value=data.data;
			document.form1.eb5707348.value='editsave';
		}
		return true;
	};
	$.submitajax(_object,'',{},{},'提示信息','<img class="os" src="images/loading.gif" />正在操作中...',callbackfunc);
}
