Content switching with Javascript
<p>I have 3 sections of specific interest on my home page.
What I'd like to do is set up links that call a javascript function that makes sure 2 sections are hidden and ONLY the section whose button was clicked is displayed.</p>

<p>Here's my code:</p>

<pre><code>            &lt;div id="idc" class="leftFloat"&gt;&lt;span id="title" class="title1"&gt;Introduction&lt;/span&gt;&lt;/div&gt;
            &lt;div class="rightFloat"&gt;
                &lt;div id="agri"&gt;&lt;a onclick="ContentSwitch('Agri');"&gt;Agri Industries&lt;/a&gt;&lt;/div&gt;
                &lt;div id="ict"&gt;&lt;a onclick="ContentSwitch('ict');"&gt;ICT Investments&lt;/a&gt;&lt;/div&gt;
                &lt;div id="intro"&gt;&lt;a onclick="ContentSwitch('intro');"&gt;Introduction&lt;/a&gt;&lt;/div&gt;
            &lt;/div&gt;

            &lt;div id="agriContent" style="display: none;"&gt;
                &lt;div class="vrtlay_both"&gt;AGRI INDUSTRIES&lt;/div&gt;
            &lt;/div&gt;

            &lt;div id="ictContent" style="display: none;"&gt;
                &lt;div class="vrtlay_both"&gt;ICT INVESTMENTS&lt;/div&gt;
            &lt;/div&gt;

            &lt;div id="introContent"&gt;
                &lt;div class="vrtlay_both"&gt;ICT INVESTMENTS&lt;/div&gt;
            &lt;/div&gt;

            &lt;script type="text/javascript"&gt;
                function ContentSwitch(id) {
                    if (id = "Agri") {
                        if (document.getElementById("agriContent").style.display = "none") {
                            document.getElementById("agriContent").style.display = "block";

                            // Hide other content
                            document.getElementById("ictContent").style.display = "none";
                            document.getElementById("introContent").style.display = "none";

                            // Change the look of the title
                            document.getElementById("idc").style.backgroundColor = "rgb(0, 100, 0)";
                            document.getElementById("idc").style.color = "rgb(255, 255, 255)";
                            document.getElementById("title").innerHTML = "Agri Industries";
                        } else {
                            return;
                        }
                    }
                    if (id = "ict") {
                        if (document.getElementById("ictContent").style.display = "none") {
                            document.getElementById("ictContent").style.display = "block";

                            // Hide other content
                            document.getElementById("agriContent").style.display = "none";
                            document.getElementById("introContent").style.display = "none";

                            // Change the look of the title
                            document.getElementById("idc").style.backgroundColor = "rgb(36, 46, 111)";
                            document.getElementById("idc").style.color = "rgb(255, 255, 255)";
                            document.getElementById("title").innerHTML = "ICT Investments";
                        } else {
                            return;
                        }
                    }
                    if (id = "intro") {
                        if (document.getElementById("introContent").style.display = "none") {
                            document.getElementById("introContent").style.display = "block";

                            // Hide other content
                            document.getElementById("agriContent").style.display = "none";
                            document.getElementById("ictContent").style.display = "none";

                            // Change the look of the title
                            document.getElementById("idc").style.backgroundColor = "rgb(255, 255, 255)";
                            document.getElementById("idc").style.color = "rgb(0, 0, 0)";
                            document.getElementById("title").innerHTML = "Introduction";
                        } else {
                            return;
                        }
                    }
                }
            &lt;/script&gt;
</code></pre>

<p><strong>The javascript isn't firing.</strong><br>
I'm aware that this isn't the most elegant (or necessarily efficient) way of doing this, so if anyone can suggest a better way, I'm all ears.</p>

<p>Right now though, I'd just really like for this to work, but I can't see the problem.</p>
