// Scripts for creating a slideshow.  To use:// - Choose a name for your slideshow, say SHOW1.  Create a <div id="SHOW1">.// - Within that, have a series of <div class="slideshow_slide" style="display:none;"> .// - Each of those divs contains one slide// - At the end of the SHOW1 div, have this script line: start_slideshow("SHOW1", time)//// The first slide will appear, and after TIME milliseconds (e.g. 5000 = 5 seconds),// the next one will replace it, and so on.// Begin animation of the slideshow with id SLIDERID.  Move forward every INTERVAL millisec.var img_play = 'http://dogtime.com/images/global/btn_play.gif';var img_pause = 'http://dogtime.com/images/global/btn_stop.gif';function start_slideshow(sliderid, interval) {	var slider = document.getElementById(sliderid);	var slidernodes = [];	var alldivs = slider.getElementsByTagName("div");	for (var i=0; i<alldivs.length; i++) {		if (alldivs[i].className == "slideshow_slide") {			slidernodes.push(alldivs[i]); //add this DIV reference to array		}	}	document[sliderid + "nodes"] = slidernodes;	document[sliderid + "interval"] = interval;	document[sliderid + "slide"] = 0;	slideshow_nextpage(sliderid, 0); //Display first DIV within slider	document[sliderid + "timer"] = setTimeout('slideshow_autoturnpage("' + sliderid + '", ' + interval + ')', interval);}// Move forward by DIR slides.  Typically DIR would be 1 or -1.function slideshow_nextpage(sliderid, dir) {	var slidernodes = document[sliderid + "nodes"];	var len = slidernodes.length;	var last =  (document[sliderid + "slide"] + len) % len;	var curr = (document[sliderid + "slide"] + dir + len) % len;	if(sliderid == 'homeshow') {		if(last != curr) {			new Effect.Fade('slide'+last, { duration:0.6, queue: { scope:'slideshow', position:'end' } } );			new Effect.Appear('slide'+curr, { duration:0.9, queue: { scope:'slideshow', position:'end' } } );		}	} else {		for (var i=0 ; i < len ; i++) { slidernodes[i].style.display = "none"; }		slidernodes[curr].style.display = "block";	}	document[sliderid+"slide"] = curr;}// If moving, pause.  If paused, go to next page and start moving again.function slideshow_toggle_playorpause(sliderid) {	if ( document[sliderid + "timer"] == null ) {		slideshow_autoturnpage(sliderid, document[sliderid + "interval"]);		return false;	} else {		slideshow_pause(sliderid);		return true;	}}function slideshow_pause(sliderid) {	img_playorpause = document.getElementById('slide_play');  img_playorpause.src = (img_play);	clearTimeout(document[sliderid + "timer"]);	document[sliderid + "timer"] = null;}// Move forward one slide, and start moving forward every INTERVAL after that.function slideshow_autoturnpage(sliderid, interval) {	img_playorpause = document.getElementById('slide_play');  img_playorpause.src = (img_pause);	slideshow_nextpage(sliderid, 1);	document[sliderid+"timer"] = setTimeout('slideshow_autoturnpage("' + sliderid + '", ' + interval + ')', interval);}