;(function($) {
	$.fn.hScroller = function(speed, without_wrap){
		
		$(this).each(function(){
			
			if(!without_wrap){
				
				$(this).removeAttr("id").css("float","left").wrap('<div class="scrollOuter" style="overflow:hidden"><div class="scrollInner" style="width:1234567px"><div class="scrollDiv" style="float:left"></div></div></div>');
				
			}
			$(this).clone().insertAfter( this );
			
			var parent = $(this).parent();
			
			$(parent).mouseover(function(){ $(this).addClass("Pause") }).mouseout(function(){ $(this).removeClass("Pause") });
			
			setInterval(function(){
				
				if(!$(parent).hasClass("Pause")){
					
					var e = $(">DIV",parent).get(0);
					
					var w = e.style.marginLeft? parseInt(e.style.marginLeft) : 0;// узнаем текущий отступ слева
					
					e.style.marginLeft = (w - 1) + "px";// делаем текущий отступ слева еще больше
					
					if( (w - 1) <= -(e.clientWidth) ){// если текущий отступ слева меньше или равен ширине первого элемента
						
						e.style.marginLeft = "0px";// удаляем отступ слева для первого элемента
						parent[0].removeChild(e);// удаляем первый элемент
						parent[0].appendChild(e);// добавляем его в конец
						
					}
				}
			}, speed);
		});
		
		return this;
	};
})(jQuery);
$(document).ready(function(){ $(".myScroll").hScroller("15",true); });
