function rotatePhotos(holderId, photos, nextIndex, pauseTime) {
	// global variables so we can pass along
	// using setTimeout function
	p = photos;
	hid = holderId
	ni = nextIndex+1;
	if(nextIndex>=photos.length-1){
		ni = 0;
	}
	ptime=pauseTime;
	nextImage = photos[ni]
	opacity(holderId, 100, 0, 1000);
	setTimeout("fadeInPhoto(hid,p,ni,ptime)",1000);
}

function fadeInPhoto(holderId, photos, nextIndex, pauseTime){
	var holder = document.getElementById(holderId);
	holder.src = nextImage.src;
	opacity(holderId, 0, 100, 1000);
	setTimeout("rotatePhotos(hid,p,ni,ptime)",pauseTime);
}

function pausecomp(millis)
{
date = new Date();
var curDate = null;

do { var curDate = new Date(); }
while(curDate-date < millis);
} 