simple javascript help
<p>hi im new to javascript and basically trying to work out.
when i click on the links to display an image in a place holder.
if placeholder1 is used by either 1.jpg, 2.jpg, or 3.jpg then to leave placeholder1 with that image and use placeholder2.
hope that makes sense
thanks for any help</p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;
function showPic (whichpic) { 
    if (document.getElementById) { 
        document.getElementById('placeholder1').src = whichpic.href
        if (whichpic.title) { 
            document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
        } else { 
            document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
        } 
        return false; 
    } else { 
        return true; 
    } 
}
&lt;/script&gt;

&lt;div style="border: 1px solid #999; padding: 1em; margin: 0 0 15px 0;"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a onclick="return showPic(this)" href="/images/1.jpg" title="A bunch of bananas on a table"&gt;some bananas&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a onclick="return showPic(this)" href="/images/2.jpg" title="Condiments in a Chinese restaurant"&gt;two bottles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a onclick="return showPic(this)" href="/images/3.jpg" title="Seashells on a table"&gt;some shells&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p id="desc"&gt;Choose an image to begin&lt;/p&gt;
&lt;img id="placeholder1" src="/images/blank.gif" alt="" /&gt;
&lt;img id="placeholder2" src="/images/blank.gif" alt="" /&gt;
&lt;/div&gt;
</code></pre>
