  imgNum = 1;
  // set  numOfImages to the number of images
 //numOfImages = 3;
 // set pet to "dogs" or "cats"
//  pet = "cats";

function getNextImage(oImg,petName) {
if (typeof(  imgNum) != "number") {
    imgNum= 1;
}
if (typeof( numOfImages) != "number") {
   numOfImages  = 3;
}
imgNum = imgNum + 1;
if (imgNum >  numOfImages) {
	imgNum = 1;
}
//oImg = getElementByID("petpic");
nextImg = "../../images/pets/" + pet + "/" + petName + imgNum + ".jpg";
if (typeof(oImg) == "object") {
	oImg.src = nextImg;
}
}