javascript code is only working with mozzila firefox?
<p>On my website, I have an image viewer.  Every time the user click the left or right button the url of the page will be changed aromatically.  The image src uses a specific number from the url of the current page (the only number in the url).  Below I have provided the code I am using. The code is working perfectly, but it is only working on mozilla firefox. How can I fix it in order to make it work for all browsers. The problem on the other browsers is that the image do not show up.</p>

<pre><code>&lt;img src="" id="image" &gt;
    &lt;script type="text/javascript"&gt;
        document.getElementById('image').src ="Images/"+location.href.match(/\d+/)+".jpg";
        &lt;br/&gt;
        document.wrriteln(location.href.match(/\d+/)+".jpg");
    &lt;/script&gt;
    &lt;br/&gt;
    &lt;script&gt;
    var url = location.href;
    function nextImage() {
        return(url.replace(/(\d+)(\.html)$/, function(str, p1, p2) {
            return((Number(p1) + 1) + p2);
        }));
    }
    function prevImage() {
        return(url.replace(/(\d+)(\.html)$/, function(str, p1, p2) {
            return((Number(p1) - 1) + p2);
        }));
    }
    &lt;/script&gt;
      &lt;a href="javascript: window.location.href = prevImage();"&gt; &lt;img border="0" src="Assets/Left.png" /&gt;&lt;/a&gt;
      &lt;a href="javascript: window.location.href = nextImage();"&gt; &lt;img border="0" src="Assets/Right.png"/&gt;&lt;/a&gt;
</code></pre>
