If you want the values to be calculated on page load then you will need to force a change event after load has completed
DEMO http://jsfiddle.net/a3aL6/1/
(function () {
function load2(){
document.getElementById("ga").onchange();
}
if (window.addEventListener) {
window.addEventListener('DOMContentLoaded', load2, false);
} else {
window.attachEvent('onload', load2);
}
} ());
If you want the values to change as a user changes the input, without haveing to lose focu on the element, then you could consider using onkeyup
instead of onchange
DEMO http://jsfiddle.net/a3aL6/2/
str_replace example
$pas_Sum = str_replace(',', '', $pa_sum['sumPA']);
$pas_Sum = number_format (pas_Sum, 2);