// Create a variable to contain the local date
var right_now=new Date();

// create an array for the month name
var weekday_name = new Array (
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday");

// create an array for the month name
var month_name = new Array (
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December");


// Begin selection option for Day of the Week
document.write("<select name=the_weekday>")

// Loop to create options for weekday with current weekday selected
for (counter = 0; counter < 7; counter++)
{
var dwk_select="";

// If the counter = the current day then 
// change the variable dwk_select from null to selected
if (counter == right_now.getDay())
{
var dwk_select="selected "
}

// Write out the options for weekday
document.write ("<option " + dwk_select + "value=" + weekday_name[counter] +">" + weekday_name[counter] + "</option>");
}
document.write("</select>");


// Begin selection option for month
document.write("<select name=the_month>")

// Loop to create options for month with current month selected
for (counter = 0; counter < 12; counter++)
{
var mth_select="";

// If the counter = the current month then 
// change the variable mth_select from null to selected
if (counter == right_now.getMonth())
{
var mth_select="selected "
}

// Write out the options for month
document.write ("<option " + mth_select + "value=" + month_name[counter] +">" + month_name[counter] + "</option>");
}
document.write("</select>");

// Begin selection option for day
document.write("<select name=the_day>")

// Loop to create options for date with current date selected
for (counter = 1; counter < 32; counter++)
{
var select="";
if (counter == right_now.getDate())
{
var select="selected "
}
// Write out the options for date
document.write ("<option " + select + "value=" + counter +">" + counter + "</option>");
}
document.write("</select>");


