Javascript to swap image
<p>I have a full image and a bunch of thumbnail images.  I want to replace the full image with the image link of whatever thumbnail was clicked.  Here is the code:  Thanks</p>

<pre><code>function swapImage() {
    var fullCoverImage = document.getElementById("full_cover");

    var linkedImage = this.childNodes[0];
    var thumbSource = linkedImage.getAttribute("src");

    var coverSource = fullCoverImage.getAttribute("src");

    var newSource = thumbSource.replace("_thumb","");
    fullCoverImage.setAttribute("src", newSource);  
}

&lt;a id="slide_thumb" onClick="swapImage();" href="Javascript:void(0);"&gt;&lt;img src="images/portfolio/fiction_001_thumb.png" /&gt;&lt;/a&gt;
&lt;a id="slide_thumb" onClick="swapImage();" href="Javascript:void(0);"&gt;&lt;img src="images/portfolio/fiction_002_thumb.png" /&gt;&lt;/a&gt;

&lt;img id="full_cover" src="images/portfolio/fiction_001.png" /&gt;
</code></pre>
