jQuery(function($) {
	
	/* Smooth Scroll */
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 'fast');
				return false;
			}
		}
	});
	
	$(".Block h2").hover(
		function(){
			i = $(this).parents().attr("id");
			tag = $( "#" + i + " ul");
			ListCheck(tag);
		},
		function(){
			i = $(this).parents().attr("id");
			tag = $( "#" + i + " ul");
			$(tag).stop();
			Remove( tag );
		}
	);
	
	function Remove( target ) {
		var n = $(target);
		var posi = n.position().left;
		
		if ( posi < 0 ) {
			$("li:first",target).remove().clone().appendTo(target);
			var move = posi + 241;
			$(target).css("left", move);
		}
	}
	
	function ListCheck( target ) {
		$(target).animate(
			{ left: "-=241px" }, 2 * 1000, "linear", function(){
				Remove( target );
				ListCheck( target );
			}
		);
	}
	
	
	/* Slide Link List */
	$(".Slide").each( function(){
		afew(this);
	});
	
	function afew( target ){
		var x = $("li",target).length;
		if ( x < 10 ) {
			$("li", target).clone().appendTo(target);
			afew(target);
		}
	}
	
});


/*
	$(".Slide").hover(
		function(){
			ListCheck(this);
		},
		function(){
			Remove( this );
			$(this).stop();
		}
	);
	
	function Remove( target ) {
		var n = $(target);
		var posi = n.position().left;
		
		if ( posi < 0 ) {
			$("li:first",target).remove().clone().appendTo(target);
			var move = posi + 241;
			$(target).css("left", move);
		}
	}
	
	function ListCheck( target ) {
		$(target).animate(
			{ left: "-=241px" }, 2 * 1000, "linear", function(){
				Remove( target );
				ListCheck( target );
			}
		);
	}
	
	$(".Slide").each( function(){
		afew(this);
	});
	
	function afew( target ){
		var x = $("li",target).length;
		if ( x < 10 ) {
			$("li", target).clone().appendTo(target);
			afew(target);
		}
	}

*/

