function editorFilter(){
	    this.mParList=new Array();
	    this.tabParList=new Array();
	    this.menuPar=null;
	    this.tabPar=null;
	    this.selectids=new Array();
	    this.selectPaths=new Array();
	    this.fileData=null;
	    this.menuData=null;
	    this.fields=null;
	    this.fData=null
	    this.field=null
	    this.serverPath="";
	    this.modiType=null;
	    this.createSignForTitle=function(){
		    var t=new outTitle();
		    t.add("用户","","150");
		    t.add("创建日期","","90");
		    t.add("签收日期","","90");
		    t.add("结束日期","","90");
		    t.add("签收状态","","60");
		    t.obj=document.getElementById("signForTitle");
		    t.create();			
	    }
    }

editorFilter.prototype.rowonmouseover=function(obj){
	    obj.className="tabListBodyRow_1";
    }

editorFilter.prototype.rowonmouseout=function(obj){
	    obj.className="tabListBodyRow";
    }

editorFilter.prototype.loadSignForTitle=function(){
	    if (pType!="modi"){
		    return;
	    }
	    if (!$("T_signFor").checked){
		    return;	
	    }
	    var objResponse=new JHttpResponse();
	    objResponse.write("mid",menuid);
	    objResponse.write("tabid",fileid);
	    objResponse.write("tab",asTab);
	    var out=objAjax.getText("post","../../system/myWeb/createDataServer.aspx?type=readSignFor",objResponse,null);
	    if (out==""){
		    return false;
	    }
	    out= comminute(out,c1,c2);  //分割数据
	      this.userList=out;
	      var page=out[0];
	      this.mPage=page[2];
	      //toUser,toDate,signFor,endDate,state
	      //0         1      2       3     4 
	      //显示内容
	      var wData=new tabList();
	      wData.obj=document.getElementById("signForList");
	      wData.rowid="signForRow_";                          //行的ID
	      wData.rowClass="tabListBodyRow";                 //行的样式
	      wData.mode=1;                                    //数据显示的格式
	      wData.isCheckbox=false;                          //加上复选框
	      wData.checkBoxID="";                      //复选框名
	      wData.onmouseroverRun="d.rowonmouseover";           //鼠标移上
	      wData.onmouseroutRun="d.rowonmouseout";             //鼠标移走
	      wData.onclickRun="";                    //鼠标单击
	      wData.ondblclickRun="";                   //鼠标双击
	      wData.add(raadArray(out,1,0),"listBodyOption","150");    //添加一列数据  用户名
	      wData.add(raadArray(out,2,0),"listBodyOption","90");    //添加一列数据 创建日期
	      wData.add(raadArray(out,3,0),"listBodyOption","90");     //添加一列数据  签收日期
	      wData.add(raadArray(out,4,0),"listBodyOption","90");     //添加一列数据   结束日期
	      wData.add(raadArray(out,5,0),"list_count","60");         //添加一列数据  状态
	      wData.addid(raadArray(out,0,0));                         //添加行标识 TID
	      wData.create();
	       var cObj=document.getElementsByName("signForRow__4"); //字符处理第四列, 
	      for (var i=0;i<cObj.length;i++){
		      if (cObj[i].innerText=="0"){
			      cObj[i].innerText="否";
			      cObj[i].title="未签收";
		      }else{
			      cObj[i].innerHTML="<B>是</B>";
			      cObj[i].title="已签收";
		      }
	      }
	}
	
editorFilter.prototype.loadPar=function(mid){  //依据栏目ID加载栏目参数
        if (mid=="" | mid==null){
	      alert("没有读取到基础栏目") 
	      return;
	    }
	    if(this.mParList.length>0){
		    for (var i=0;i<this.mParList.length;i++){
			    if (this.mParList[i][0]==mid){
				    return this.mParList[i][1];
			    }
		    }
	    }
	    var out=objAjax.getText("post","../../system/myWeb/createDataServer.aspx?type=readMenuPar&menuid="+mid+"&pType="+pType,null,null);
	    if (out=="noPop"){
		    return out;	
	    }
        out=out.split(c1);
	    if (out.length<2){
		    alert(erStr(out.toString()))
		    return;
	    }
	    var newArray=new Array();
	    newArray[0]=mid;
	    newArray[1]=out;
	    this.mParList[0]=newArray;	
	    return out;
    }
	
editorFilter.prototype.loadExDataPar=function(tab){  //读出挂接表的参数;  这里是读出可编辑的字段	
	    if(this.tabParList.length>0){
		    for (var i=0;i<this.tabParList.length;i++){
			    if (this.tabParList[i][0]==tab){
				    return this.tabParList[i][1];
			    }
		    }
	    }
	    var out=objAjax.getText("post","../../system/myWeb/createDataServer.aspx?type=tabPar&table="+tab,null,null);
        out=comminute(out,c1,c2);
	    var newArray=new Array();
	    newArray[0]=tab;
	    newArray[1]=out;
	    this.tabParList.push(newArray);
	    return out;
    }

editorFilter.prototype.displayExData=function(dObj){ //在指定的对象中,显示挂表可编辑字段
		var fList=this.tabPar;
		var tempObj=document.createElement("div");
		var obj=dObj.appendChild(tempObj);
		obj.innerHTML="<a target='_blank' id='displayUpFileHref' href='' style='display:none;'></a>";
		
		for (var i=0;i<fList.length-1;i++){
			tempObj=document.createElement("div");
			obj=dObj.appendChild(tempObj);
			obj.style.cssText="width:100%"

			//fName,fAsName,fType,fSize,fEditType,isNull 
			tempObj=document.createElement("div");
			var textObj=obj.appendChild(tempObj);

			tempObj=document.createElement("div");
			var inputObj=obj.appendChild(tempObj);
			
			textObj.style.cssText=" float:left;width:70px; padding-top:4px; padding-left:6px;"
			
			if (fList[i][5]=="1"){
				textObj.innerHTML=fList[i][1]+"<font color='#ff0000'>*</font>";
			}else{
				textObj.innerText=fList[i][1];
			}
			var html="";
			switch (fList[i][2]){
				case "int":
				case "numeric":
					inputObj.innerHTML="<input  isV='1' isNum='1' max='999999999' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:500px;' title='"+fList[i][1]+"'>";
					break;
				case "_img":
					html="<input  isV='1' isNum='' max='' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:400px;' title='"+fList[i][1]+"'>"
					html=html+"<input type='button' value='上传' onclick=\"d.upfile(this,'"+this.serverPath+"','1')\">";
					html=html+"<input type='button' value='打开' onclick=\"d.displayUpFile(document.getElementById('T_"+fList[i][0]+"'))\" >";
					inputObj.innerHTML=html;
					break;
				case "_soft":
				
					html="<input  isV='1' isNum='' max='' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:400px;' title='"+fList[i][1]+"'>"
					html=html+"<input type='button' value='上传' onclick=\"d.upfile(this,'"+this.serverPath+"','3')\">";
					html=html+"<input type='button' value='打开' onclick=\"d.displayUpFile(document.getElementById('T_"+fList[i][0]+"')) \">";
					
					inputObj.innerHTML=html;
					break;
				case "datetime":
					html="<input  isV='1' isNum='' max='' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:400px;' title='"+fList[i][1]+"'>"
					html=html+"<input type='button' value='选择' onclick='d.selectDate(this)'>";
					inputObj.innerHTML=html;
					break;
				default :
					if (fList[i][4]<20){
						switch  (fList[i][4]){
							case "1":
								inputObj.innerHTML="<textarea  isV='1'  max='"+fList[i][3]+"' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:500px;height:100px;' title='"+fList[i][1]+"'></textarea>";
								break;
							case "2":
								html="<input  isV='1' isNum='' max='' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:400px;' title='"+fList[i][1]+"'>"
								html=html+"<input type='button' value='选择' onclick='d.selectDate(this)'>";
								inputObj.innerHTML=html;
								break;
							case "3":
								html="<input  isV='1' isNum=''  max='"+fList[i][3]+"'  notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:400px;' title='"+fList[i][1]+"'>"
								html=html+"<input type='button' value='选择' onclick='d.selectAddress(this)'>";
								inputObj.innerHTML=html;
								break;
							default :
								inputObj.innerHTML="<input  isV='1'  max='"+fList[i][3]+"' notNull='"+fList[i][5]+"'  type='text' id='T_"+fList[i][0]+"' name='T_"+fList[i][0]+"' style='width:500px;' title='"+fList[i][1]+"'>";
								break;
						}
					}else{  //自定义扩展下拉菜单
						var sindex=fList[i][4]-20;
						var findItem=new itemClassEditorClass();
						findItem.mode="sindex";
						findItem.add(sindex,"T_"+fList[i][0],"");  //添加选项, 选项名或序号, 对象名, 样式表名
						findItem.obj=inputObj;
						findItem.create("../../system/");
					}
			}
			inputObj.style.cssText=" float:left;"
		}
 }
 
editorFilter.prototype.addSelectMenu=function(menu){  //写入选中的栏目
			var x=this.selectids.length;
			this.selectids[x]=menu[1];
			this.selectPaths[x]=menu[0];
			var tempObj=document.createElement("div");
			var obj=selectPathDiv.appendChild(tempObj);
			obj.title=menu[1];
			obj.style.width="350px";
			obj.id="pathOption";
			
			tempObj=document.createElement("span");
			var textObj=obj.appendChild(tempObj);
			textObj.innerText=menu[0];
			textObj.style.cssText="width:315px;";
			
			tempObj=document.createElement("span");
			var delObj=obj.appendChild(tempObj);
			delObj.innerText="删除";
			delObj.style.cssText="width:30px;cursor:hand";
			delObj.title=menu[1];
			delObj.onclick=function(){
				var x=pathOption.length;
				if (x==1){
					alert("最后一个所属栏目不能删除")
					return;	
				}
				for (var i=0;i<x;i++){
					if (pathOption[i].title==this.title){
						pathOption[i].removeNode(true);
						d.selectids.removeAt(i);
						d.selectPaths.removeAt(i);
						break;
					}
				 }
			}
}

editorFilter.prototype.upfile=function(obj,sysPath,fileType){
	   if (sysPath==null){
		   sysPath="";
	   }
	   if (fileType==null){
		   fileType="1";
		}
	   var photo=openUpfile(fileType,"../../system/");
	   	if (photo!=null){
			photo=photo.split(c1);
			var textObj=obj.previousSibling;
			textObj.value=photo[0];
		}
    }
    
editorFilter.prototype.displayUpFile=function(obj){//模拟点击
   if(obj.vaule!=null&&obj.value!="")
   {
   	 window.location.href=obj.value;
   }  
}

editorFilter.prototype.selectDate=function(obj){
	   var d=openSelectDate("../../");
	   	if (d!=null){
			var textObj=obj.previousSibling;
			textObj.value=d;
		}
   }
   
editorFilter.prototype.selectAddress=function(obj){
		var d=showModalDialog("../../system/sysSetup/selectAddress.htm?t="+create_id(), window, "dialogWidth:315px; dialogHeight:260px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
	   	if (d!=null){
			var textObj=obj.previousSibling;
			textObj.value=d;
		}
   }
   
editorFilter.prototype.openSelectDate=function(){
	  var v=openSelectDate()
	  if (v!=null){ $("endsignDate").value=v; }
  }
  
editorFilter.prototype.selectmenu=function(){ //选择栏目
		var menu=showModalDialog("../../system/myweb/selectMenu.htm?tab="+this.menuPar[15]+"&t="+create_id(), window, "dialogWidth:580px; dialogHeight:460px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
		if (menu!=null){
			menu=menu.split(c1);
			var x=this.selectids.length;
			for (var i=0;i<x;i++){
				if (this.selectids[i]==menu[1]){
					return false;
				}
			}
			this.addSelectMenu(menu);
	     }
	}
	
editorFilter.prototype.readFileData=function(){
		var objResponse=new JHttpResponse();
		objResponse.write("table",asTab);	
		objResponse.write("fileid",fileid);
		objResponse.write("menuid",menuid);
		var out=objAjax.getText("post","../../system/myWeb/createDataServer.aspx?type=readFileData",objResponse,null);
		out=comminute(out,c1,c2);
		if (out.length<2){
			alert(erStr(out.toString()))
			return;
		}
		this.fileData=out[0];   //文件的字段的值
		this.menuData=out[1];   //数据在哪些栏目中有保存		
		//title,Kind,content,TabImage,TabKeys,CBS,Source,SourceUrl,signForUser,signInUser,WebUrl," + fields + ",signFor,signForUser,signInUser,IsHidden,IsTop,IsEssence,IsRemark,Examine,P_A_View_ID,Art_View_Int_ID
		this.fields=out[2][0];  //字段集合
		this.fields=this.fields.split(",");
		this.fData=this.fileData;
		this.field=this.fields;		
		for (var i=0;i<this.fields.length;i++){
			if (this.fields[i]=="signFor"){				
				break;
			}
			var obj=document.getElementById("T_"+this.fields[i]);
			if (obj!=null){
				var objType=obj.type;
				objType=objType.toLowerCase();
				switch (objType){
					case "text":
						var v=this.fileData[i];
						if (v.length<30 & v.indexOf("0:00:00")!=-1){
							v=v.split(" ")[0]
						}
						obj.value=v;
						break;
					case "checkbox":
						findCheckbox("T_"+this.fields[i],this.fileData[i])
						break;
					case "radio":
						findRadio("T_"+this.fields[i],this.fileData[i])
						break;
					case "hidden":
						if (obj.id=="T_content"){
							EditContent=this.fileData[i].replace("<sc","<");
							EditContent=this.fileData[i].replace("<SC","<");
						}else{
							findSelect("T_"+this.fields[i],this.fileData[i])
						}
						break;
					default:
						if (obj.id=="T_content"){
							EditContent=this.fileData[i];
						}else{
							obj.value=this.fileData[i]
						}
						break;
				}
			}
		}
		if (out[3]!="" & out[3]!=null){
			try{
				intNum=out[3]
				$("dispInt").value=out[3][0];
				$("dispMoney").value=out[3][1];
				$("AwardsInt").value=out[3][2];
				$("AwardsMoney").value=out[3][3];
				$("intType").checked=false;
				$("intDiv").style.display="";
			}catch(e) {}
		}
		if (this.modiType==null){
			for (var i=0;i<this.menuData.length-1;i++){
				var menu=this.menuData[i].split(c3);
				menu[0]=m.id2Path(menu[0]);
				var x=this.selectids.length;
				var box=setCheckBox("signFor");					
				if(box){			
			        if (box.checked){
			          var boxParend=box.parentElement.parentElement.parentElement;
			          for(var k=0;k<boxParend.childNodes.length;k++){  
			            boxParend.childNodes[k].style.display="block";
			          }			          
				    }
				}
				var add=1;
				for (var i1=0;i1<x;i1++){
					if (this.selectids[i1]==menu[1]){
						add=0;
						break;
					}
				}
				if (add=1){
					this.addSelectMenu(menu);
				}
			}
		}
	}
	
editorFilter.prototype.openVot=function(obj){
	var arr=showModalDialog("../../system/vot/List.htm?mode=call&t="+create_id(), window, "dialogWidth:500px; dialogHeight:500px; toolbar=no;location=no;directories=no;status=no;menubar=no;scroll=auto;resizable=0;help=0");
	    $('T_inquiry').value=arr;
	}
	
editorFilter.prototype.saveDAta=function(){  //提交表单
		var va=editTxt.GetContent();
		if (va.indexOf("fileBodyImg")==-1){
			va=va.replace("<IMG ","<IMG style='display:none;' id='fileBodyImg' name='fileBodyImg' ");
		}
		va=va.replace("style=\"BORDER-LEFT-COLOR: #000000; FILTER: ; BORDER-BOTTOM-COLOR: #000000; BORDER-TOP-COLOR: #000000; BORDER-RIGHT-COLOR: #000000\"","");
	    $("T_content").value=va;
   		var v=new validate();
		v.form=document.getElementById("form1");
		if (!v.start()){  //验证必填项
		   return ;
		}
	    if (this.selectids.length==0){
		   	alert ("请设置你要发布文件的栏目")
			return false;
	    }
		var objResponse=new JHttpResponse();
		objResponse.write("table",asTab);
		var fList=this.tabPar;
		var fields="";
		for (var i=0;i<fList.length-1;i++){
			if (i<fList.length-2){
				fields=fields+fList[i][0]+","
			}else{
				fields=fields+fList[i][0]+""
			}
		}
		objResponse.write("fields",fields);
		objResponse.write("P_A","-1");
		objResponse.write("menuids",this.selectids);
		if (fileid==null|fileid==""){
			fileid=""
		}		
		objResponse.write("id",fileid);
		//fName,fAsName,fType,fSize,fEditType,isNull 
	    var out=objAjax.submit(form1,"post",true,objResponse);
		if (out.search("OK")!=-1){
			if (fileid==null | fileid==""){
				alert ("一条信息发布完成, 点击确定继续.");
				if ($("isClear").checked){
					location.reload();
				}
			}else{
				alert ("数据已保存.");
				if ($("isClear").checked){
					location.reload();
				}
			}
			var frame=eval("parent.wIframe_"+wNum);
			try{
				frame.myWeb.readFiels();
			}catch(e){
				
			}			
		}else{
			alert (erStr(out));
		}
   }
   
function setCheckBox(field){
		var obj=document.getElementById("T_"+field)
		if (obj){		
			if (getField(d.fData,d.fields,field)=="1"){			
				obj.checked=true;
			}else{
				obj.checked=false;
			}
		}
		return obj;
}
