/**
 * Created by IntelliJ IDEA.
 * User: Dylan Wagstaff
 * Date: 04.02.2011
 * Time: 11:27:05
 * To change this template use File | Settings | File Templates.
 */


function theRotator() {
	$('div#rotator ul li').css({opacity: 0.0});
	$('div#rotator ul li:first').css({opacity: 1.0});
	setInterval('rotate()',5000);
}

function theRotator2() {
	$('div#rotator2 ul li').css({opacity: 0.0});
	$('div#rotator2 ul li:first').css({opacity: 1.0});
	setInterval('rotate2()',5000);
}


function rotate() {
	var current = ($('div#rotator ul li.show')?  $('div#rotator ul li.show') : $('div#rotator ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator ul li:first') :current.next()) : $('div#rotator ul li:first'));
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 500);
	current.animate({opacity: 0.0}, 500)
	.removeClass('show');
}

function rotate2() {
	var current = ($('div#rotator2 ul li.show')?  $('div#rotator2 ul li.show') : $('div#rotator2 ul li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('div#rotator2 ul li:first') :current.next()) : $('div#rotator2 ul li:first'));
	next.css({opacity: 0.0})
	.addClass('show')
	.animate({opacity: 1.0}, 500);
	current.animate({opacity: 0.0}, 500)
	.removeClass('show');
}

$(document).ready(function() {
	theRotator();
    theRotator2();
});




