var SideBannerRotator = function()
{
	var numberOfItems = null;
	var currentItem = null;
	var selector = null;
	
	this.init = function(selector)
	{
		this.selector = selector;
		this.numberOfItems = $(selector).find('img').size();
		this.start();
	}
	
	this.start = function()
	{
		var ref = this;
		this.currentItem = 1;
		setTimeout(function(){ref.next();}, 5000);
	}
	
	this.next = function()
	{
		var nextItem = this.currentItem + 1;
		if(nextItem > this.numberOfItems)
		{
			nextItem = 1;
		}
		
		$(this.selector).find('img.rotating-image-' + nextItem).fadeIn('slow');
		$(this.selector).find('img.rotating-image-' + this.currentItem).fadeOut('slow');
		this.currentItem = nextItem;
		
		var ref = this;
		setTimeout(function(){ref.next();}, 5000);
	}
}
