Enhancing javascript