NewImg = new Array (
"http://www.naturecoasthumanesociety.org/images/Top-Pic-14.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-2009-1.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-2009-2.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-1.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-4.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-6.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-10.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-13.jpg",
"http://www.naturecoasthumanesociety.org/images/Top-Pic-16.jpg"
);

NewLink = new Array ("#",
"#",
"#",
"#",
"#",
"#",
"#",
"#",
"#"
);

var ImgNum = 0;
var ImgLength = NewImg.length - 1;

//Time delay between Slides in milliseconds
var delay = 5000;

var lock = false;
var run;

function chgImg(direction) {
if (document.images) {
ImgNum = ImgNum + direction;
if (ImgNum > ImgLength) {
ImgNum = 0;
}
if (ImgNum < 0) {
ImgNum = ImgLength;
}
document.slideshow.src = NewImg[ImgNum];
document.getElementById('myLink').href = NewLink[ImgNum];
   }
}
function auto() {
if (lock == true) {
lock = false;
window.clearInterval(run);
}
else if (lock == false) {
lock = true;
run = setInterval("chgImg(1)", delay);
   }
}
