var hinterval=8000;    // microseconds between slides
var hnumslides = 10;    // 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/superselect.jpg";
hpiclist[3] = "images/cartpics/MarlinMag.jpg";
hpiclist[4] = "images/cartpics/tunaOverfishing.jpg";
hpiclist[5] = "images/cartpics/billfisherWM88.jpg";
hpiclist[6] = "images/cartpics/islamar.jpg";
hpiclist[7] = "images/cartpics/qualifier2.jpg";
hpiclist[8] = "images/cartpics/newsletter4.jpg";
hpiclist[9] = "images/cartpics/wmo2009orion.jpg";
hpiclist[10] = "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#11004";
hpicurl[3] = "http://www.marlinmag.com/gear/fishing-tackle/baitmasters-bait-shipping";
hpicurl[4] = "http://www.fishhound.com/conservation/spains-centuries-old-almadraba-bluefin-tuna-fishing-threatened-factory-fleet";
hpicurl[5] = "javascript:void(0)"; //null link
hpicurl[6] = "javascript:void(0)"; //null link
hpicurl[7] = "javascript:void(0)"; //null link
hpicurl[8] = "newsletter.asp";
hpicurl[9] = "javascript:void(0)"; //null link
hpicurl[10] = "javascript:void(0)"; //null link

var hpictarget = new Array(); //will hold the target that goes along with each jpeg above
hpictarget[1] = ""; //null target
hpictarget[2] = ""; //null target
hpictarget[3] = "_blank"; //null target
hpictarget[4] = "_blank"; //null target
hpictarget[5] = ""; //null target
hpictarget[6] = ""; //null target
hpictarget[7] = ""; //null target
hpictarget[8] = ""; //null target
hpictarget[9] = ""; //null target
hpictarget[10] = ""; //null target

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];
	document.getElementById('hsurl').target = hpictarget[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];
	document.getElementById('hsurl').target = hpictarget[h];
}
