... così, ad occhio:

codice:
function controlla(f){ 
if (f.checked) {
(document.getElementById("rag_soc2").style.visibility = "visible") 
(document.getElementById("txt_rag_soc2").style.visibility = "visible") 
(document.getElementById("pivacf2").style.visibility = "visible") 
}
else { 
(document.getElementById("rag_soc2").style.visibility = "hidden") 
(document.getElementById("txt_rag_soc2").style.visibility = "hidden") 
(document.getElementById("pivacf2").style.visibility = "hidden") 
}
}
Ciao !