jQuery unintentional delay when hiding/showing content
<p>When you go to a specific URL there the initial content gets loaded and then it interprets the url params, then the content changes. </p>

<p>On my local machine this happens "lickety split", aka so fast you can't see any delay. However, if you go to that URL after about 5 seconds the content finally hides and shows the correct content. The js is below and here is a little html snippet that is pretty close.</p>

<p>example URL: www.example.com/page1.aspx?nav=2012?id=113&amp;pid=2</p>

<p><strong>HTML</strong>:</p>

<pre><code>  &lt;div id="default"&gt;content&lt;/div&gt;   
  &lt;div id="mobile2012" style="display:none;"&gt;content&lt;/div&gt;
</code></pre>

<p><strong>Javascript</strong>:</p>

<pre><code>var querystring = location.search.replace('?', '').split('?');
var queryObj = {};
for (var i = 0; i &lt; querystring.length; i++) {
    var name = querystring[i].split('=')[0];
    var value = querystring[i].split('=')[1];

    queryObj[name] = value;
}
////////
var subNavDestination = queryObj["nav"];
////////
urlParams(subNavDestination);
function urlParams(subNavDestination) {
    var displayInformation;

    switch (subNavDestination) {
        case 'about': displayInformation = "AboutEarthquakeIns";
            break;
        case 'homeowner': displayInformation = "Homeowner2012Content";
            break;
        case 'renter': displayInformation = "Renter2012Content";
            break;
        case 'mobilehome': displayInformation = "Mobilehome2012Content";
            break;
        case 'condo': displayInformation = "Condominium2012Content";
            break;
        case '2011': displayInformation = "pdf2011";
            break;
        case '2012': displayInformation = "pdf2012";
            break;
        default: displayInformation = "GeneralContent";
    }

    if (displayInformation != "AboutEarthquakeIns") {
        //$('#PolicyTypes2012 .sideNavPolicyType').slideToggle();
        $('#PolicyTypes2011 .sideNavCoverage').slideUp();
    }

    if (displayInformation == "pdf2011") {
        controlContentVisibility("pdf2011");
        $('#PolicyTypes2011 .sideNavPolicyType').slideToggle();
        $('#PolicyTypes2011 .sideNavCoverage').slideUp();
        setActiveLink();
        setSelectedPolicyType();
        hideYearSubMenus(2012);
    }
    else if (displayInformation == "pdf2012") {
        controlContentVisibility("pdf2012");
        $('#PolicyTypes2012 .sideNavPolicyType').slideToggle();
        $('#PolicyTypes2012 .sideNavCoverage').slideUp();
        setActiveLink();
        setSelectedPolicyType();
        hideYearSubMenus(2011);
    }

    controlContentVisibility(displayInformation);
}
</code></pre>
