convert js to YUI