$j(document).ready(function(){

	var seconds = 4;

	$j('body:not(.edit_mode) .easy_rotator').addClass('ready').each(function(){
	  var Rotator = this;
		var $rotator=$j(this);
		this.doRotation=function(){
			if ($rotator.is(':visible')){
				$rotator.hide();
				var $nextRotator = $rotator.next('.easy_rotator');
				if($nextRotator.length==0){ $nextRotator = $rotator.prevUntil(':not(.easy_rotator)').last(); }
				$nextRotator.show().each(function(){this.triggerRotation();});
			}
		}
		this.triggerRotation=function(){
		  if ($rotator.next('.easy_rotator').length>0||$rotator.prev('.easy_rotator').length>0) {
		  	setTimeout(function(){
  				Rotator.doRotation();
  			},seconds*1000);
  		}
		}
	});
	$j('body:not(.edit_mode) .easy_rotator + .easy_rotator').hide();
	$j('body:not(.edit_mode) .easy_rotator:not(.easy_rotator + .easy_rotator)').each(function(){this.triggerRotation();});



});
