title: Replace image and image title/alt text with Javascript
body: <p>I currently have the following code that replaces a big image when a thumbnail is clicked:</p>
  
  <p>Javascript:</p>
  
  <pre><code>    img1 = new Image();
      img1.src = '{$smarty.const.dir_images}/l_{$this_page.image1}';
      img2 = new Image();
      img2.src = '{$smarty.const.dir_images}/l_{$this_page.image2}';
  </code></pre>
  
  <p>Thumbnail HTML:</p>
  
  <pre><code>    &lt;a href="javascript:document['mainimage'].src = img1.src; javascript:void(0);"&gt;&lt;img src="{$smarty.const.dir_images}/t_{$this_page.image1}" title="" alt=""/&gt;&lt;/a&gt;
      &lt;a href="javascript:document['mainimage'].src = img2.src; javascript:void(0);"&gt;&lt;img src="{$smarty.const.dir_images}/t_{$this_page.image2}" title="" alt=""/&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Large Image HTML:</p>
  
  <pre><code>    &lt;img id="mainimage" name="mainimage" src="{$smarty.const.dir_images}/l_{$this_page.image1}" title="{$this_page.image1text}" alt="{$this_page.image1text}" /&gt;
  </code></pre>
  
  <p>What I want to do is not only change the large image source when the thumbnail is clicked but the alt &amp; title tags as well.</p>
  
  <p>Thanks in advance</p>