function readMenuidPar(menuid,outType){
	var objResponse=new JHttpResponse();
	objResponse.write("menuid",menuid);	
	var out=objAjax.getText("post","mywebServer.aspx?type=readMenuData",objResponse,null);
	if (out=="noPop"){
		return out;
	}
	//alert(out);
	out=comminute(out,c1,c2);
	if (out.length<2){
		if (out.toString()!=""){
			alert(erStr(out.toString()));
		}
		return null;
	}
	
	//MID,MName,IndexNum,Type,Intro,AsTab,TitleImg,menuText,Affiche,menuKey,UpListID,isNavigation, isMenu, isHidden, isReview, isHTML, PageUrl, templet,userInt, pageSize, isListFile,isHomePage,isTop,MenuIsFind,isChildHome
	//0,  1          2    3       4  5       6       7         8     9          10         11          12     13        14        15      16       17     18       19        20           21       22      23         24
	 
	out=out[0];
	if (outType!=null){
		return out;
	}
	form1.menuName.value=out[1];
	form1.menuIndex.value=out[2];
	form1.menuText.value=out[7];
	form1.menuAffiche.value=out[8];
	form1.menuKey.value=out[9];
	form1.menuIntro.value=out[4];
	form1.TitleImg.value=out[6];
	form1.isTop.value=out[22];
	$("pageSize").value=out[19];
	form1.pageUrl.value=out[16];
	findCheckbox("isNavigation",out[11]);
	findCheckbox("isMenu",out[12]);
	findCheckbox("isHidden",out[13]);
	findCheckbox("isReview",out[14]);
	findCheckbox("isListFile",out[20]);
	findCheckbox("isHomePage",out[21]);
	findCheckbox("isChildHome",out[24]);
	findCheckbox("MenuIsFind",out[23]);
	findRadio("menuType",out[3])
	return out;
}

function fieldClass(){
	this.fValue="";
	this.delField="";
	this.tabList=null;
	this.fList=null;
	this.sysField=null;
	this.selectRow=null;
	this.loadEditMenu=function(){
		var out=objAjax.getText("post","../sysSetup/optionSetupServer.aspx?type=readList",null,null);
	    out=comminute(out,c1,c2);
		var sObj=document.getElementsByName("fEditType");
		for (var x=0;x<sObj.length;x++){
			for (var i=0;i<out.length-1;i++){
				var opt=document.createElement("option")
				opt.text=out[i][1];
				opt.value=parseInt(out[i][0])+20;
				sObj[x].options.add(opt);
			}
			
		}
	}
	this.addRow=function(){
		var objTemplate=document.getElementById("add");
		var objCopy=objTemplate.cloneNode(true); //复制行
		objCopy.style.display="block";
		objCopy.id="fieldRow";
		var newObj=objTemplate.parentNode.insertBefore(objCopy,objTemplate);//放置新行
		newObj.onclick=function(){
			if (this.isSys!="1"){
				if (f.selectRow!=null){
					f.selectRow.className="";
				}
				f.selectRow=this;
				f.selectRow.className="selectRow";
			}
		}
		setField(form1.fName.length-3,"1");
	}
	this.upRow=function(){
		if (this.selectRow==null){
			return false;
		}
		var tr1=this.selectRow;
		var tr2=tr1.previousSibling;
		if (tr1.rowIndex>4){
			ExchangeTr(tr2,tr1)
		}
	}	
	
		
	this.downRow=function(){
		if (this.selectRow==null){
			return false;
		}
		var tr1=this.selectRow
		var tr2=tr1.nextSibling;
		if (!tr2.nextSibling){
			return false;
		}
		if (tr2){
			ExchangeTr(tr1,tr2)
		}
	}
	
	this.keyDown=function(){ //检测键盘		
	 //上光标 38 左光标37 右光标39   下光标40  回车13  ESC 27 pageup 33 pagedown34  删除键 46
	    var key=event.keyCode;
		if (optionBodyObj!=null){
			if (optionBodyObj[2].style.display=="none")	{
				return  false;
			}
		}
		if (key==46&event.ctrlKey){
			this.delRow();
			return  false;
		}
		if (key==38){
			this.upRow();
			return  false;
		}
		if (key==40){
			this.downRow();
			return  false;
		}
	}
	this.delRow=function(){ //删除行
		if (this.selectRow==null){
			return  false;
		}
			var o=this.selectRow.getElementsByTagName("INPUT")
			var _fname=null;
			var _asname=null;
			for (var i=0;i<o.length;i++){
				if (o[i].id=="fName"){
					_fname=o[i];
				}
				
				if (o[i].id=="fAsName"){
					_asname=o[i];
				}
			}
			
			if (_fname.value!=""&_asname.value!=""){
				if (!this.isSysField(_fname.value)){
					this.delField=this.delField+" ["+_fname.value+"],"
					this.selectRow.removeNode(true);
					this.selectRow=null;
				}
			}
	}
	
	this.clearTab=function(){
	    var tab=$("selectTable").value;
	    if (window.confirm("注意你的操作,你在做一件危险的事!\n\n 您清空此表("+tab+")中的数据, 会导致此表中的所有数据丢失,\n\n 注意:是这个表的所有数据, 不仅仅是你当前操作的栏目,\n\n 所有使用此表的栏目下的数据, 都将丢失, \n\n并且不可以从回收站中找回来, 你真的要这么干?"))
	    {
	       var objResponse=new JHttpResponse();
	       objResponse.write("table",tab);	
	       var out=objAjax.getText("post","mywebServer.aspx?type=clearTab",objResponse,null);
	       if (out=="noPop"){
	           alert("您没有此操作的权限, 只有系统管理员可以这么干");
	            return;
	       }else if (out=="OK"){
	            alert(tab+" 表内数据已全部清除完毕");
	       }else{
	            alert(erStr(out));
	       }
	    }
	}	
	this.saveTitleImg=function(){
		if ( menuid==null | menuid=="" ){
			 return;
		}
	    var objResponse=new JHttpResponse();
	    objResponse.write("menuid",menuid);	
		var TImg=$("TitleImg").value;
	    objResponse.write("TImg",TImg);	
    	var out=objAjax.getText("post","mywebServer.aspx?type=saveTitleImg",objResponse,null);
		if (out=="1"){
			alert("设置成功");
		}else{
			 alert(erStr(out));	
		}
	}
	
	this.setDownMenu=function(){
		if (!window.confirm("此操作将会把本栏目的子栏目设置为相同的数据模型\n\n您确定要执行此操作吗？")){
			return;
		}
	    var tab=$("selectTable").value;
		var objResponse=new JHttpResponse();
	    objResponse.write("table",tab);	
	    objResponse.write("menuid",menuid);	
	    var out=objAjax.getText("post","mywebServer.aspx?type=setDownMenu",objResponse,null);
	}
	
	this.loadSysField=function(){ //取出所有系统字段
		var out=objAjax.getText("post","mywebServer.aspx?type=readSysField",null,null);
		
		this.sysField=out.split(c1);
	}
	
	this.isSysField=function(fName){ //判断一个字段是不是系统字段。
		for (var i=0;i<this.sysField.length-1;i++){
			if (this.sysField[i].toLowerCase()==fName.toLowerCase()){				
				  return true;	
			}
		}
		return  false;
	}
	
	this.loadTablist=function(){//加载已设置好配置的表
		var out=objAjax.getText("post","mywebServer.aspx?type=readTab",null,null);
		//tabName,tabAsName,isSys,ContentPage,EditPage,DisplayType
		//0           1         2     3         4       5
		var tList=comminute(out,c1,c2);
		this.tabList=tList;
		var l=form1.selectTable.options.length;
		for (var i=0;i<l;i++){
			form1.selectTable.options[0].removeNode(true);
		}
		for (i=0;i<tList.length-1;i++){
			var opt=document.createElement("option");
			opt.text=tList[i][1];
			opt.value=tList[i][0];
			opt.isSys=tList[i][2];
			form1.selectTable.options.add(opt);
		}
		form1.selectTable.onchange=function(){
			f.loadOldData(this.value);
		}
	}
	
	this.loadOldData=function(table){ //装入指定表的配置
		var objResponse=new JHttpResponse();
		objResponse.write("table",table);
		var out=objAjax.getText("post","mywebServer.aspx?type=readTabField",objResponse,null);
		var fList=comminute(out,c1,c2);
		this.fList=fList;
		this.clearAllRow();
		var tList=this.tabList;
		form1.tabName.readOnly=true;
		for (var i=0;tList.length-1;i++){
			if (tList[i][0]==table){
				form1.tabAsName.value=tList[i][1];
				form1.tabName.value=table;
				if (tList[i][2]=="1"){
					form1.tabAsName.readOnly=true;
				}else{
					form1.tabAsName.readOnly=false;
				}
				form1.ContentPage.value=tList[i][3];
				form1.EditPage.value=tList[i][4];
				selectoption(form1.DisplayType,tList[i][5])
				break;
			}
		}
		for (i=0;i<fList.length-1;i++){
			this.addRow();
			this.fillRow(fList[i]);
		}
	}
	
	this.clearAllRow=function(){//清除所有行
	   if (!isObject(fieldRow)){
		    return ;
		}
		if (fieldRow.length==null |fieldRow.length==0 ){
			return ;
		}
		var l=fieldRow.length;
		for (var i=0;i<l-1;i++){ 
			fieldRow[0].removeNode(true);
		}
	}
	
	this.loadNewData=function(){
		//建立新的挂接库配置
		var out=objAjax.getText("post","mywebServer.aspx?type=readVerType",null,null);
		if (out=="0"){
			alert("您使用的系统版本无此功能");
			return;	
		}
		var rowConfig=new Array();
		rowConfig[0]=new Array();
		rowConfig[0][0]="title";  //字段名
		rowConfig[0][1]="标题";    //字段别名
		rowConfig[0][2]="nvarchar"; //字段类型
		rowConfig[0][3]="50";   //字段宽度
		rowConfig[0][4]="0";   //编辑方式
		rowConfig[0][5]="0";  //排序方式
		rowConfig[0][6]="1";   //是否允许为空
		rowConfig[0][7]="1";  //是否允许搜索
		rowConfig[0][8]="1";  //允许编辑
		rowConfig[0][9]="1";   //是否在列表中显示
		rowConfig[0][10]="1";  //是否可以在新窗口中显示 
		rowConfig[0][11]="1"; //是否系统字段
		
		rowConfig[1]=new Array();
		rowConfig[1][0]="content";  //字段名
		rowConfig[1][1]="内容";    //字段别名
		rowConfig[1][2]="ntext"; //字段类型
		rowConfig[1][3]="16";   //字段宽度
		rowConfig[1][4]="1";   //编辑方式
		rowConfig[1][5]="0";  //排序方式
		rowConfig[1][6]="1";   //是否允许为空
		rowConfig[1][7]="1";  //是否允许搜索
		rowConfig[1][8]="1";  //允许编辑
		rowConfig[1][9]="1";   //是否在列表中显示
		rowConfig[1][10]="1";  //是否可以在新窗口中显示 
		rowConfig[1][11]="1"; //是否系统字段
		
		rowConfig[2]=new Array();
		rowConfig[2][0]="SaveUser";  //字段名
		rowConfig[2][1]="发布人";    //字段别名
		rowConfig[2][2]="nvarchar"; //字段类型
		rowConfig[2][3]="50";   //字段宽度
		rowConfig[2][4]="0";   //编辑方式
		rowConfig[2][5]="0";  //排序方式
		rowConfig[2][6]="1";   //是否允许为空
		rowConfig[2][7]="1";  //是否允许搜索
		rowConfig[2][8]="0";  //允许编辑
		rowConfig[2][9]="1";   //是否在列表中显示
		rowConfig[2][10]="1";  //是否可以在新窗口中显示 
		rowConfig[2][11]="1"; //是否系统字段
		form1.tabName.value="";
		form1.tabAsName.value="";
		form1.tabName.readOnly=false;
		form1.tabAsName.readOnly=false;
		
		this.clearAllRow();
		for (var i=0;i<=2;i++){
			this.addRow();
			this.fillRow(rowConfig[i]);
		}
	}
	
	this.fillRow=function(data){  //为最大的一行填充数据
		var i=form1.fName.length-3;
		var isSys=this.isSysField(data[0]);
		form1.fName[i].value=data[0];
		form1.fAsName[i].value=data[1];
		selectdel(form1.fType[i],data[2]);
		form1.fSize[i].value=data[3];
		if (isSys){
			selectdel(form1.fEditType[i],data[4]);
		}else{
			selectoption(form1.fEditType[i],data[4]);
		}
		selectoption(form1.fOrder[i],data[5]);
		setChecked(form1.isNull[i],data[6])
		setChecked(form1.isFind[i],data[7])
		setChecked(form1.isEdit[i],data[8])
		setChecked(form1.isList[i],data[9])
		setChecked(form1.isWindow[i],data[10])
		
		form1.fName[i].readOnly=true;
		form1.fSize[i].readOnly=true;
		form1.fType[i].readOnly=true;
		
		if (isSys){
			fieldRow[i].isSys="1";
			fieldRow[i].className="sysRow";
			fieldRow[i].title="这是系统字段";
		}else{
			fieldRow[i].isSys="0";
		}
	}
	
	
	this.SaveData=function(){  //保存挂接库的配置
		if (form1.fName.length==2 &form1.fName[0].value.trim()==""){
			 alert("请为你的数据表设置数据模型\n(原8.*版挂接表功能)");
			 return ;
		}
		var addField="";
		var fieldUp=new Array();
		for (var i=0;i<15;i++){
			fieldUp[i]="";
		}
		for (i=0;i<form1.fName.length-1;i++){
			if (form1.fName[i].value==""&i==form1.fName.length-2){break;}
			if (form1.fName[i].readOnly!=true){
				switch (form1.fType[i].value){
					case "int":
					    addField=addField+" ["+form1.fName[i].value+"] int,"
						break;
					case "numeric":
						addField=addField+" ["+form1.fName[i].value+"] numeric(18,4),"
  						break;
					case "datetime":
						addField=addField+" ["+form1.fName[i].value+"] datetime,"
  						break;
					case "ntext":
					    addField=addField+" ["+form1.fName[i].value+"] ntext,";
						break;
					default:
						addField=addField+" ["+form1.fName[i].value+"] nvarchar("+form1.fSize[i].value+"),"
						break;
				}
				form1.fName[i].readOnly=true;
			}
			var fName=form1.fName[i].value;
			var fAsName=form1.fAsName[i].value;
			if (fAsName==""){
				alert("字段别名不能为空");
			   	 return ;
			}
			var fType=form1.fType[i].value;
			var fSize=form1.fSize[i].value;
			var fEditType=form1.fEditType[i].value;
			var fOrder=form1.fOrder[i].value;
			var isNull=0;
			if (form1.isNull[i].checked==true){isNull=1;}
			var isFind=0;
			if (form1.isFind[i].checked==true){isFind=1;}
			var isEdit=0;
			if (form1.isEdit[i].checked==true){isEdit=1;}
			var isList=0;
			if (form1.isList[i].checked==true){isList=1;}
			var isWindow=0;
			if (form1.isWindow[i].checked==true){isWindow=1;}
			var isSys=fieldRow[i].isSys;
			if (isSys==null|isSys+""==""){isSys=0}
			
			fieldUp[0]=fieldUp[0]+fName+",";
			fieldUp[1]=fieldUp[1]+fAsName+",";
			fieldUp[2]=fieldUp[2]+fType+",";
			fieldUp[3]=fieldUp[3]+fSize+",";
			fieldUp[4]=fieldUp[4]+fEditType+",";
			fieldUp[5]=fieldUp[5]+fOrder+",";
			fieldUp[6]=fieldUp[6]+isNull+",";
			fieldUp[7]=fieldUp[7]+isFind+",";
			fieldUp[8]=fieldUp[8]+isEdit+",";
			fieldUp[9]=fieldUp[9]+isList+",";
			fieldUp[10]=fieldUp[10]+isWindow+",";
			fieldUp[11]=fieldUp[11]+isSys+",";
		}
		if (addField!=""){addField=addField.substr(0,addField.length-1)}
		var objResponse=new JHttpResponse();
		objResponse.write("fName",fieldUp[0]);
		objResponse.write("fAsName",fieldUp[1]);
		objResponse.write("fType",fieldUp[2]);
		objResponse.write("fSize",fieldUp[3]);
		objResponse.write("fEditType",fieldUp[4]);
		objResponse.write("fOrder",fieldUp[5]);
		objResponse.write("isNull",fieldUp[6]);
		objResponse.write("isFind",fieldUp[7]);
		objResponse.write("isEdit",fieldUp[8]);
		objResponse.write("isList",fieldUp[9]);
		objResponse.write("isWindow",fieldUp[10]);
		objResponse.write("isSys",fieldUp[11]);
		objResponse.write("addField",addField);
		if (this.delField!=""){this.delField=this.delField.substr(0,this.delField.length-1)}
		objResponse.write("delField",this.delField);
		
		objResponse.write("tabName",form1.tabName.value);
		objResponse.write("tabAsName",form1.tabAsName.value);
		objResponse.write("displayType",form1.DisplayType.value);
		objResponse.write("ContentPage",form1.ContentPage.value);
		objResponse.write("EditPage",form1.EditPage.value);
		var out=objAjax.getText("post","mywebServer.aspx?type=tabSet",objResponse,null);
		this.delField="";
		if (out.search("OK")==-1){
		   out=out.substr(out.length-1000,1000);
		  	alert(out)
			return false;
		}else{
			return true;
		}
	}
	
	this.edit=function(obj){
		var textobj=obj.previousSibling;
		var arr=openEdit(textobj.id);
		if (arr!=null){
			var textobj=obj.previousSibling;
			textobj.value=arr;
		}
	}
	this.saveMenu=function (){
		var v=new validate();
		v.form=document.getElementById("form1");
		if (!v.start()){  //验证必填项
		   return ;
		}else{
			var p=power.save("");  //保存权限		
			if (p==null){
				return false;
			}			
			var uint=sInt.save("");  //保存积分规则
			if (!uint){
				return false;
			}
			var a=f.SaveData();  //挂接表数据保存
			if (!a){
				return false;
			}
			if (powerForm.setDownMenu.checked ==true){
				var setDownMenu="1";
			}else{
				var setDownMenu="0";
			}
			if (IntForm.setDownMenuInt.checked==true){
				var setDownMenuInt="1";
			}else{
				var setDownMenuInt="0";
			}
			var objResponse=new JHttpResponse();
			objResponse.write("menuid",menuid);
			objResponse.write("powerid",p);
			objResponse.write("userInt",IntForm.MIName.value);
			objResponse.write("setDownMenu",setDownMenu);
			objResponse.write("setDownMenuInt",setDownMenuInt);
			objResponse.write("asTab",form1.tabName.value);
			if (pType!="modi"){
				form1.action="mywebServer.aspx?type=add";
				var out=objAjax.submit(form1,"post",true,objResponse);
			}else{
				form1.action="mywebServer.aspx?type=modiMenu";
				var out=objAjax.submit(form1,"post",true,objResponse);
			}
			if (out.search("OK")>=0){
				//---------------------------------------
				if(intObject){
					var wxi=intObject.saveDate();
					if (!wxi){
						return false;
					}
				}
				frame=eval("parent.wIframe_"+wNum);
				try{
					frame.myWeb.readMenu(frame.myWeb.menuid);
				}catch(e){
				}
				if (pType!="modi"){
					out=comminute(out,"|",",");
					alert("操作成功，"+out[1][0]+"个栏目已成功创建");
					form1.menuName.value="";
					if (isClear.checked){
						for (var i=0;i<form1.elements.length;i++){
							var e = form1.elements[i];
							if (e.type!="button"){
								e.value="";
							}
						}
						var url=location.href;
						location.href=url;
					}
				}else{
					alert("操作成功, 栏目已修改");
				}
			}else{
			 
				alert(out);
				return null;
			}
		}
	}	
	this.modiSysLabel=function(thisObj){
	    var obj=thisObj.previousSibling;
		var labelText=obj.value;
		var objResponse=new JHttpResponse();
		objResponse.write("labelText",labelText);
		var out=objAjax.getText("post","../label/editFile.aspx?type=rLabelPar",objResponse,null);
		if (out=="-1"){
			alert("标签不存在,可能已经删除");
			return;	
		}
		if (out.indexOf(c1)==-1){
			alert("错误:\n"+erStr(out))
			return;	
		}
		out=out.split(c1);
		var objnum=parent.win.objNum;
		var par="wNum="+objnum+"&ID="+out[2]+"&lType="+out[0]+"&lClass="+out[1]+"&lName="+labelText;
		parent.win.pCreate("p-createLabel_Modi",par,"修改标签",true);
	}
}
function setField(i,isNew){
	if (i==null){i=0}
	for (i=i;i<form1.fName.length;i++){
		form1.fName[i].i=i;
		form1.fAsName[i].i=i;
		form1.fType[i].i=i;
		//开始为字段名绑定事件
		if (isNew=="1"){
			form1.fName[i].readOnly	=false;
		}
		form1.fName[i].onfocus=function(){
			f.fValue=this.value.trim();
		}		
		form1.fName[i].onchange=function(){
			if (this.value.length>15){alert("字段名不能超过15个字符")}
		}		
		form1.fName[i].onblur=function(){			
			if (this.value.substr(0,1).search(/[0-9]{1,}/g)!=-1){
			    this.value="";
				alert("字段不能用数字开头");
				this.focus();
				return null;
			}
			if (this.value.trim()==""&this!=form1.fName[form1.fName.length-2] ){
				alert("字段名不能为空");
				this.value=""
				this.focus();
				return null;
			}
			var v=this.value;
			if (v.search(/[^0-9^a-z^A-Z_]{1,}/g)>=0){
				alert("字段名只能由英文和数字和下划线构成");
				this.value=v.replace(/[^0-9^a-z^A-Z]/g,"")
				this.focus();
				return null;	
			}			
			for (var i=0;i<form1.fName.length-1;i++){
				if (form1.fName[i]!=this){
					if (form1.fName[i].value==this.value){
						this.value="";
						alert("字段名禁止重名");
						this.focus();
						return null;
					}
				}
			}
			if (f.isSysField(this.value) & !this.readOnly){
				this.value="";
				alert("字段名和系统字段重名");
				this.focus();
				return null;
			}			
			if (this.value.trim()!=""&this==form1.fName[form1.fName.length-2] ){
				f.addRow();
			}
		}		
		form1.fName[i].onclick=function(){
			if (this.value.trim()!=""&this==form1.fName[form1.fName.length-2] ){
				f.addRow();
			}	
		}
		//别名事件绑定开始
		
		form1.fAsName[i].onblur=function(){
			if (this.value.substr(0,1).search(/[0-9]{1,}/g)!=-1){
				alert("字段别名不能用数字开头");
				this.focus();
				return null;
			}
			if (this.value.search(/[\^ ,;<>\?\*※⊙|#@|!]{1,}/g)!=-1){
				alert("字段别名中禁止包含特殊符号");
				this.value="";
				this.focus();
				return null;				
			}
			try{
				if (this.value.trim()==""){
					this.value=form1.fName[parseInt(this.i)].value;
				}else{
					if (form1.fName[parseInt(this.i)].value=="" & this.value.search(/[^0-9^a-z^A-Z_]{1,}/g)==-1){
						form1.fName[parseInt(this.i)].value=this.value;
					}
				}
			}catch(e) {}
		}		
		//字段类型事件开始
		form1.fType[i].onchange=function(){
			var v=this.value;
			
			switch  (v){
				case  "nvarchar":
					form1.fSize[parseInt(this.i)].value="50";
					form1.fSize[parseInt(this.i)].readOnly=false;
				    break;
				case  "int":
					form1.fSize[parseInt(this.i)].readOnly=true;
					form1.fSize[parseInt(this.i)].value="4";
				    break;
				case  "numeric":
					form1.fSize[parseInt(this.i)].value="9";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "datetime":
					form1.fSize[parseInt(this.i)].value="4";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "ntext":
					form1.fSize[parseInt(this.i)].value="200000";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "_img":
					form1.fSize[parseInt(this.i)].value="211";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "_soft":
					form1.fSize[parseInt(this.i)].value="213";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "_video":
					form1.fSize[parseInt(this.i)].value="217";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
				case  "_link":
					form1.fSize[parseInt(this.i)].value="212";
					form1.fSize[parseInt(this.i)].readOnly=true;
				    break;
			}
			
		}
		
		//字段长度事件开始
		form1.fSize[i].onblur=function(){
			if (this.value.trim()==""){
				alert("字段长度不能为空");
				this.focus();
				return null;	
			}
			if (this.value.search(/[^0-9]{1,}/g)>=0){
				alert("字段长度只能是数字");
				this.value="";
				this.focus();
				return null;	
			}
			if (parseInt(this.value)>255){
				this.value="255";
				return null;	    
			}
		}
	}
	//字段事件绑定完成, 开始其它事件绑定
	form1.tabName.onblur=function(){
		if (this.value.substr(0,4)!="tab_"){
				this.value="tab_"+this.value;
				this.focus();			
		}
		if (this.readOnly!=true){
			var tList=f.tabList;
			for (var i=0;i<tList.length-1;i++){
				if (this.value.toLowerCase()==tList[i][0].toLowerCase()){
					this.value="";
					alert("数据表禁止重名");
					this.focus();			
					return null;
				}
			}
		}
	}
	
	form1.tabAsName.onblur=function(){
		if (this.value==""&form1.tabName.value!=""){
			this.value=form1.tabName.value;
			return null;
		}
		if (this.value==""){
			alert("数据表别名不能为空");
			this.value="tab_"+this.value;
			this.focus();	
			return null;
		}
	}
	
  }
   function setChecked(obj,v){
	   if (v=="1" | v==1){
		 obj.checked=true;  
		}else{
			obj.checked=false;
		}
   }
  function upfile(obj){
		var url=openUpfile(9);
		if (url!=null){
			var textobj=obj.previousSibling;
			if (textobj!=null){
				url=url.replace("../../","/");
				url=url.replace(c1,"");
				textobj.value=url;
			}
		}
	}