var Nav4 = document.layers; var IE4 = document.all; var keyPressed; var bWidth, bHeight, offsetX, offsetY; function chkKey(e){ if (Nav4) { keyPressed = String.fromCharCode(e.which); if (keyPressed == "\x0D"){ chkallData(window.document.frmQry,'Qry'); } } else if (IE4) { keyPressed = String.fromCharCode(window.event.keyCode); if (keyPressed == "\x0D") { chkallData(window.document.frmQry,'Qry'); } } } /* if (window.document.captureEvents!=null) window.document.captureEvents(Event.KEYPRESS) window.document.onkeypress = chkKey; */ function init() { if (Nav4) { //bHeight=window.innerHeight; var tmp = 1; bWidth= window.innerWidth-14; //var tempwidth = bWidth - (( bWidth + 20 )* 0.95 - 20); if ( bWidth > 1000 ) tmp = 2; var tempwidth = bWidth - ( (bWidth + 20) * 0.95 - 20); if ( document.DataSet != null ) document.DataSet.clip.width = bWidth - tempwidth*tmp; } else if (IE4) { //bHeight=document.body.clientHeight; var tmp = 1; bWidth= document.body.clientWidth; if ( bWidth > 1000 ) tmp = 2; var tempwidth = bWidth - ( (bWidth + 20) * 0.95 - 20); if ( DataSet != null ) DataSet.style.width = bWidth - tempwidth*tmp; } } function sbar(st) { st.style.backgroundColor='#F3F3F3'; } function cbar(st) { st.style.backgroundColor=''; } // Swap Images function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i "9") return false; } return true; } function isErrorChar(inObj,InMsg) {//�ˬd���X�k�r��(',") var InString = inObj.value; var IS_SINGLE_QUOTES = InString.indexOf("'"); var IS_DOUBLE_QUOTES = InString.indexOf("\""); if (IS_SINGLE_QUOTES>=0 || IS_DOUBLE_QUOTES>=0) { alert('[' + InMsg + '] contains illegal Characters (\' or \")!'); inObj.focus(); return false; } else { return true; } } function isEmailAddrFormat(inObj,InMsg) {//�ˬdEmailAddress�榡 var InString = inObj.value; if(InString.length == 0) return true; var IS_AT = InString.indexOf("@"); if (IS_AT<=0) { alert('EmailAddress Format Error!'); inObj.focus(); return false; } else { return true; } } function vDate(date){ if(date.length != 8) return false; var year = date.substring(0, 4); var month = date.substring(4, 6); var day = date.substring(6, date.length); if(!isNumberString(year) || !isNumberString(month) || !isNumberString(day)) return false; year = parseInt(year); month = parseInt(month,10); day = parseInt(day,10); if (year < 1900) return false; if (month < 1 || month > 12) return false; if (day < 1 || day > 31) return false; if (month == 2) { if ((year/4) != Math.floor(year/4) || year == 1900) {// 1900 ���O�|�~�A�� 2000 �O�|�~ if (day > 28) return false; } else { if (day > 29) return false; } } else if (month==2 || month==4 || month==6 || month==9 || month==11) { if(day > 30) return false; } return true; } function vTime(time){ if(time.length != 4) return false; var hour = time.substring(0, 2); var minute = time.substring(2, 4); if(!isNumberString(hour) || !isNumberString(minute)) return false; hour = parseInt(hour); minute = parseInt(minute,10); if(hour <0 || hour >24) return false; if(minute < 0 || minute > 60) return false; return true; } function getDate() { var now = new Date(); var month = now.getMonth() + 1; var strMonth = month + ''; var date = now.getDate()+''; var strdate = ''; if (date.length < 2) date = '0'+ '' + date else date = '' + date if (strMonth.length < 2) month = '0' + '' + month else month = '' + month strdate = now.getYear() + month + date; return strdate; } function getTime(inObj) { var now = new Date(); var hours = now.getHours(); var strHours = hours + ''; var minutes = now.getMinutes(); var strMinutes = minutes + ''; if (strHours.length < 2) hours = '0'+ '' + hours else hours = '' + hours if (strMinutes.length < 2) minutes = '0' + '' + minutes else minutes = '' + minutes strtime = hours + minutes; inObj.value = strtime; } function vTime2(time){ if ( time.length == 4) { var hour = time.substring(0, 2); var minute = time.substring(2, 4); if(!isNumberString(hour) || !isNumberString(minute) ) return false; hour = parseInt(hour); minute = parseInt(minute,10); if(hour <0 || hour >24) return false; if(minute < 0 || minute > 60) return false; } else if ( time.length == 6) { var hour = time.substring(0, 2); var minute = time.substring(2, 4); var second = time.substring(4, 6); if(!isNumberString(hour) || !isNumberString(minute) || !isNumberString(second) ) return false; hour = parseInt(hour); minute = parseInt(minute,10); second = parseInt(second,10); if(hour <0 || hour >24) return false; if(minute < 0 || minute > 60) return false; if(second < 0 || second > 60) return false; } else { return false; } return true; } function getTime2(inObj) { var now = new Date(); var hours = now.getHours(); var strHours = hours + ''; var minutes = now.getMinutes(); var strMinutes = minutes + ''; var seconds = now.getSeconds(); var strSeconds = seconds + ''; if (strHours.length < 2) hours = '0'+ '' + hours else hours = '' + hours if (strMinutes.length < 2) minutes = '0' + '' + minutes else minutes = '' + minutes if (strSeconds.length < 2) seconds = '0' + '' + seconds else seconds = '' + seconds strtime = hours + minutes + seconds; inObj.value = strtime; } function isPrint(form) { form.isPrint.value= 'Y'; chkallData(form,'Qry'); } function isPrint1(form) { form.isPrint.value= 'Y'; chkallData(form,'Lst'); } function linkTo(form, customerId, rawMsgNumber, prsMsgNumber, flag) { form.action = 'LgcMsgLogDtlInfo.jsp'; form.qryLogonCustId.value = customerId; form.qryRawMessageNumber.value = rawMsgNumber; form.qryParseMessageNumber.value = prsMsgNumber; form.qryConfirm.value = flag; setloading(); form.submit(); } function setEnvVar(form, inobj, value) { inobj.value = value; form.action = 'setEnvVar.jsp'; setloading(); form.submit(); } function openChromeslessWindow(openUrl, winName, wWidth, wHeight, wPosx, wPosy, wTIT, wRealTiT, windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel, bCenter, sFontFamily, sFontSize, sFontColor){ openchromeless(openUrl,winName, wWidth, wHeight, wPosx, wPosy, wTIT, wRealTiT , windowBORDERCOLOR, windowBORDERCOLORsel, windowTITBGCOLOR, windowTITBGCOLORsel, bCenter, sFontFamily, sFontSize, sFontColor); } function setloading(){ offset=60; if (Nav4 && document.loading!=null) { thewindowwidth=window.innerWidth-14; thewindowheight=window.innerHeight; newwidthpos=(thewindowwidth/2)-offset; newheightpos=(thewindowheight/2); document.loading.left=newwidthpos; document.loading.top=newheightpos; document.loading.visibility='show'; } else if (IE4 && loading!=null) { thewindowwidth=document.body.clientWidth; thewindowheight=document.body.clientHeight; newwidthpos=(thewindowwidth/2)-offset; newheightpos=(thewindowheight/2); loading.style.left=newwidthpos; loading.style.top=newheightpos; loading.style.visibility='visible'; } } //----------- function isNumber(num) { return isNumber(num, false); } function isNumber(num, f) { var fl = false; for (var n = 0; n < num.length; n++) { if (num.substring(n, n+1) == ".") { if (f && !fl) { fl = true; } else { return false; } } if (((num.substring(n, n+1) < "0") || (num.substring(n, n+1) > "9")) && !f) { return false; } } return true; } function isIllegalString(str) { var legalStr = "-@.,"; for (var i=0;i "9") && (ch < "A" || ch > "Z") && (ch <"a" || ch >"z")) { return true; } } return false; } function isChosen(field) { for(var i=0;i= 0) { value = field.options[si].value; } } else { value = field.value; } if (trim(value).length == 0) { return true; } } return false; } function trim(s) { return s.replace( /^\s*/, "" ).replace( /\s*$/, "" ); } function isValidDate(month, day) { if (month < 1 || month > 12) { return false; } if (day < 1 || day > 31) { return false; } if ((month == 4 || month == 6 || month == 9 || month == 11) && (day == 31)) { return false; } if (month == 2 && day > 29) { return false; } /* if (month == 2) { var leap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day == 29 && !leap)) { return false; } } */ return true; } function isValidTime(hour, minute) { if (hour >= 24) return false; if (minute >= 60) return false; return true; }