function LoadCalendar(m, y)
{
	ShowWorking();
	sendRequest('/calendar?y='+y+'&m='+m, ShowCalendar);
}
function ShowCalendar(r)
{
	var elem = document.getElementById('calendar');
	if (elem) elem.innerHTML = r;
	HideWorking();
}
function HighlightRow(i)
{
	var col = 1;
	var elem;
	while (elem = document.getElementById('row'+i+'col'+col))
	{
		if (col == 1) elem.style.cursor='pointer';
		elem.style.color='#fff';
		elem.style.backgroundColor='#444';
		col++;
	}
	col = 1;
	while (elem = document.getElementById('row'+i+'col'+col+'x'))
	{
		elem.style.backgroundColor='#444';
		col++;
	}
}
function RestoreRow(i)
{
	var col = 1;
	var elem;
	while (elem = document.getElementById('row'+i+'col'+col))
	{
		if (col == 1) elem.style.cursor='default';
		elem.style.color='#000';
		elem.style.backgroundColor='transparent';
		col++;
	}
	col = 1;
	while (elem = document.getElementById('row'+i+'col'+col+'x'))
	{
		elem.style.backgroundColor='transparent';
		col++;
	}
}
function HighlightCell(i,j)
{
	var elem = document.getElementById('row'+i+'col'+j);
	if (elem)
	{
		elem.style.cursor='pointer';
		if (j.length == 1)
			elem.style.color='#fff';
		elem.style.backgroundColor='#444';
	}
}
function RestoreCell(i,j)
{
	var elem = document.getElementById('row'+i+'col'+j);
	if (elem)
	{
		elem.style.cursor='default';
		if (j.length == 1)
			elem.style.color='#000';
		elem.style.backgroundColor='#fff';
	}
}
