Group or make a seperate file for the event handlers.
Put it in an function and add the function to the document.ready