/*随机数*/
function random(n)
{
 return(Math.floor(Math.random()*n));
}

function publish(actionurl,target,parameter){
   var action = actionurl+"?"+parameter;
   window.open(action,target,"WIDTH=580,HEIGHT=180,left=200,top=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
   //window.showModalDialog(action,target,"dialogtop:20;dialogleft:20;dialogHeight: 200px; dialogWidth:500px; help: no;scroll: no; status: no");
}
function publishtemp(actionurl,target,parameter){
	alert('您的发布请求已提交，请到[我的发布任务]处查看发布状态！');
   var action = actionurl+"?"+parameter;
   window.open(action,target,"WIDTH=580,HEIGHT=180,left=200,top=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
   //window.showModalDialog(action,target,"dialogtop:20;dialogleft:20;dialogHeight: 200px; dialogWidth:500px; help: no;scroll: no; status: no");
}

function infospider(channelcode){
window.open("../commons/geturlinfo/main.jsp?channelCode="+channelcode,"","WIDTH=780,HEIGHT=480,left=20,top=20,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");

}

function copy(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要复制的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能复制一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .7 );
  		var height = Math.floor( screen.height * .8 );
  		var leftm  = Math.floor( screen.width  * .1)+30;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?Theselect="+Theselect+parameter,"editwin",argu);
}

//收藏信息用
function favoriteinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要收藏的"+title);
		return false;
	}
	if(confirm("您确定要收藏这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target,"WIDTH=360,HEIGHT=140,left=260,top=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
	}
}

//发布操作，允许一次发布多个记录的方法
function pubcmsinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	var Theselect1="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+ "※" + document.all.ID.value.split("|")[3]+ "※" + document.all.ID.value.split("|")[4]+",";
	          	Theselect1=document.all.ID.value.split("|")[1]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+ "※" + document.all.ID[i].value.split("|")[3]+ "※" + document.all.ID[i].value.split("|")[4]+",";
					Theselect1=Theselect1+document.all.ID[i].value.split("|")[1]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要发布的"+title);
		return false;
	}
	if(confirm("您确定要发布这些"+title+"吗？")) {
        var width  = Math.floor( screen.width  * .3 );
  		var height = Math.floor( screen.height * .1 )+20;
  		var leftm  = Math.floor( screen.width  * .1)+300;
 		var topm   = Math.floor( screen.height * .05)+270;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;
		window.open(actionurl+"?Theselect="+Theselect+parameter+"&Theselect1="+Theselect1,target,argu);
	}
}

/*信息采集*/
function spider(actionurl,target,title,parameter,sel){
	var flag=0;
	var sellen=0;
	var selrecid="";
	var state="";
	if(parameter!='')parameter='&'+parameter;
	if(form2.ID!=null)
	{
		var msglen=form2.ID.length;
		if(msglen==null)
		{
			if(form2.ID.checked==true){
			   flag=1;
                    selrecid=form2.ID.value.split("|")[0];
		       state=form2.ID.value.split("|")[1];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(form2.ID[i].checked==true)
				{
					sellen=sellen+1;
					selrecid=form2.ID[i].value.split("|")[0];
		                        state=form2.ID[i].value.split("|")[1];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要采集的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能采集一个"+title);
		return false;
	}
	if(sel!='test'){
	  if(state=='0'){
	    alert("没有通过连接测试!");
		return false;
	  }
	  if(state=='2'){
	    alert("请先进行连接测试!");
		return false;
	  }
	}
    var action=actionurl+"?spiderid="+selrecid+parameter+"&spidername="+state;
	window.open(action,"","WIDTH=600,HEIGHT=400,right=20,top=220,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,menu=no,min=no,max=no");
}




function add(actionurl,target,parameter) {
   if(parameter!='')parameter='?'+parameter;
     var width  = Math.floor( screen.width  * .7 );
     var height = Math.floor( screen.height * .8 );
     var leftm  = Math.floor( screen.width  * .1)+30;
     var topm   = Math.floor( screen.height * .05)+30;
     var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;
    window.open(actionurl + parameter, target,argu)
}

function addopenwin(actionurl,target,parameter) {
   if(parameter!='')parameter='?'+parameter;
     var width  = Math.floor( screen.width  * .7 );
     var height = Math.floor( screen.height * .7 ) + 33;
     var leftm  = Math.floor( screen.width  * .1)+30;
     var topm   = Math.floor( screen.height * .05)+30;
     var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

   window.open(actionurl + parameter, target,argu)
}



function edit(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要编辑的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能编辑一个"+title);
		return false;
	}
	window.open(actionurl+"?Theselect="+Theselect+parameter,target);
}


function channelpre(actionurl,title,parameter)
{
var flag=0;
	var sellen=0;
	var channelcode="";
        var templetid = "";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   channelcode=document.all.ID.value.split("|")[0];
                           templetid=document.all.ID.value.split("|")[1];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					channelcode=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
					templetid=document.all.ID[i].value.split("|")[1];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要预览的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能预览一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .7 );
  		var height = Math.floor( screen.height * .8 );
  		var leftm  = Math.floor( screen.width  * .1)+30;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?channel="+channelcode+"&templetid="+templetid+parameter,"chanelpre",argu);
}

//信息预览
function infopre(actionurl,title,parameter)
{
        var flag=0;
	var sellen=0;
	var infoid="";
        var templetid = "";
        var channelcode = "";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   infoid=document.all.ID.value.split("|")[0];
                           templetid=document.all.ID.value.split("|")[1];
                           channelcode=document.all.ID.value.split("|")[2];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					infoid=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
					templetid=document.all.ID[i].value.split("|")[1];
                                        channelcode=document.all.ID[i].value.split("|")[2];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要预览的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能预览一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .7 );
  		var height = Math.floor( screen.height * .8 );
  		var leftm  = Math.floor( screen.width  * .1)+30;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?channelcode="+channelcode+"&infoid="+infoid+"&templetid="+templetid+parameter,"infopre",argu);
}

//设置主要文物
function wenwu(actionurl,title,parameter)
{
        var flag=0;
	var sellen=0;
	var infoid="";
        var templetid = "";
        var channelcode = "";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   infoid=document.all.ID.value.split("|")[0];
                           templetid=document.all.ID.value.split("|")[1];
                           channelcode=document.all.ID.value.split("|")[2];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					infoid=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
					templetid=document.all.ID[i].value.split("|")[1];
                                        channelcode=document.all.ID[i].value.split("|")[2];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要设置的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能设置一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .6 );
  		var height = Math.floor( screen.height * .7 );
  		var leftm  = Math.floor( screen.width  * .1)+60;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?channelcode="+channelcode+"&infoid="+infoid+parameter,"wenwu",argu);
}

//恢复成历史版本
function renewInfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要恢复的"+title+"历史版本");
		return false;
	}
	else if(flag==2){
		alert("您每次只能选择一个"+title+"历史版本进行恢复！");
		return false;
	}
	if(confirm("您确定要恢复"+title+"到该版本吗？（该操作不可逆！）")) {
	  window.open(actionurl+"?Theselect="+Theselect+parameter,"_self","");
	}
}

function editinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要编辑的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能编辑一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .7 );
  		var height = Math.floor( screen.height * .7 )+33;
  		var leftm  = Math.floor( screen.width  * .1)+30;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?Theselect="+Theselect+parameter,"editwin",argu);
}

function editspiderinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要编辑的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能编辑一个"+title);
		return false;
	}
	window.open(actionurl+"?Theselect="+Theselect+parameter,"spidereditwin","WIDTH=720,HEIGHT=560,left=130,top=80,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,menu=no,min=no,max=no");
}

//得到选择的信息,执行相关操作,可以选多条
function selinfoaction(actionurl,target,action,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要"+action+"的"+title);
		return false;
	}
	if(confirm("您确定要"+action+"这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}



//分发操作，允许一次分发多个记录的方法
function distribute(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要分发的"+title);
		return false;
	}
	if(confirm("您确定要分发这些"+title+"吗？")) {
		window.showModalDialog(actionurl+"?Theselect="+Theselect+parameter,window,"dialogHeight:480px;dialogWidth:400px;dialogTop:120;dialogLeft:500px;help:no;status:no;scroll:auto;");
		//window.open(actionurl+"?Theselect="+Theselect+parameter,"_blank","dialogHeight:100%;dialogWidth:100%;dialogTop:260;dialogLeft:450px;help:no;status:no;scroll:auto;");
	}
}

//转发操作，允许一次转发多条记录的方法
function transmit(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要转发的"+title);
		return false;
	}
        window.open(actionurl+"?Theselect="+Theselect+parameter,"_blank","WIDTH=420,HEIGHT=480,left=340,top=120,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
}


//呈送操作，允许一次呈送多条记录的方法
function infosend(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要呈送的"+title);
		return false;
	}
        window.open(actionurl+"?Theselect="+Theselect+parameter,"_blank","WIDTH=630,HEIGHT=520,left=80,top=20,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
}
function editcmsinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0] + "※" + document.all.ID.value.split("|")[2];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0] + "※" + document.all.ID[i].value.split("|")[2];
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要编辑的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能编辑一个"+title);
		return false;
	}
                var width  = Math.floor( screen.width  * .7 );
  		var height = Math.floor( screen.height * .7 )+33;
  		var leftm  = Math.floor( screen.width  * .1)+30;
 		var topm   = Math.floor( screen.height * .05)+30;
 		var argu = "toolbar=0,location=0,maximize=1,directories=0,status=0,menubar=0,scrollbars=1, resizable=1,left=" + leftm+ ",top=" + topm + ", width="+width+", height="+height;

	window.open(actionurl+"?Theselect="+Theselect+parameter,"editwin",argu);
}

//信息共享
function infoshare(url,channelcode)
{

		var features =
			'dialogWidth:'  + 620 + 'px;' +
			'dialogHeight:' + 450 + 'px;' +
			'dialogLeft:'   + 80 + 'px;' +
			'dialogTop:'    + 50 + 'px;' +
			'directories:no; location:no; menubar:no; status=no; toolbar=no;scrollbars:no;resizeable=yes';
		ChangeUrl = new Date().getTime();
		var page = url+"?objectid="+channelcode+"&ChangeUrl="+ChangeUrl;
		 //var retVal = window.showModalDialog(page,window.document,features);
        window.open(page,"_blank","WIDTH=630,HEIGHT=450,left=80,top=20,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");

		//if(retVal)
      //document.location.reload();
}


function transmitchannel(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
        	if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要转移的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能转移一个"+title);
		return false;
	}
        window.open(actionurl+"?Theselect="+Theselect+parameter,"_blank","WIDTH=420,HEIGHT=480,left=340,top=120,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
}

function exportwebapp(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要导出的"+title);
		return false;
	}
	else if(flag==2){
		alert("您每次只能导出一个"+title);
		return false;
	}
	window.open(actionurl+"?Theselect="+Theselect+parameter,target);

}


function CheckAll(from1)
  {
  for (var i=0;i<form1.elements.length;i++)
    {
    var e = form1.elements[i];
    if (e.name != 'chkall')
       e.checked = form1.chkall.checked;
    }
  }
//设置为新稿操作，允许一次设置多条记录的方法
function setnew(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要"+title+"的信息!");
		return false;
	}
	if(confirm("您确定要将这些信息"+title+"吗?")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}


//删除操作，允许一次删除多个记录的方法
function delcmsinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	var Theselect1="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+ "※" + document.all.ID.value.split("|")[3]+ "※" + document.all.ID.value.split("|")[4]+",";
	          	Theselect1=document.all.ID.value.split("|")[1]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+ "※" + document.all.ID[i].value.split("|")[3]+ "※" + document.all.ID[i].value.split("|")[4]+",";
					Theselect1=Theselect1+document.all.ID[i].value.split("|")[1]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要删除的"+title);
		return false;
	}
	if(confirm("您确定要删除这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter+"&Theselect1="+Theselect1,target);
	}
}


//删除操作，允许一次删除多个记录的方法
function del(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	var Theselect1="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
	          	Theselect1=document.all.ID.value.split("|")[1]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
					Theselect1=Theselect1+document.all.ID[i].value.split("|")[1]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要删除的"+title);
		return false;
	}
	if(confirm("您确定要删除这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter+"&Theselect1="+Theselect1,target);
	}
}
//完全删除频道操作，一旦确定删除，该频道下的所有数据将不可恢复
function delchannelall(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要完全删除的"+title);
		return false;
	}
	if(confirm("完全删除将导致该频道下的所有数据被删除且不可恢复！\n您确定要完全删除这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}
//完全删除应用操作，一旦确定删除，该应用下的所有数据将不可恢复
function delwebappall(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要完全删除的"+title);
		return false;
	}
	if(confirm("完全删除将导致该应用下的所有数据被删除且不可恢复！\n您确定要完全删除这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}

//审核发布操作，允许一次发布多个记录的方法
function auditpublish(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要审核的"+title);
		return false;
	}
	window.open(actionurl+"?Theselect="+Theselect+parameter,target,'left=300,top=200,width=400,height=220,menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=no');
//	if(confirm("您确定要发布这些"+title+"吗？")) {
//                window.open(actionurl+"?Theselect="+Theselect+parameter,target);
//	}
}

//撤稿还原操作，允许一次还原多个记录的方法
function revertpublish(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要还原的"+title);
		return false;
	}
	if(confirm("您确定要还原这些"+title+"吗？")) {
                window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}

//撤稿操作，允许一次撤走多个记录的方法
function withdraw(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要进行撤稿的"+title);
		return false;
	}
	if(confirm("您确定要对这些"+title+"进行撤稿吗？")) {
                window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}

//选择生成操作操作，允许一次生成多个记录的方法
function selectGen(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	var state="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null) {
	  var msglen=document.all.ID.length;
	  if(msglen==null) {
 	    if(document.all.ID.checked==true){
		flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
		state=document.all.ID.value.split("|")[1];
	        state="2";   //zhaozg add it
		if(state!='2'){
			 alert("选择的信息没有经过审核!");
			 return false;
		}
	    }
	}
	else {
	  for(i=0;i<msglen;i++) {
		if(document.all.ID[i].checked==true) {
			sellen=sellen+1;
			Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
			state=document.all.ID[i].value.split("|")[1];
      	                state="2";   //zhaozg add it
			if(state!='2') {
			 alert("选择的信息至少有一条没有经过审核!");
			 return false;
			}
		}
	  }
  	  if(sellen>=1){
		flag=1;
	  }
        }
}
	if(flag==0){
		alert("请您选择要生成静态文件的"+title);
		return false;
	}
	if(confirm("您确定要生成这些"+title+"吗？")) {
		var action=actionurl+"?Theselect="+Theselect+parameter;
		window.open(action,"","WIDTH=420,HEIGHT=100,left=260,top=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
	}
}


//信息驳回操作，允许一次驳回多个记录的方法
function reject(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要驳回的"+title);
		return false;
	}
	if(confirm("您确定要驳回这些"+title+"吗？")) {
                window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}

//信息送审操作，允许一次送审多个记录的方法
function submitinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                          Theselect=document.all.ID.value.split("|")[0]+ "※" + document.all.ID.value.split("|")[2]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+ "※" + document.all.ID[i].value.split("|")[2]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要送审的"+title);
		return false;
	}
	if(confirm("您确定要送审这些"+title+"吗？")) {

		window.open(actionurl+"?Theselect="+Theselect+parameter,target);


	}
}


/*
2004 9 16 chenwt add
正文输出为word
*/
function exporttoword(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要输出的"+title);
		return false;
	}
	if(confirm("您确定要输出这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target,"WIDTH=360,HEIGHT=140,left=260,top=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,menu=no,min=no,max=no");
	}
}


//导入信息
function importinfo(url,channelcode) {
  var arrRet = new Array();
  arrRet[0]  = ( window.screen.width - 350 ) /2 ;
  arrRet[1]  = ( window.screen.height - 180 )/2 ;
  window.open(url+"?channelcode="+channelcode, "ae_filewin","top="+arrRet[1]+",left="+arrRet[0]+",width=560,height=320,toolbar=0,menubar=0,resizable=0,scrollbars=no,status=0,titlebar=0 ,status=no");
}

//导出信息
function exportinfo(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
        if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					if (Theselect == "")
					{
						Theselect=document.all.ID[i].value.split("|")[0];
					}else
					{
						Theselect=Theselect+","+document.all.ID[i].value.split("|")[0];
					}

				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要导出的"+title);
		return false;
	}
	if(confirm("您确定要导出这些"+title+"吗？")) {
            window.open(actionurl+"?Theselect="+Theselect+parameter,"hidenwin");
	}
}

function doDefaultFormDefine(actionurl,parameter){
try {
      var argu = "dialogWidth:38em; dialogHeight:38em;center:yes;status:no;help:no";
      window.showModalDialog("/cms/cms/channel/column/windowframe.jsp?loadfile="+actionurl+"&"+parameter,"定义业务模型表单",argu);
   }
   catch(exception){
   }
}

function doFormDefine(actionurl,parameter){
try{
var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
			   Theselect=document.all.ID.value.split("|")[0];
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=document.all.ID[i].value.split("|")[0];//我加的代码我加的代码
				}
			}
			if(sellen==1){
				flag=1;
			}
			else if(sellen>1){
				flag=2;
			}
		}
	}
	if(flag==0){
		alert("请您选择要操作的频道!");
		return false;
	}
	else if(flag==2){
		alert("您每次只能操作一个频道");
		return false;
	}
	 	var argu = "dialogWidth:38em; dialogHeight:38em;center:yes;status:no;help:no";
		window.showModalDialog("column/windowframe.jsp?loadfile="+actionurl+"&columnid="+Theselect+parameter,"定义频道表单",argu);
		}catch(exception){}
}

//审核操作，允许一次审核多个记录的方法 如：评论审核
function check(actionurl,target,title,parameter){
	var flag=0;
	var sellen=0;
	var Theselect="";
	if(parameter!='')parameter='&'+parameter;
	if(document.all.ID!=null)
	{
		var msglen=document.all.ID.length;
		if(msglen==null)
		{
			if(document.all.ID.checked==true){
				flag=1;
                Theselect=document.all.ID.value.split("|")[0]+",";
			}
		}
		else
		{
			for(i=0;i<msglen;i++)
			{
				if(document.all.ID[i].checked==true)
				{
					sellen=sellen+1;
					Theselect=Theselect+document.all.ID[i].value.split("|")[0]+",";
				}
			}
			if(sellen>=1){
				flag=1;
			}
		}
	}
	if(flag==0){
		alert("请您选择要审核的"+title);
		return false;
	}
	if(confirm("您确定要审核这些"+title+"吗？")) {
		window.open(actionurl+"?Theselect="+Theselect+parameter,target);
	}
}


