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);


$('document').ready(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}, 700);
					
				return false;
				
			}
			
		}
		
	});
	
	$('#rodape #seguir_link a').click(function() {
	  if ($('#rodape #seguir_link').is(".aberto")) {
		  $('#rodape #seguir ul').animate({
			marginLeft: '-106px'
		  }, 400, 'easeOutCubic', function() {
			$('#rodape #seguir_link').attr("class", "fechado");
		  });
	  }
	  else {
		  $('#rodape #seguir ul').animate({
			marginLeft: '86px'
		  }, 400, 'easeOutCubic', function() {
			$('#rodape #seguir_link').attr("class", "aberto");
		  });
	  }
	});
	
});

