You declare showOn as a local variable to the click handler. This variable will be lost each time the method quits. Next time it will be reinitialized.
Code:
var auto = document.getElementById("button");
var showOn = 0;
// alert(auto.src);
auto.onclick = function() {
if(auto.src == "file:///C:/jimslounge.com/jsClass/lab6.1/images/playBtn.png") {
auto.src="images/pauseBtn.png";
showOn = window.setInterval("loadNextPic()", 5000);
}else{
auto.src="images/playBtn.png";
clearInterval(showOn);
}
}