// highlight the main input field 
function highlight()
{
	document.forms[0].s.focus();
	document.forms[0].s.select();
}

// hide or show "other" field b based on popup menu a
// derived from www.quirksmode.org/js/select.html
function other(a, b)
{
	var menu = document.forms[0].elements[a];
	var other = document.forms[0].elements[b];
	if (menu.options[menu.selectedIndex].value == "other") {
		other.style.display = "inline";
		other.focus();
		other.select();
	}
	else {
		if (other.style.display != "none") {
			other.blur();
			other.style.display = "none";
		}
	}
}

// hide or show div named boxid based on checkbox a
function togglebox(a,boxid)
{
	var chkbox = document.forms[0].elements[a];
	var bdiv = document.getElementById(boxid);
	if (chkbox.checked) {
		bdiv.style.display = "block";
	}
	else {
		bdiv.style.display = "none";
	}
}

// hide or show input field b based on checkbox a
function toggleinput(a,b)
{
	var chkbox = document.forms[0].elements[a];
	var input = document.forms[0].elements[b];
	if (chkbox.checked) {
		input.style.display = "inline";
		input.focus();
		input.select();
	}
	else {
		input.blur();
		input.style.display = "none";
	}
}

