var sMon = new Array(12); sMon[0] = "Jan" sMon[1] = "Feb" sMon[2] = "Mar" sMon[3] = "Apr" sMon[4] = "May" sMon[5] = "Jun" sMon[6] = "Jul" sMon[7] = "Aug" sMon[8] = "Sep" sMon[9] = "Oct" sMon[10] = "Nov" sMon[11] = "Dec" //Norman add 2004/11/16 add min input for Effective Time function calendar2(t) { var sPath = "js/calendar1.htm"; strFeatures = "dialogWidth=206px;dialogHeight=228px;center=yes;help=no"; st = t.value; var sPath2 = "js/AddTime.htm"; strFeatures2 = "dialogWidth=230px;dialogHeight=30px;center=yes;help=no"; sDate = showModalDialog(sPath,st,strFeatures); var time=showModalDialog(sPath2,st,strFeatures2); if(time.indexOf("undefined")!=-1){ time="01:01"; } t.value = formatDate(sDate, 0)+" "+time; } //Norman add end //Norman add 2004/11/16 add min input for Expiration Time function calendar3(t) { if(window.confirm("It will set Expiration Time. Sure?")){ var sPath = "js/calendar1.htm"; strFeatures = "dialogWidth=206px;dialogHeight=228px;center=yes;help=no"; st = t.value; var sPath2 = "js/AddTime.htm"; strFeatures2 = "dialogWidth=230px;dialogHeight=30px;center=yes;help=no"; sDate = showModalDialog(sPath,st,strFeatures); var time=showModalDialog(sPath2,st,strFeatures2); if(time.indexOf("undefined")!=-1){ time="01:01"; } t.value = formatDate(sDate, 0)+" "+time; }else{ t.value = ""; } } //Norman add end function calendar(t) { var sPath = "js/calendar1.htm"; strFeatures = "dialogWidth=206px;dialogHeight=228px;center=yes;help=no"; st = t.value; sDate = showModalDialog(sPath,st,strFeatures); t.value = formatDate(sDate, 0); } function checkDate(t) { dDate = new Date(t.value); if (dDate == "NaN") {t.value = ""; return;} iYear = dDate.getFullYear() if ((iYear > 1899)&&(iYear < 1950)) { sYear = "" + iYear + "" if (t.value.indexOf(sYear,1) == -1) { iYear += 100 sDate = (dDate.getMonth() + 1) + "/" + dDate.getDate() + "/" + iYear dDate = new Date(sDate) } } t.value = formatDate(dDate); } function formatDate(sDate) { var sScrap = ""; var dScrap = new Date(sDate); if (dScrap == "NaN") return sScrap; iDay = dScrap.getDate(); if (iDay <= 9){ iDay = "0" + iDay; } iMon = dScrap.getMonth() + 1; if(iMon <=9){ iMon = "0" + iMon; } iYea = dScrap.getFullYear(); sScrap = iYea + "/" + iMon + "/" + iDay ; return sScrap; }