/* 
 * clearFunction
 * Clears the value of input field
 * 
 * @deprecated use clearField instead
 *
 */
function clearFunction(input) {
	if (input.defaultValue==input.value) {
		input.value = "";
	}
}

/*
 * setField
 * Sets the field back to its default value if cleared
 *
 * @input String
 */
function setField(input) {
	if (input.value=="") {
		input.value = input.defaultValue;
	}
}
/*
 * clearField
 * Clears the field to simplify use when it has a default value
 *
 * @input String
 */
function clearField(input) {
	if (input.defaultValue==input.value) {
		input.value = "";
	}
}

/*
 * setReferer
 * Sets the carefully-named input field with the HTTP referer.
 * To use, authors should insert a text field with the ID 'httpref'.  Unfor-
 * tunately (for them) there may be only one such field on the page to still be
 * XHTML valid.
 *
 * Note that the Id referenced might change at any time, so you probably
 * shouldn't reference this function if not using CMS.
 * 
 */
function setReferrer() {
	var ref = document.getElementById('ndsumailformhttpref');
	if (document.referrer) {
		ref.value = document.referrer;
		ref.disabled = true;
	}
	else {
		ref.value = 'Not available';
	}
}

