
	function checkForm()
	{
		// variable to store any error messages returned from validation functions
		var sErrorText = "";
		
		// Validate the repayment amount
		sErrorText += checkAmount(document.mcBorrow.fMCPay.value,35,"borrow");
		
		// Validate the repayment term
		sErrorText += checkRepaymentTerm(document.mcBorrow.fMCTerm.value);
		
		// Validate the mortgage type
		for (var i = 0; i < document.mcBorrow.strMCType.length ; i++)
		{
			if (document.mcBorrow.strMCType.options[i].selected)
			{
				sErrorText += checkMortgageType(document.mcBorrow.strMCType.options[i].value)
			}
		}
		
		// Validate the mortgage rate
		var sRates = "";
		
		for(var i=0; i < document.mcBorrow.bMCmt.length; i++)
		{
			if (document.mcBorrow.bMCmt[i].checked)
			{
				sRates += document.mcBorrow.bMCmt[i].value;
			}
		}		
		
		sErrorText += checkMortgageRate(sRates);
		
		// Check for any validation errors, empty string indicates no errors found
		if (sErrorText == "")
		{
			return true;
		}
		else
		{
			// Validation errors found, so report to user in message box
			alert("Warning. This form cannot be submitted for the following reasons: \n" + sErrorText);
			return false;		
		}	
	}
