/**
 * @author tward
 * 
 * Excel formula 1 =H4*H6*12*H5/1000*H9
 * Excel formula 2 =H7*H8*12*H5/1000*H9
 * Excel formula 3 =h11+h12
 * 
 */

function dothemath()
{
    var v = document.getElementsByTagName('input');
	ioffset = 2; //on the martin homepage there are two pre-existing input fields
    v[6+ioffset].value = Math.round((v[0+ioffset].value * v[2+ioffset].value * 12 * (v[1+ioffset].value/1000)) * v[5+ioffset].value);
    v[7+ioffset].value = Math.round((v[3+ioffset].value * v[4+ioffset].value * 12 * (v[1+ioffset].value/1000)) * v[5+ioffset].value);
    v[8+ioffset].value = parseInt(v[6+ioffset].value) + parseInt(v[7+ioffset].value);
    return false;
}
