var tools=new toolsClass();
 var objAjax=new JAjax();

function loadPage(){
	tools.add("","保存","save()","保存设置")
	tools.create(toolsDiv)
	loadPar();
}


function save(){
		var objResponse=new JHttpResponse();
		objResponse.write("cType","userSetup");
		$("form1").action="../server/hiwebServer.aspx?type=saveSetup";
		var out=objAjax.submit($("form1"),"POST",true,objResponse);
		if (!isNaN(out)){
			alert("保存成功");
		}else{
			alert(erStr(out));
		}
   }
   

   function loadPar(){
   		var objResponse=new JHttpResponse();
		objResponse.write("cType","userSetup");	
		var out=objAjax.getText("post","../server/hiwebServer.aspx?type=readSetupPar",objResponse,null);
		out=comminute(out,c1,c2);
		if (out.length==0){
			alert(erStr(out.toString()));
			return;
		}
		for (var i=0;i<out.length-1;i++){
			var obj=$(out[i][0]);
			var value=out[i][1];
			var objName=out[i][0];
			
			switch (obj.type){
				case "text":
				obj.value=value;
				break;
			case "radio":
				findRadio(objName,value)
				break;
			case "checkbox":
				 findCheckbox(objName,value)
				break;
			case "select":
				selectoption(obj,value)
				break;
			default:
				obj.value=value;
				break;
				
			}
		
		}
   }
   
