I have a main content area and a sidebar. In the sidebar I want to display various affiliate banner ads and/or Google ads. I found a free JavaScript that allows me to rotate various ads in whatever location I choose. The problem I'm having is that my pages vary in length and I'm looking for a way for the JavaScript to only fill ads to the length on my content area for each page. Otherwise I will either have a lot of unwanted whitespace on some pages or a long length of ads in the sidebar that push out the length of shorter pages. Either way it look bad.

Here's a link to my page that is work. http://www.christian-life-advisor.com/indexNewTest.html

The JavaScript rotation I found requires that I place the following code for each instance of an ad that I want to appear. Since I don't know how many each page needs without manually coding each page this is not an elegant solution. Any ideas? I only barely understand JavaScript at this time and have no idea how to proceed on my own.

<script type="text/javascript">

I really appreciate any help you folks are willing to provide.