<!-- hide from older browsers
//check for valid input
function compareDeal() {
var repeat = document.raterebate.length - 1; // last field is result
for  (i = 0; i < repeat; i++) {
	// check that everthing is filled in
	noAnswer = 0;
	if (document.raterebate[i].value == "") {
		alert("Please fill in all fields");
		document.raterebate[i].focus();
		noAnswer = 1;
		i = repeat;
		} else {
	// check for numeric values where needed
	if (document.raterebate[i].name != "moyears") {
		if (isNaN(document.raterebate[i].value)) {
			alert("Please enter numbers only.  Do not use '$', '%' or commas");
			document.raterebate[i].focus();
			document.raterebate[i].select();
			i = repeat;
			}
		}
	}
	} 
//convert months to years
termYears = document.raterebate.term.value;
if (document.raterebate.moyears[1].checked) {
	termYears = termYears/12;
	}
// get interest multiplier
rebInt = document.raterebate.rebint.value;
	if (rebInt >= .3) {
		rebInt = rebInt/100;
		}
rebnoInt = document.raterebate.rebnoint.value;
	if (rebnoInt >= .3) {
		rebnoInt = rebnoInt/100;
		}
intDiff =  rebnoInt - rebInt;
	if (intDiff < 0) {
	intDiff = -intDiff;
	}
calcAmt = document.raterebate.loanamt.value/2;
bestDeal = calcAmt * intDiff * termYears - document.raterebate.rebamt.value;
if (isNaN(bestDeal) || noAnswer == 1) {
	document.raterebate.result.value = "";
	} else {
// Give em the answer
	bestDeal = Math.round(bestDeal);
	if (bestDeal == 0) {
		bestDeal = "The number comes out the same either way.  Think about which institution you really want to deal with on your loan for the next several months.";
		}
	if (bestDeal > 0) {
		bestDeal = "You might save about $" + bestDeal + " by taking the lower interest rate if you qualify.  Dealers may find reasons to steer you away from the special rate.  Read the StreetWise Auto Buying Guide before you sign anything.";
		}
	if (bestDeal < 0) {
		bestDeal = -bestDeal;
		bestDeal = "You should save about $" + bestDeal + " by pocketing the rebate and using regular financing.  Make sure you read the StreetWise Auto Buying Guide before you shop.  Follow our advice and you'll lower the purchase price, too.";
		}		
		
//	}
			

	document.raterebate.result.value = bestDeal;
	}


}

// -->
