/******************************************************************************
*
*	This is where you make the changes to the calendar
*/
	
	// Change this to the name of last month
	var prev_month = "June";
	// Change this to the file name for last month
	var prev_month_file = "June2010.htm";
	
	
	// Change this to the name of this month
	var this_month = "July";
	// Change this to the file name for this month
	var this_month_file = "July2010.htm";
	
	
	// Change this to the name of next month
	var next_month = "August";
	// Change this to the file name for next month
	var next_month_file = "August2010.htm";
	
/*
*
*
******************************************************************************/

///////////////////////////////////////////////////////////////////////////////
// DO NOT EDIT BELOW THIS LINE ////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

var months = new Array();
var urls = new Array();

function doCalendar()
{
	// add some months
	months.push(prev_month);
	months.push(this_month);
	months.push(next_month);
	
	urls.push("calendar/" + prev_month_file);
	urls.push("calendar/" + this_month_file);
	urls.push("calendar/" + next_month_file);
	
	updateCal(1);
}
window.onload=doCalendar;

function updateCal(num)
{
	$('month').innerHTML = "";
	
	var title = document.createElement("h4");
	title.innerHTML = months[num];
	
	var nextA = document.createElement("a");
	var nextImg = document.createElement("img");
	
	var prevA = document.createElement("a");
	var prevImg = document.createElement("img");
	
	
	if(num > 0)
	{
		prevImg.src = "http://wcroads.org/images/arrow-left.gif";
		prevImg.alt = "next";
		prevA.appendChild(prevImg);
		$('month').appendChild(prevA);
		prevA.onclick = function(e){
			updateCal(num - 1);
		}
	}
	
	$('month').appendChild(title);
	
	if(num < 2)
	{
		nextImg.src = "http://wcroads.org/images/arrow-right.gif";
		nextImg.alt = "next";
		nextA.appendChild(nextImg);
		$('month').appendChild(nextA);
		nextA.onclick = function(e){
			updateCal(num + 1);
		}
	}
	
	var myAjax = new Ajax.Updater('cal', urls[num], {method:'get'});
}
