convert js to YUI calls