Looks like SSI_GetValue is coming up a little short for you. It believes these input elements are meant to store text rather than a number, so it returns strings, which the custom JavaScript then concatenates rather than sums. There are a few ways we could address this, but the simplest would be to just surround the SSI_GetValue calls with the Number function to convert them.
var var1 = Number(SSI_GetValue ("Q7_r1"));