function clear_list(list) {
	while (list.length > 0) {
		list.remove(0);
	}
}

function append_option(list, value, display) {
	var newItem = document.createElement('option');
	newItem.text = display;
	newItem.value = value;
	try {
		list.add(newItem, null);
	} catch(ex) {
		list.add(newItem);  // IE IS SPECIAL :)
	}
}

function on_change_month() {
	var year = document.getElementById("year");
	if (year.selectedIndex == 0) {
		year.selectedIndex = 1;
	}
		
}

function sort(sort, what) {
	document.getElementById("sort_what").value = what;
	var sort = document.getElementById("sort");
	if (sort.value == "up" || sort.value == "") {
		sort.value = "down";
	} else {
		sort.value = "up";
	}
	document.getElementById("searchForm").submit();
}
