Added pause and resume to javascript

Added pause and resume methods to javascript