$( document ).ready( function () {
	
	//scrollFollow
	$("#navi").scrollFollow({
		container: "wrapper"
	});
	
	//hover
	$('a > img').hover(function(){ 
		$(this).fadeTo(200,0.2);
	},function() {
		$(this).fadeTo(200,1);
	});

	//changeimage
	$("#items a[rel='changeImg']").click(function(){
		var src = $(this).attr("href");
		$(this).parent().siblings().find("a").removeClass("selected");
		$(this).addClass("selected");
		$(this).parent().parent().parent().prev().find("img").fadeOut(0,function() {
			$(this).unbind().attr("src",src).fadeIn(0);
		});
		return false;
	});
	
	//prettyPhoto
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'light_rounded'});
		
	//SmoothScroll
	jQuery.easing.quart = function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b; };

	$('#navi a[href*=#], area[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}, 500);
				return false;
			}
		}
	});

});
