add:  dayField = calDateField.name+"day"; monthField = calDateField.name+"month"; yearField = calDateField.name+"year"; calDateField.form.elements[dayField].value = day; calDateField.form.elements[monthField].value = month; calDateField.form.elements[yearField].value = year;  
context: function returnDate(inDay){    // inDay = THE DAY THE USER CLICKED ON    calDate.setDate(inDay);    // SET THE DATE RETURNED TO THE USER    var day           = calDate.getDate();    var month         = calDate.getMonth()+1;    var year          = calDate.getFullYear();    var monthString   = monthArray[calDate.getMonth()];    var monthAbbrev   = monthString.substring(0,3);    var weekday       = weekdayList[calDate.getDay()];    var weekdayAbbrev = weekday.substring(0,3);	    outDate = calDateFormat;    // RETURN TWO DIGIT DAY    if (calDateFormat.indexOf("DD") != -1) {        day = makeTwoDigit(day);        outDate = jsReplace(outDate, "DD", day);    }    // RETURN ONE OR TWO DIGIT DAY    else if (calDateFormat.indexOf("dd") != -1)	{        if(day < 10)			day = "0"+day;		outDate = jsReplace(outDate, "dd", day);    }    // RETURN TWO DIGIT MONTH    if (calDateFormat.indexOf("MM") != -1) {        month = makeTwoDigit(month);        outDate = jsReplace(outDate, "MM", month);    }    // RETURN ONE OR TWO DIGIT MONTH    else if (calDateFormat.indexOf("mm") != -1) 	{		if(month < 10)			month = "0"+month;        outDate = jsReplace(outDate, "mm", month);    }    // RETURN FOUR-DIGIT YEAR    if (calDateFormat.indexOf("yyyy") != -1) {        outDate = jsReplace(outDate, "yyyy", year);    }    // RETURN TWO-DIGIT YEAR    else if (calDateFormat.indexOf("yy") != -1) {        var yearString = "" + year;        var yearString = yearString.substring(2,4);        outDate = jsReplace(outDate, "yy", yearString);    }    // RETURN FOUR-DIGIT YEAR    else if (calDateFormat.indexOf("YY") != -1) {        outDate = jsReplace(outDate, "YY", year);    }    // RETURN DAY OF MONTH (Initial Caps)    if (calDateFormat.indexOf("Month") != -1) {        outDate = jsReplace(outDate, "Month", monthString);    }    // RETURN DAY OF MONTH (lowercase letters)    else if (calDateFormat.indexOf("month") != -1) {        outDate = jsReplace(outDate, "month", monthString.toLowerCase());    }    // RETURN DAY OF MONTH (UPPERCASE LETTERS)    else if (calDateFormat.indexOf("MONTH") != -1) {        outDate = jsReplace(outDate, "MONTH", monthString.toUpperCase());    }    // RETURN DAY OF MONTH 3-DAY ABBREVIATION (Initial Caps)    if (calDateFormat.indexOf("Mon") != -1) {        outDate = jsReplace(outDate, "Mon", monthAbbrev);    }    // RETURN DAY OF MONTH 3-DAY ABBREVIATION (lowercase letters)    else if (calDateFormat.indexOf("mon") != -1) {        outDate = jsReplace(outDate, "mon", monthAbbrev.toLowerCase());    }    // RETURN DAY OF MONTH 3-DAY ABBREVIATION (UPPERCASE LETTERS)    else if (calDateFormat.indexOf("MON") != -1) {        outDate = jsReplace(outDate, "MON", monthAbbrev.toUpperCase());    }    // RETURN WEEKDAY (Initial Caps)    if (calDateFormat.indexOf("Weekday") != -1) {        outDate = jsReplace(outDate, "Weekday", weekday);    }    // RETURN WEEKDAY (lowercase letters)    else if (calDateFormat.indexOf("weekday") != -1) {        outDate = jsReplace(outDate, "weekday", weekday.toLowerCase());    }    // RETURN WEEKDAY (UPPERCASE LETTERS)    else if (calDateFormat.indexOf("WEEKDAY") != -1) {        outDate = jsReplace(outDate, "WEEKDAY", weekday.toUpperCase());    }    // RETURN WEEKDAY 3-DAY ABBREVIATION (Initial Caps)    if (calDateFormat.indexOf("Wkdy") != -1) {        outDate = jsReplace(outDate, "Wkdy", weekdayAbbrev);    }    // RETURN WEEKDAY 3-DAY ABBREVIATION (lowercase letters)    else if (calDateFormat.indexOf("wkdy") != -1) {        outDate = jsReplace(outDate, "wkdy", weekdayAbbrev.toLowerCase());    }    // RETURN WEEKDAY 3-DAY ABBREVIATION (UPPERCASE LETTERS)    else if (calDateFormat.indexOf("WKDY") != -1) {        outDate = jsReplace(outDate, "WKDY", weekdayAbbrev.toUpperCase());    }    // SET THE VALUE OF THE FIELD THAT WAS PASSED TO THE CALENDAR    calDateField.value = outDate;    // GIVE FOCUS BACK TO THE DATE FIELD    calDateField.focus();    // CLOSE THE CALENDAR WINDOW    top.newWin.close()}
meta: 3540	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3540/188b27329c3d34e25e517b873adc4064f3bd530d/lib_calendar.js/buggy/htdocs/lib/lib_calendar.js