// UpdateCal is used by the hmpg to update the default iframe calendar to the current month.
// The iframe element must have id="calframe" and calendar files must be named in the format yyyy-mm.html and have a relative link from the hmpg as calendars/yyyy-mm.html
var UpdateCal =
{
	init: function()
	{
		var calframe = document.getElementById("calframe"); // targets the calendars iframe
		var today = new Date();
		var yr = today.getFullYear();
		if (yr > 2009) // Just to ensure a person's computer is not set to 1970!
		{
			var mthnos = ["01","02","03","04","05","06","07","08","09","10","11","12"];
			var mth = mthnos[today.getMonth()];
			calframe.src = "calendars/" + yr + "-" + mth + ".html";
		}
	}
};
UpdateCal.init();
