function mtgIns(LnNbr)   //JavaScript Version
	{
	var Loanterm = document.forms[0].Loanterm1.value;
	var DwnPmtPct = document.forms[0].DwnPmtPercent.value;
	var mtgInsFactor;
		
	if ((Loanterm == 40) || (Loanterm == 30)){
		if ((DwnPmtPct >= 0) && (DwnPmtPct < 5)){
				mtgInsFactor = .96;
				}
		if ((DwnPmtPct >= 5)&& (DwnPmtPct < 10)) {
				mtgInsFactor = .78;
				}
		if ((DwnPmtPct >= 10)&& (DwnPmtPct < 15)){
				mtgInsFactor = .52;
				}
		if ((DwnPmtPct >= 15)&& (DwnPmtPct < 20)){
				mtgInsFactor = .32;
				}
		if (DwnPmtPct >= 20) {
				mtgInsFactor = 0;
				}
	}

	if (Loanterm == 25) {
		if ((DwnPmtPct >= 0) && (DwnPmtPct < 5)) {
				mtgInsFactor = .85;
				}
		if ((DwnPmtPct >= 5)&& (DwnPmtPct < 10)) {
				mtgInsFactor = .67;
				}
		if ((DwnPmtPct >= 10)&& (DwnPmtPct < 15)){
				mtgInsFactor = .41;
				}
		if ((DwnPmtPct >= 15)&& (DwnPmtPct < 20)){
				mtgInsFactor = .21;
				}
		if (DwnPmtPct >= 20) {
				mtgInsFactor = 0;
				}
	}
	
	if ((Loanterm == 20) || (Loanterm == 15) || (Loanterm == 10)) {
		if ((DwnPmtPct >= 0) && (DwnPmtPct < 5)) {
				mtgInsFactor = .80;
				}
		if ((DwnPmtPct >= 5)&& (DwnPmtPct < 10)) {
				mtgInsFactor = .56;
				}
		if ((DwnPmtPct >= 10)&& (DwnPmtPct < 15)){
				mtgInsFactor = .23;
				}
		if ((DwnPmtPct >= 15)&& (DwnPmtPct < 20)){
				mtgInsFactor = .19;
				}
		if (DwnPmtPct >= 20) {
				mtgInsFactor = 0;
				}
	}
	
	if (LnNbr == 1) {
	document.forms[0].mtgIns1.value = mtgInsFactor;
	}
	if (LnNbr == 2) {
	document.forms[0].mtgIns2.value = mtgInsFactor;
	}
	}

