// work out which browser type is needed
var ns4 = false;
var ns5plus = false;
var ie = false;
if (document.layers)
	ns4 = true;
else if ((parseInt(navigator.appVersion) >= 5) && (navigator.appName=="Netscape"))
	ns5plus = true;
else if (document.all)
	ie = true;


// make the user confirm their action before proceeding (used when deleting things,  etc)
function confirm_action (message, urllocation) {
	if (!confirm (message)) {
		return (false);
	}
	else {
		document.location.href = urllocation;
	}
}

// record in a hidden field that a form on the page has been updated
function form_changed () {
	document.formChanges.changesMade.value = 'Y';
}

// record in a hidden field that a form on the page has been updated
function go_to (urllocation) {
	if (document.formChanges.changesMade.value == 'Y')
		confirm_action ("You have made changes to the form on this page.  If you continue without saving then these changes will be lost.\n\nContinue to the next page?", urllocation);
//		alert ("You have made changes to the form on this page.\nPlease save this information before continuing.");
	else
		document.location.href = urllocation;
}

// toggle a checkbox's value
function toggle_checkbox (fieldName, arrayPosition) {
	if (ie)
		toggle_checkbox_temp = document.all[fieldName];
	else if (ns5plus)
		toggle_checkbox_temp = document.getElementById(fieldName);
	else if (ns4)
		toggle_checkbox_temp = document.layers[fieldName];

	if (arrayPosition !== false) {
		if (toggle_checkbox_temp[arrayPosition].checked == false)
			toggle_checkbox_temp[arrayPosition].checked = true;
		else
			toggle_checkbox_temp[arrayPosition].checked = false;
	}
	else {
		if (toggle_checkbox_temp.checked == false)
			toggle_checkbox_temp.checked = true;
		else
			toggle_checkbox_temp.checked = false;
	}
}








// 
function get_object (fieldName) {
	if (ie)
		temp = document.all[fieldName];
	else if (ns5plus)
		temp = document.getElementById(fieldName);
	else if (ns4)
		temp = document.layers[fieldName];

	return temp;
}