timeoutID = -1;
sstimeout = 5000;
nextpagelocation = '';

function SSStateChanged(pgloc) {
	nextpagelocation = pgloc;
	if (ss_running) {
		timeoutID = setTimeout("document.location='" + nextpagelocation + "?slideshow=yes'", sstimeout);
	}
	else {
		clearTimeout(timeoutID);
	}
}

function SSButtonClick() {
	ss_running = !ss_running;
	SSStateChanged(nextpagelocation);
}

ss_running = false;
address_str = document.location.search.substring(1);
if (address_str.indexOf('slideshow=') > -1) {
	ss_running = true;
}
