// JavaScript Document
function howMuch() { 
var weight,caratage,price;
weight = document.goldCalculator.weight.value;
caratage = document.goldCalculator.caratage.value;
answerBox = document.goldCalculator.total.value;
isITaNumber = isNaN(weight);
if (isITaNumber==true)
{
alert('That is not a number!');
}
else if (weight!="") 
{
	jQuery('#total').val("").css({background:"url(/calculator/ajax-loader.gif) no-repeat 0 0 #fff"})
	jQuery.post('/calculator/ajax.php?w='+weight+'&c='+caratage, function(data) {
	  jQuery('#total').val(data).css({background:"#fff"});
	});
	/*
firstResult = weight*caratage;
result=Math.round((firstResult*100))/100;
document.goldCalculator.total.value = result + "GBP";
*/
}
else
{
alert('Please enter your weight into the box!');
}

}

jQuery(document).ready(function(){
	jQuery('#weight').val("")
	jQuery('#total').val("")
})
