Converted some functions to jQuery...