function theRotator() {
$('div#rotator ul li').css({opacity: 0.0});
$('div#rotator ul li:first').css({opacity: 1.0});
setInterval('rotate()',4000);	
}

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}, 1000);
current.animate({opacity: 0.0}, 1000)
.removeClass('show');
};

$(document).ready(function()
{
theRotator();

if ($('#studio').length)
{
	$('div#t2t').innerfade({
		speed: 1000,
		timeout: 3000,
		type: 'random',
		containerheight: '400px'
	});
}

if ($('#bikram').length)
{
	$('#bikramshow').innerfade({
		speed: 1000,
		timeout: 3000,
		type: 'random',
		containerheight: '350px'
	});
}

if (($('#index').length) || ($('#gray').length))
{
	$('div#a').innerfade({
	speed: 1000,
	timeout: 2900,
	type: 'random',
	containerheight: '115px'
	});
	$('div#b').innerfade({
	speed: 1000,
	timeout: 3800,
	type: 'random',
	containerheight: '115px'
	});
	$('div#c').innerfade({
	speed: 1000,
	timeout: 4444,
	type: 'random',
	containerheight: '115px'
	});
	$('div#d').innerfade({
	speed: 1000,
	timeout: 6300,
	type: 'random',
	containerheight: '115px'
	});
	$('div#e').innerfade({
	speed: 1000,
	timeout: 5500,
	type: 'random',
	containerheight: '115px'
	});
	$('div#f').innerfade({
	speed: 1000,
	timeout: 8000,
	type: 'random',
	containerheight: '115px'	
	});
	$('div#g').innerfade({
	speed: 1000,
	timeout: 6700,
	type: 'random',
	containerheight: '115px'	
	});
	$('div#h').innerfade({
	speed: 1000,
	timeout: 5000,
	type: 'random',
	containerheight: '115px'	
	});
	$('div#i').innerfade({
	speed: 1000,
	timeout: 2600,
	type: 'random',
	containerheight: '115px'	
	});
	$('div#j').innerfade({
	speed: 1000,
	timeout: 7700,
	type: 'random',
	containerheight: '115px'	
	});
}
});


