var hinterval=8000;    // microseconds between slides
var hnumslides = 5;    // total amount of slides

var hintervalID=0;
var hpiclist = new Array(); // will hold the URL of jpeg to display
hpiclist[1] = "images/cartpics/hometop.jpg";
hpiclist[2] = "images/cartpics/doublehook.jpg";
hpiclist[3] = "images/cartpics/newsletter2.jpg";
hpiclist[4] = "images/cartpics/wmo2009orion.jpg";
hpiclist[5] = "images/cartpics/jaspertime09.jpg";

var hpicurl = new Array(); //will hold the URL link that goes along with each jpeg above
hpicurl[1] = "javascript:void(0)"; //null link
hpicurl[2] = "shopdisplayproducts.asp?id=31&cat=rigballyhoo#11010";
hpicurl[3] = "newsletter.asp";
hpicurl[4] = "javascript:void(0)"; //null link
hpicurl[5] = "javascript:void(0)"; //null link

h=0; // reset index variable   
starthshow();
	
// function that creates the slide show window and schedules showing of slides by newslide
function starthshow() { 
    clearInterval(hintervalID); // reset, in case one was already running
    hintervalID = window.setInterval('newhslide()', hinterval);  // set up the periodic new pic
    newhslide();  // display the first slide
}
// function that displays the next slide
function newhslide() {
	if (h == hnumslides) h = 0;   // go back to beginning when at end
	h++;
	document.images['hslide'].src = hpiclist[h];
	document.getElementById('hsurl').href = hpicurl[h];
}
// function that displays the previous slide
function prevhslide() {
	if (h == 1) h = hpiclist.length;   // go back to end when at beginning
	h--;
	document.images['hslide'].src = hpiclist[h];
	document.getElementById('hsurl').href = hpicurl[h];
}