
      //************************************************************************
      // Global variables
      //************************************************************************

      var submitting = false;

      //************************************************************************
      // Function:  initForm
      // Purpose:   Initialize Arrival Date and Departure Date controls.
      // Input:     arr* - Arrival date
      //            dep* - Departure date
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    None
      //************************************************************************

      function initForm (arrYear, arrMonth, arrDay, depYear, depMonth, depDay, language, locale)
      {
        var datef = document.arrivalDate;

        // Initialize date to todays date.
        var myDate = new Date ();
        var month = myDate.getMonth () + 1;
        var day = myDate.getDate ();
        var year = getFullYear (myDate);
                
        if (arrYear != "" && arrMonth != "" && arrDay != "")
        {
          // If Arrival date was posted in then initialize.
          year = parseInt (arrYear, 10);
          month = parseInt (arrMonth, 10);
          day = parseInt (arrDay, 10);
          
          myDate = new Date (arrYear, arrMonth, arrDay);
        }
        
        // Initialize arrival date.
        // Initalize form year.
        var index;
        for (index = 0; (index < datef.DATERANGESTART_YEAR.length) &&  
                        (datef.DATERANGESTART_YEAR.options[index].value != year);
             index++);
        datef.DATERANGESTART_YEAR.options[index].selected = true;

        // Initalize form month.
        for (index = 0; (index < datef.DATERANGESTART_MONTH.length) &&  
                        (datef.DATERANGESTART_MONTH.options[index].value != month);
             index++);
        datef.DATERANGESTART_MONTH.options[index].selected = true;

        // Initalize form day.
        for (index = 0; (index < datef.DATERANGESTART_DAY.length) &&  
                        (datef.DATERANGESTART_DAY.options[index].value != day);
             index++);
        datef.DATERANGESTART_DAY.options[index].selected = true;

        // Initalize Day of the week.
        datef.DATERANGESTART_DOW.value = getDayOfWeek (buildCRSDate (year, month, day));

        if (depYear != "" && depMonth != "" && depDay != "")
        {
          // If departure date was posted in then initialize.
          year = parseInt (depYear, 10);
          month = parseInt (depMonth, 10);
          day = parseInt (depDay, 10);
        }
        else
        {
          // Add 1 to the current date to get the initial departure date.
          day = myDate.getDate () + 1;
          if (day > getDaysInMonth (month, year)) 
          {
            day = 1;
            month = month + 1;
            if (month > 12)
            {
              year = year + 1;
              month = 1;
            }
          }
        } 

        // Initalize form year.
        for (index = 0; (index < datef.DATERANGEEND_YEAR.length) &&  
                        (datef.DATERANGEEND_YEAR.options[index].value != year);
             index++);
        datef.DATERANGEEND_YEAR.options[index].selected = true;

        // Initalize form month.
        for (index = 0; (index < datef.DATERANGEEND_MONTH.length) &&  
                        (datef.DATERANGEEND_MONTH.options[index].value != month);
             index++);
        datef.DATERANGEEND_MONTH.options[index].selected = true;

        // Initalize form day.
        for (index = 0; (index < datef.DATERANGEEND_DAY.length) &&  
                        (datef.DATERANGEEND_DAY.options[index].value != day);
             index++);
        datef.DATERANGEEND_DAY.options[index].selected = true;

        // Initalize Day of the week.
        datef.DATERANGEEND_DOW.value = getDayOfWeek (buildCRSDate (year, month, day));        
        
        // other dropdowns are inited in XSL.
      }

      //************************************************************************
      // Function:  validateDay
      // Purpose:   Ensure that a selected day is valid. Example 2/31 is an 
      //            invalid day. If an invalid date is selected, select the
      //            previous valid day.
      // Input:     yearCtrl - Year dropdown.
      //            monthCtrl - Month dropdown.
      //            dayCtrl - Day dropdown.
      // Output:    None
      //************************************************************************
      
      function validateDay (yearCtrl, monthCtrl, dayCtrl)
      {
        var datef = document.arrivalDate;
        eval ("var year = parseInt (datef." + yearCtrl + ".options[datef." + yearCtrl + ".selectedIndex].value, 10)");
        eval ("var month = parseInt (datef." + monthCtrl + ".options[datef." + monthCtrl + ".selectedIndex].value, 10)");
        eval ("var day = parseInt (datef." + dayCtrl + ".options[datef." + dayCtrl + ".selectedIndex].value, 10)");

        if (day > (maxDay = getDaysInMonth (month, year)))
        {
          for (index = 0; (index < eval ("datef." + dayCtrl + ".length")) &&  
                          (eval ("datef." + dayCtrl + ".options[" + index+ "].value != " + maxDay));
               index++);
          eval ("datef." + dayCtrl + ".options[" + index + "].selected = true");
        }

      }

      //************************************************************************
      // Function:  updateDOW
      // Purpose:   Set the Day of the Week to the valid string (Monday, Tuesday, etc.)
      // Input:     yearCtrl - Year dropdown.
      //            monthCtrl - Month dropdown.
      //            dayCtrl - Day dropdown.
      //            dowCtrl - Day of the Week Control - Control to set.
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    None
      //************************************************************************

      function updateDOW (yearCtrl, monthCtrl, dayCtrl, dowCtrl, language, locale)
      {
        var datef = document.arrivalDate;

        eval ("var year = parseInt (datef." + yearCtrl + ".options[datef." + yearCtrl + ".selectedIndex].value, 10)");
        eval ("var month = parseInt (datef." + monthCtrl + ".options[datef." + monthCtrl + ".selectedIndex].value, 10)");
        eval ("var day = parseInt (datef." + dayCtrl + ".options[datef." + dayCtrl + ".selectedIndex].value, 10)");

        eval ("datef." + dowCtrl + ".value = getDayOfWeek (buildCRSDate (year, month, day))");
      }

      //************************************************************************
      // Function:  updateDATERANGEEND
      // Purpose:   Update the Departure Date to the Arrival Date + 1.
      // Input:     language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    None
      //************************************************************************
      
      function updateDATERANGEEND (language, locale)
      {
        var datef = document.arrivalDate;

        // Get the current arrival date.
        var startYear = parseInt (datef.DATERANGESTART_YEAR.options[datef.DATERANGESTART_YEAR.selectedIndex].value, 10);
        var startMonth = parseInt (datef.DATERANGESTART_MONTH.options[datef.DATERANGESTART_MONTH.selectedIndex].value, 10);
        var startDay = parseInt (datef.DATERANGESTART_DAY.options[datef.DATERANGESTART_DAY.selectedIndex].value, 10);
    
        var startDate = new Date (startYear, startMonth - 1, startDay);

        // Get the current departure date.
        var endYear = parseInt (datef.DATERANGEEND_YEAR.options[datef.DATERANGEEND_YEAR.selectedIndex].value, 10);
        var endMonth = parseInt (datef.DATERANGEEND_MONTH.options[datef.DATERANGEEND_MONTH.selectedIndex].value, 10);
        var endDay = parseInt (datef.DATERANGEEND_DAY.options[datef.DATERANGEEND_DAY.selectedIndex].value, 10);
        
        var endDate = new Date (endYear, endMonth - 1, endDay);

        // If the arrival date is greater than the departure date then update the departure date.
        if (startDate.getTime () >= endDate.getTime ())
        {         
          endDay = startDay + 1;
          endMonth = startMonth;
          endYear = startYear;
          
          if (endDay > getDaysInMonth (startMonth, startYear)) 
          {
            // Move to the first day of the next month.
            endDay = 1;
            endMonth = endMonth + 1

            // If endMonth is > 12, cycle into the next year.
            if (endMonth > 12)
            {
              endMonth = 1;
              endYear = startYear + 1;
            }
          } 
          
          // Update departure year.
          for (index = 0; (index < datef.DATERANGEEND_YEAR.length) &&  
                          (datef.DATERANGEEND_YEAR.options[index].value != endYear);
               index++);
          datef.DATERANGEEND_YEAR.options[index].selected = true;

          // Update departure month.
          for (index = 0; (index < datef.DATERANGEEND_MONTH.length) &&  
                          (datef.DATERANGEEND_MONTH.options[index].value != endMonth);
               index++);
          datef.DATERANGEEND_MONTH.options[index].selected = true;

          // Update departure day.
          for (index = 0; (index < datef.DATERANGEEND_DAY.length) &&  
                          (datef.DATERANGEEND_DAY.options[index].value != endDay);
               index++);
          datef.DATERANGEEND_DAY.options[index].selected = true;
        
          updateDOW ('DATERANGEEND_YEAR', 'DATERANGEEND_MONTH', 'DATERANGEEND_DAY', 'DATERANGEEND_DOW', language, locale);
        }
      }


      var monthName = new Array ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");  

      var dayName = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");  


      //************************************************************************
      // Function:  getFullYear
      // Purpose:   Get the four digit year given a two digit year.
      // Input:     date - date to get the four digit year for.
      // Output:    Four digit year.
      //
      // Function required because NE 3.01 does not support date.getFullYear.
      // Code copied from O'Reilly - JavaScript The Definitive Guide
      //************************************************************************

      function getFullYear (date)
      {
        var year = date.getYear ();
        if (year < 1000) year += 1900;
        return (year);
      }

      //************************************************************************
      // Function:  getDayOfWeek
      // Purpose:   Get the day of the week for a given date.
      // Input:     date - date to get the four digit year for.
      // Output:    String containing the Day of the Week (Monday, Tuesday, etc).
      //************************************************************************

      function getDayOfWeek (crsDate)
      {
        var myDate = new Date (crsDate.substring (0, 4), parseInt(crsDate.substring (4, 6), 10) - 1,  parseInt(crsDate.substring (6, 8), 10));
        return (dayName [myDate.getDay ()]);    
      }

      //************************************************************************
      // Function:  getDayOfWeek
      // Purpose:   Get the day of the week for a given date.
      // Input:     year, month, day
      // Output:    String containing the Day of the Week (Monday, Tuesday, etc).
      //************************************************************************

      function getDayOfWeek2 (year, month, day)
      {
        var myDate = new Date (year, parseInt(month, 10) - 1,  parseInt(day, 10));
        return (dayName [myDate.getDay ()]);    
      }

      //************************************************************************
      // Function:  getMonth
      // Purpose:   Get the month description for a given date.
      // Input:     month - month to get the description for.
      // Output:    String containing the month (January, February, etc).
      //************************************************************************

      function getMonth (month)
      {
        return (monthName [month - 1]);    
      }

      //************************************************************************
      // Function:  formatDateDisplay
      // Purpose:   Format a date in the form of January 1, 1999 Tuesday
      // Input:     crsDate - date to format
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    String containing the formatted date.
      //************************************************************************

      function formatDisplayDate (crsDate, language, locale)
      {
        var monthStr = getMonth (parseInt (crsDate.substring (4, 6), 10));
        return (monthStr  + " " + crsDate.substring (6, 8) + ", " + crsDate.substring (0, 4) 
                  + " " + getDayOfWeek (crsDate));
      }

      //************************************************************************
      // Function:  formatDateDisplay
      // Purpose:   Format a date in the form of January 1, 1999 Tuesday
      // Input:     year
      //            month
      //            day
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    String containing the formatted date.
      //************************************************************************

      function formatDisplayDate2 (year, month, day, language, locale)
      {
        var monthStr = getMonth (parseInt (month, 10));
        return (monthStr  + " " + day + ", " + year 
                  + " " + getDayOfWeek2 (year, month, day));
      }

      //************************************************************************
      // Function:  formatDateDisplayShort
      // Purpose:   Format a date in the form of January 1
      // Input:     crsDate - date to format
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    String containing the formatted date.
      //************************************************************************

      function formatDisplayDateShort (crsDate, language, locale)
      {
        monthStr = getMonth (parseInt (crsDate.substring (4, 6), 10));
        return (monthStr  + " " + crsDate.substring (6, 8));
      }

      //************************************************************************
      // Function:  buildCRSDate
      // Purpose:   Format a date in the form YYYYMMDD
      // Input:     year
      //            month
      //            day
      // Output:    String containing the formatted date.
      //************************************************************************
      
      function buildCRSDate (year, month, day)
      {
        if (day < 10)
        {
          dayString = "0" + day;
        }
        else
        {
          dayString = new String (day);
        }

        if (month < 10)
        {
          monthString = "0" + month;
        }
        else
        {
          monthString = new String(month);
        }

        return (year + monthString + dayString);
      }
      //************************************************************************
      // Function:  isLeapYear
      // Purpose:   Determine if a year is a leap year.
      // Input:     yrStr - year to determine leapness..
      // Output:    true - if the year is a leap year.
      //            false - otherwise.
      //************************************************************************

      function isLeapYear(yrStr) 
      {
        var leapYear=false; 
        // every fourth year is a leap year
        if ((parseInt(yrStr, 10)%4) == 0)
        {
          leapYear=true;
        }
        return leapYear;
      }

      //************************************************************************
      // Function:  getDaysInMonth
      // Purpose:   Determine the number of days in a month.
      // Input:     mthIdx - month 
      //            yrStr - year 
      // Output:    true - if the year is a leap year.
      //            false - otherwise.
      //************************************************************************

      function getDaysInMonth(mthIdx, YrStr) 
      {
        // all the rest have 31 
        var maxDays = 31 
        // expect Feb. (of course)
        if (mthIdx==2)
        {
          if (isLeapYear(YrStr))
          {
            maxDays=29;
          }
          else
          {
            maxDays=28;
          }
        }
        // thirty days hath...
        if (mthIdx==4 || mthIdx==6 || mthIdx==9 || mthIdx==11)
        {
          maxDays=30;
        }
        return maxDays;
      }


    //-->

      var calendarCtrlStrings = new Array ("Next","Previous","Cancel");  


			//************************************************************************
      // Global variables
			//************************************************************************

			var calendarWindow;

			//************************************************************************
      // Function:  getCalendarCtrlString
      // Purpose:   Return the appropriate localized calendar control string.
      //            (eg: prev, cancel, next).
      // Input:     stringID - Control string to return.
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      // Output:    String containing the Calendar Control string.
			//************************************************************************

			var CALCTRLSTR_NEXT = 0;
			var CALCTRLSTR_PREV = 1;
			var CALCTRLSTR_CNCL = 2;
	
			function getCalendarCtrlString (stringID, language, locale)
			{
//				var enCalendarCtrlStrings = new Array ("Next", "Prev", "Cancel");
//				var esCalendarCtrlStrings = new Array ("Despu&#233s", "Anterior", "Cancelan");

				return (calendarCtrlStrings [stringID]);    
			}
      
      //************************************************************************
      // Function:  parseYear
      // Purpose:   Find the index of the year in a HTML SELECT control.
      // Input:     year - year to locate in the control.
      //            inY - the control to search.
      // Output:    Index into the SELECT control.
			//************************************************************************

			function parseYear(year, inY) 
			{
				var retval=0; 
				var i=0;
				for (i=0; i<=5; i++)
				{
					if (year == inY.options[i].text)
					{
						retval=i;
						break;
					}
			}
				return retval;
			}

			//************************************************************************
      // Function:  nextMonth
      // Purpose:   Increment the month.
      // Input:     month
      // Output:    month + 1
			//************************************************************************

			function nextMonth (month) 
			{
				if (month==12) 
				{
					return 1;
				}
				else
				{
					return (month+1);
				}
			}

			//************************************************************************
      // Function:  prevMonth
      // Purpose:   Previous month.
      // Input:     month
      // Output:    month - 1
			//************************************************************************

			function prevMonth (month) 
			{
				var prevMonth = (month - 1) 
				if (month==1)
				{
					prevMonth = 12;
				}
				return prevMonth
			}

			//************************************************************************
      // Function:  changeYear
      // Purpose:   Updates the year if incrementing or decrementing into the
      //            previous or following year.
      // Input:     direction - incrementing or decrementing
      //            month - month that is being updated.
      //            year - current year value.
      // Output:    Updated year.
			//************************************************************************

			function changeYear (direction, month, year) 
			{
				// increments or decrements month when it goes past Jan or Dec 
				var theYear = year 
				if (direction=='next')
				{
					if (month == 12)
					{
						theYear = (year + 1)
					}
				}
				if (direction=='prev')
				{
					if (month == 1)
					{
						theYear = (year - 1)
					}
				}
				return theYear
			}

			//************************************************************************
      // Function:  createCalendar
      // Purpose:   Create the calendar popup.
      // Input:     formStr - HTML name of the form that contains the date controls.
      //            dayCtrlStr - HTML name of the day drop down.
      //            monthCtrlStr - HTML name of the month drop down.
      //            yearCtrlStr - HTML name of the year drop down.
      //            dowCtrlStr - HTML name of the day of week control.
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      //            callBackFn - JavaScript function to call when closing the calendar.
      // Output:    none
			//************************************************************************

			function createCalendar (formStr, dayCtrlStr, monthCtrlStr, yearCtrlStr, dowCtrlStr, language, locale, callBackFn) 
			{
      
				// Open calendar twice too work around a problem with IE 3.0.
				calendarWindow = window.open ('', 'Calendar', 'width=202,height=200,left=300,top=300,resizable=yes,scrollbars=no');
				calendarWindow = window.open ('', 'Calendar', 'width=202,height=200,left=300,top=300,resizable=yes,scrollbars=no');

			 	var mthVal = eval ("parseInt(document." + formStr + "." + monthCtrlStr + ".options [document." + formStr + "." + monthCtrlStr + ".selectedIndex].value, 10)"); 
				var yearVal = eval ("document." + formStr + "." + yearCtrlStr + ".options [document." + formStr + "." +yearCtrlStr + ".selectedIndex].value"); 
				generateCalendar (calendarWindow, mthVal, yearVal, formStr, dayCtrlStr, monthCtrlStr, yearCtrlStr, dowCtrlStr, language, locale, callBackFn) 
			}


			//************************************************************************
      // Function:  generateCalendar
      // Purpose:   Emit the HTML into the calendar popup window.
      // Input:     target - Target browser window for the calendar.
      //            month - Month of the calendar top create.
      //            year - Year of the calendar to create.
      //            formStr - HTML name of the form that contains the date controls.
      //            dayCtrlStr - HTML name of the day drop down.
      //            monthCtrlStr - HTML name of the month drop down.
      //            yearCtrlStr - HTML name of the year drop down.
      //            dowCtrlStr - HTML name of the day of week control.
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      //            callBackFn - JavaScript function to call when closing the calendar.
      // Output:    none
			//************************************************************************

			function generateCalendar(target, month, year, formStr, dayCtrlStr, monthCtrlStr, yearCtrlStr, dowCtrlStr, language, locale, callBackFn) 
			{
				target.document.open()
				calendar = " <html><head><title>Calendar</title><link href='calendar.css' rel='STYLESHEET' type='text/css'><script language='javaScript' src='cellrollover.js'><!--//	//--></script></head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0 bgcolor=ffffff>" 
				calendar +=" <table border=0 cellspacing=0 cellpadding=0><tr><td valign=top><table border=0 cellspacing=2 cellpadding=0 width=202>" 
				calendar +="<tr valign=top>" 
				var mthIdx = month;
				var endday = getDaysInMonth(mthIdx, year) 
				calendar +=" <td colspan=7 align=left class='monthTextHeader'>"  
				var index = (mthIdx-1)

        // Create the calendar header
				calendar +=" <b>" + getMonth (mthIdx) + " " + year + "</b></td></tr>"  
				calendar +=" </tr><tr class='daysTextHeaderRowBG'>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><span class='weekendDaysText'><b>S</b></span></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><b>M</b></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><b>T</b></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><b>W</b></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><b>T</b></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><b>F</b></td>"  
				calendar +=" <td align=center class='daysHeadText' width='26'><span class='weekendDaysText'><b>S</b></span></td>" 
				calendar +=" </tr>"  

        // Create the days.
				wholeDate = month + "/01/" + year 
				thedate = new Date(wholeDate) 
				firstDay = thedate.getDay() 
				selectedmonth = mthIdx; 
				var today = new Date(); 
				var thisyear = today.getYear() + 1900; 
				selectedyear = year 
				var lastDay = (endday + firstDay+1) 
				var iRows =0 
				calendar +=" <tr>"  
				for (var i = 1; i < lastDay; i++) 
				{ 
					if (i <= firstDay) 
					{ 
						calendar +=" <td>&nbsp;</td>"  
					} 
					else 
					{ 
			  			calendar +=" <td align=center class='daysText'><a onMouseOver='CellColorMouseOver(this);' onMouseOut='CellColorMouseOut(this);' href='JavaScript:opener.closeCalendar(" + (i-firstDay) + ", \"" + formStr + "\", \"" + dayCtrlStr + "\", \"" + monthCtrlStr + "\",\"" + yearCtrlStr + "\",\"" + dowCtrlStr 
			  			calendar += "\", \"" +  language + "\", \"" + locale + "\",\"" + callBackFn + "\");self.close();'><div style='width : 100%; padding:3px;'>"+(i-firstDay)+"</div></a></td>"
					} 
					if (i % 7 == 0 ) 
					{ 
						if (i != lastDay-1) 
						{ 
							calendar +=" </tr><tr>"  
							iRows = iRows + 1 
						} 
						else 
						{ 
							iRows = iRows 
						} 
					} 
				} 
				calendar +=" </tr></table></td><td><img src='imgs/calendar/nowt.gif' width=1 height=177></td></tr>"  

        // Create the calendar footer
				iRows = iRows + 1 

				var goPrevMonth = prevMonth(mthIdx) 
				var goNextMonth = nextMonth(mthIdx) 
				var nextYear = changeYear ('next', parseInt (month, 10), parseInt (year, 10)) 
				var prevYear = changeYear ('prev', parseInt (month, 10), parseInt (year, 10)) 
				if(navigator.userAgent.indexOf('MSIE',0) != -1) 
				{ 
					calendar +=" <tr><td colspan=2 style='padding-left:2px;'><table cellspacing=0 cellpadding=4 border=0 width=198><tr class='buttonStrip'><td align=left colspan=2><a href='javascript:opener.generateCalendar(self," + goPrevMonth + "," + prevYear + ",\"" + formStr + "\",\"" + dayCtrlStr + "\",\"" + monthCtrlStr + "\",\"" + yearCtrlStr + "\",\"" 
					calendar +=  dowCtrlStr + "\", \"" + language + "\",\" " + locale + "\",\" " + callBackFn + "\")'>" + "<img src='imgs/calendar/prev_butt.gif' width=42 height=13 border=0>" + "</a></td>"  
					calendar +=" <td align=center colspan=3><a href='javascript:self.close()'>" + "<img src='imgs/calendar/close_butt.gif' width=86 height=13 border=0>" + "</a></td>"  
					calendar +=" <td align=right colspan=3><a href='javascript:opener.generateCalendar(self," + goNextMonth + "," + nextYear + ",\"" + formStr + "\",\"" + dayCtrlStr + "\",\"" + monthCtrlStr + "\",\"" + yearCtrlStr + "\",\"" 
					calendar +=  dowCtrlStr  + "\", \"" + language + "\",\" " + locale + "\",\" " + callBackFn + "\")'>" + "<img src='imgs/calendar/next_butt.gif' width=42 height=13 border=0>" + "</a></td></tr>"  
					calendar +=" </table></td><tr></table></body></html>"  
					target.document.close(); 
				} 
				else 
				{ 
					calendar +=" <form><tr><td align=left colspan=3 bgcolor=#E0E0E0><input type=button value=' < '"  
					calendar += "onClick='document.clear();opener.generateCalendar(opener.calendarWindow," + goPrevMonth + "," + nextYear + ",\"" + formStr + "\",\"" + dayCtrlStr + "\",\"" + monthCtrlStr + "\",\"" + yearCtrlStr + "\",\"" + dowCtrlStr 
					calendar += "\", \"" + language + "\",\" " + locale + "\",\" " + callBackFn + "\");'></td>"  
					calendar +=" <td align=center colspan=1 bgcolor=#E0E0E0>&nbsp;</td>"  
					calendar +=" <td align=right colspan=3 bgcolor=#E0E0E0><input type=button value=' > '"  
					calendar += "onClick='document.clear();opener.generateCalendar(opener.calendarWindow," + goNextMonth + "," + nextYear + ",\"" + formStr + "\",\"" + dayCtrlStr + "\",\"" + monthCtrlStr + "\",\"" + yearCtrlStr + "\",\"" + dowCtrlStr 
					calendar += "\", \"" + language + "\",\" " + locale + "\",\" " + callBackFn + "\");'></td></tr></form>"  
					calendar +=" </table></body></html>"   
				} 
				target.document.write(calendar); 
				target.document.close(); 
			}

			//************************************************************************
      // Function:  closeCalendar
      // Purpose:   Close the calendar and update the parent forms date controls.
      // Input:     day - selected day.
      //            formStr - HTML name of the form that contains the date controls.
      //            dayCtrlStr - HTML name of the day drop down.
      //            monthCtrlStr - HTML name of the month drop down.
      //            yearCtrlStr - HTML name of the year drop down.
      //            dowCtrlStr - HTML name of the day of week control.
      //            language - language used by the WEB page.
      //            locale - locale used by the WEB page.
      //            callBackFn - JavaScript function to call when closing the calendar.
      // Output:    none
			//************************************************************************

			function closeCalendar (day, formStr, dayCtrlStr, monthCtrlStr, yearCtrlStr, dowCtrlStr, language, locale, callBackFn) 
			{
        // Update the controls.
				var yrIdx = parseYear (selectedyear, eval ("document." + formStr + "." + yearCtrlStr));
				eval ("document." + formStr + "." + dayCtrlStr + ".selectedIndex = " + parseInt(day-1, 10));
			 	eval ("document." + formStr + "." + monthCtrlStr + ".selectedIndex = "  + selectedmonth + "-1");
				eval ("document." + formStr + "." + yearCtrlStr + ".selectedIndex = " + yrIdx);

				eval ("document." + formStr + "." + dowCtrlStr + ".value = '" 
									+ getDayOfWeek (buildCRSDate (selectedyear, 
																			selectedmonth, 
																			day)) + "'");
        // Call the callback function.
        eval (callBackFn);
			}
