window.rotateSlides = new function() {
	this.arrSlides = [];
	this.intNumberOfSlides = 0;
	this.intIdx = 0;
	this.oSlideRotationTimer = null;
	this.intSlideFade = 2000;
	this.intSlideChange = 8000;
}
/*
window.rotateQuotes = new function() {
	this.arrQuotes = [];
	this.intNumberOfQuotes = 0;
	this.intIdx = 0;
	this.oQuoteRotationTimer = null;
	this.intQuoteFade = 2000;
	this.intQuoteChange = 20000;
}
*/
tilt.attachEvent(document, "contentreceived", function(){
	/*
	rotateQuotes.arrQuotes = $(".quotes li");
	rotateQuotes.intNumberOfQuotes = rotateQuotes.arrQuotes.length;
	rotateQuotes.intIdx = Math.floor(Math.random()*rotateQuotes.intNumberOfQuotes);
	chooseQuote(rotateQuotes.intIdx);
	rotateQuotes.oQuoteRotationTimer = setInterval(nextQuote, rotateQuotes.intQuoteChange);		

	function chooseQuote() {
		$(rotateQuotes.arrQuotes[rotateQuotes.intIdx]).fadeIn(rotateQuotes.intQuoteFade);
	}
	function nextQuote() {
		clearInterval(rotateQuotes.oQuoteRotationTimer);
		var intPrev = rotateQuotes.intIdx;
		if (++rotateQuotes.intIdx >= rotateQuotes.intNumberOfQuotes) {
			rotateQuotes.intIdx = 0;
		}
		$(rotateQuotes.arrQuotes[intPrev]).fadeOut(rotateQuotes.intQuoteFade, chooseQuote);
		rotateQuotes.oQuoteRotationTimer = setInterval(nextQuote, rotateQuotes.intQuoteChange);		
	}
*/
	$('#slogans').cycle({ 
		timeout:  6000, 
		speed:  2000
	});
	
	$('.quotes ul').cycle({ 
		timeout:  22000, 
		speed:  2000
	});

	rotateSlides.arrSlides = $(".slideshow img");
	rotateSlides.intNumberOfSlides = rotateSlides.arrSlides.length;
	rotateSlides.intIdx = 0;
	chooseSlide(rotateSlides.intIdx);
	rotateSlides.oSlideRotationTimer = setInterval(nextSlide, rotateSlides.intSlideChange);		

	function chooseSlide() {
		$(rotateSlides.arrSlides[rotateSlides.intIdx]).fadeIn(rotateSlides.intSlideFade);
	}
	function nextSlide() {
		clearInterval(rotateSlides.oSlideRotationTimer);
		var intPrev = rotateSlides.intIdx;
		if (++rotateSlides.intIdx >= rotateSlides.intNumberOfSlides) {
			rotateSlides.intIdx = 0;
		}
		$(rotateSlides.arrSlides[intPrev]).fadeOut(rotateSlides.intSlideFade, chooseSlide);
		rotateSlides.oSlideRotationTimer = setInterval(nextSlide, rotateSlides.intSlideChange);		
	}	
});
