Nearly finished conversion to jQuery