	$(function() {	
	
	    $('#slideshow').cycle({
		fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
	});

		$("#navigation li ul").hide();
		$("#navigation li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn("200");

		$("#navigation li ul li a").hover(function(){
			$(this).addClass("active");
		}, function(){

		});
		},
		function(){
		$(this).find('ul:first').css({visibility: "hidden"});
		$("#navigation li ul li a").removeClass("active");
		});
	
		var step = 1; 
		var current = 0; 
		var maximum = $('#meetTheTeam ul li').size(); 
		var visible = 1; 
		var speed = 750; 
		var liSize = 355;
		var meetTheTeam_height = 124;
		var infinite = true;
	 

		var ulSize = liSize * maximum;   
		var divSize = liSize * visible;  

		$('#meetTheTeam ul').css("width", ulSize+"px").css("left", -(current * liSize)).css("position", "absolute");
		
		$('#meetTheTeam').css("width", divSize+"px").css("height", meetTheTeam_height+"px").css("visibility", "visible").css("overflow", "hidden").css("position", "relative"); 

		$('.btnnext').click(function() { 
			if(current + step < 0 || current + step > maximum - visible) {
			
			if (infinite)
			{
			$('#meetTheTeam ul').animate({left: 0}, speed, null);
			current=0;
			}
			else
			return;
			}
			else {
				current = current + step;
				$('#meetTheTeam ul').animate({left: -(liSize * current)}, speed, null);
			}
			return false;
		});

		$('.btnprev').click(function() { 
			if(current - step < 0 || current - step > maximum - visible) {
			if (infinite)
			{
			$('#meetTheTeam ul').animate({left: -(liSize * (maximum - 1))}, speed, null);
			current=maximum-1;
			}
			else
			return;
			}
			else {
				current = current - step;
				$('#meetTheTeam ul').animate({left: -(liSize * current)}, speed, null);
			}
			return false;
		});
		
			
		$('#social .socialButton').mouseenter( function() {
			showSocialContent($(this).find('.socialHover'))}
		);
		
		$('#social .socialButton').mouseleave( function() {
			hideSocialContent($(this).find('.socialHover'))
			}
		);	
		
//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first a").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li a").click(function() {

		$("ul.tabs li a").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).attr("href"); //Find the href attribute value to identify the active tab + content
		
		
		$(activeTab).show(); //Fade in the active ID content
		return false;
	});
	});
	
	function showSocialContent(object) {
		$(object).show();
		$(object).animate({
			height: 320,
			opacity: 100
		}, {
			queue: false,
			duration: 200
		});
		
	}
	
	function hideSocialContent(object) {
		
		$(object).animate({
			opacity: 0,
			height: 0

		}, {
			queue: false,
			duration: 300,
			complete: function() {
				$(object).hide();
			}
		});
		
	}
