codice:
var temp = parseInt(rig[i].value,10);
Parentesi quadre per l'indice di un array, please! :-)

HTH
Zappa