/*  */
function mode_sum_number(path, sval, mode, ditem, dform, fow) {
	var zmode = $('#SUB_MODE'+fow).val(),
		type = ($('#SUB_MODE'+fow).val() == $('#SUB_SUBPATH'+fow).val()) ? 'D' : 'S',
		djson = (fromid_output_json(dform,'name')).replace(/'/g, "''");
	var zdiv = '#detail_div_'+zmode+fow,zform = '#detail_form_'+zmode+fow,
		sdiv = '#sub_div_'+zmode+fow,sform = '#sub_form_'+zmode+fow;
	var sberis = $(sdiv+' #SUB_ERIPATH'+fow).val().split('/'),
		zeri = ($(zform+' #ERI').length > 0 && $(zform+' #ERI').val() != '') ? $(zform+' #ERI').val() : $(zform+' #TEMPERI').val();
	var meri = (mode == zmode) ? zeri : sberis[sberis.length-1];
	var url = path+'core/cw5e_engine_detail.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+EncodeURLutf8(ditem)+'&act=fesum'+
			  '&zmode='+zmode+'&zeri='+zeri+'&dform='+EncodeURLutf8(dform)+'&fow='+fow+'&meri='+meri+'&verlen='+(djson.length).toString();
	//console.log(url);
	//$.ajaxSetup({ async:false });
	$.post(url, 'htmljson='+EncodeURLutf8(djson), function(msg) {
		// console.log(msg);
		var ret_msg = JSON.parse(msg);
		if (ret_msg[0].result == 'false') {
			alert(ret_msg[0].message);
			return false;
		} else {
			if (ret_msg[0].data) mode_valchange_action(ret_msg[0].data, dform);
		}
	});
	//$.ajaxSetup({ async:true });
}