//一二三

//textboxDefaultValue
(function($){
	$.fn.defaultValue = function(defaultValue){
		$(this).val(defaultValue);
		$(this).focus(function(){
			if($(this).val() == defaultValue) $(this).val("");
		});
		$(this).blur(function(){
			if($(this).val() == "") $(this).val(defaultValue);
		});
	}
})(jQuery);


//imageScroller
(function($){
	$.fn.imageScrollLeft = function(speed){
		var scroller = $(this);
		var trackLength = $(scroller)[0].scrollWidth;
		if(trackLength >= $(scroller).innerWidth()){
			$(scroller).children().clone().appendTo(scroller);
			var stopScroll = false;
			var currentPos = 0;
			
			$(scroller).hover(function(){
				stopScroll = true;
			},function(){
				stopScroll = false;
			});
			setInterval(function(){
				if(stopScroll) return;
				currentPos++;
				if(currentPos > trackLength + 1) currentPos=0;
				$(scroller).scrollLeft(currentPos);
			}, speed);
		}
	}
})(jQuery);
