updating YUI code with events