/*  */
function encrypt_text_change(path, sval, mode, ditem, field, deri, dform, fow) {
	var intnm = field+(((deri) && deri != '') ? '_'+deri : '');
	if ($(dform+' .'+intnm+'_text').length > 0 && $(dform+' .'+intnm+'_text').val() != '') {
		var cust = ($(dform+' #'+intnm).attr('mft')) ? $(dform+' #'+intnm).attr('mft') : '';
		var url = path+'core/cw5e_engine_detail.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&field='+field+'&deri='+deri+'&fow='+fow+'&act=encrypt';
		url += '&cust='+cust;
		var data = 'enstr='+EncodeURLutf8($(dform+' .'+intnm+'_text').val());
		$.post(url, data, 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].enstr) $(dform+' #'+intnm).val(ret_msg[0].enstr);
			}
		});
	} else {
		if ($(dform+' #'+intnm).length > 0) $(dform+' #'+intnm).val('');
	}
}