// JavaScript Document

var welcomeRotator = 1;
var welcomeCurrPhoto = 1;
var welcomeTotalPhoto = 2;
var welcomeTimer = null;
var welcomeDelay = 5000;

function welcomeRotate() {
	if(welcomeRotator==1) {
		if(welcomeCurrPhoto>=welcomeTotalPhoto) { welcomeCurrPhoto = 1; }
		else { welcomeCurrPhoto++; }
		new Ajax.Updater('welcome', 'ajax/welcomeRotate.php?num='+welcomeCurrPhoto, {
		  method: 'get'
		});
		welcomeTimer = setTimeout("welcomeRotate()",welcomeDelay);
		}
	}

function welcomeStop() {
	welcomeRotator = 0;
	clearTimeout(welcomeTimer);
	}

function welcomeNext() {
	welcomeRotator = 1;
	if(welcomeCurrPhoto>=welcomeTotalPhoto) { welcomeCurrPhoto = 1; }
	else { welcomeCurrPhoto++; }
	new Ajax.Updater('welcome', 'ajax/welcomeRotate.php?num='+welcomeCurrPhoto, {
	  method: 'get'
	});
	clearTimeout(welcomeTimer);
	welcomeTimer = setTimeout("welcomeRotate()",welcomeDelay);
	}

function welcomeBack() {
	welcomeRotator = 1;
	if(welcomeCurrPhoto<=1) { welcomeCurrPhoto = 2; }
	else { welcomeCurrPhoto--; }
	new Ajax.Updater('welcome', 'ajax/welcomeRotate.php?num='+welcomeCurrPhoto, {
	  method: 'get'
	});
	clearTimeout(welcomeTimer);
	welcomeTimer = setTimeout("welcomeRotate()",welcomeDelay);
	}