function calcSmokes(){

// GET VALUES FROM FORM, SET VALUE TO ONE IF THE VALUE IN THE FORM IS NOT A NUMBER

var years = (isNaN(document.wcbubba.years.value)) ? 1 : document.wcbubba.years.value;
var smokes = (isNaN(document.wcbubba.smokes.value)) ? 1 : document.wcbubba.smokes.value;
var price = (isNaN(document.wcbubba.price.value)) ? 1 : document.wcbubba.price.value;

// DO CALCULATION OF NUMBER OF CIGARETTES SMOKED ROUNDED TO WHOLE NUMBER

var smoked = parseInt(years * 365.25 * smokes);

// CALCULATE TODAY'S VALUE OF ALL CIGS ROUNDED TO TWO DECIMAL PLACES

var expense = parseInt(((smoked/20) * price) *100) / 100;

// CALCULATE WEIGHT OF TOBACCO IN GRAMS AND POUNDS TO TWO DECIMAL PLACES

var weight = parseInt((smoked * 0.68) *100) / 100;
var pounds = parseInt(((weight/1000) * 2.204) * 100) / 100;

var expout = 'You smoked approximately ' + smoked + ' cigarettes.<br>At current prices, that would cost $' + expense + '.<br>And the weight of the tobacco in all those cigarettes was ' + pounds + ' pounds (' + weight +' grams).';

document.getElementById('totals').innerHTML = expout;
}