<div id="calendar_side">
<%
	dim calendar
	set calendar = new ASP_Calendar
	calendar.database_bind = true
	calendar.database_connection = oconn
	calendar.database_field = "EventDate"
	calendar.database_table = "Calendar_Event"
	calendar.scrollable = true
	calendar.set_month = month_key
	calendar.set_year = year_key
	response.write calendar.draw("default.asp")
%>
<br />
<div id="calendar_opts">
<span class="mainLabel">Jump to Month</span><br />
<p>
	Month: 
	<select id="jmpMo">
<%
	dim i
	for i = 1 to 12
		dim slct
		slct=""
		if month_key = i then slct = " selected"
		response.write vbtab & vbtab & "<option" & slct & " value=""" & i & """>" & MonthName(i) & "</option>" & vbcr
	next
%>	
	</select><br /><br />
	Year: 
	<select id="jmpYr">
<%
	sql = "SELECT DISTINCT Year(EventDate) AS yr FROM Calendar_Event WHERE Year(EventDate) >= " & Year(Date)
	oconn.open
	set ors = oconn.execute(sql)
	while not ors.eof
		slct=""
		if year_key = ors.fields("yr") then slct = " selected"
		response.write vbtab & vbtab & "<option" & slct & " value=""" & ors.fields("yr") & """>" & ors.fields("yr") & "</option>"
		ors.movenext
	wend
	oconn.close
%>
	</select>
<%
	dim url
	dim page
	url = split(Request.ServerVariables("URL"), "/")
	page = url(UBound(url))
%>
	<input class="button" type="button" onclick="location.href = '<%= page %>?sort=<%= sort_key %>&mo=' + document.getElementById('jmpMo').value + '&yr=' + document.getElementById('jmpYr').value;" value="Go">
</p>
<span class="mainLabel">Viewing Options</span>
<p>
<img alt="bullet" class="bullet" src="<%= rootPath %>smhImages/hollow_blue_arrow.gif">
<% if sort_key <> 0 then %>
<a href="default.asp?mo=<%= month_key %>&yr=<%= year_key %>">All Dates</a>
<% else %>
All Dates
<% end if %>
<br />
<%
	sql = "SELECT CategoryID, Description FROM Calendar_Category ORDER BY Description"
	oconn.open
	set ors = oconn.execute(sql)
	if not ors.eof then
		while not ors.eof
			response.write vbtab & "<img alt=""bullet"" class=""bullet"" src=""" & rootPath & "smhImages/hollow_blue_arrow.gif""> "
			if sort_key <> ors.fields("CategoryID") then
				response.write "<a href=""default.asp?s=" & ors.fields("CategoryID") & "&mo=" & month_key & "&yr=" & year_key & """>"
			end if
			response.write ors.fields("Description") 
			if sort_key <> ors.fields("CategoryID") then
				response.write "</a>"
			end if
			response.write "<br />" & vbcr
			ors.movenext
		wend
	else
		response.write "There are currently no calendar categories"
	end if
	oconn.close
%>
</p>
</div>
</div>