//Carousel Navigation
function mycarousel_initCallback(carousel) {
    $('.jcarousel-control1 a').bind('click', function() {
		var index = $(this).attr("id").split("_");
		carousel.scroll(jQuery.jcarousel.intval(index[1]));
        return false;
    });
};

$(document).ready(function() {
	
	window.location.hash = '#email';
	
	//Carousel
	$('#carousel').jcarousel({
	    scroll: 1,
	    visible: 1,
	    initCallback: mycarousel_initCallback
    });
    
    //Filter
	$('#portfolio-list').filterable({
		tagSelector: '#featured_filter a'
	});
		
	//Navigation
	$(".top").click(function(event){
	    event.preventDefault();
	    $.scrollTo('header', 800);
	});
	$(".portfolio").click(function(event){
	    event.preventDefault();
	    $.scrollTo('#featured_creative', 800);
	});
	$(".about").click(function(event){
	    event.preventDefault();
	    $.scrollTo('#about', 800);
	});
	$(".contact").click(function(event){
	    event.preventDefault();
	    $.scrollTo('footer', 800);
	});
	
	//Load member images after DOM load
	$('.a_member > .loading').removeClass('loading').each(function() {
		var divelement = this;
		var img = new Image();
		var src = $(this).attr("title");
		$(img).load(function () {
			$(this).hide();
			$(divelement).append(img);
			$(this).fadeIn();
		}).attr('src', src);
	});

});







