How can I turn this jquery into a function?
<p>I would like to turn the below jquery code into a function so i could add links to the list and not have to touch the jquery. I'm assuming I will have to put the image name into the <code>&lt;a href&gt;</code> tag somewhere.</p>

<p>html code</p>

<pre><code>&lt;img id="storyimg" src="1.png" alt="img" /&gt;
&lt;ul class="sb_menu"&gt;            
    &lt;li&gt;&lt;a href="linkpage.htm" class="newslink1"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="linkpage.htm" class="newslink2"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="linkpage.htm" class="newslink3"&gt;Link 3&lt;/a&gt;&lt;/li&gt;                        
&lt;/ul&gt;
</code></pre>

<p>jquery</p>

<pre><code>$('a.newslink1').bind('mouseover', function() {
    $('img#storyimg').attr("src", "1.png");
});
$('a.newslink2').bind('mouseover', function() {
    $('img#storyimg').attr("src", "2.png");
});
$('a.newslink3').bind('mouseover', function() {
    $('img#storyimg').attr("src", "3.png");
});
</code></pre>
