JavaScript closure: code trivia to keep the event handler separate
Add more spaces.
Use more named functions. (wrap the whole thing in an anonimous wrapper if you're worried about name space conflicts).
When you do use lamdas give them names (it makes the code easier to read and you don't get  showing up in the error log. 
Declare variables in higher functions to take advantage of closures. eg x, y, elementStart and mouseStart.
camelCase.
Use === unless you explicitly want to force casting.
Don't make functions in a loop.


http://codr.cc/s/03c0d0af/js