var today = new Date();
var real_month = today.getMonth();
var month_array = new Array("January","February","March",
	"April","May","June","July","August","September",
	"October","November","December");
var real_year = today.getFullYear();
var real_default = month_array[real_month] + "-" +
	real_year;
var select_obj;
var active_cal_obj;

function initCalendar()
{
	select_obj = 
		window.document.getElementById("selector");
	var default_obj = 
		window.document.getElementById(real_default);
	var num_of_options = select_obj.options.length;
	var found = false;
	var count = 0;

	while ((!found) && (count < num_of_options))
	{
		if (select_obj.options[count].value == real_default)
		{
			found = true;
			select_obj.options[count].selected = true;
		}
		else
		{
			count++;
		}
	}
	
	if (!default_obj)
	{
		var first_opt_div = 
			select_obj.options[0].value;
		default_obj = 
			window.document.getElementById(first_opt_div);
		select_obj.options[0].selected = true;
	}
	
	default_obj.style.display = "block";
	active_cal_obj = default_obj;
}	

function changeMonth()
{
	active_cal_obj.style.display = "none"; 
	var calendar_id = 
		select_obj.options[select_obj.selectedIndex].value;
	active_cal_obj = 
		window.document.getElementById(calendar_id);
	active_cal_obj.style.display = "block";
}

function eventLink(uri)
{
	var event_win = 
		window.open(uri,"bmes_event","height=275,width=275");
	event_win.focus();
}

function photoLink(uri)
{
	var photo_win = 
		window.open(uri,"bmes_photogal","height=744,width=780,resizable=yes,scrollbars=yes");
	photo_win.focus();
}