function StyleChange(mobj,bgColor,fontColor){ mobj.style.backgroundColor=bgColor; mobj.style.color=fontColor; } function StyleChange(mobj,bgColor,fontColor, uLine){ mobj.style.backgroundColor=bgColor; mobj.style.color=fontColor; if (uLine!=undefined) mobj.style.textDecoration="underline"; else mobj.style.textDecoration="none"; } function GoTo(URL,type){ var nwin=window.open(URL,type,""); } function FontColorChange(mobj, fontColor, uLine) { mobj.style.color=fontColor; if (uLine!=undefined) mobj.style.textDecoration="underline"; else mobj.style.textDecoration="none"; } function openPage(url, name, wx, wy){ formObj = document.ActionForm ; x = (screen.width - wx) / 2 ; y = (screen.height - wy) / 2 ; var newWindow = window.open(url, name, "left=" + x + ",top=" + y + ",width=" + wx + ",height=" + wy + "titlebar=no,toolbar=no,scrollbars=yes,resizable=yes"); if (newWindow == undefined) { alert('Please close the pop-up blocker.'); } else { newWindow.window.focus(); } } String.prototype.trim = function () { return this.replace(/^\s+|\s+$/g, ""); } function isInteger(s, allowMinus) { var i; if (allowMinus=='undefined') allowMinus=true; s = s.trim(); if (s=='' || isNaN(s)) { return false; } else if (allowMinus==false && parseInt(s) < 0) { return false; } else { for (i = 0; i < s.length; i++) { // Check that current character is number. var c = s.charAt(i); if (((c < "0") || (c > "9"))) { if (allowMinus && c == '-') { //do nothing } else { return false; } } } // All characters are numbers. return true; } } function changeAction(action) { formObj['PageAction'].value = action; formObj.submit(); formObj['PageAction'].value = ''; } function dateCheck(str){ var re = new RegExp("^([0-9]{4})[./]{1}([0-9]{1,2})[./]{1}([0-9]{1,2})$"); var ar; var res = true; if ((ar = re.exec(str)) != null){ var i; i = parseFloat(ar[1]); // verify yyyy if (i <= 1999 || i > 2100){ res = false; } i = parseFloat(ar[2]); // verify mm if (i <= 0 || i > 12){ res = false; } i = parseFloat(ar[3]); // verify dd if (i <= 0 || i > 31){ res = false; } }else{ res = false; } if (!res){ alert('請輸入YYYY/MM/DD日期格式'); } return res; } function changeLanguage(lan) { var formObj = document.getElementById("ActionForm"); formObj["dLanguage"].value = lan ; formObj['PageAction'].value = "changeLanguage"; if (typeof removeCloseWindow == 'function') { removeCloseWindow(); } formObj.submit(); }