Changed all js code to jQuery