rewrite to use YUI instead of jQuery