I moved this thread to a new one so that it does not get too confusing for the other individual that seems to have a simpler problem. Here is a link to the original thread for reference:
showthread.php?p=50755#post50755
So it seems that you have show regions that you are hiding and showing based on URL parameters. Are you not getting the correct result with the code that you posted? What is the current result that you are getting and how does it differ from the desired result? With this info I think we will better be able to give some advice on your situation.