fix #348 animation event in non-browser

Make sure that Delegate can be loaded even in non-browser environments like Rhino or nodejs where window/document are not defined