/*  */
function mode_tempsave_detail(path, sval, mode, dform, act, ERI, stype, rpstr, ldiv, mtype, mutp) {
	// 存檔檢查 
	if(!mode_save_check(path, sval, mode, dform, ERI, mutp)) return;
	// 存檔 
	//if (confirm(return_language_str(path, sval, '', mode+'_CONFIRM_SUBMIT', '')+"?")) {
	loading_create('Y');
	var djson = (fromid_output_json(dform,'name')).replace(/'/g, "''"),mdir = '',perm = '';
	var url = path+'core/cw5e_engine_detail.php?sid='+sval+'&parent='+EncodeURLutf8(path)+
			  '&mode='+mode+'&mutp='+mutp+'&act='+act+'&ERI='+ERI+'&verlen='+(djson.length).toString();
	if (stype == '1' || stype == '2') {
		var nmary = ['exec','qwe','sor','itms'];
		rpstr = rpstr.split(',');
		for (var i = 0; i < nmary.length; i++) {
			if ((rpstr[i]) && $('#'+rpstr[i]+mtype).length > 0) {
				if (perm != '') perm += '&';
				perm += nmary[i]+'='+EncodeURLutf8($('#'+rpstr[i]+mtype).val());
			}
		}
	}
	$.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);
			loading_close('');
			return false;
		} else {
			//alert(return_language_str(path, sval, '', mode+'_DATA_SAVED', '')+'!');
			if (ret_msg[0].ERI) {
				switch (mutp) {
					case 'R': mdir = 'manage'; break;
					case 'B':
					default: mdir = 'modules'; break;
				}
				post_redirect(ldiv, perm, path+mdir+'/'+mode+'/detail.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&mutp='+mutp+'&act=tempview&ERI='+ret_msg[0].ERI);
			}
		}
	});
	//}
}