var blnSubmitted = false; //Has this form already been submitted? set/checked by OnFormSubmit() method

/************************************************************
Name: killLinks
Purpose: Disable links on the page so that user cannot submit twice
Input: None
Output: None
************************************************************/     
function killLinks()
{
	var intIndex = 0;
	{
		if(gobjBrowser.isIE)
		{
			for(intIndex = document.links.length - 1; intIndex >= 0; intIndex--)
			{
				document.links[intIndex].removeAttribute('href', false);
			}
		}
		else
		{
			for(intIndex = document.links.length - 1; intIndex >= 0; intIndex--)
			{
				document.links[intIndex].href = '#';
			}
		}
	}
}

/************************************************************
Name: onFormSubmit
Purpose: Handle form submission.  Intended to override the
         Form::Submit() method in order to disable all links
         when the user submits the form.
Input: None
Output: None
************************************************************/     
function onFormSubmit()
{
	if(!blnSubmitted)
	{
		blnSubmitted = true;
		killLinks();
		this.baseSubmit();
	}
}

/************************************************************
Name: setSubmit
Purpose: Set up override for the Form::Submit() method
Input: None
Output: None
************************************************************/     
function setSubmit()
{
	if(!document.forms[0] === void 1){
		document.forms[0].baseSubmit = document.forms[0].submit;
		document.forms[0].submit = onFormSubmit;
	}
}

//Set up override for the Form::Submit() method
setSubmit();
