Javacript not work on chrome while its enable in settings
<p>This script is working only on firefox and in chrome it gives me that error:</p>

<p><code>Uncaught TypeError: Cannot call method 'substring' of undefined</code></p>

<pre class="lang-html prettyprint-override"><code>&lt;script type="text/javascript"&gt;
    function hidediv()
    {
        document.getElementById('divright').style.display = 'none';
        document.getElementById('divleft').style.margin = "0 auto";
        document.getElementById('divleft').style.cssFloat = "none";
    } 

    function showdiv()
    {
        document.getElementById('divright').style.display = 'block';
        document.getElementById('divleft').style.cssFloat = "left";
    } 
&lt;/script&gt;

&lt;div class="right_links"&gt;
    &lt;nav class="reader_nav"&gt;&lt;!-- html5 nav tag --&gt;
        &lt;span class="content" id="show4" onmouseover="tooltip.show('Content', 300);" onmouseout="tooltip.hide();" &gt;&lt;/span&gt;
        &lt;span id="show5" class="prefrance" onmouseover="tooltip.show('Settings', 250);" onmouseout="tooltip.hide();"  &gt;&lt;/span&gt;
        &lt;span id="show"  class="search" onmouseover="tooltip.show('Search', 210);" onmouseout="tooltip.hide();"&gt;&lt;/span&gt;
        &lt;span id="show2"  class="about" onmouseover="tooltip.show('About this book', 204);" onmouseout="tooltip.hide();"&gt;&lt;/span&gt;
        &lt;span id="show3"  class="help" onmouseover="tooltip.show('Help', 120);" onmouseout="tooltip.hide();" &gt;&lt;/span&gt;
    &lt;/nav&gt;
&lt;/div&gt;
</code></pre>
