Well to clear up a popular misconception, it's Javascript, not Java. The 2 are not related.
Yes, you use either document.getElementById('idname').style.visibility or you can use
document.getElementById('idname').style.display="none" or "block"
Or since they're in a form, you can reference like this:
document.forms[0].elements[elementNumber].style
Put a 0 in place of element number for the 1st element,1 for the 2nd, 2 for the 3rd, etc.