// JavaScript Document

function rollover(name,pic) {

	if (document.images)

        document.images[name].src = pic;

}

function rollout(name,pic) {

	if (document.images)

        document.images[name].src = pic;

}



function enlarge_aslan() {

	if (document.images)

        document.images['enlargement'].src = ('../images/dog/aslan/large/' + self.name + '.jpg');

	
}


function enlarge_cr() {

	if (document.images)

        document.images['enlargement'].src = ('../images/costa_rica/large/' + self.name + '.jpg');

	
}
		
function enlarge_gorkem() {

	if (document.images)

        document.images['enlargement'].src = ('http://www.jarvispack.com/images/friend/gorkem/large/' + self.name + '.jpg');

	
}

function enlarge_baby() {

	if (document.images)

        document.images['enlargement'].src = ('http://www.jarvispack.com/images/baby/caroline/' + self.name + '.jpg');
		
}


function enlarge_pregnancy() {

	if (document.images)

        document.images['enlargement'].src = ('http://www.jarvispack.com/images/baby/pregnancy/large/' + self.name + '.jpg');
		
}


function enlarge_vietnam() {

	if (document.images)

        document.images['enlargement'].src = ('../images/vietnam/large/' + self.name + '.jpg');

	
}

function enlarge_watson() {

	if (document.images)

        document.images['enlargement'].src = ('../images/dog/watson/large/' + self.name + '.jpg');

	
}

function enlarge_wedding() {

	if (document.images)

        document.images['enlargement'].src = ('../images/wedding/large/' + self.name + '.jpg');

	
}

function enlarge_wedding_photos() {

	if (document.images)

        document.images['enlargement'].src = ('../images/wedding/photos/large/' + self.name + '.jpg');

	
}

function enlarge_babyphotos(no) {
	
	window.open('enlargement_baby.html', no,'width=800,height=600,resizable=yes');
	
}
	

//function setUp() {
  //  currentPhoto = 1;
	//captionText[1] = "Photo 1"
	//captionText[2] = "Photo 2"
	//document.images['slide'].src = ('../images/baby/caroline/000' + currentPhoto + '.jpg');
	//document.getElementById['captiondiv'].value = captionText[currentPhoto];
	//document.forCaptions.captiondiv.value = captionText[currentPhoto];
//}

function setUp() {
    currentPhoto = 1;
	if (month < 10) {
		month = "0" + month;
	}
	document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/000' + currentPhoto + '.jpg');
	document.forCaptions.captiondiv.value = captionText[currentPhoto];
	document.forCaptions.photoid.value = 1;
	document.forCaptions.numphotos.value = numPhotos;
	//}
}

function switchPhoto(no) {
	
	newPhoto = currentPhoto + no;
	//alert ('currentPhoto=' + currentPhoto);
	//alert ('newPhoto=' + newPhoto);
	if (!newPhoto) newPhoto=numPhotos;
	if (newPhoto > numPhotos) newPhoto=1;
	if (newPhoto < 10) {
	document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/000' + newPhoto + '.jpg');
	}
	else {
		if (newPhoto < 100) {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/00' + newPhoto + '.jpg');
		}
		else {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/0' + newPhoto + '.jpg');
		}
	}
	currentPhoto = newPhoto;
	document.forCaptions.captiondiv.value = captionText[currentPhoto];
	document.forCaptions.photoid.value = currentPhoto;
	document.forCaptions.numphotos.value = numPhotos;
	
	if (t!=0) {
		if (no>0) {
		timedCount();
		}
	}
	
}

function gotoPhoto() {
	
	photoid = document.forCaptions.photoid.value;
	newPhoto = (photoid * 1);
	if (!newPhoto) newPhoto=numPhotos;
	if (newPhoto > numPhotos) newPhoto=1;
	if (newPhoto < 10) {
	document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/000' + newPhoto + '.jpg');
	}
	else {
		if (newPhoto < 100) {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/00' + newPhoto + '.jpg');
		}
		else {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/0' + newPhoto + '.jpg');
		}
	}
	//alert ('newPhoto =' + newPhoto);
	//alert ('newPhoto + 1 =' + newPhoto + 1);
	currentPhoto = newPhoto;
	document.forCaptions.captiondiv.value = captionText[currentPhoto];
	document.forCaptions.photoid.value = currentPhoto;
	document.forCaptions.numphotos.value = numPhotos;
	
	//if (t!=0) {
		//if (currentPhoto>0) {
		//timedCount();
		//}
	//}
	
}

function switchSlide(no) {
	
	newPhoto = currentPhoto + no;
	if (!newPhoto) newPhoto=numPhotos;
	if (newPhoto > numPhotos) newPhoto=1;
	if (newPhoto < 10) {
	document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/000' + newPhoto + '.jpg');
	}
	else {
		if (newPhoto < 100) {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/00' + newPhoto + '.jpg');
		}
		else {
			document.images['slide'].src = ('../images/baby/caroline/' + year + '-' + month + '/0' + newPhoto + '.jpg');
		}
	}
	currentPhoto = newPhoto;
	document.forCaptions.captiondiv.value = captionText[currentPhoto];	
	document.forCaptions.photoid.value = currentPhoto;
	document.forCaptions.numphotos.value = numPhotos;
	timedCount();
}


function timedCount()
{
	s = document.forCaptions.seconds.value;
	h=setTimeout("switchSlide(+1)",(s * 1000));
}

function stopCount()
{
	clearTimeout(h);
}
