function radioMatch(thisButton) {
	theForm = thisButton.form;
	theValue = thisButton.value;
	
	for (counter = 0; counter < theForm.length; counter++) {
		cButton = theForm[counter];
		if (cButton.type == 'radio' && cButton.value == theValue) {
			cButton.checked = true;
		}
	}
	
	return true;
}

function radioSwitch(thisButton, allButtonName) {
	theForm = thisButton.form;
	theValue = thisButton.value;
	
	//if the buttons on this side are not the same, the allbutton must be 'other'
	//otherwise, the allbutton should match the buttons on this side
	
	yesCount = 0;
	noCount = 0;
	
	allButton = new Array();
	
	for (counter = 0; counter < theForm.length; counter++) {
		cButton = theForm[counter];
		if (cButton.type == 'radio') {
			if (cButton.name == allButtonName) {
				allButton[cButton.value] = cButton;
			} else {
				if (cButton.checked) {
					if (cButton.value == 'yes') {
						yesCount++;
					} else if (cButton.value == 'no') {
						noCount++;
					}
				}
			}
		}
	}
	
	if (yesCount == 0) {
		allButton['no'].checked = true;
	} else if (noCount == 0) {
		allButton['yes'].checked = true;
	} else {
		//there are more than one values; use other
		allButton['other'].checked = true;
	}
	return true;
}

function radioCheck(theForm,theButton,theValue,text2change,change2) {
	counter = 0;
	while (counter < theForm.length) {
		if (theForm[counter].name == theButton && theForm[counter].value == theValue) {
			theForm[counter].checked = true;
		}
		if (theForm[counter].name == text2change) {
			theForm[counter].value = change2;
		}
		counter++;
	}
	return true;
}

function setVirtual(theForm, regExp, theDomain) {
	counter = 0;
	theButton = "rx";
	theValue = regExp;
	text2change = "hn";
	change2 = theDomain;
	if (regExp != '/*') {
		theWebSite = "http://www.sandiego.edu/~" + theDomain + "/";
	} else {
		theWebSite = "http://" + theDomain + ".sandiego.edu/";
	}
	while (counter < theForm.length) {
		theField = theForm[counter];
		cName = theField.name;
		cValue = theField.value;
		
		if (cName == theButton) {
			if (cValue == theValue) {
				theField.checked = true;
			}
		} else if (cName == text2change) {
			theField.value = change2;
		} else if (cName == "hu") {
			theField.value = theWebSite;
		}
		counter++;
	}
	return true;

}



