Toggle menu disappears
<p>Okay, I need some help.
I have tried the solutions found here but so far, none have seemed to fit.
Can someone please help me with keeping a sidenav submenu dropdown appearing once the mouse leaves the parent menu item so I can hover to select the link.  At the moment it just disappears ?</p>

<p>The .js file I have is as follows:</p>

<pre><code>window.onload = initAll;

function initAll() {
var allLinks = document.getElementsByTagName("a");

for (var i=0; i&lt;allLinks.length; i++) {
    if (allLinks[i].className.indexOf("sidenav_sub_popdown") &gt; -1) {
        allLinks[i].onclick = retFalse;                     
        allLinks[i].onmouseover = toggleMenu;
    }
}
}

function toggleMenu() {
var startMenu = this.href.lastIndexOf("/")+1;
var stopMenu = this.href.lastIndexOf(".");
var thisMenuName = this.href.substring(startMenu,stopMenu);

document.getElementById(thisMenuName).style.display = "block";      

this.parentNode.className = thisMenuName;       
this.parentNode.onmouseout = toggleDivOff;      
this.parentNode.onmouseover = toggleDivOn;      
}

function toggleDivOn() {
document.getElementById(this.className).style.display = "block";
}

function toggleDivOff() {
document.getElementById(this.className).style.display = "none";
}

function retFalse() {
return false;
}
</code></pre>

<p>The html I have is:</p>

<pre><code>                &lt;div class="sidenav"&gt;

                &lt;menu&gt;
                    &lt;ul&gt;
                    &lt;li&gt;&lt;a href="about_us_company.php" title="Company Information" &gt;&lt;h2&gt;Company Information &lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="about_us_vision.php" title="Our Vision" &gt;&lt;h2&gt;Our Vision &lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="about_us_team.php" title="Our Team" class="sidenav_sub_popdown"&gt;&lt;h2&gt;Our Team &lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;ul id="about_us_team"&gt;
                        &lt;li&gt;&lt;a href="about_us_steve.php" title="Steve Malcolm" &gt;&lt;h4&gt;&amp;#187 Steve Malcolm &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_anita.php" title="Anita Malcolm" &gt;&lt;h4&gt;&amp;#187 Anita Malcolm &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_dave.php" title="David Stanley" &gt;&lt;h4&gt;&amp;#187 David Stanley &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_ian.php" title="Ian Wallace" &gt;&lt;h4&gt;&amp;#187 Ian Wallace &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_terence.php" title="Terence Price" &gt;&lt;h4&gt;&amp;#187 Terence Price &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_michael.php" title="Michael Malcolm" &gt;&lt;h4&gt;&amp;#187 Michael Malcolm &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_kristy.php" title="Kristy Beer" &gt;&lt;h4&gt;&amp;#187 Kristy Beer &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_natalie.php" title="Natalie Kay" &gt;&lt;h4&gt;&amp;#187 Natalie Kay &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;
                        &lt;li&gt;&lt;a href="about_us_sarah.php" title="Sarah Reed" &gt;&lt;h4&gt;&amp;#187 Sarah Reed &lt;/h4&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt; 
                        &lt;/ul&gt;
                    &lt;li&gt;&lt;a href="about_us_qualifications.php" title="Qualifications" &gt;&lt;h2&gt;Qualifications &lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;li&gt;&lt;a href="about_us_partners.php" title="Industry Partners" &gt;&lt;h2&gt;Industry Partners &lt;/h2&gt;&lt;/a&gt;&lt;/li&gt;
                    &lt;/ul&gt;
                &lt;/menu&gt;
</code></pre>

<p>Trusting this is enough information.
Thanks :)
Laura</p>
