$(document).ready(function(){

	// Calculate sample shipping amount
	$("#samplecalculate").click(function() {
		
		// Get amount from text box
		itemAmount = parseFloat($("#sampletotal").val().replace(/\$|\s/g, ""));
		
		// Check amount
		if (isNaN(itemAmount)) {
			alert("Hey! Enter a valid amount!");
			return false;
		}
		if (itemAmount > 2000) {
			alert("Really!? You're buying that much?");
			return false;
		}
		
		// Calculate shipping method costs
		itemAmount = Math.round(itemAmount * 100);
		
		groundAmount = "Free!";
		
		selectAmount = 1095 + (Math.floor(itemAmount / 2500) * 100);
		nextDayAmount = Math.round((selectAmount * 2) / 100) * 100 - 5;
		selectAmount = "$" + (selectAmount / 100);
		nextDayAmount = "$" + (nextDayAmount / 100);
		
		// Write them
		$("#sampleshipping .ground").text(groundAmount);
		$("#sampleshipping .2-3select").text(selectAmount);
		$("#sampleshipping .next-day").text(nextDayAmount);
		
	})

});