
var cost_of_one_well    = 3000.00;
var people_per_well     = 750;

var cost_of_goat        = 75.00;
var cost_of_pig         = 195.00;

var cost_of_startup     = 172.00;

var cost_of_education   = 3.55;

function calculate()
{
    var salary = $F($('salary')).gsub(/\D/, '');
    var one_percent = salary * 0.01;

    var number_of_wells = one_percent / cost_of_one_well;
    $('number-of-wells').update(sprintf("%.2f", number_of_wells));
    $('people-from-wells').update(Math.round(number_of_wells * people_per_well));

    $('number-of-goats').update(Math.round(one_percent / cost_of_goat));
    $('number-of-pigs').update(Math.round(one_percent / cost_of_pig));

    $('number-of-startups').update(Math.round(one_percent / cost_of_startup));

    $('number-of-children').update(Math.round(one_percent / cost_of_education));
}

