var $= jQuery.noConflict();

(function($) {
	var imgList = [];
	$.extend({
		preload: function(imgArr, option) {
			var setting = $.extend({
				init: function(loaded, total) {},
				loaded: function(img, loaded, total) {},
				loaded_all: function(loaded, total) {}
			}, option);
			var total = imgArr.length;
			var loaded = 0;
			
			setting.init(0, total);
			for(var i in imgArr) {
				imgList.push($("<img />")
					.attr("src", imgArr[i])
					.load(function() {
						loaded++;
						setting.loaded(this, loaded, total);
						if(loaded == total) {
							setting.loaded_all(loaded, total);
						}
					})
				);
			}
			
		}
	});
})(jQuery);

$(function(){
    
	$('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}, 1000);
					
				return false;
				
			}
			
		}
		
	});
	
	$('.ico-facebook').hover(
		function () {
			$(".ico-facebook-box").fadeIn(100);
		}, 
		function () {
			$(".ico-facebook-box").fadeOut();
		}
	);
	
	$('.ico-twitter').hover(
		function () {
			$(".ico-twitter-box").fadeIn(100);
		}, 
		function () {
			$(".ico-twitter-box").fadeOut();
		}
	);
	
	$('.ico-flickr').hover(
		function () {
			$(".ico-flickr-box").fadeIn(100);
		}, 
		function () {
			$(".ico-flickr-box").fadeOut();
		}
	);
	
	$('.ico-youtube').hover(
		function () {
			$(".ico-youtube-box").fadeIn(100);
		}, 
		function () {
			$(".ico-youtube-box").fadeOut();
		}
	);
	
	$('.ico-vimeo').hover(
		function () {
			$(".ico-vimeo-box").fadeIn(100);
		}, 
		function () {
			$(".ico-vimeo-box").fadeOut();
		}
	);
	
	$('.ico-rss').hover(
		function () {
			$(".ico-rss-box").fadeIn(100);
		}, 
		function () {
			$(".ico-rss-box").fadeOut();
		}
	);
	
});
