There is an example of a calculator that was borrowed from here:
http://javascript.internet.com/calculators/5-function.html
=