Replace inline javascript with jQuery handler