Calculates interest payments on a loan using JavsScript, with PHP fallback.