Open clicked thumbnail in a new tab
<p>I have the below code on one page:</p>

<pre><code>&lt;div id="prodoneid" class="prodcls"&gt;
    &lt;a href="javascript:void(changeIt('big.png', 'pagewrapid')());"&gt;
        &lt;img src="images/zara/thumbnails/1.png" alt="ZARA"/&gt;
    &lt;/a&gt;
&lt;/div&gt;
</code></pre>

<p>By the below code I am opening the image in a new window. The new page is opening but is not showing the image in the div.</p>

<pre><code>var changeIt, img;
changeIt = function(imageName, objName) { 
    img = '&lt;img src="images/zara/' + imageName + '"&gt;';
    newwindow = window.open( 'fprod.html', target="_blank" );
    document.getElementById(objName).innerHTML = img;
    setTimeout('newwindow.document.getElementById("pagewrapid").innerHTML=img',0)
};
</code></pre>
