// JavaScript Document
// Mambolearn Team
// M.Firoozmandan 29-Jun-2009
$(document).ready(function(){
	var slideCount = $('.slide').size() - 1;
	$('.slide').each(function(i) {
		$(this).css('z-index', slideCount - i);
	});

	var currentSlide = slideCount;
	var zIndex = 0;

	function imgRotate() {
		$('.slide').each(function(i) {
			if($(this).css('z-index') == currentSlide)
			{
				$(this).fadeOut('slow', function() {
					$(this).css('z-index', (0));
					$(this).show();
					});
			}
 			else
			{
				zIndex = $(this).css('z-index');
				zIndex = parseInt(zIndex) + parseInt(1);
				$(this).css('z-index', (zIndex));
			}
		});
	}

	setInterval(imgRotate, 4000);

});
