May want to extract this to a JS asset rather than inline.