Where are these variables declared (so I can make sense of the coding)?
$i
$n1
$n2
$j
$quotes
$checked
or any others used in tpl_checkout_shipping_default.php

Is there a FAQ file that tells how the code used in zencart is structured? I could probably avoid asking you tons of questions if I new the ideology of how it all fits together.