// JavaScript Document

var dirtyForm=false;
//dirtyForm =true;

function submitForm(formNumber){
	dirtyForm=false;
	document.forms[formNumber].submit();
}

function alertOnCloseDirtyForm(){
	if(dirtyForm) {
		var msg = 'Closing this form will lose your changes. Click OK to continue and lose your changes or cancel to return to the form'
		return window.confirm(msg)
	}
}

function displayMessage(formNumber, message, functionToExecute){
	if (document.forms[formNumber]){
		try 	{
			functionToExecute(message);
			return true;
			}
		catch (e)
			{
			return false;
			}
	}
}
