encapsulated whole script and added private methods
added ESC key support and cancel event
turned off "cancel" event bubbling, "ESC" key detection is now persistent
find form[method=dialog] instead of simply form
autofocus is now supported
forms now propagate custom events for dialog
fixed nits
another fix
one more fix
Merge pull request #10 from agektmr/master

ESC key support + 'cancel' event, autofocus, form[type=dialog]