function buildSelect(first, second, source) {
	main = document.getElementById(first);
	id = main.options[main.selectedIndex].value;
	child = document.getElementById(second);
	if (id != 0) {
		tmp = child.options[0].text;
		child.options.length = 0;
		child.options[0] = new Option(tmp, 0);
		if (source[id]) {
			i = 0;
			for (c in source[id]) {
				i++;
				child.options[i] = new Option(source[id][c], c);
			}
		}
	}
}

function checkLogin() {
	if (document.loginForm && document.loginForm.username) {
		document.loginForm.username.focus();
	}
}