/** SlideShow	**/

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

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

// The number of images in the array.
var NumOfImages = image_slide.length;

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

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

// the onload event handler that starts the fading.
function StartSlideShow() {
	playInterval = setInterval('Play()',wait);
								
}

function Play() {
	var ImageShow, ImageHide;

	ImageShow = i+1;
	ImageHide = i;
	
	if (ImageShow == NumOfImages) {
		SwapImage(0,ImageHide);	
		i = 0;					
	} else {
		SwapImage(ImageShow,ImageHide);			
		i++;
	}
}

function GoNext() {
	clearInterval(playInterval);
	
	var ImageShow, ImageHide;

	ImageShow = i+1;
	ImageHide = i;
	
	if (ImageShow == NumOfImages) {
		SwapImage(0,ImageHide);	
		i = 0;					
	} else {
		SwapImage(ImageShow,ImageHide);			
		i++;
	}
}

/** SlideShow /eof	**/

/**	Form checkMe	**/

function checkMe() {
	if(document.getElementById('nimi').value == "" ) {

		alert("Täytäthän kaikki vaaditut kentät");

	}
	else {
		document.getElementById('inputform').submit();
	}
}

/**	Form checkMe /eof	**/
