//calendar js functions

function togglesubs (parentid, originator) {
	//alert (parentid);
	//alert (originator.checked);
	i = 1;
	subcat = "parent" + parentid + i;
	while (document.getElementById(subcat)) {
		//alert ("hello");
		document.getElementById(subcat).checked = originator.checked;
		i++;
		subcat = "parent" + parentid + i;
	}
}

function calendar_move (direction) {
	//alert ("go: " + direction);
	document.getElementById("move").value = direction;
	document.getElementById("settings").submit ();
}

function gotodate (datestamp) {
	document.getElementById("thedate").value = datestamp;
	document.getElementById("settings").submit ();
}

function toggle_newsevent (eventid) {
	showbody = "newsbody" + eventid;
	expandcollapse = "expandcollapse" + eventid;
	if (window.document.getElementById(showbody).style.display == "block") {
		window.document.getElementById(expandcollapse).innerHTML = "<img src=\"/i/news_expand.gif\" alt=\"Expand\" border=\"0\" align=\"middle\" style=\"padding-bottom: 4px;\" />";
		window.document.getElementById(showbody).style.display = "none";
	} else {
		window.document.getElementById(expandcollapse).innerHTML = "<img src=\"/i/news_collapse.gif\" alt=\"Collapse\" border=\"0\" align=\"middle\" style=\"padding-bottom: 4px;\" />";
		window.document.getElementById(showbody).style.display = "block";
	}
}

function toggleallcats (onoff) {
	i=0;
	while (window.document.getElementById("settings").elements[i]) {
		if (window.document.getElementById("settings").elements[i].type == "checkbox") {
			window.document.getElementById("settings").elements[i].checked = onoff;
		}
		i++;
	}
}