function computerect()
{
    var rec = document.calculator;  // This is the form we'll we working with;
	if (checkContactInfo()){
	    rec.recvol.value = Math.round(((rec.recheight.value * rec.recwidth.value * rec.reclen.value) + (Math.PI * rec.recrad.value * rec.recrad.value * rec.reclen.value) - (4 * rec.recrad.value* rec.recrad.value * rec.reclen.value)) / 231) ;
	}
}
function computecyl()
{
    var cyl = document.calculator;  // This is the form we'll we working with;

	if (checkContactInfo()){
	    cyl.cylvol.value = Math.round(((Math.PI * cyl.cyllen.value * cyl.cyldia.value * cyl.cyldia.value) / 4) / 231) ;
	}
}
function checkContactInfo(){
	var msg="";
	if (!document.calculator.username || document.calculator.username.value==null || document.calculator.username.value==''){
		msg= msg + "You must supply your name to use the calculator.\n";
	}
	if (!document.calculator.email || document.calculator.email.value==null || document.calculator.email.value==''){
		msg= msg + "You must supply your email address to use the calculator.\n";
	}
	if (!document.calculator.phone || document.calculator.phone.value==null || document.calculator.phone.value==''){
		msg= msg + "You must supply your phone number to use the calculator.\n";
	}
	if (msg!=null && msg!=""){
		alert(msg);
		return false;
	}
	submitimg = new Image(1,1);
	var reqstr = "";
	var x=document.forms[0];
	for (var i=0;i<x.length;i++){
		reqstr= reqstr + x.elements[i].name + "=" + x.elements[i].value + "&";
	}
    submitimg.src = "metaltanks-calculator.php?" + reqstr;
	
	return true;
}