function delselect(sObj){
if(sObj.options.length==0){alert("没有可以删除的数据");return;}
if(sObj.selectedIndex==-1){alert("请选择要删除的类别");return;}



    oChild=sObj.children(sObj.selectedIndex);
    //alert(oChild);
	with(form){
		dealin_statement.value.replace(oChild.text+"*"+oChild.value+"#","");
		//alert(dealin_statement.value);	
		}
    sObj.removeChild(oChild);
	
	
	}




function movetoselect(ob,sObj){
//alert();

if(ob.selectedIndex==-1){alert("请选择一个类别");return;}
//alert(sObj.options.length);
for(i=0;i<sObj.options.length;i++){
	if(sObj.options[i].value==ob.options[ob.selectedIndex].value){
		alert("类别已经存在");return;
		}
	}
	o = document.createElement("OPTION");
	o.value = ob.options[ob.selectedIndex].value;
	o.text = ob.options[ob.selectedIndex].text;
	sObj.add(o);
	with(form){
	if(dealin_statement.value=="")dealin_statement.value+="#";
	dealin_statement.value+=ob.options[ob.selectedIndex].text+"*"+ob.options[ob.selectedIndex].value+"#";
	//alert(dealin_statement.value);
	}
}

function initSelect(arr, sObj)
{
	
	var i;
	var o;

	delSub(sObj);
	//alert(sObj.name+" inside|"+arr.length)
	
	for (i=0; i<arr.length; i++)
	{
		o = document.createElement("OPTION");
		o.value = arr[i].code;
		o.text = arr[i].name;
		sObj.add(o);
	}
}










function Provinceoption(code,name)
{
	this.code = code; 
	this.name = name; 
}

function delSub(object){
	/*for(i in object){
	
	document.write(i);
	document.write("<br>");
	
	}

while(object.children.length){
    oChild=object.children(0);	
    object.removeChild(oChild);
	}
*/

while(object.options.length){
   //object.
	oChild=object.children(0);	
    object.removeChild(oChild);
	}

}


function initSelected(sObj, sValue)
{
	
	var i;
	for (i=0; i<sObj.length; i++)
	{
		if (sObj.options[i].value == sValue)
		{
			sObj.options[i].selected = true;
			return;
		}
	}
}