//=========================================================
// CLIMO_SELECT.JS selectes prior climo data using pull-downs
//=========================================================

//=========================================================
// Display link category title
//=========================================================
	document.write('<br><br><font face="Verdana" size="4" color="Cyan">Climatic Summaries:</font>',spacer)

//=========================================================
// Pull-down menu for monthly summaries
//=========================================================
	document.write('<select onChange="if (this.options.selectedIndex != 0) self.location=this.options[this.selectedIndex].value">') 
	document.write('<option selected>Monthly</option>')
	selected_year = year
	while (selected_year >= first_data_year) {
		start_month = 12
		end_month = 1
		if (selected_year == first_data_year) {end_month = first_data_month}
		if (selected_year == year) {if (day == 1) {start_month = month - 1} else {start_month = month}}
		if (end_month == 0) {end_month = 12, selected_year = selected_year - 1}
		selected_month = start_month
		while (selected_month >= end_month) {
			display_month = text_month[selected_month].substring(0,3)
	     		if ((selected_year > first_full_data_year) || (selected_year == first_full_data_year && selected_month >= first_full_data_month)) {
				if (selected_month == start_month) {document.write('<option disabled="disabled">-- ',selected_year,' --</option>')}
				document.write('<option value="http://gretnawx.net/climo_display.php?yy=',selected_year,'&mm=',selected_month,'">',display_month,'</option>')}
	     		if ((selected_year == first_full_data_year && selected_month < first_full_data_month) || (selected_year < first_full_data_year)) {
				if (selected_month == start_month) {document.write('<option disabled="disabled">-- ',selected_year,' --</option>')}
				document.write('<option value="http://gretnawx.net/Data/Climo_Data/',selected_year,'/',text_month[selected_month],'.pdf">',display_month,'</option>')}
		selected_month--}
	selected_year--}
	document.write('</select>&nbsp;&nbsp;&nbsp;&nbsp;')

//=========================================================
// Pull-down menu for annual summaries
//=========================================================
	document.write('<select onChange="if (this.options.selectedIndex != 0) self.location=this.options[this.selectedIndex].value">') 
	document.write('<option selected>Annual</option>')
	selected_year = year
	if (month == 1) {selected_year = year - 1}
	while (selected_year >= first_data_year) {
	     	if (selected_year >= first_full_data_year) {
			if ((selected_year == year && month > 1) || (selected_year < year)) {
				document.write('<option value="http://gretnawx.net/climo_display.php?yy=',selected_year,'&mm=0">',selected_year,'</option>')}}
	     	if (selected_year < first_full_data_year) {
			document.write('<option value="http://gretnawx.net/Data/Climo_Data/',selected_year,'/Annual.pdf">',selected_year,'</option>')}
	selected_year--}
	document.write('</select><br><br>')

//=========================================================
// End CLIMO_SELECT.JS 
//=========================================================
