function toAddFile(tname) {
    window.open('/common/upload/upload_file.jsp?fileType='+tname,'imgform','width=350,height=250');
}

function selectAdd(txt, value) {
    var f = document.dataForm;

    if(!f.fileUplist.value=="") {
        f.fileUplist.value += "^";
    }
    f.fileUplist.value += value;
    f.filelist.options.add(new Option(txt, value));
}

function DelFileList(dseq_no, tname) {
    var f = document.dataForm;

    var delIndex = f.filelist.options.selectedIndex;

    if (delIndex > 0){
        var filelist = f.filelist.options[delIndex].value;
        var fileUplist = f.fileUplist.value;

        var paramStr = "filelist=" + filelist + "&dseq_no=" + dseq_no + "&tname=" + tname;

        new ajax.xhr.Request("/common/upload/upload_file_del_proc.jsp",paramStr,deleteRowAfter, "POST");
        f.filelist.options.remove(delIndex);

        var firstpos = fileUplist.indexOf(filelist);
        if (firstpos > 0) {
            firstpos--;
        }
        var endpos = firstpos + filelist.length + 1;
        f.fileUplist.value = fileUplist.substr(0,firstpos) + fileUplist.substr(endpos, fileUplist.length);
    }
}
