Hello,
I have some issues to understand how parts of the following code are working:
demo:
http://devfiles.myopera.com/articles/649/example2.html
source:
http://devfiles.myopera.com/articles/649/example2.js
this is the part I have issues with:
Code:
var func = tool[ev.type];
if (func) {
func(ev);
}
I don't quite get the idea behind this

How does it work/what does it to?
Any help is welcome, thanks in advance!