function skodaStage(elementSelector) {
	var stage = {
		selector:null,
		stageHolder:null,
		items:{},
		navigation:{},
		navItems:{},
		changeTimer:{},
		duration:6000,
		animationSteps:65,
		animationWidth:31,
		currentStep:0,
		current:0,
		init:function(selector) {
			this.selector = selector;
			this.stageHolder = jQuery(this.selector);
			this.items = jQuery('ul.items li', this.stageHolder);
			this.render();
			this.applyFunctions();
			this.startStageTimer();
			return this;
		},
		render:function(){
			var self = this;
			
			var navTemplate = '<ul class="navigation"></ul>';
			jQuery(self.stageHolder).append(navTemplate);
			self.navigation = jQuery('.navigation', self.stageHolder);
			
			self.items.each(function(i) {
				jQuery(this).css('display','none');
				var navItem = '<li><span>'+ (i+1) +'</span></li>';
				self.navigation.append(navItem);
            });
			self.navItems = jQuery('li', self.navigation);
		},
		applyFunctions:function() {
			var self = this;
			self.navItems.click(function() {
				var index = jQuery(this).index();
				if(index != self.current) {
					self.showNext(index);
				}
			});
		},
		startStageTimer:function() {
			var self = this;
			self.currentStep = 0;
			var activeItem = jQuery(self.items[self.current]);
			if(activeItem.css('display') == 'none') {
				activeItem.css('display','block');
			}
			var activeNavItem = jQuery(self.navItems[self.current]);
			activeNavItem.addClass('active');
			self.step(self);
		},
		showNext:function(index) {
			var self = this;
			self.stop();
			
			var currentItem = jQuery(self.items[self.current]);
			currentItem.fadeOut();
			
			var currentNavItem = jQuery(self.navItems[self.current]);
			currentNavItem.removeClass('active');
			var standardBGPosition = -((self.animationSteps - 1) * self.animationWidth) + 'px 0px';
			currentNavItem.css('background-position', standardBGPosition);
			
			var nextItem = jQuery(self.items[index]);
			nextItem.fadeIn();
			
			self.current = index;
			self.startStageTimer();
		},
		step:function(self) {
			self.animateNavItem(self, self.currentStep);
			self.currentStep++;
			if (self.currentStep == self.animationSteps) {
				self.showNext(self.getNextIndex());
			}
			else {
				self.changeTimer = window.setTimeout(function() {self.step(self);}, (self.duration / self.animationSteps));
			}
		},
		animateNavItem:function(self, step) {
			var activeNavItem = jQuery(self.navItems[self.current]);
			var newPosition = -(step * self.animationWidth) + 'px 0px';
			activeNavItem.css('background-position',newPosition);
		},
		stop:function() {
			var self = this;
			if (self.changeTimer) {
				window.clearTimeout(self.changeTimer);
				self.changeTimer = null;
			}
		},
		getNextIndex:function () {
			var self = this;
			var nextIndex;
			if(self.current == (self.items.length - 1))
			{
				nextIndex = 0;
			} else {
				nextIndex = self.current + 1;
			}
			return nextIndex;
		}
	}

	return stage.init(elementSelector);
}

