function compute() {

var amount;

var rates = new Array( 0, 10, 15, 20, 25, 30 );
var visit = new Array( 0, 35, 70, 100, 125, 145  );

function formatNumber(expr, decplaces) {

	var str = "" + Math.round(eval(expr) * Math.pow(10,decplaces));
		while (str.length <= decplaces) {
		str = "0" + str;
	}

	var decpoint = str.length - decplaces;
	
	return str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);
	}

	amount = visit[ document.poop.visit.value ]  + ( document.poop.dogs.value * rates[ document.poop.visit.value ] );

	document.poop.monthly.value = formatNumber( amount, 2 );

}

