/*
	OFPEC Intel Depot
	18 July 2009
	
	javascript functions
*/


// hide all archive calendars
function setup_archive_calendars(which) {
	// find the calendars
	middlecol_divs = document.getElementById('middle_column').getElementsByTagName('div');
	for (i = 0; i < middlecol_divs.length; i ++) {
		if (middlecol_divs[i].className == 'archive_calendar') {
			// hide the archive_container
			the_calendar = middlecol_divs[i].getElementsByTagName('*');
			for (j = 0; j < the_calendar.length; j ++) {
				if (the_calendar[j].className == 'archive_container') {
					the_calendar[j].style.display = 'none';
				}
			}
		}
	}
	
	if (which) {
		// selected calendar
		the_archive = document.getElementById('calendar_' + which);
		the_calendar = the_archive.getElementsByTagName('*');
		for (j = 0; j < the_calendar.length; j ++) {
			if (the_calendar[j].className == 'archive_container') {
				the_calendar[j].style.display = 'block';
			}
		}
	}
}


function select_category() {
	var choice = document.getElementById('choose');
	var opt = document.getElementById('choose').selectedIndex;
	var option = choice[opt].value;
	window.location = 'index.php?action=list&cat=' + option;
}
