3 totals & pulls from table for calcs in ajax

Two user entered numbers. Then it does 3 calculations and displays the
three totals in fields. It also pulls a number from a custom table &
includes this in one of the calculations
syntax error, unexpected 'chartdiv' (T_STRING)

In am charts example