function isNum(passedVal) {				if (passedVal == "") {				return false			}			for (i=0; i<passedVal.length; i++) {				if (passedVal.charAt(i) < "0") {					return false				}				if (passedVal.charAt(i) > "9") {					return false				}			}			return true		}				function validNumber(blah) {								if (blah == "") {				return true			}			if (isNum(blah)) {						// Check if blah is numeric				return true			}			return false		}function stampduty(){var topay;if (!validNumber(document.stamp_duty.houseprice.value)) {				alert("Please enter a property value in numbers only")				document.stamp_duty.houseprice.focus()				document.stamp_duty.houseprice.select()				return false			}houseprice = Number(document.stamp_duty.houseprice.value);if (houseprice <= 0)  {alert ("Please enter a property value greater than zero");document.stamp_duty.houseprice.value = '';document.stamp_duty.pay.value = '';return;}houseprice = Math.round(houseprice*100)/100;//disadvantaged = (document.stamp_duty.disadvantaged[0].checked) ? 175372 : 175373;//disadvantaged = (document.stamp_duty.disadvantaged[0].checked);//disadvantaged = (document.stamp_duty.disadvantaged[0].value);if (document.stamp_duty.disadvantaged[1].checked) {//this means they are in a disadvantaged area//if (houseprice <= disadvantaged) {//topay = 0;//} if (houseprice <= 150000) {topay = 0;} //if (houseprice > disadvantaged && houseprice <= 250000) {//topay = houseprice * 0.01;//} if (houseprice > 150000 && houseprice <= 250000) {topay = houseprice * 0.01;}if (houseprice > 250000 && houseprice <= 500000) {topay = houseprice * 0.03;}if (houseprice > 500000 && houseprice <= 1000000) {topay = houseprice * 0.04;}if (houseprice > 1000000) {topay = houseprice * 0.05;}}if (document.stamp_duty.disadvantaged[0].checked) {//this means they are not in a disadvantaged area//if (houseprice <= disadvantaged) {//topay = 0;//} if (houseprice <= 125000) {topay = 0;} //if (houseprice > disadvantaged && houseprice <= 250000) {//topay = houseprice * 0.01;//} if (houseprice > 125000 && houseprice <= 250000) {topay = houseprice * 0.01;}if (houseprice > 250000 && houseprice <= 500000) {topay = houseprice * 0.03;}if (houseprice > 500000 && houseprice <= 1000000) {topay = houseprice * 0.04;}if (houseprice > 1000000) {topay = houseprice * 0.05;}}document.stamp_duty.pay.value = topay;//document.stamp_duty.pay.value = disadvantaged;}
