function intClass(){
	var groupList=null;
	var opField="Art_View_Int,Art_Add_Int,Cmt_Add_Int,Art_Ese_Int,Art_Top_Int,Art_Del_Int,Cmt_Del_Int,Art_Non_Int,Art_View_Money,art_Add_Money,Cmt_add_Money"
	opField=opField.split(",");
	var userIntList=new Array();
	var sel=null;
	this.upid=null;
	this.startName=null;
	this.menuid=null;
	
	this.loadGroup=function(){  //加载有哪些用户组
		 var out=objAjax.getText("get","../user/saveUser.aspx?type=readGroup",null,null);
		 out= comminute(out,c1,c2); 
		 groupList=out;
	 	//[ID],[GroupName],[IsDefault],[IsGuest] 
		// 0        1           2        3  

	}
	
	this.createDiv=function(obj,title, width){ //创建权限组外框
		 tempObj=document.createElement("div");
		 var div=obj.appendChild(tempObj);
		 div.className="PowerList";
		 if (width!=null){
			 div.style.width=width;
		 }
		
		 tempObj=document.createElement("fieldset");
		 var addObj=div.appendChild(tempObj);
 		 tempObj=document.createElement("legend");
		 var addText=addObj.appendChild(tempObj);
		 addText.innerText=title;
		 tempObj=document.createElement("div");
		 var addDiv=addObj.appendChild(tempObj);
		 addDiv.innerHTML="";
		 addDiv.className="PowerListOption";
		 return addDiv;
	}
	
	this.createGroup=function(obj){
		var tempObj=document.createElement("div");
	    var div=obj.appendChild(tempObj);
		for (var i=-1;i<groupList.length-1;i++){
			tempObj=document.createElement("span");
			var sp=obj.appendChild(tempObj);
			if (i==-1){
				sp.innerText="";
				sp.style.width="100px";
			}else{
				sp.innerText=groupList[i][1];
			}
			sp.className="intSpan";
		}
		var op="看主题扣积分,发贴加积分,回贴加积分,精华加积分,置顶加积分,删除主题扣积分,删除回复扣积分,屏蔽扣积分,看主题扣金钱,发贴扣金钱,回贴扣金钱"
		op=op.split(",");
		for (i=0;i<op.length;i++){
			tempObj=document.createElement("div");
		    var div=obj.appendChild(tempObj);
			for (var x=-1;x<groupList.length-1;x++){
				tempObj=document.createElement("span");
				var sp=obj.appendChild(tempObj);
				if (x==-1){
					sp.innerText=op[i];
					sp.style.width="100px";
				}else{
					sp.innerHTML="<input title='"+groupList[x][1]+op[i]+"' isV='1' isNum='1' notNull='1' max='1000' text='' id='"+opField[i]+"' value='0' name='"+opField[i]+"' size='3'>";
				}
				sp.className="intSpan";
			}
		}
			
	}
	this.createSetName=function(obj){
		
		var tempObj=document.createElement("span");
		var textObj=obj.appendChild(tempObj);
		textObj.innerHTML="加载配置:";
		
		
		var out=objAjax.getText("get","../myweb/mywebServer.aspx?type=readUserIntList",null,null);
		out=comminute(out,c1,c2); 
		var tempObj=document.createElement("select");
	    var selObj=obj.appendChild(tempObj);
		for (var i=0;i<out.length-1;i++){
		     tempObj=document.createElement("option");
			 tempObj.text=out[i][0];
			 tempObj.value=out[i][0];
			 selObj.options.add(tempObj);
		}
		
		selObj.onchange=function(){
			sInt.selectInt(this.value);
		}
		sel=selObj;

		
		var tempObj=document.createElement("input");
	    var nameObj=obj.appendChild(tempObj);
		nameObj.name="MIName";
		nameObj.id="MIName";
		nameObj.isV="1";
		nameObj.notNull="1";
		nameObj.max="50";
		nameObj.min="2";
		nameObj.title="积分规则配置名称";
		
			
		var tempObj=document.createElement("span");
		var textObj=obj.appendChild(tempObj);
		var html="<input type='checkbox' value='1' id='setDownMenuInt' name='setDownMenuInt'><label for ='setDownMenuInt'>应用到子栏目</label>";
		html=html+"<span style='width:15px'></span><input title='删除选定的配置' onclick='sInt.del()' type='button' value='删除'>"
		textObj.innerHTML=html;
		
	}
	
	this.del=function(){ //删除一个配置.
		var v=IntForm.MIName.value;
		if (v==""){
			alert("请选择一个配置");
			return false;
		}
  		var out=objAjax.getText("get","../myweb/mywebServer.aspx?type=delInt&MIName="+v,null,null);
		if (out=="OK"){
			IntForm.MIName.value="";
			selectDelvalue(sel,v);
		}else{
			alert(erStr(out))
		}
	}
	
	this.create=function(obj){  //开始创建
		this.loadGroup();
		var name=this.createDiv(obj,"名字","98%");
		var set=this.createDiv(obj,"设置","98%");
		this.createSetName(name);
		this.createGroup(set);
			
		if (this.startName!="" & this.startName!=null){ //默认的积分规则名
			
			this.selectInt(this.startName);
		}else{
			if (pType=="modi"){
				var mid=this.upid;
			}else{
				var mid=this.menuid;
			}
			if (mid==null){
				return false;
			}
			var menuData=readMenuidPar(mid,"");
			if (menuData!=null){
				var v=menuData[18];
			}else{
				var v="";
			}
			this.selectInt(v);
		}
		
	}
	
	this.selectInt=function(v){
		if (v==null|v=="") {
			IntForm.MIName.value="";
			return false;
		}
		
		//userIntList
		var out=null;
		IntForm.MIName.value=v;
		selectoption(sel,v);
		for (var i=0;i<userIntList.length;i++){
			if (userIntList[i][0]==v){
				out=userIntList[i][1]
				break;
			}
		}
		v=encodeURI(v);
		if (out==null){
			out=objAjax.getText("get","../myweb/mywebServer.aspx?type=readUserInt&MIName="+v,null,null);
			
			//alert(out);
			out=comminute(out,c1,c2); 
			if (out.length<2){
				//alert(out);
				return false;
			}
			i=userIntList.length;
			userIntList[i]=new Array();
			userIntList[i][0]=v;
			userIntList[i][1]=out;
		}
		
		//alert(groupList.length);




		for (var i=0;i<groupList.length-1;i++){
			try{
				for (var x=0;x<out[i].length-1;x++){
					
					var objs=document.getElementsByName(opField[x]);
					var obj=objs[i];
					var str=out[i][x];
					if (str==""){str="0"}
					obj.value=str;
				}
			}catch(e) {}
		}
		
		
	}
	
	this.save=function(info){
		var v=new validate();
		v.form=IntForm;
		if (!v.start()){
			return false;
		}
		
		var text=IntForm.getElementsByTagName("input");
		for (var i=0;i<text.length;i++){
			if (text[i].type=="text"){
				if (text[i].value==""){
					text[i].value="0";
				}
			}
		}
		var objResponse=new JHttpResponse();
		var gList="";
		for (var i=0;i<groupList.length;i++){
			gList=gList+groupList[i][0]+",";
		}
		gList=gList.slice(0,gList.length-2);
		objResponse.write("gList",gList);
		
		IntForm.action="../myweb/mywebServer.aspx?type=saveInt";
		var out=objAjax.submit(IntForm,"post",true,objResponse);
		if (!isNaN(out)){
			if (info==null){
				alert("数据保存成功")
			}
			return	true;
		}else{
			alert(erStr(out));
		}
	}
		
}