function clearForm(theForm) {	counter = 0;	while (counter < theForm.length) {		if (theForm[counter].type == 'checkbox' || theForm[counter].type == 'radio') {			theForm[counter].checked = false;		} else if (theForm[counter].type == 'select-one' || theForm[counter].type == 'select-multiple') {			theForm[counter].selectedIndex = 0;		} else {			theForm[counter].value = "";		}		counter++;	}	return false;}function switchChecks(theForm) {	counter = 0;	while (counter < theForm.length) {		if (theForm[counter].type == 'checkbox') {			theCheck = theForm[counter];			if (theCheck.checked) {				theCheck.checked = false;			} else {				theCheck.checked = true;			}		}		counter++;	}	return false;}//returns false if the next element does not exist or if this element is not part of a form//or is not numbered.//if the field name ends in a number, it adds one to the number and returns that next element//currently only works for from 0 to 9; i.e., no two-digit numbersfunction getNextField(theElement) {	if (theForm = theElement.form) {		formName =theForm.name;		elementName = theElement.name;				nameLength = elementName.length;		lastChar = elementName.substr(elementName.length-1, 1);		if (lastChar >= "0" && lastChar <= "9") {			//yes, this was at one time the official way of converting strings to numbers: subtract zero			lastChar = lastChar - 0 + 1;			newName = elementName.substr(0, elementName.length-1) + lastChar.toString();			if (nextElement = theForm[newName]) {				return nextElement;			}		}	}		return false;}function advanceField(theEvent) {	if (!theEvent) {		theEvent = window.event;	}		//get the current element from netscape or explorer event models	//this may not work--it may error out on the non-existent property	theElement = theEvent.target;	if (!theElement) {		theElement = theEvent.srcElement;	}		elementName = theElement.name;	if (theElement) {			//get the key that was just pressed, from netscape or explorer event models		theKey = theEvent.which;		if (!theKey) {			theKey = theEvent.keyCode;		}			if (theKey == 46 || theKey == 58) {			//this is a period or a colon.			//jump to the next field			if (nextField = getNextField(theElement)) {				nextField.focus();				nextField.select();				return false;			}		}	}		return true;}