/*  */
function impt_action_exec(path, sval, mode, ditem, fdname, fiext, act, csid) {
	var loary = JSON.parse(return_language_str(path, sval, mode, '', ''));
	switch (act) {
		case 'del':
			if (csid.val() == '') {
				var emsg = ((loary['F_IMPORT_NOTDEL']) ? loary['F_IMPORT_NOTDEL']+'!' : 'F_IMPORT_NOTDEL');
				alert(emsg);
				return false;
			}
			var cmsg = ((loary['CONFIRM_REMOVE']) ? loary['CONFIRM_REMOVE']+'?' : 'CONFIRM_REMOVE'),
				fmsg = ((loary['DATA_REMOVED']) ? loary['DATA_REMOVED']+'!' : 'DATA_REMOVED');
			if (confirm(cmsg)) {
				var url = path+'core/cw5e_import.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&fdname='+fdname+'&fiext='+fiext+'&act='+act+'&code='+csid.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 false;
					} else {
						if (ret_msg[0].html_str) {
							$('#popup_box #imptclass').empty().append(ret_msg[0].html_str);
							if ($('#popup_box #imptclass').val() == '' && $('#popup_box #imptsave').val() == '1') {
								$('#popup_box #impttext').show();
							} else {
								$('#popup_box #impttext').hide();
							}
						}
						alert(fmsg);
					}
				});
			}
			break;
		case 'reset':
			var cmsg = ((loary['CONFIRM_RESET']) ? loary['CONFIRM_RESET']+'?' : 'CONFIRM_RESET'),
				fmsg = ((loary['DATA_RESETD']) ? loary['DATA_RESETD']+'!' : 'DATA_RESETD');
			if (confirm(cmsg)) {
				var url = path+'core/cw5e_import.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&fdname='+fdname+'&fiext='+fiext+'&act='+act;
				$.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 false;
					} else {
						if (ret_msg[0].html_str) {
							$('#popup_box #imptclass').empty().append(ret_msg[0].html_str);
							if ($('#popup_box #imptclass').val() == '' && $('#popup_box #imptsave').val() == '1') {
								$('#popup_box #impttext').show();
							} else {
								$('#popup_box #impttext').hide();
							}
						}
						alert(fmsg);
					}
				});
			}
			break;
		case 'xmlout':
			var cmsg = ((loary['CONFIRM_EXPORT']) ? loary['CONFIRM_EXPORT']+'?' : 'CONFIRM_EXPORT');
			if (confirm(cmsg)) {
				var url = path+'core/cw5e_import.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&fdname='+fdname+'&fiext='+fiext+'&act='+act+'&code='+csid.val();
				window.location.href = url;
			}
			break;
		case 'xmlin':
			var filelen = 0;
			if (csid[0].files[0]) filelen = csid[0].files[0].size;
			if (filelen <= 0) {
				var emsg = ((loary['F_IMPORT_ER_FILE_EMPTY']) ? loary['F_IMPORT_ER_FILE_EMPTY']+'!' : 'F_IMPORT_ER_FILE_EMPTY');
				alert(emsg);
				return false;
			}
			var cmsg = ((loary['CONFIRM_IMPORT']) ? loary['CONFIRM_IMPORT']+'?' : 'CONFIRM_IMPORT'),
				fmsg = ((loary['DATA_IMPORTD']) ? loary['DATA_IMPORTD']+'!' : 'DATA_IMPORTD');
			if (confirm(cmsg)) {
				var fdata = new FormData();
				fdata.append('file',csid[0].files[0]);
				var url = path+'core/cw5e_import.php?sid='+sval+'&parent='+EncodeURLutf8(path)+'&mode='+mode+'&ditem='+ditem+'&fdname='+fdname+'&fiext='+fiext+'&act='+act;
				$.ajax({
					url: url,
					type: 'POST',
					data: fdata,
					processData: false,
					contentType: false,
					success: 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) {
								$('#popup_box #imptclass').empty().append(ret_msg[0].html_str);
								if ($('#popup_box #imptclass').val() == '' && $('#popup_box #imptsave').val() == '1') {
									$('#popup_box #impttext').show();
								} else {
									$('#popup_box #impttext').hide();
								}
							}
							alert(fmsg);
						}
					}
				});
			}
			break;
		default:
			break;
	}
}