var slideShowInterval = 3200; // (ms)

function goRight(ms){
	if(currentPhoto<numOfPhotos){
		david[currentPhoto].opacity('gallery-photo-'+currentPhoto, 0, ms, 0, 0, '');
		currentPhoto++;
		}
	else{
		david[1].opacity('gallery-photo-'+1, 1, ms, 0, 0, 'reset()');
		currentPhoto=1;
		}
	changeText();
	}
 function goLeft(){
	if(currentPhoto!=1){
		david[currentPhoto-1].opacity('gallery-photo-'+(currentPhoto-1), 1, 300, 0, 0, '');
		currentPhoto--;
		}
	else{
		for(i=2;i<numOfPhotos;i++){
			xOpacity('gallery-photo-'+i, 0);
			}
		david[currentPhoto].opacity('gallery-photo-'+(currentPhoto), 0, 300, 0, 0, '');
		currentPhoto=numOfPhotos;
		}
	changeText();
	}
 function playLoop(loop){
	if(playOperator==loop){
		goRight(800);
		setTimeout("playLoop("+loop+")", slideShowInterval);
	}}
 function playNow(){
	playOperator++;
	playLoop(playOperator);
	}
 function reset(){
	for(i=1;i<=numOfPhotos;i++){
		xOpacity('gallery-photo-'+i, 1);
		}
	}
 function changeText(){
	//document.getElementById('gallery-info-1').innerHTML = currentPhoto;
	}
