changing a banner ad based on visible tab
<p>I got some help on this today, but had to modify it and need to clean it up. basically I have a tabbed interface and I need to show the appropriate banner ad based on what tab is visible. There are only two groups, brokers and all others. So if the broker tab (#BrokContent) is selected (both on page load and when you click it when another tab is visible) show the broker banner. All other times show the other banner.</p>

<p>HTML - the banner ads</p>

<pre><code>&lt;div id="brokerAd"&gt;
    &lt;h3 class="featured"&gt;Featured PARTNER&lt;/h3&gt;
    &lt;div class="bannerTop"&gt;Im the broker banner
    &lt;!-- brokerAd End --&gt;&lt;/div&gt;
&lt;!-- /bannerContain --&gt;&lt;/div&gt;

&lt;div id="bannerContain"&gt;
    &lt;h3 class="featured"&gt;Featured PARTNER&lt;/h3&gt;
    &lt;div class="bannerTop"&gt;Other banners
    &lt;!-- AdSpeed.com End --&gt;&lt;/div&gt;
&lt;!-- /bannerContain --&gt;&lt;/div&gt;
</code></pre>

<p>and the JS that needs simplifying</p>

<pre><code>if ($("#BrokContent").is(":visible")) {
          $("#brokerAd").show();
          $("#bannerContain").hide();
        } else {
          $("#bannerContain").show();
          $("#brokerAd").hide();
        }

        $("ul#flowtabs li a").click(function(){
            var bcVisible = $("#BrokContent").is(":visible");
            $("#brokerAd").toggle(bcVisible);
            $("#bannerContain").toggle(!bcVisible);
        });
</code></pre>
