I'm trying to calculate the Subtotal of several values located in text boxes in a form "securemail". The text boxes [17 of them] are named 1Total, 2Total, 3Total, 4Total, etc. Here's the code:

function UpdateSubTotal() {
var SubTotal = 0;
var k;
for (i = 1; i <= 17; i++) {
k = document.securemail.elements[i + "Total"].value;
SubTotal = SubTotal + k;
document.securemail.elements["Subtotal"].value = SubTotal;

The problem I've encountered is this: if, for example, all of the text boxes have a value of zero, the SubTotal would come out 00000000000000000. I'm assuming that this is caused because it's treating them as strings instead of integers. How do I solve this problem? I've never read a JavaScript book or tutorial - I've learned it all through code, so I've missed out on a bunch of fundamental things, such as this.

Thanks in advance for any and all help.