using the same function of different events
<p>This seems pretty simple, but I can't figure it out. I'm new to javascript/ jquery.</p>

<p>i want to trigger a function to move a div onmouseover,  and another onmouseout. I want to call this same function on several different divs. how would I do this without writing multiple functions?</p>

<pre><code>  &lt;div id="indexJoinBanner" onmouseover="moveDivRight()" onmouseout="moveDivLeft()"&gt; 
  &lt;!-- end #indexJoinBanner --&gt;&lt;/div&gt;
  &lt;div id="indexJoinBanner2" onmouseover="moveDivRight()" onmouseout="moveDivLeft()"&gt; 
  &lt;!-- end #indexJoinBanner2 --&gt;&lt;/div&gt;



function moveDivRight(){
  $("#indexJoinBanner").animate({
    left: "0px",
  },500 );
};

function moveDivLeft() {
  $("#indexJoinBanner").animate({
    left: "-150px",
  },500 );
}
</code></pre>

<p>Thanks</p>
