function updateList (field) {
	if (field && field.name && field.value) {
		courseList = document.getElementById("course-list");
		if (courseList) {
			if (courseList.childNodes.length > 0) {
				var i = 0;
				while (i < courseList.childNodes.length) {
					if (courseList.childNodes[i].getAttribute("value") == field.name) {
						courseList.removeChild(courseList.childNodes[i]);
					} else {
						i++;
					}
				}
			}
			if (field.checked) {
				var opt = document.createElement("option");
				opt.setAttribute("value", field.name);
				opt.appendChild(document.createTextNode(field.value));
				courseList.appendChild(opt);
			}
			hiddenList = document.getElementById("course-list-hidden");
			if (hiddenList) {
				var courses = new Array();
				for (var i = 0; i < courseList.childNodes.length; i++) {
					courses[courses.length] = courseList.childNodes[i].getAttribute("value");
				}
				hiddenList.setAttribute("value", courses.join(","));
			}
		}
	}
}

if (document.getElementById && document.getElementsByTagName) {
	document.write('<style> div#content div#courses div.warning { display: none; } div#content div.registration div.register { display: block; } div#content div.registration h2.register { display: block; } div#content div.registration table.form { display: block; } </style>');
}
