function checkCalculate(obj)
{
	if (obj.submitType.value == "submit")
	{
		if ((obj.BasAdvance1.value == "") || (obj.BasAdvance1.value == 0))
		{
			//alert("Please enter a value for \"Outstanding mortgage balance\"")
			//obj.BasAdvance1.focus()
			//return false
		}
		if (isNaN(obj.BasAdvance1.value.replace(",","")))
		{
			//alert("Please enter a numeric value for \"Outstanding mortgage balance\"")
			//obj.BasAdvance1.focus()
			//return false
		}
		if (obj.BasAdvance1.value.replace(",","") < 50000)
		{
			//alert("The \"Outstanding mortgage balance\" must be no lower than £50,000")
			//obj.BasAdvance1.focus()
			//return false
		}

		if ((obj.PropValue1.value == "") || (obj.PropValue1.value == 0))
		{
			//alert("Please enter a value for \"Estimated value of property\"")
			//obj.PropValue1.focus()
			//return false
		}
		if (isNaN(obj.PropValue1.value.replace(",","")))
		{
			//alert("Please enter a numeric value for \"Estimated value of property\"")
			//obj.PropValue1.focus()
			//return false
		}

		if (obj.BasAdvance1.value.replace(",","")/obj.PropValue1.value.replace(",","") > .75)
		{
			//alert("Sorry, this rate is only available if you owe less than 75% of the value of your property")
			//obj.BasAdvance1.focus()
			//return false		
		}
		
		if ((obj.IntOnly1.options[obj.IntOnly1.selectedIndex].value != 'y') && (obj.IntOnly1.options[obj.IntOnly1.selectedIndex].value != 'n'))
		{
			//alert("Invalid option selected for \"Repayment type\"")
			//obj.IntOnly1.focus()
			//return false	
		}

		if ((obj.Term1.options[obj.Term1.selectedIndex].value == '0') && (obj.TermMonths1.options[obj.TermMonths1.selectedIndex].value == '0'))
		{
			//alert("Please select the period for \"Repayment term\"")
			//obj.Term1.focus()
			//return false	
		}
		if ((isNaN(obj.Term1.options[obj.Term1.selectedIndex].value)) || (isNaN(obj.TermMonths1.options[obj.TermMonths1.selectedIndex].value)))
		{
			//alert("Invalid option selected for \"Repayment term\"")
			//obj.Term1.focus()
			//return false
		}

		if ((obj.NewPayments1.value == "") || (obj.NewPayments1.value == 0))
		{
			//alert("Please enter a value for \"New existing lender monthly payments\"")
			//obj.NewPayments1.focus()
			//return false
		}
		if (isNaN(obj.NewPayments1.value.replace(",","")))
		{
			//alert("Please enter a numeric value for \"New existing supplier monthly payments\"")
			//obj.NewPayments1.focus()
			//return false
		}
		
		obj.submit()
	}
	else
	{
		obj.BasAdvance1.value = 0
		obj.PropValue1.value = 0
		obj.IntOnly1.selectedIndex = 0
		obj.Term1.selectedIndex = 0
		obj.TermMonths1.selectedIndex = 0
		obj.NewPayments1.value = 0
		document.getElementById('userFeedback').innerHTML = ''
	}
	
	return true
}

function checkApply(obj)
{
	if (obj.submitType.value == "submit")
	{
		if (obj.ffTitle.value == "")
		{
			alert("Please enter a value for \"Title\"")
			obj.ffTitle.focus()
			return false
		}

		if (obj.ffFname.value == "")
		{
			alert("Please enter a value for \"First name\"")
			obj.ffFname.focus()
			return false
		}

		if (obj.ffSname.value == "")
		{
			alert("Please enter a value for \"Surname\"")
			obj.ffSname.focus()
			return false
		}

		if (obj.ffAddress.value == "")
		{
			alert("Please enter a value for \"First line of address\"")
			obj.ffAddress.focus()
			return false
		}

		if (obj.ffPcode.value == "")
		{
			alert("Please enter a value for \"Postcode\"")
			obj.ffPcode.focus()
			return false
		}

		obj.submit()
	}
	else
	{
		obj.ffTitle.value = ''
		obj.ffFname.value = ''
		obj.ffSname.value = ''
		obj.ffAddress.value = ''
		obj.ffPcode.value = ''
		obj.ffMtype.selectedIndex = 0
		obj.ffBorrow.value = ''
		obj.ffRepayy.selectedIndex = 0
		obj.ffRepaym.selectedIndex = 0
		obj.ffRtype.selectedIndex = 0
		obj.ffPhone.value = ''
		obj.ffTime.selectedIndex = 0
	}
	
	return true
}
