ScrollingPromoBlock = function( el ) {
  this.__constructor( el );
}

$.extend(ScrollingPromoBlock.prototype, {
	
	promo:			null,
	view:			null,

	__constructor: function( el ) {
		var __instance = this;
		__instance.promo = el;
		__instance.view = el.find('.viewport');
		__instance.view.scrollTo( 0, 0, { axis:'x'});
		__instance.promo.find('.navigation LI A, .navigator DIV A').click(function() {
			if( !$(this).parent().is('.on') ) {
				number = $(this).parent().prevAll().length;
				__instance.promo.find('.navigation LI:eq('+number+'), .navigator DIV:eq('+number+')').addClass('on').siblings().removeClass('on');;
				__instance.view.scrollTo( 990*number, 500, { easing:'swing', axis:'x', onAfter:function(){
				}});
			}
			return false;
		});
		
	}
	
	
});

(function($) {
jQuery.fn.scrollingPromoBlock = function() {
	$(this).each(function() {
		new ScrollingPromoBlock( $(this) );
	});
	return $(this);
};
})(jQuery);
