Adding pause and resume functions

Added javascript pause and event methods.