<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Created by: Lee Hinder, lee.hinder@ntlworld.com -->

<!-- Begin
//set todays date
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape

//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear)
{
  var DaysInMonth = 31;
  if (WhichMonth == "Apr" || WhichMonth == "Jun" || WhichMonth == "Sep" || WhichMonth == "Nov") DaysInMonth = 30;
  if (WhichMonth == "Feb" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;
  if (WhichMonth == "Feb" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;
  return DaysInMonth;
}

//function to change the available days in a months
function ChangeOptionDays(Which)
{
  DaysObject = eval("document.Form1." + Which + "D");
  MonthObject = eval("document.Form1." + Which + "M");
  YearObject = eval("document.Form1." + Which + "Y");
  
  DaysObjectt = eval("document.Form1." + Which + "Dt");
  MonthObject2 = eval("document.Form1." + Which + "M2");
  YearObject2 = eval("document.Form1." + Which + "Y2");

  Month = MonthObject[MonthObject.selectedIndex].text;
  Year = YearObject[YearObject.selectedIndex].text;
  
  Month = MonthObject[MonthObject2.selectedIndex].text;
  Year = YearObject[YearObject2.selectedIndex].text;

  DaysForThisSelection = DaysInMonth(Month, Year);
  CurrentDaysInSelection = DaysObject.length;
  CurrentDaysInSelection = DaysObjectt.length;
  if (CurrentDaysInSelection > DaysForThisSelection)
  {
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
    {
      DaysObject.options[DaysObject.options.length - 1] = null
	  
	   DaysObjectt.options[DaysObjectt.options.length - 1] = null
    }
  }
  if (DaysForThisSelection > CurrentDaysInSelection)
  {
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
    {
      NewOption = new Option(DaysObject.options.length + 1);
      DaysObject.add(NewOption);
	  
	  NewOption = new Option(DaysObjectt.options.length + 1);
      DaysObjectt.add(NewOption);
    }
  }
    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
	
	 if (DaysObjectt.selectedIndex < 0) DaysObjectt.selectedIndex == 0;
}


//function to set options to today
function SetToToday(Which)
{

DaysObjectt = eval("document.Form1." + Which + "Dt");
  MonthObject2 = eval("document.Form1." + Which + "M2");
  YearObject2 = eval("document.Form1." + Which + "Y2");
  
  DaysObject = eval("document.Form1." + Which + "D");
  MonthObject = eval("document.Form1." + Which + "M");
  YearObject = eval("document.Form1." + Which + "Y");

	
  YearObject[0].selected = true;
  MonthObject[NowMonth].selected = true;

 YearObject2[0].selected = true;
  MonthObject2[NowMonth].selected = true;
  ChangeOptionDays(Which);

  DaysObject[NowDay-1].selected = true;
  DaysObjectt[NowDay+10].selected = true;
}

//function to write option years plus x
function WriteYearOptions(YearsAhead)
{
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;
  }
  return line;
}
//  End -->
<!-- Original:  Mike Fernandez -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function submitForm(s)  {
s.value = "  Finding...  ";
return true;
}
//  End -->
<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Original:  Nick Baker -->

