<!-- Begin
var i = 0; // wallwidth
var m = 0; // patternrepeat
var wh = 0; // wallheight
var fw = 0; // fabricwidth
var E = 0;
var F = 0;
var s = "0"; // string
var d = 0; // decimal place
var needed = 0; //total needed
var rollsneeded = 0;
function CalcA() {
if(document.calform.wallwidth.value=="" || document.calform.fabricwidth.value=="" || document.calform.patternrepeat.value=="" || document.calform.wallheight.value=="") {
alert("Please fill in all of the required fields.");
}
else {
wh = Number(document.calform.wallheight.value);
m = Number(document.calform.patternrepeat.value);
fw = Number(document.calform.fabricwidth.value);
i = Number(document.calform.wallwidth.value);
E = wh + m;
F = Math.ceil(i / fw);
needed = E * F;
rollsneeded = Math.ceil(needed / 10.05)
//alert("rolls:" + rollsneeded);
document.calform.total.value = needed;
document.calform.rollstotal.value = rollsneeded;

//d = String(needed).indexOf(".");
//s = String(needed).substring(0,(d+3));
//document.calform.total.value = "$" + s;
   }
}
//  End -->