
// set the starting image.
var j = 0;			

// The array of div names which will hold the images.
var image_slide1 = new Array('image-1', 'image-2', 'image-3', 'image-4', 'image-5', 'image-6', 'image-7', 'image-8', 'image-9', 'image-10');

// The number of images in the array.
var NumOfImages1 = image_slide1.length;

// The time to wait1 before moving to the next image. Set to 3 seconds by default.
var wait1 = 2000;

// The Fade Function
function SwapImage1(x,y) {		
	$(image_slide1[x]).appear({ duration: 1.5 });
	$(image_slide1[y]).fade({duration: 1.5});
}

// the onload event handler that starts the fading.
function StartSlideShow1() {
	play1 = setInterval('Play1()',wait1);
//	$('PlayButton1').hide();
//	$('PauseButton1').appear({ duration: 0});
}

function Play1() {
	var imageShow1, imageHide1;

	imageShow1 = j+1;
	imageHide1 = j;
	
	if (imageShow1 == NumOfImages1) {
		SwapImage1(0,imageHide1);	
		j = 0;					
	} else {
		SwapImage1(imageShow1,imageHide1);			
		j++;
	}
	var textIn1 = j+1 + ' de ' + NumOfImages1;
}

function Stop1() {
	clearInterval(play1);				
//	$('PlayButton1').appear({ duration: 0});
//	$('PauseButton1').hide();
}

function GoNext1() {
	clearInterval(play1);
//	$('PlayButton1').appear({ duration: 0});
//	$('PauseButton1').hide();
	
	var imageShow1, imageHide1;

	imageShow1 = j+1;
	imageHide1 = j;
	
	if (imageShow1 == NumOfImages1) {
		SwapImage1(0,imageHide1);	
		j = 0;					
	} else {
		SwapImage1(imageShow1,imageHide1);			
		j++;
	}
}

function GoPrevious1() {
	clearInterval(play1);
//	$('PlayButton1').appear({ duration: 0});
//	$('PauseButton1').hide();

	var imageShow1, imageHide1;
				
	imageShow1 = j-1;
	imageHide1 = j;
	
	if (j == 0) {
		SwapImage1(NumOfImages1-1,imageHide1);	
		j = NumOfImages1-1;		
		
		//alert(NumOfImages1-1 + ' and ' + imageHide1 + ' i=' + i)
					
	} else {
		SwapImage1(imageShow1,imageHide1);			
		j--;
		
		//alert(imageShow1 + ' and ' + imageHide1)
	}
}

