$(document).ready(function() {
	
	
	$(".fancybox_trigger").fancybox({
		'titlePosition'		: 'inside',
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
	
	$("li").children().last().addClass("none-bg");
	
	
});

$(window).load(function() {
						
	var slid;
	if (window.location.hash) {
		var tempp = window.location.hash.substr(1);
		if(tempp == "approach"){
			slid = 1;
		} else if(tempp == "work") {
			slid = 2;
		} else if(tempp == "people") {
			slid = 3;
		}
	} else {
		slid = 0;
	}									
						
	$('.flexslider').flexslider({
		animation: "slide",
		after: function(slider){
			$('.flexslider').animate({'height':$('.slides li').eq(slider.currentSlide+1).height()});
		},
		slideshow: false,
		manualControls: "#navigation li a",
		controlsContainer: '#wrapper',
		slideToStart: slid,
		start: function(slider) {
		  
		  $('#logo a').click(function(e){
			e.preventDefault();
			
			slider.flexAnimate(0, true);
		  
		  });
		
		}				
   });
});
