Am I correct in believing you want to hide/show DIVs so that when they are not visible they do not take up page space? If so, you can use "display: none" to remove a DIV from the page's flow, so it doesn't take up any space, and "dispay: inline" or "display: block" to show it again. You can also set the element.style.display property using JavaScript.
If I have misinterpreted what you want, please post code or a URL so I can see the problem.
Adam