		function notAllowed()  {
		     document.frmMortgage.txtPrice.focus();
		     alert("You are not allowed to enter a number in this box.  These values are automatically calculated for you.");
		}
		
		function calcMortgage()  {
		     var vPrice = document.frmMortgage.txtPrice.value;
		     var vDownPay = document.frmMortgage.txtDownPay.value;
		     var vInterest = document.frmMortgage.txtInterest.value;
		     var vTerm = document.frmMortgage.txtTerm.value;
		
		     if(vPrice == "") {
		          alert("Please enter a price.");
		          document.frmMortgage.txtPrice.focus();
		          return;
		     }
		
		     if(vDownPay == "") {
		          vDownPay = "0";
		     }
		
		     if(vInterest == "" || vInterest < "1") {
		          alert("Please enter an interest rate greater than 0%.");
		          document.frmMortgage.txtInterest.focus();
		          return;
		     }
		
		     if(vTerm == "" || vTerm < "1") {
		          alert("Please enter a term in years.");
		          document.frmMortgage.txtTerm.focus();
		          return;
		     }
		
		     var vPriceDiff = vPrice - vDownPay;
		     var vInterestRate = (vInterest/100) / 12;
		     var vMonths = vTerm * 12;
		     document.frmMortgage.txtPayments.value = vMonths;
		     vTemp = Math.floor((vPriceDiff*vInterestRate)/(1-Math.pow(1+vInterestRate,(-1*vMonths)))*100)/100;
		     document.frmMortgage.txtMonthly.value = FormatCurrency(vTemp, 2, true, true, true);
		     document.frmMortgage.txtTotal.value = FormatCurrency(Math.floor((vMonths*vTemp)*100)/100, 2, true, true, true);
		}
		
		function FormatCurrency(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
		{
			var tmpStr = new String(FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas));
		
			if (tmpStr.indexOf("(") != -1 || tmpStr.indexOf("-") != -1) {
				// We know we have a negative number, so place '$' inside of '(' / after '-'
				if (tmpStr.charAt(0) == "(")
					tmpStr = "($"  + tmpStr.substring(1,tmpStr.length);
				else if (tmpStr.charAt(0) == "-")
					tmpStr = "-$" + tmpStr.substring(1,tmpStr.length);
		
				return tmpStr;
			}
			else
				return "" + tmpStr;		// Return formatted string!
		}
		
		function FormatNumber(num,decimalNum,bolLeadingZero,bolParens,bolCommas)
		{
		        if (isNaN(parseInt(num))) return "NaN";
		
			var tmpNum = num;
			var iSign = num < 0 ? -1 : 1;		// Get sign of number
		
			// Adjust number so only the specified number of numbers after
			// the decimal point are shown.
			tmpNum *= Math.pow(10,decimalNum);
			tmpNum = Math.round(Math.abs(tmpNum))
			tmpNum /= Math.pow(10,decimalNum);
			tmpNum *= iSign;					// Readjust for sign
		
		
			// Create a string object to do our formatting on
			var tmpNumStr = new String(tmpNum);
		
			// See if we need to strip out the leading zero or not.
			if (!bolLeadingZero && num < 1 && num > -1 && num != 0)
				if (num > 0)
					tmpNumStr = tmpNumStr.substring(1,tmpNumStr.length);
				else
					tmpNumStr = "-" + tmpNumStr.substring(2,tmpNumStr.length);
		
			// See if we need to put in the commas
			if (bolCommas && (num >= 1000 || num <= -1000)) {
				var iStart = tmpNumStr.indexOf(".");
				if (iStart < 0)
					iStart = tmpNumStr.length;
		
				iStart -= 3;
				while (iStart >= 1) {
					tmpNumStr = tmpNumStr.substring(0,iStart) + "," + tmpNumStr.substring(iStart,tmpNumStr.length)
					iStart -= 3;
				}
			}
		
			// See if we need to use parenthesis
			if (bolParens && num < 0)
				tmpNumStr = "(" + tmpNumStr.substring(1,tmpNumStr.length) + ")";
		
			return tmpNumStr;		// Return our formatted string!
		}
