/*  */
function expt_ckval_click(ckid, hiid, clid, divid, path, sval, mode, ditem, fdname, fiext) {
	checkbox_val_click(ckid, hiid);
	if (clid.val() == '' && hiid.val() == '1') {
		divid.show();
	} else {
		divid.hide();
	}
	if (clid.val() != '') {
		var url = path+'core/cw5e_export.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&act=exptdafs';
		url += '&mode='+mode+'&ditem='+ditem+'&fdname='+fdname+'&fiext='+fiext+'&code='+clid.val();
		$.get(url, '', function(msg) {
			// console.log(msg);
			var ret_msg = JSON.parse(msg);
			if (ret_msg[0].result == 'false') {
				alert(ret_msg[0].message);
				return;
			} else {
				if (ret_msg[0].exptm) {
					if (fiext == 'S') {
						$('#popup_box #file_clas').val(ret_msg[0].exptm.MFTYP);
						exp_change_input(path,sval,$('#popup_box #file_clas'));
					}
					switch ($('#popup_box #file_clas').val()) {
						case 'EXCEL':
							if (ret_msg[0].exptm.MFILE == 'XLSX' ||
								ret_msg[0].exptm.MFILE == 'XLS') {
								$('#popup_box #file_ext').val(ret_msg[0].exptm.MFILE);
							}
							$('#popup_box #file_title').val(ret_msg[0].exptm.MHEAD);
							break;
						case 'CSV':
							$('#popup_box #file_title').val(ret_msg[0].exptm.MHEAD);
							break;
						case 'TXT':
							$('#popup_box #file_deli').val(ret_msg[0].exptm.MSEPS);
							$('#popup_box #file_wrap').val(ret_msg[0].exptm.MWRAP);
							$('#popup_box #file_title').val(ret_msg[0].exptm.MHEAD);
							break;
						case 'XML':
						default:
							break;
					}
				}
				if (ret_msg[0].html_str) {
					$('#popup_box #export_table_fields tbody').empty().append(ret_msg[0].html_str);
				}
			}
		});
	}
}