function initMonth()
{
	var cookies = new Cookies();
	oldMonth = cookies.getCookie("afishamonth");	
	var cnt = document.getElementById('cal_' + oldMonth);
	if (!cnt)
	{
		return;
	}
	else
	{
		cnt.style.display = "block";
		SelectOptionInList(document.SelectMonth.month, oldMonth);
		hideOtherMonths(oldMonth);
	}		
}

function selectMonth()
{

	var month = document.SelectMonth.month.value;

	var cnt = document.getElementById('cal_' + month);

	if(!cnt)
	{
		return;
	}

	if(cnt.style.display == "none")
	{
		cnt.style.display = "block";
		var cookies = new Cookies();
		hideOtherMonths(month);
		cookies.setCookie("afishamonth", month, "/");
	}
	else
	{
		return;
	}

}

function hideOtherMonths(exception)
{
	for (var loop = 0; loop < document.SelectMonth.month.options.length; loop++)
	{
		if (document.SelectMonth.month.options[loop].value != exception)
		{
			var oldCnt = document.getElementById('cal_' + document.SelectMonth.month.options[loop].value);
			if (oldCnt)
				oldCnt.style.display = "none";
		}
	}
	
}

function SelectOptionInList( lstSelectList, intID )
{
	try	
	{
		var intIndex = 0;
		// Loop through all the options
		for( intIndex = 0; intIndex < lstSelectList.options.length; intIndex++ )
		{
			// Is this the ID we are looking for?
			if( lstSelectList.options[intIndex].value == intID ) 
			{
				// Select it
				lstSelectList.selectedIndex = intIndex;
				// Yes, so stop searching
				break;
			}
		}
	}
	catch( expError )
	{
		alert( "ClientUtilities1.js::SelectOptionInList( ).\n" +
                         "Error:" + expError.number + ", " + expError.description );
	}
}