Hi guys,

I am doing quite a complex application form, for part of it I need my users to select one radio button from 3 and to then be displayed with more options depending on which they chose, this is easy enough, but i need them to be able to do this several times, for example question 1 has 3 options that branch to 3 sets of 3 options...question 2 has 4 options that brances to 4 sets of 2 options...make sense? difficult to explain.. so iv got a code which works fine for a single expansion but as soon as i try to add another question, i get stuck as the javascript is name dependant...any ideas how i could rewrite this javascript so that it could include multipul names for multipul questions?

here is the code:
function hideAll(){
tag = document.getElementsByTagName("div");
	for(x=0;x<tag.length; x++){
		if(tag[x].getAttribute('id').indexOf("loc_") != -1){
			tag[x].style.display = "none";

function show(id){
el = document.getElementById('loc_' + id.value);
		el.style.display = "block";
if you could write the exact code out it would be very appreciative, as im not great at writting javascript.

Thanks for any and all help,