function onDelete(){ if (confirm("是否確定刪除?")){ return true; }else{ return false; } } function onExit(){ if (confirm("確定要放棄儲存?")){ return true; }else{ return false; } } function toChineseDate(WDate) { var rv = ""; if (WDate == "") return rv; if (WDate.indexOf("/") <= 3) return WDate; var fm = function(v, len) { var rv1 = ""; try { var sv = "" + v; for (var i = 0; i < len - sv.length; i++) rv1 = "0" + rv1; rv1 = rv1 + sv; } catch (err) { } return rv1; } ; var date = null; try { date = new Date(WDate); rv = fm(date.getFullYear() - 1911, 3) + "/" + fm(date.getMonth() + 1, 2) + "/" + fm(date.getDate(), 2); if (rv == "//") rv = ""; } catch (err) { } return rv; } function toWesternDate(CDate) { var rv = ""; if (CDate == "") return rv; try { CDate = CDate.replace(/\//g, ""); var v = eval(CDate.substring(0, 3) ) + 1911 ; rv = v + "/" + CDate.substring(3, 5) + "/" + CDate.substring(5, 7); if (rv == "//") rv = ""; } catch (err) { } return rv; }