function ResetAll() {
	form1.reset();
	form2.reset();
	form3.reset();
	form4.reset();
	form5.reset();
	form6.reset();
	form7.reset();
	form8.reset();
	form9.reset();
	form10.reset();
}

function submitButtonRollover(action) {
	document.getElementById('calculateButton').style.cursor='pointer';
	if (action=='over') {
		document.getElementById('calculateButton').className='colortwobackground colortwofontcolor' ; 
	}
	else {
		document.getElementById('calculateButton').className='oragenBG white10' ; 
	}
}
function floor(number){
  return Math.floor(number*Math.pow(10,2))/Math.pow(10,2);
}

function replaceChar(inputString){			
	// remove the commas
	outputString = inputString.replace(",","");
	if (outputString.match(",") != null) {
		replaceChar(outputString);
	}
	// return the variable after removing commas
	return outputString;
}		

function dosum(){
	// LM 09Dec2005: call the replaceChar function to remove any commas	from the loan amount
	var loanAmount = replaceChar(document.temps.LA.value);		
	var mi = document.temps.IR.value / 1200;
	var base = 1;
	var mbase = 1 + mi;
	for (i=0; i<document.temps.YR.value * 12; i++){
	  base = base * mbase
	}
	document.temps.PI.value = floor(loanAmount * mi / ( 1 - (1/base)))
	document.temps.MT.value = floor(document.temps.AT.value / 12)
	document.temps.MI.value = floor(document.temps.AI.value / 12)
	var dasum = loanAmount * mi / ( 1 - (1/base)) +
		document.temps.AT.value / 12 + 
		document.temps.AI.value / 12;
	document.temps.MP.value = floor(dasum);
	
	return false;
}
<!-- //###################### STAMP DUTY ###########################
function select_item(name, value) {
	this.name = name;
	this.value = value;
}

function get_selection(select_object) {
	contents = new select_item();
	for(var i=0;i<select_object.options.length;i++) {
		if(select_object.options[i].selected == true) {
			contents.name = select_object.options[i].text;
			contents.value = select_object.options[i].value;
		}
	}
	return contents;
}

function stampduty(formfield) {
	var amount = formfield.amount.value;
	var state = get_selection(formfield.state);

	if (amount == "") {
		window.alert("You have not entered a value!");
	}
	if (amount == "") {
		amount = 0;
	}
	if ((amount % 100) != 0 ) {
		var mod = eval(100-(amount % 100));
		amount = -(-amount - mod);
	}
	if (state.value == "VIC") {
						
			//frm.vicSD.value = 0;
			if (amount <= 20000) {var CalcSD = eval(((amount)/100)*1.4);}
			else if ((amount > 20000) && (amount < 115000)) {var CalcSD = eval((((amount - 20000)/100)*2.4) + 280);}
			else if ((amount >= 115000) && (amount < 870000)) {var CalcSD = eval((((amount - 115000)/100)*6) + 2560);}
			else {var CalcSD = eval(((amount)/100)*5.5);}
			var duty = CalcSD;

	
		if (amount <= 20000) {
			var duty = eval(((amount)/100)*1.4);
		}
		else if ((amount > 20000) && (amount <= 115000)) {
			var duty = eval((((amount - 20000)/100)*2.4) + 280);
		}
		else if ((amount > 115000) && (amount <= 400000)) {
			var duty = eval((((amount - 115000)/100)*5) + 2560);
		}
			else if ((amount > 400000) && (amount <= 500000)) {
			var duty = eval((((amount - 400000)/100)*6) + 16810);
		}
		else if ((amount > 500000) && (amount <= 870000)) {
			var duty = eval((((amount - 500000)/100)*6) + 25660);
		}
		else {
			var duty = eval(((amount)/100)*5.5) ;
		}
	}
	
	 if (state.value == "NSW") {
		if (amount <= 14000) {
			var duty = eval((amount/100)*1.25);
		}
	
		else if ((amount > 14000) && (amount <= 30000)) {
			var duty = eval((((amount - 14000)/100)*1.5) + 175);
		}
	
		else if ((amount > 30000) && (amount <= 80000)) {
			var duty = eval((((amount - 30000)/100)*1.75) + 415);
		}
	
		else if ((amount > 80000) && (amount <= 300000)) {
			var duty = eval((((amount - 80000)/100)*3.5) + 1290);
		}
	
		else if ((amount > 300000) && (amount <= 1000000)) {
			var duty = eval((((amount - 300000)/100)*4.5) + 8990);
		}
	
		else {
			var duty = eval((((amount - 1000000)/100)*5.5) + 40490);
		}	
	}
	else if (state.value == "ACT") {
	
		if (amount <= 14000) {
			var duty = eval((amount/100)*1.25);
		}
	
		else if ((amount > 14000) && (amount <= 30000)) {
			var duty = eval((((amount - 14000)/100)*1.5) + 175);
		}
	
		else if ((amount > 30000) && (amount <= 60000)) {
			var duty = eval((((amount - 30000)/100)*2) + 415);
		}
	
		else if ((amount > 60000) && (amount <= 100000)) {
			var duty = eval((((amount - 60000)/100)*2.5) + 1015);
		}
		else if ((amount > 100000) && (amount <= 300000)) {
			var duty = eval((((amount - 100000)/100)*3.5) + 2015);
		}
	
		else if ((amount > 300000) && (amount <= 1000000)) {
			var duty = eval((((amount - 300000)/100)*4.5) + 9015);
		}
	
		else {
			var duty = eval((((amount - 1000000)/100)*5.5) + 40515);
		}
	}
	
	else if (state.value == "QLD") {
		// ceil here to raise to the next 100$
		 amount = (Math.ceil(amount/100)) * 100;
		if (amount <= 20000) {
			var duty = eval((amount/100)*1.5);
		}
		else if ((amount > 20000) && (amount <= 50000)) {
			var duty = eval((((amount - 20000)/100)*2.25) + 300);
		}
		else if ((amount > 50000) && (amount <= 100000)) {
			var duty = eval((((amount - 50000)/100)*2.75) + 975);
		}
		else if ((amount > 100000) && (amount <= 250000)) {
			var duty = eval((((amount - 100000)/100)*3.25) + 2350);
		}
		else if ((amount > 250000) && (amount <= 500000)) {
			var duty = eval((((amount - 250000)/100)*3.5) + 7225);
		}
		// changed rate as of 1 jul 2006
		else if ((amount > 500000) && (amount <= 700000)) {
			var duty = eval((((amount - 500000)/100)*4.00) + 15975);
		}
		// changed rate as of 1 jul 2006
		else {
			var duty = eval((((amount - 700000)/100)*4.50) + 23975);
		}
	}
	
	else if (state.value == "SA") {
	
		if (amount <= 12000) {
			var duty = eval((amount/100)*1);
		}
	
		else if ((amount > 12000) && (amount <= 30000)) {
			var duty = eval((((amount - 12000)/100)*2) + 120);
		}
	
		else if ((amount > 30000) && (amount <= 50000)) {
			var duty = eval((((amount - 30000)/100)*3) + 480);
		}
	
		else if ((amount > 50000) && (amount <= 100000)) {
			var duty = eval((((amount - 50000)/100)*3.5) + 1080);
		}
	
		else if ((amount > 100000) && (amount <= 500000)) {
			var duty = eval((((amount - 100000)/100)*4) + 2830);
		}
	
		else if ((amount > 500000) && (amount <= 1000000)) {
			var duty = eval((((amount - 500000)/100)*4.5) + 18830);
		}
	
		else {
			var duty = eval((((amount - 1000000)/100)*5) + 41330);
		}	
	}
	
	else if (state.value == "TAS") {
	
		if (amount <= 1300) {
			var duty = 20;
		}
		else if ((amount > 1300) && (amount <= 10000)) {
			var duty = eval((amount/100)*1.5);
		}
	
		else if ((amount > 10000) && (amount <= 30000)) {
			var duty = eval((((amount - 10000)/100)*2) + 150);
		}
	
		else if ((amount > 30000) && (amount <= 75000)) {
			var duty = eval((((amount - 30000)/100)*2.5) + 550);
		}
	
		else if ((amount > 75000) && (amount <= 150000)) {
			var duty = eval((((amount - 75000)/100)*3) + 1675);
		}
	
		else if ((amount > 150000) && (amount <= 225000)) {
			var duty = eval((((amount - 150000)/100)*3.5) + 3925);
		}
	
		else {
			var duty = eval((((amount - 225000)/100)*4) + 6550);
		}	
	}
	
	else if (state.value == "WA") {
		if (amount <= 80000) {
			var duty = eval((amount/100)*2);
		}
	
		else if ((amount > 80000) && (amount <= 100000)) {
			var duty = eval((((amount - 80000)/100)*3) + 1600);
		}
	
		else if ((amount > 100000) && (amount <= 250000)) {
			var duty = eval((((amount - 100000)/100)*4) + 2200);
		}
	
		else if ((amount > 250000) && (amount <= 500000)) {
			var duty = eval((((amount - 250000)/100)*5) + 8200);
		}
	
		else {
			var duty = eval((((amount - 500000)/100)*5.4) + 20700);
		}		
	}
	
	else if (state.value == "NT") {	
		if (amount <=500000) {
			newamount = eval(amount / 1000);
			var duty = eval((0.065 * Math.pow(newamount,2)) + (21 * newamount));
		}
	
		else {
			var duty = eval(5.4 * (amount/100));
		}
	}
	duty = Math.round(duty);
	formfield.duty.value = duty;
	return false;
}
