function Subform(theform) {

if (theform.xxy.value == "")
 { alert("Please enter a valid year.");
 theform.xxy.focus();
 return false; }

if (theform.place.value == "")
 { alert("Please enter a city name.");
 theform.place.focus();
 return false; }

// Get Data for Single Day
 if (document.usasunset.chartype[0].checked) {
 
 if (theform.xxd.value == "")
 { alert("Please enter a valid day number.");
 theform.xxd.focus();
 return false; }

 document.usasunset.action = "http://aa.usno.navy.mil/cgi-bin/aa_pap.pl"; 
 document.usasunset.submit(); 
 return false; }

// Get Data for Entire Year
// default type of chart for year request is sunset/sunrise times
// this script uses default. other poss. 1=moonrise/moonset, 2=civil twilight, etc.

if (document.usasunset.chartype[1].checked) {

 document.usasunset.action = "http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl"; 
 document.usasunset.submit(); 
 return false; }
}
