Reusing functionality in Javascript
<p>I created a page on which there's a red square that can be moved by a mouse.  I would like to find out how I can reuse Javascript to have more than 1 square.  In the following fiddle <a href="http://jsfiddle.net/sbel/utM5k/" rel="nofollow">http://jsfiddle.net/sbel/utM5k/</a> I show that in HTML on top I include the CSS, the square is a div and the Javascript has the form (function(window) {...})(window);. How can I change the Javascript to be able to simply say here is the ID of a div, apply the moving functionality to it?</p>
