Removed jquery duplicate
Changed js function to inline