title: image src from url?
body: <p>in my website I am using the function bellow to navigate through images.(http://jsut4fun.site40.net/2.html)
  the function adds 1 to the url so that it will go to the next page. as you can see I have to rename each webpage and image then I have to change the code of the webpage for each image number. is there any easy way to store the number from the url in the src of the image so that I do not have to change the code ?
  generally do you have any ideas that can help me do this better ?
  I still a javascript noob :)</p>
  
  <pre><code>&lt;img src="Images/100.jpg"&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>