function setdate(obj) { var d = new Date() var mm = d.getMonth()+1 var dd = d.getDate() var yy = d.getFullYear() mm = mm.toString() dd = dd.toString() yy = yy.toString() yy = yy.substring(2,4) if (dd.length == 1) { dd = "0"+dd } if (mm.length == 1){ mm = "0"+mm } obj.value = mm+"-"+dd+"-"+yy } var months = new Array("January","February","March","April","May","June","July","August","September","October","November","December") var totalDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31) function dateSelectWin(obj) { stats='toolbar=no,location=no,directories=no,status=no,menubar=no,' stats += 'scrollbars=no,resizable=no,width=260,height=200' CalWin = window.open ("","Calendar",stats) var calMonth = 1 var calYear = 2005 theDate = new Date(calYear, (calMonth - 1), 1) buildCal_AVAILDATE1(theDate, obj) } function buildCal_AVAILDATE1(theDate, obj) { var startDay = theDate.getDay() var printDays = false var currDay = 1 var rowsNeeded = 5 if (startDay + totalDays[theDate.getMonth()] > 35) rowsNeeded++ CalWin.document.write('Select Date') CalWin.document.write('') CalWin.document.write('') CalWin.document.write('') CalWin.document.write('') CalWin.document.write('') for (x=1; x<=rowsNeeded; x++){ CalWin.document.write('') for (y=0; y<=6; y++){ if (currDay == 1 && !printDays && startDay == y) printDays = true CalWin.document.write('') if (currDay > totalDays[theDate.getMonth()]) printDays = false } else CalWin.document.write(' ') } CalWin.document.write('') } CalWin.document.write('') CalWin.document.write('
' + months[theDate.getMonth()] + ' ' + theDate.getFullYear() + '
SuMoTuWeThFrSa
') if (printDays){ CalWin.document.write('' + currDay++ + '
Previous Month                Next Month
') CalWin.document.close() } function getNewCal_AVAILDATE1(newDir, obj) { if (newDir == -1){ theDate.setMonth(theDate.getMonth() - 1) if (theDate.getMonth() == 0){ theDate.setMonth(12) theDate.setYear(theDate.getYear() - 1) } } else if (newDir == 1){ theDate.setMonth(theDate.getMonth() + 1) if (theDate.getMonth() == 13){ theDate.setMonth(1) theDate.setYear(theDate.getYear() + 1) } } CalWin.document.clear(); buildCal_AVAILDATE1(theDate, obj); } function placeDate_AVAILDATE1(monthNum, dayNum, yearNum, obj){ var dateString = (monthNum + 1) + '-' + dayNum + '-' + yearNum document["nameof1form"].obj.value = dateString CalWin.close() }