First portion of JQuery conversion