$(function() {
	// Fade in content
	//$('#main').hide();
	//$('#main').fadeIn(300);
	
	// Fade in Work section thumb scroller
	$('#thumbscroller').hide();
    $('#thumbscroller').scrollable({size: 2, speed: 1500, activeClass:'active', clickable: false}).circular(); 
	$('#thumbscroller').fadeIn(1500);
	$('.jcarousel-prev').css({width:'0px'});
	$('.jcarousel-next').css({width:'0px'});
	
	// Thumb scroller (work) hover styling
	$('#thumbscroller').hover(function(){
		$('.prevPage, .nextPage').animate({width:'19px'},300);
	}, function(){
		$('.prevPage, .nextPage').animate({width:'0px'},300);
		
	});
	$('.items a').hover(function() {
		$(this).children('.mask').fadeIn(300)
	}, function(){$('.items a').children('.mask').fadeOut(300)
	});
	
	// Case Studies navigator function
	$('#imagescroller').scrollable({size: 1, speed: 750}).navigator({navi:'ul.navi', activeClass:'active'});
	
	// Custom Scrollbars
	$('.info_scrollbar').jScrollPane({showArrows: false, scrollbarWidth:'7', arrowSize:'5', animateTo:true});
	$('.scrollbar').jScrollPane({showArrows: true, scrollbarWidth:'7', arrowSize:'20', animateTo:true});
	reinitialiseScrollPane = function(){
		$('.scrollbar').jScrollPane({showArrows: true, scrollbarWidth:'7', arrowSize:'20', animateTo:true});
	}
	$('li.pres_item').click(function(){
		if($(this).children('p').css('display') == 'none'){
			$(this).children('p').fadeIn(300);
			reinitialiseScrollPane();
		}else{
			$(this).children('p').fadeOut(300);
			reinitialiseScrollPane();
		};
	});
	$('div.logos').jScrollPane({showArrows: true, scrollbarWidth:'7', arrowSize:'20', animateTo:true});
});
