//getDateCurrent //Get current date; assign to array function getDateArray (InString) { var dater = new Date (InString) var DateArray = new Array(); DateArray[1] = dater.getDate(); DateArray[2] = dater.getMonth()+1; DateArray[3] = dater.getYear(); now = null; return (DateArray); } function getTimeArray () { var now = new Date(); var TimeArray = new Array(); TimeArray[1] = ""+now.getHours(); TimeArray[2] = ""+now.getMinutes(); TimeArray[3] = ""+now.getSeconds(); if (TimeArray[2].length == 1) TimeArray[2]="0"+TimeArray[3] if (TimeArray[3].length == 1) TimeArray[3]="0"+TimeArray[3] now = null; return (TimeArray); } //monthText //Return month (numeric) as month string function monthText (Month) { var sMonth; Month = parseInt(Month); if (Month == 1) { sMonth = "January"} else if (Month == 2) { sMonth = "February"} else if (Month == 3) { sMonth = "March"} else if (Month == 4) { sMonth = "April"} else if (Month == 5) { sMonth = "May"} else if (Month == 6) { sMonth = "June"} else if (Month == 7) { sMonth = "July"} else if (Month == 8) { sMonth = "August"} else if (Month == 9) { sMonth = "September"} else if (Month == 10) { sMonth = "October"} else if (Month == 11) { sMonth = "November"} else if (Month == 12) { sMonth = "December"} return (sMonth); } //monthTextAbbr //Return month (numeric) as month string function monthTextAbbr (Month) { var sMonth; Month = parseInt(Month); if (Month == 1) { sMonth = "Jan"} else if (Month == 2) { sMonth = "Feb"} else if (Month == 3) { sMonth = "Mar"} else if (Month == 4) { sMonth = "Apr"} else if (Month == 5) { sMonth = "May"} else if (Month == 6) { sMonth = "Jun"} else if (Month == 7) { sMonth = "Jul"} else if (Month == 8) { sMonth = "Aug"} else if (Month == 9) { sMonth = "Sep"} else if (Month == 10) { sMonth = "Oct"} else if (Month == 11) { sMonth = "Nov"} else if (Month == 12) { sMonth = "Dec"} return (sMonth); } //dayOrd //Return st, nd, rd, th suffix to day function dayOrd (Day) { var sDay; Day = ""+Day; if (Day.substring(Day.length-1, Day.length) == "1") { sDay = Day +"st"; return (sDay) } if (Day.substring(Day.length-1, Day.length) == "2") { sDay = Day +"nd"; return (sDay) } if (Day.substring(Day.length-1, Day.length) == "3") { sDay = Day +"rd"; return (sDay) } return (sDay=Day+"th"); } //dayText //Return spelled out day function dayText (Day) { var sDay; Day = ""+Day; if (Day == "1") {sDay = "first"} else if (Day == "2") {sDay = "second"} else if (Day == "3") {sDay = "third"} else if (Day == "4") {sDay = "fourth"} else if (Day == "5") {sDay = "fifth"} else if (Day == "6") {sDay = "sixth"} else if (Day == "7") {sDay = "seventh"} else if (Day == "8") {sDay = "eighth"} else if (Day == "9") {sDay = "ninth"} else if (Day == "10") {sDay = "tenth"} else if (Day == "11") {sDay = "eleventh"} else if (Day == "12") {sDay = "twelfth"} else if (Day == "13") {sDay = "thirteenth"} else if (Day == "14") {sDay = "fourteenth"} else if (Day == "15") {sDay = "fifteenth"} else if (Day == "16") {sDay = "sixteenth"} else if (Day == "17") {sDay = "seventeenth"} else if (Day == "18") {sDay = "eighteenth"} else if (Day == "19") {sDay = "nineteenth"} else if (Day == "20") {sDay = "twentieth"} else if (Day == "21") {sDay = "twenty-first "} else if (Day == "22") {sDay = "twenty-second"} else if (Day == "23") {sDay = "twenty-third"} else if (Day == "24") {sDay = "twenty-fourth"} else if (Day == "25") {sDay = "twenty-fifth"} else if (Day == "26") {sDay = "twenty-sixth"} else if (Day == "27") {sDay = "twenty-seventh"} else if (Day == "28") {sDay = "twenty-eighth"} else if (Day == "29") {sDay = "twenty-ninht"} else if (Day == "30") {sDay = "thirtieth"} else if (Day == "31") {sDay = "thirty-first"} return (sDay) } //yearText //Return spelled out year function yearText (Year) { var sYear; Year = ""+Year; if (Year.substring(0, 1) == "2") { Year = Year.substring (2, 4) sYear = "two tousand " if (Year == "00") {sYear = "two thousand"} else if (Year == "01") {sYear += "one"} else if (Year == "02") {sYear += "two"} else if (Year == "03") {sYear += "three"} else if (Year == "04") {sYear += "four"} else if (Year == "05") {sYear += "five"} else if (Year == "06") {sYear += "six"} else if (Year == "07") {sYear += "seven"} else if (Year == "08") {sYear += "eight"} else if (Year == "09") {sYear += "none"} else if (Year == "10") {sYear += "ten"} return (sYear); } else { sYear="nineteen hundred and " Year = Year.substring (2, 4) if (Year == "95") {sYear += "ninety-five"} else if (Year == "96") {sYear += "ninety-six"} else if (Year == "97") {sYear += "ninety-seven"} else if (Year == "98") {sYear += "ninety-eight"} else if (Year == "99") {sYear += "ninety-nine"} return (sYear); } } //yearAbbr //Return last two digits of year function yearAbbr (Year) { Year = "" + Year if (Year.length == 4) Year = Year.substring (2, 4) return (Year) } function yearComplete (Year) { if (Year < 100) Year = "19"+Year else { Year = "" + Year; Year = "20" + Year.substring (1, 3) } return (Year) } function dayOfWeek (InString) { var now = new Date(InString); var WeekDay = now.getDay(); now = null; var DayArray = new Array(); DayArray[1] = WeekDay; if (WeekDay == 0) { DayArray[2]="Sunday"; DayArray[3]="Sun"; } else if (WeekDay == 1) { DayArray[2]="Monday"; DayArray[3]="Mon"; } else if (WeekDay == 2) { DayArray[2]="Tuesday"; DayArray[3]="Tue"; } else if (WeekDay == 3) { DayArray[2]="Wednesday"; DayArray[3]="Wed"; } else if (WeekDay == 4) { DayArray[2]="Thursday"; DayArray[3]="Thu"; } else if (WeekDay == 5) { DayArray[2]="Friday"; DayArray[3]="Fri"; } else if (WeekDay == 6) { DayArray[2]="Saturday"; DayArray[3]="Sat"; } return (DayArray); } function calendar (SelMonth, SelYear) { Month=SelMonth+1 Year=SelYear ret=getDaysofYear(Year); Days=ret[Month]; firstOfMonth = new Date (Year, Month-1, 1); StartingPos=firstOfMonth.getDay(); retVal= new Array (4) retVal[1]=StartingPos; retVal[2]=Days; retVal[3]=Month; retVal[4]=Year; return (retVal); } function getDaysofYear (Year) { if (leapYear (Year)==1) Leap=29; else Leap=28; daysOfYear = new makeArrayImplicit (31, Leap, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); return (daysOfYear); } function leapYear (Year) { if (((Year % 4)==0) && ((Year % 100)!=0) || ((Year % 400)==0)) return (1); else return (0); } makeArrayImplicit () { for (Count = 1; Count < makeArrayImplicit.arguments.length+1; Count ++) this[Count]=makeArrayImplicit.arguments[Count]) this[0]=makeArrayImplicit.arguments.length return (this); } //dateConv //Convert date text function dateConv (InString, DateType) { var RetArray = new Array(3); RetArray.length = 0; var len = InString.length if (len == 0) return (RetArray); var TempString = ""; for (Count=0; Count