
/** LEFT GALLERY	**/

// set the starting image.
var o = 0;			

// The array of div names which will hold the images.
var leftimage_slide = new Array('leftimage-1', 'leftimage-2', 'leftimage-3', 'leftimage-4', 'leftimage-5');

// The number of images in the array.
var NumOfLeftImages = leftimage_slide.length;

// The time to wait before moving to the next image. Set to 3 seconds by default.
var waitLeft = 4000;

// The Fade Function
function SwapLeftImage(x,y) {		
	$(leftimage_slide[x]).appear({ duration: 1.5 });
	$(leftimage_slide[y]).fade({duration: 1.5});
}

// the onload event handler that starts the fading.
function StartLeftSlideShow() {
	
	playLeftInterval = setInterval('PlayLeft()',waitLeft);
	//$('PlayLeftButton').hide();
	//$('PauseButton').appear({ duration: 0});
								
}

function PlayLeft() {
	var leftImageShow, leftImageHide;

	leftImageShow = o+1;
	leftImageHide = o;
	
	if (leftImageShow == NumOfLeftImages) {
		SwapLeftImage(0,leftImageHide);	
		o = 0;					
	} else {
		SwapLeftImage(leftImageShow,leftImageHide);			
		o++;
	}
}

function GoNextLeft() {
	clearInterval(playLeftInterval);
	//$('PlayLeftButton').appear({ duration: 0});
	//$('PauseButton').hide();
	
	var leftImageShow, leftImageHide;

	leftImageShow = o+1;
	leftImageHide = o;
	
	if (leftImageShow == NumOfLeftImages) {
		SwapLeftImage(0,leftImageHide);	
		o = 0;					
	} else {
		SwapLeftImage(leftImageShow,leftImageHide);			
		o++;
	}
}


/** LEFT GALLERY /eof	**/


/** RIGHT GALLERY	**/

// set the starting image.
var i = 0;			

// The array of div names which will hold the images.
var rightimage_slide = new Array('rightimage-1', 'rightimage-2', 'rightimage-3', 'rightimage-4', 'rightimage-5');

// The number of images in the array.
var NumOfRightImages = rightimage_slide.length;

// The time to wait before moving to the next image. Set to 3 seconds by default.
var waitRight = 4000;

// The Fade Function
function SwapRightImage(x,y) {		
	$(rightimage_slide[x]).appear({ duration: 1.5 });
	$(rightimage_slide[y]).fade({duration: 1.5});
}

// the onload event handler that starts the fading.
function StartRightSlideShow() {
	playRightInterval = setInterval('PlayRight()',waitRight);
	//$('PlayRightButton').hide();
	//$('PauseButton').appear({ duration: 0});
								
}

function PlayRight() {
	var rightImageShow, rightImageHide;

	rightImageShow = i+1;
	rightImageHide = i;
	
	if (rightImageShow == NumOfRightImages) {
		SwapRightImage(0,rightImageHide);	
		i = 0;					
	} else {
		SwapRightImage(rightImageShow,rightImageHide);			
		i++;
	}
}

function GoNext() {
	clearInterval(playRightInterval);
	//$('PlayButton').appear({ duration: 0});
	//$('PauseButton').hide();
	
	var rightImageShow, rightImageHide;

	rightImageShow = i+1;
	rightImageHide = i;
	
	if (rightImageShow == NumOfRightImages) {
		SwapRightImage(0,rightImageHide);	
		i = 0;					
	} else {
		SwapRightImage(rightImageShow,rightImageHide);			
		i++;
	}
}



/** RIGHT GALLERY /eof	**/
