function moveimg()
{
//function changes pictures - files must be name pic1.jpg and pic2.jpg etc
// and writes the euglogy text based on what picture was chosen by the calling function moveimg
var EulogyArray = new Array();

// eulogies
EulogyArray[0] = "";
EulogyArray[1] = "Ruffly Purrfect Pet Services";
EulogyArray[2] = "Pepper - 3yr old spayed female independent - contact SarahJoNY@aol.com"
EulogyArray[3] = "Stella - older female 10yrs old ok with other cats  - contact SarahJoNY@aol.com"
EulogyArray[4] = "Ginger spayed female about 3yrs old she has a chronic eye problem but she is a real sweetheart and great with other cats - contact SarahJoNY@aol.com"
EulogyArray[5] = "Jeannie - a spayed tuxedo about 3yrs old ok with other cats she would love to be indoor/outdoor - contact SarahJoNY@aol.com"
EulogyArray[6] = "Simba and Felix - about 2yrs old neutered males they do not have to go together. Felix is a great cat shy at first but warms up quickly and is sweet and loving - contact SarahJoNY@aol.com"
EulogyArray[7] = "Thor - about 2yrs old neutered male is ok with other cats somewhat independent and would be ok as indoor/outdoor cat- contact SarahJoNY@aol.com"
EulogyArray[8] = "Simba - a shy sweet neutered male about 1-2 great with other cats (brown tiger tabby)- contact SarahJoNY@aol.com"
EulogyArray[9] = "Annie -  playful young spayed female about 3yrs old gets along with other cats- contact SarahJoNY@aol.com"
EulogyArray[10] = "Fluffy - 5yr old neutered male ok with other cats- contact SarahJoNY@aol.com"
EulogyArray[11] = "Coco and Cookie - M and F 3 yrs. Well cared for. Housebroken, trained, neutered - Must stay together. Contact Katherine at kjmorris74@yahoo.com"
EulogyArray[12] = "Tyson - He is a lap cat and will purr and purr til your legs fall asleep!  He is great with other pets, including dogs! - contact SarahJoNY@aol.com or crazycatladycole@yahoo.com"
EulogyArray[13] = "Claude - Approx 1yr old. Would prefer to go with his brother to an indoor/outdoor home.  Seems to prefer a home without dogs.  email:Patsppets@aol.com"
EulogyArray[14] = "Joe -   Approx. 1yr old.  a friendly easy going kitty; would be content being an indoor only kitty...doesn't mind other animals.   email:Patsppets@aol.com"
EulogyArray[15] = "Andy is a 3 yr old American Shorthair mix, neutered, very sweet, docile friendly.He's an indoor/outdoor cat but would prefer indoors with someone to give him love and attention. Up to date with all shots, has lived with cats and dogs, gets along well with both. He's affectionate with people: He gives kisses on your nose!! Please come meet him.  You'll be hooked especially if he decides to give you one of his kisses.For more of Andy call Barbara (914) 620-5141"
EulogyArray[16] = "Jackson is a rescued kitty in search of a good home. He is healthy although FIV+ and has been neutered. If you would like more information about Jackson or FIV, please contact: Ronda 917-204-8614"












var maxPic = 17;                       //the maximum number of pictures in the folder
var picpath = "./room/pic";             //the relative path to a generic picture that has the form pic4.jpg
maxPic  = maxPic - 1;  			//adjust for the array indices


var fullpath = document.getElementById("slidepicture").src; //get the absolute path to the picture

var fullpathlen = fullpath.length;   //get length of path so we can cut out the picture name
	
//picture names are always look like pic1, or pic2, and end of fullpath looks  pic2.jpg
//we don't need the pic part of the name pic1.jpg, and we don't need .jpg, only the number part

var startChop = fullpath.lastIndexOf("/") + 4 ;   //now we have the place to chop away everything not numeric
var endChop = fullpath.lastIndexOf(".") ;    //now we have the place to stop chopping away everything not numeric

var newPicName = fullpath.substring(startChop,endChop) * 1; //convert it to a number
newPicName = newPicName +1; //increment picture name

	if (newPicName > maxPic) //if we exceed the number of pictures in the folder, reset to first picture
		{ 
			newPicName = 0;
		}

//insert the new eulogy text
//
document.getElementById("roomDiv").innerHTML = EulogyArray[newPicName];//write it into the document


//now concatenate a new file name
picpath = picpath + newPicName.toString() + ".jpg";
	document.getElementById("slidepicture").src = picpath; 
}





