ovviamente:

...if (document.all.mod_dim.value == 3)...