Adding pause/play buttons to the Photo XML gallery

I am using the code provided from this tutorial: http://www.kirupa.com/developer/mx2004/xml_slideshow3.htm

Since this is an auto-play slideshow, I would also like to put pause/play buttons so that the slideshow will stop when pause is hit and will continue when play is clicked. I figured that the play button will probably have to call the nextImage function to continue, but I have no clue how to pause/stop the slideshow. Any help is appreciated, thanks!