//清除上传选择
function clearUpload(obj) {  
  var nf = obj.cloneNode(true);  
    nf.value='';     
        obj.parentNode.replaceChild(nf, obj);    
}
//关闭div
function createAjax() {		
	var _xmlhttp;
	try {	
		_xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");	
	}
	catch (e) {
		try {
			_xmlhttp=new XMLHttpRequest();	
		}
		catch (e) {
			_xmlhttp=false;		
		}
	}
	return _xmlhttp;	
}

//弹出div
function dvck(good){
var SysIsIE; 

var ua = navigator.userAgent.toLowerCase(); 
var s;(s = ua.match(/msie ([\d.]+)/)) ? SysIsIE = s[1] : 0; 
var ids;
var date = new Date(); //日期对象
ids=date.getSeconds();

e=document.getElementById('tian'+ids); 
if(e != null  ){ 
e.parentNode.removeChild(e); 
} 

var div=document.createElement("div"); 
div.style.position="absolute"; 
div.style.top='10%'; 
div.style.left='40%'; 
var widths =window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
div.style.cssText='filter: alpha(opacity=10);opacity:0.1;position:absolute;top:50%; left:50%;margin-left:-110px;margin-top:-15px;padding:8px;width:200px;border:#93B2D0 10px solid;z-index:10000000;background-color:#FFFFCC'; 
div.id='tian'+ids; 
div.innerHTML='<center>'+good+'</center>'; 
document.body.appendChild(div); 
if (SysIsIE) 
dcbIE('+',ids); 
else 
dcboth('+',ids); 
} 
function dcbIE(j,ids){ 
o=document.getElementById('tian'+ids); 
opc=parseInt(o.filters.alpha.opacity); 
if(j=='+'){ 
if(opc<100){ 
o.filters.alpha.opacity=(opc+20)+''; 
setTimeout("dcbIE('"+j+"',"+ids+")",100); 
}
else{
setTimeout("dcbIE('-',"+ids+")",2400); 
} 
}else if(j=='-'){ 
if(opc>0){ 
o.filters.alpha.opacity=(opc-20)+''; 
setTimeout("dcbIE('"+j+"',"+ids+")",100); 
}
else{
	o.style.display="none";
	}
} 
} 
function dcboth(j,ids){ 
o=document.getElementById('tian'+ids); 
opc=parseFloat(o.style.opacity); 
if(j=='+'){ 
if(opc<1){ 
o.style.opacity=(opc+0.09)+''; 
setTimeout("dcboth('"+j+"',"+ids+")",100); 
} 
else{ 
setTimeout("dcboth('-',"+ids+")",2400);  
} 
}else if(j=='-'){ 
if(opc>0){ 
o.style.opacity=(opc-0.09)+''; 
setTimeout("dcboth('"+j+"',"+ids+")",100); 
} 
else{
	o.style.display="none";
	}
}
} 
//弹出div




//非群日志操作

function callnoqun(id,pass,types,yemian,page,keyword,totalput,typess) {
	var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
	  if ((id== null) || (id == "") || (pass== null) || (pass == "")) return;	
    if( (pass == 1 || pass ==11  || pass == 10  || pass == 20 || pass == 30 || pass == 40)  ) {
var neirong=document.getElementById("neirong").value; 
var miaoshu=document.getElementById("miaoshu").value; 
var leibie=document.getElementById("leibie").value;
var zhibiao=document.getElementById("zhibiao").value;
var jiaofu=document.getElementById("jiaofu").value;
var beizhu1=document.getElementById("beizhu1").value;
var beizhu2=document.getElementById("beizhu2").value;
var beizhu3=document.getElementById("beizhu3").value;
var beizhu4=document.getElementById("beizhu4").value;
 if(document.getElementById("emailsend").checked)
 {	var emailsend=1;}
else
{var emailsend=0;}			
 if(document.getElementById("duanxinsend").checked)
 {	var duanxinsend=1;}
else
{var duanxinsend=0;}
var beizhu5=document.getElementById("beizhu5").value;
var pagefrom=document.getElementById("pagefrom").value;
var wenjian=document.getElementById("wenjian").value;
var jinji=document.getElementById("jinji").value; 
var totime=document.getElementById("totime").value;
var zerenren=document.getElementById("zerenren").value;
var genzongren=document.getElementById("genzongren").value; 
var gzhuren=document.getElementById("gzhuren").value;
var qunzu=document.getElementById("qunzu").value;
  var url = "secret/cutask.asp?types="+types+"&id="+id+"&beiyong=0&pass="+pass+"&duanxinsend="+duanxinsend+"&emailsend="+emailsend+"&neirong=" + escape(neirong)+"&miaoshu=" + escape(miaoshu)+"&leibie=" + escape(leibie)+"&zhibiao=" + escape(zhibiao)+"&jiaofu=" + escape(jiaofu)+"&wenjian=" + escape(wenjian)+"&jinji=" + escape(jinji)+"&beizhu1=" + escape(beizhu1)+"&beizhu2=" + escape(beizhu2)+"&beizhu4=" + escape(beizhu4)+"&beizhu5=" + escape(beizhu5)+"&beizhu3=" + escape(beizhu3)+"&genzongren=" + escape(genzongren)+"&zerenren=" + escape(zerenren)+"&qunzu=" + escape(qunzu)+"&gzhuren=" + escape(gzhuren)+"&totime=" + escape(totime)+"&suijishu="+Date();
  }
   if (pass == 2 || pass == 6 || pass == 5 || pass == 91 || pass == 92 || pass == 81 || pass == 82 || pass == 83 || pass == 84 || pass == 85 || pass == 86) {
  var url = "secret/cutask.asp?types="+types+"&id="+id+"&pass="+pass+"&suijishu="+Date();
  }
     if (pass == 3) {
	       var jjyuanyin=document.getElementById("jjyuanyin" + id).value;
if ((jjyuanyin== null) || (jjyuanyin== "") || (jjyuanyin == "请输入拒绝原因") ) return;
  var url = "secret/cutask.asp?types="+types+"&id="+id+"&pass=3&jjyuanyin=" + escape(jjyuanyin)+"&suijishu="+Date();
  } 
     if (pass == 4) {
	       var yqyuanyin=document.getElementById("yqyuanyin" + id).value;
		 var yqdate=document.getElementById("yqdate" + id).value;
 if ((yqyuanyin== null) || (yqyuanyin== "") || (yqdate== null) || (yqdate == "") || (yqyuanyin == "请输入延期原因") ) return;		 
		  var url = "secret/cutask.asp?types="+types+"&id="+id+"&pass=4&yqyuanyin=" + escape(yqyuanyin)+"&yqdate=" + escape(yqdate)+"&suijishu="+Date();
  } 
//批准延期
     if (pass == 15 || pass == 16 ) {
var yqdates=document.getElementById("yqdates" + id).value;
if ((yqdates == null) || (yqdates == '') ) return;	
var url = "secret/cutask.asp?types="+types+"&id="+id+"&pass="+pass+"&yqdate=" + escape(yqdates)+"&suijishu="+Date();
  } 
if (pass == 7 || pass == 8) {

var scyuanyin=document.getElementById("scyuanyin" + id).value;

if ((scyuanyin== null) || (scyuanyin== "") || (scyuanyin == "请输入删除理由") ) return;

var url = "secret/cutask.asp?types="+types+"&id="+id+"&pass="+pass+"&scyuanyin=" + escape(scyuanyin)+"&suijishu="+Date();
  }
  xmlhttp.open("GET", url, true);
 if (pass == 91 || pass ==92 ){//关注。
  updatePageb = eval("updateguanzhu" + id);
  }
if (pass >80 && pass <90 )//紧急。
  {
updatePageb= eval("isjinji" + id);
 } 
  	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("失败：") >= 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	return;
	}	
//审核成功ok
	if (pass == 2 && unescape(xmlhttp.responseText)==2 )
	{
		dvck('<img src=../images/okla.gif> 审核通过！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒
		}
//审核拒绝	ok	
	if (pass == 3 && unescape(xmlhttp.responseText)==3 )
	{
			dvck('<img src=../images/okla.gif> 审核已拒绝！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒
			}
	//同意延期
	if (pass == 16 && unescape(xmlhttp.responseText)==2 )
	{
	dvck('<img src=../images/okla.gif> 已批准延期！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒

			}	
	//拒绝延期
	if (pass == 15 && unescape(xmlhttp.responseText)==2 )
	{dvck('<img src=../images/okla.gif> 已拒绝延期！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒
		
		
		
	
			}	
//关闭任务		
	if (pass == 6 && unescape(xmlhttp.responseText)==6 )
	{
		dvck('<img src=../images/okla.gif> 任务已关闭！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒
			}	
	//申请关闭任务ok		
	if (pass == 5 && unescape(xmlhttp.responseText)==5 )
	{

getcontent('taskstatus.asp?yemian='+escape(yemian)+'&rizhiid='+escape(id),'caozuo',0);
		setTimeout("dvck('<img src=../images/okla.gif> 申请关闭成功！')",500);//3秒
			}	
	//申请延期ok
	if (pass == 4 && unescape(xmlhttp.responseText)==4 )
	{
	getcontent('taskstatus.asp?yemian='+escape(yemian)+'&rizhiid='+escape(id),'caozuo',0);
		setTimeout("dvck('<img src=../images/okla.gif> 延期申请成功！')",500);//3秒
	}
//申请删除任务		
	if (pass == 7  )
	{
		
getcontent('taskstatus.asp?yemian='+escape(yemian)+'&rizhiid='+escape(id),'caozuo',0);
		setTimeout("dvck('<img src=../images/okla.gif> 已经申请删除！')",500);//3秒

		}
		//申请删除	
	if (pass == 8  )
	{
		if (types==8){
			types=0;
			}
			if (yemian=='needshenpi'){
				
				dvck('<img src=../images/okla.gif> 删除成功！正在自动为您加载下一条记录');	
		setTimeout("window.location.href='taskdatail.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒		
		}
		else
		{
			dvck('<img src=../images/okla.gif> 删除成功！正在返回中');	
		setTimeout("window.location.href='task.asp?page="+escape(page)+"&types="+escape(typess)+"&yemian="+escape(yemian)+"'",2000);//3秒		
			}	
			}		
			 if (pass == 1 || pass ==11  || pass == 10  || pass == 20 || pass == 30  || pass == 40)
  {
	  if(pass==20 || pass==30  || pass == 40){
		  	var arrstr = unescape(xmlhttp.responseText).split("|||");
				setTimeout("dvck('"+arrstr[0]+"')",500);//3秒
	if(pagefrom=="taskdatail")
setTimeout("window.location.href='taskdatail.asp?qunzuid="+escape(qunzu)+"&types="+escape(typess)+"&rizhiid="+escape(arrstr[1])+"&page="+escape(page)+"&keyword="+escape(keyword)+"&yemian="+escape(yemian)+"'",2000);//3秒	
		else
setTimeout("window.location.href='addtask.asp?qunzuid="+escape(qunzu)+"&types="+escape(typess)+"&rizhiid="+escape(arrstr[1])+"&page="+escape(page)+"&keyword="+escape(keyword)+"&yemian="+escape(yemian)+"'",2000);//3秒	
}


if ( (types==8 &&pass==11) || pass==1 ||  (types==8 &&pass==10) ) {
if(pagefrom=="taskdatail")
setTimeout("window.location.href='taskdatail.asp?qunzuid="+escape(qunzu)+"&types="+escape(typess)+"&rizhiid="+id+"&page="+escape(page)+"&keyword="+escape(keyword)+"&yemian="+escape(yemian)+"'",2000);//3秒	
		else
setTimeout("window.location.href='addtask.asp?qunzuid="+escape(qunzu)+"&types="+escape(typess)+"&rizhiid="+id+"&page="+escape(page)+"&keyword="+escape(keyword)+"&yemian="+escape(yemian)+"'",2000);//3秒	
		setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
}

	
 } 
if ( pass ==92  )
{
	if (types==8){
		types=0;
		}

	updatePageb.innerHTML=unescape(xmlhttp.responseText);
		setTimeout("dvck('<img src=../images/okla.gif> 关注成功')",500);//3秒

		}
  if ( pass ==91 )
{
	if (types==8){
		types=0;
		}
	
	updatePageb.innerHTML=unescape(xmlhttp.responseText);
		setTimeout("dvck('<img src=../images/okla.gif> 取消关注成功')",500);//3秒

		}
 if (  pass == 81  || pass == 82 || pass == 83  || pass == 84 || pass == 85 || pass == 86)
 {
			updatePageb.innerHTML=unescape(xmlhttp.responseText); 
}}}}
		xmlhttp.send(null);
	}
//非群日志操作结束



//添加进度开始
function calljindu(id,zhi) {
		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
  var tupian=document.getElementById("tupian" + id).value;
  var jindu=document.getElementById("jindu" + id).value;

 if(document.getElementById("ansong" + id).checked)
 {var ansong=1;	 }
	 else
  {	var ansong=0;	 }
	    if(document.getElementById("duanxin" + id).checked)
 {	var duanxin=1;	 }
	 else
  {var duanxin=0;	 }
   updatePagel = eval("updatePager" + id);
   jinzhanfk=eval("jinzhanfk" + id);
    tuijianid=eval("tuijianid" + id);
xmlhttp.open('post','secret/cutask.asp?pass=100&zhi='+escape(zhi)+'&id='+escape(id)+'&types=6&jindu=' + escape(jindu)+'&duanxin=' + escape(duanxin)+'&tupian=' + escape(tupian)+'&ansong=' + escape(ansong)+'&suijishu='+Date(),true)		//参上同看
		xmlhttp.onreadystatechange=function() {
 if(jindu.length<1){
jinzhanfk.innerHTML="<img align=absmiddle src=../images/x.gif> 进展不能为空！";
tuijianid.disabled=false;
return true;
		}
 if(jindu.length>200){
	 jinzhanfk.innerHTML="<img align=absmiddle src=../images/x.gif> 留言内容不能超过200个字符！";
tuijianid.disabled=false;
			return true;
		}			
if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
jinzhanfk.innerHTML="";
tuijianid.disabled=false;	
		setTimeout("dvck('<img src=../images/okla.gif align=absmiddle> 提交进展成功！')",500);//3秒	
	eval("jindu" + id).value="";
	eval("tupian" + id).value="";
	eval("ansong" + id).checked=false;
		eval("filexianshi" + id).innerHTML="";
	updatePagel.innerHTML=unescape(xmlhttp.responseText);
	
		}}}
		xmlhttp.send(null);
	}
//添加进度结束


//统计数量开始
   function tjwangong(isgengxin) {	
	var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {
if(isgengxin==11)//如果是在报表页面
xmlhttp.open('post','../wangongshu.asp?isgengxin='+isgengxin+'&suijishu='+Date(),true)	
else
xmlhttp.open('post','wangongshu.asp?isgengxin='+isgengxin+'&suijishu='+Date(),true)	
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
	var arrstr = unescape(xmlhttp.responseText).split(",");
eval("wangongtj1").innerHTML=arrstr[1];
eval("wangongtj2").innerHTML=arrstr[2];
eval("wangongtj3").innerHTML=arrstr[3];
eval("wangongtj4").innerHTML=arrstr[4];
eval("wangongtj5").innerHTML=arrstr[5];

}}}
		xmlhttp.send(null);
	}
	
	
	function getcontent(url,divid,xianshi) {		
	var xmlhttp=createAjax();
	if (xmlhttp) {		
		var content=document.getElementById(divid);		
		xmlhttp.open('post',url+'&suijishu='+Date(),true);	
		
		xmlhttp.onreadystatechange=function() {	
		if (xmlhttp.readyState<4 && xianshi==1) {	
			  document.all("loading").style.display="";
			}
			if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
				if ( xianshi==1) {	
				document.all("loading").style.display="none";
			}
				content.innerHTML=unescape(xmlhttp.responseText);
			 tjwangong(1);
				}}
		xmlhttp.send(null);	
	}}
//添加上传的文件
function backfn(fname,inputs,xianshi){
	if (fname.length>10){
var newsfname=document.getElementById(inputs).value+"|{|"+fname;
	document.getElementById(inputs).value=newsfname;
	var arrstrs = newsfname.split("|{|");
	var xianshivalue="";
 for (var i=1;i<arrstrs.length;i++)
{
	
xianshivalue=xianshivalue+"<br>&nbsp;&nbsp;文件"+i+"："+arrstrs[i].substr(18)+"&nbsp;&nbsp;<a href='javascript:void(0)' id='openthis' onclick=deletefujian('"+arrstrs[i]+"','"+inputs+"','"+xianshi+"');>删除</a>";
}
document.getElementById(xianshi).innerHTML=xianshivalue;	
	document.getElementById("fileToUpload").value="";
}
}
//系统图片上传
function backfxitong(fname,inputs,xianshi){
	if (fname.length>10){
	document.getElementById(inputs).value=fname;
	document.getElementById("imgs").src="images/upload/"+fname;
	document.getElementById("fileToUpload").value="";
	}
}
//删除上传的文件
function deletefujian(fname,inputs,xianshi){
	var newsfname=document.getElementById(inputs).value.replace("|{|"+fname,"")
	document.getElementById(inputs).value=newsfname;
var arrstrs = newsfname.split("|{|");
	var xianshivalue="";
 for (var i=1;i<arrstrs.length;i++)
{
xianshivalue=xianshivalue+"<br>&nbsp;文件"+i+"："+arrstrs[i].substr(18)+"&nbsp;&nbsp;<a href='javascript:void(0)'  id='openthis'  onclick=deletefujian('"+arrstrs[i]+"','"+inputs+"','"+xianshi+"');>删除</a>";
}
document.getElementById(xianshi).innerHTML=xianshivalue;	
}
//删除上传的文件结束


//添加汇报开始
function addnewhb(id,pass) {

		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	

  var hbcontent=document.getElementById("hbcontent").value;
 if(hbcontent.length<1){
setTimeout("dvck('<img src=../../images/x.gif> 失败！名称不能为空！')",500);//3秒	
			return;
		}

xmlhttp.open('post','../baobiao/cuhbcontent.asp?id='+escape(id)+'&pass='+escape(pass)+'&hbcontent='+escape(hbcontent)+'&suijishu='+Date(),true)
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	}
else{
document.getElementById("newhuibao").innerHTML=unescape(xmlhttp.responseText)+document.getElementById("newhuibao").innerHTML;
document.getElementById("hbcontent").value='';
setTimeout("dvck('<img src=../../images/okla.gif> 汇报添加成功！')",500);//3秒
}}}}
		xmlhttp.send(null);
	}
//添加汇报结束
//修改汇报开始
function EditHuibao(element,content,zhi,id)
{
var oldhtml = content;
var newobj = document.createElement('input');//创建新的input元素
newobj.value = content;//为新增元素添加类型
newobj.id ='contentid'+zhi;//为新增元素添加类型
newobj.setAttribute("type","text");
newobj.setAttribute("maxlength","17");
newobj.setAttribute("size","18");
newobj.onblur   = function(){
thevalue=document.getElementById('contentid'+zhi).value.replace(/\r/ig, "").replace(/\n/ig, ""); 
if ( thevalue=='' ){
	element.innerHTML =oldhtml;
	}
	else{
if ( thevalue==content ){
	element.innerHTML =content;
	}	
if ( thevalue!=content ){
			var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
xmlhttp.open('post','../baobiao/cuhbcontent.asp?pass=200&id='+escape(id)+'&hbcontent='+escape( thevalue)+'&suijishu='+Date(),false)		//参上同看	

		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	element.innerHTML =content;
	}
	else
	{
		setTimeout("dvck('<img src=../../images/okla.gif align=absmiddle> 修改成功！')",500);//3秒	
	 eval("huibao"+id).innerHTML="<span ondblclick=\"EditHuibao(this,'"+thevalue+"',"+zhi+","+id+")\" >" + thevalue+"</span>";
}}}}
xmlhttp.send(null);
}}}
element.innerHTML = '';
element.appendChild(newobj);
newobj.focus();
}
//修改备注4、备注5结束
//删除汇报开始
function delehb(id,pass) {
		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
xmlhttp.open('post','../baobiao/cuhbcontent.asp?id='+escape(id)+'&pass='+escape(pass)+'&hbcontent=notkong&suijishu='+Date(),true)
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	}
else{
document.getElementById("data"+id).style.display="none";
setTimeout("dvck('<img src=../../images/okla.gif> 汇报删除成功！')",500);//3秒
}}}}
		xmlhttp.send(null);
	}
//删除汇报结束


//修改字段名称开始
function changeziduan(ii,id,pass) {
	
	var xuanxiang;
	
	if (ii==11 ||  ii==12 ){
	 xuanxiang=document.getElementById("xuanxiang").value; 
	}

  var newsziduan=document.getElementById("ziduan").value;	

 if(newsziduan.length<1 || newsziduan=='请重新输入' ){
	setTimeout("dvck('<img src=../../images/x.gif>失败！名称不能为空！')",500);//3秒 

			return;
		}

		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
xmlhttp.open('post','../baobiao/cuhbcontent.asp?id='+escape(id)+'&ii='+escape(ii)+'&pass='+escape(pass)+'&hbcontent='+escape(newsziduan)+'&xuanxiang='+escape(xuanxiang)+'&suijishu='+Date(),true)
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
			if ( unescape(xmlhttp.responseText).indexOf("请先在操作栏中启用该字") > 0 ) {
				setTimeout("dvck('<img src=../../images/x.gif>失败,请先在操作栏中启用该字段！')",500);//3秒 	
			}

		else if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {	
		
			setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒 
		
	
	
	}
else{
eval("newdata"+ii).innerHTML='<a href="javascript:void(0)" onClick="edititem('+ii+',\''+newsziduan+'\','+id+',\''+xuanxiang+'\');">'+newsziduan+'</a>';

setTimeout("dvck('<img src=../../images/okla.gif>修改成功！')",500);//3秒 	
closedivs(1);

}}}}
		xmlhttp.send(null);
	}
//修改字段名称结束
//汇报字段是否启用开始
function ishbqiyong(ii,id,pass) {
		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
xmlhttp.open('post','../baobiao/cuhbcontent.asp?id='+escape(id)+'&ii='+escape(ii)+'&pass='+escape(pass)+'&hbcontent=yes&suijishu='+Date(),true)
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {	
		
		setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒 

	}
else{
	eval("alldata").innerHTML=unescape(xmlhttp.responseText);

setTimeout("dvck('<img src=../../images/okla.gif> 调整成功！')",500);//3秒 	


}}}}
		xmlhttp.send(null);
	}
//汇报字段是否启用结束
//汇报用户添加、删除
   function callhuibaouser(ii,users,zhi,huibaoid) {	
	var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {
  if ((users== null) || (users == "") || (ii== null) || (ii == "")|| (huibaoid== null) || (huibaoid == "")|| (zhi == "")|| (zhi ==null)) return;
//删除用户
    if (zhi==2 ){
                  updatePagee = eval("updatePageb" + ii);	  
                 }
//设置是否需要汇报
    if (zhi>=3 ){
                  updatePagee = eval("updatePagerb" + ii);	  
                 }
  //添加用户
    if (zhi==1){
	            updatePagee = eval("alluser");
                var users=document.getElementById('qunusers').value;	
                if ((users== null) || (users == "") ) return;
                 }
xmlhttp.open('post','../baobiao/huibaopeopleedit.asp?zhi=' + escape(zhi)+'&ii=' + escape(ii)+'&user=' + escape(users)+'&huibaoid=' + escape(huibaoid)+'&suijishu='+Date(),true)		//参上同看
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
	updatePagee.innerHTML=unescape(xmlhttp.responseText);
    if (zhi==2 ){
eval("updatePagerb" + ii).innerHTML="/";  
                 }
	   }}}
		xmlhttp.send(null);
	}
//汇报用户添加、删除

//添加汇报内容开始
function addnewhuibao(id,pass,xianshi,needshenpi,contentid) {

		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {	
var allshuju="";

var arrstrs = xianshi.split("||");
 for (var i=1;i<arrstrs.length-1;i++)
{
allshuju=allshuju+"&"+arrstrs[i]+"="+escape(document.getElementById("input"+arrstrs[i]).value).replace(/(\r)*\n/g,"<br />");
}

if (needshenpi==1){
var shenpiren=document.getElementById("shenpiren").value;
xmlhttp.open('post','../baobiao/cuaddhuibao.asp?id='+escape(id)+'&contentid='+escape(contentid)+'&shenpiren='+escape(shenpiren)+'&pass='+escape(pass)+allshuju+'&suijishu='+Date(),true)
}
else
xmlhttp.open('post','../baobiao/cuaddhuibao.asp?id='+escape(id)+'&contentid='+escape(contentid)+'&pass='+escape(pass)+allshuju+'&suijishu='+Date(),true)
	
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	}
else{
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"系统正在自动返回中...')",500);//3秒
setTimeout("window.location.href='../baobiao/hbdatail.asp?huibaoid="+escape(id)+"'",1000);//3秒
}}}}
		xmlhttp.send(null);
	}
//添加汇报内容结束

//添加留言开始
function callliuyan(id) {
		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {
	  var liuyan=document.getElementById("liuyan" + id).value;		
xmlhttp.open('post','../baobiao/culiuyan.asp?id='+escape(id)+'&liuyan='+escape(liuyan)+'&suijishu='+Date(),true)
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		if ( unescape(xmlhttp.responseText).indexOf("align=absmiddle> 失败") > 0 ) {		
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	eval("addliuyanbutton"+id).disabled=false;
	}
else{
	eval("updatePager"+id).innerHTML=unescape(xmlhttp.responseText);
document.getElementById("liuyan"+id).value="";
setTimeout("dvck('<img src=../../images/okla.gif> 留言添加成功！')",500);//3秒
eval("addliuyanbutton"+id).disabled=false;
}}}}
		xmlhttp.send(null);
	}
//添加留言结束

//	汇报审批开始
   function huibaosp(hbcontentid,zhi) {	

	var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {
var data6=document.getElementById('data6').value.replace(/(\r)*\n/g,"<br />").replace(/\s/g," "); 
if(document.getElementById("data1").checked)
 {	var leixing=1;}
else
{var leixing=2;}

if(document.getElementById("data4").checked)
 {	var isqueren=4;}
else
{var isqueren=3;}

xmlhttp.open('post','../baobiao/huibaoshenpi.asp?hbcontentid=' + escape(hbcontentid)+'&zhi=' + escape(zhi)+'&leixing=' + escape(leixing)+'&isqueren=' + escape(isqueren)+'&data6=' + escape(data6)+'&suijishu='+Date(),true)		//参上同看	
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
		var jieguo=unescape(xmlhttp.responseText);
if( jieguo.indexOf("成功") > 0 ) {

setTimeout("window.location.href='../baobiao/hbshenpi.asp?thiss=14&yemian=baobiao'",1000);//3秒
setTimeout("dvck('"+jieguo+"正在自动为您加载下一个需要审批的信息!')",100);//3秒
	}
else{
	shenpibutton.disabled=false;
setTimeout("dvck('"+jieguo+"')",500);//3秒
}}}}
		xmlhttp.send(null);
	}
//	汇报审批结束
//汇报设置开始
function sethuibao(qunzuid,pass) {
		var xmlhttp=createAjax();	//创建对象
	if (xmlhttp) {
  var isshenpi=document.getElementById("isshenpi").value;
    var ismeiren=document.getElementById("ismeiren").value;
  var gonggao=document.getElementById("gonggao").value;
  var maxshuliang=document.getElementById("maxshuliang").value;
    var isyici=document.getElementById("isyici").value; 
	   var isniming=document.getElementById("isniming").value;
xmlhttp.open('post','../baobiao/cuhbcontent.asp?id='+escape(qunzuid)+'&ii=1&hbcontent=hbcontent&pass=' + escape(pass)+'&isshenpi=' + escape(isshenpi)+'&gonggao=' + escape(gonggao)+'&maxshuliang=' + escape(maxshuliang)+'&ismeiren=' + escape(ismeiren)+'&isniming=' + escape(isniming)+'&isyici=' + escape(isyici)+'&suijishu='+Date(),true)		//参上同看

	
		xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4 && xmlhttp.status==200) {	
				
	setTimeout("dvck('"+unescape(xmlhttp.responseText)+"')",500);//3秒
	sethuibaobutton.disabled=false;
	jinzhanfk.innerHTML="";

}}}
		xmlhttp.send(null);
	}
//汇报设置结束


