var tools = {
	category : function(obj){
		var idx = obj.options[obj.options.selectedIndex].value;
		var child = getObj('childid');
		var source = getObj('optionmode_'+idx);//container
		var option = getObj('child_'+idx);
		if(!child) return false;
		if(!option){
			option = getObj('child_empty');
		}
		child.outerHTML = '<select name="childid" id="childid" class="select_wa">'+option.innerHTML+'</select>';
	},
    getChildCategory : function (url, obj, childid) {
		var idx = obj.options[obj.options.selectedIndex].value;
		url = url + '&parentid=' + idx;
		if(childid) url = url + '&childid=' + childid;
		DP.post(url, '', function() {
			if(ajax.request.responseText == null) getObj('optionitem').innerHtml = '';
			var childSelect= ajax.request.responseText;
			if(childSelect.indexOf("<select") == -1) childSelect = "<select name='childid' id='childid' class='select_wa mr5' title='分类'><option value=''>请选择分类</option></select>";
			getObj('optionitem').innerHTML = childSelect;
		});
		return false;
	}
};