/*  */
function file_export_output(path, sval, mode, ditem, field, ccv) {
	$('#popup_box #cw5e_export_form :input').prop('disabled', true);
	$('#popup_box .proj_export_loading').empty().append("<img src=\"images/loading.gif\" alt=\"loading\" width=\"16px\">");
	var url = path+'core/cw5e_export.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&field='+field+'&ccv='+EncodeURLutf8(ccv);
	var djson = (fromid_output_json('#cw5e_export_form','name')).replace(/'/g, "''");
	var verlen = djson.length;
	url += '&act=expck&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);
			$('#popup_box #cw5e_export_form :input').prop('disabled', false);
			$('#popup_box .proj_export_loading').empty();
			return false;
		} else {
			if ((ret_msg[0].filename) && (ret_msg[0].filepath)) {
				window.location.href = 'libs/download.php'+
									   '?name='+EncodeURLutf8(ret_msg[0].filename)+
									   '&path='+EncodeURLutf8(ret_msg[0].filepath)+
									   '&fdel=1';
				setTimeout(function(){
					close_popup_box();
				}, 500);
			}
		}
	});
}