function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;

if (keycode == 13)
   {
   submitForm(myfield.form.name);
   return false;
   }
else
   return true;
}


function cancelForm(cancelUrl)
{
	if(confirm("Are you sure you want to cancel?  You will lose any changes you've made on this page."))
	{
		window.location = cancelUrl;
	}
}

function confirmDelete(frm) {
		for(var i=0; i < frm.elements.length; i++) {
			if(frm.elements[i].name == 'delete' && frm.elements[i].checked) {
				return confirm("Are you sure you want to delete this?  You cannot undo this action.");
			}
		}
	
	return true;
}

function submitForm(formName) {
	
	theform = document.forms[formName];
	
	if(arguments.length > 1)
	{
		fieldname = arguments[1];
		if(fieldname == 'delete' && !confirm("Are you sure you want to delete this?  You cannot undo this action."))
		{
			return false;
		}
		value = theform[fieldname].value; 
		theform[fieldname].value = value ? 1 : 0;
	}
	
	if(theform.onsubmit)
	{
		if(theform.onsubmit()) {
			theform.submit();
		}
	} else { theform.submit(); }
}