/*  */
function modedb_edload_detail(path, sval, mode, ditem, fow, eri, iid) {
	var zmode = $('#SUB_MODE'+fow).val(),subph = $('#SUB_SUBPATH'+fow).val();
	var dform = '#detail_form_'+zmode+fow,sform = '#sub_form_'+zmode+fow;
	var meri = $(dform+' #ERI').val(),
		maperi = ($(dform+' #HIDEFLOW_ERI').length > 0) ? $(dform+' #HIDEFLOW_ERI').val() : '';
	var type = ((zmode == subph) ? 'D' : 'S');
	var eform = ((zmode == subph) ? dform : sform);
	var url = path+'core/cw5e_engine_detail.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&fow='+fow+'&type='+type+'&ERI='+eri+'&act=dbliedit';
	url += '&iedit=V&meri='+meri+'&zmode='+zmode+'&maperi='+maperi;
	var djson = (fromid_output_json(eform,'name')).replace(/'/g, "''");
	var verlen = djson.length;
	url += '&verlen='+verlen.toString();
	$.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].html_str) {
				iid.closest('tr').empty().append(ret_msg[0].html_str);
			}
		}
	});
}