$(window).load(function() {
	
	var casestudysize = $(".view-portfolio .field-content").size();
	
	$("#right_arrow").show().css({ opacity: 1 });
	$("#left_arrow").show().css({ opacity: 0.25 });
		
	$(".casestudy").slice(12,24).hide();
	$("#box2").hide();
	
	$("#left_arrow").click(function() {
		$(".casestudy").slice(0,12).fadeIn("slow");
		$(".casestudy").slice(12,24).hide();
		$(this).css({ opacity: 0.25 });
		$("#right_arrow").css({ opacity: 1 });
	});
	
	$("#right_arrow").click(function() {
		$(".casestudy").slice(0,12).hide();
		$(".casestudy").slice(12,24).fadeIn("slow");
		$(this).css({ opacity: 0.25 });
		$("#left_arrow").show().css({ opacity: 1 });
	});
	
	$(".link1").click(function() {
		$("#box1").hide();
		$("#box2").fadeIn("slow");
	});
	
	$(".link2").click(function() {
		$("#box2").hide();
		$("#box1").fadeIn("slow");
	});
	
		$(".wwd-two a").css({ opacity: 0.5 });
		$(".wwd-three a").css({ opacity: 0.5 });
	
	$(".wwd-one a").click(function(){
		$(this).css({ opacity: 1 });
		$(".wwd-two a").css({ opacity: 0.5 });
		$(".wwd-three a").css({ opacity: 0.5 });
		$("#WWD-about-wrapper").show();
		$("#WWD-services").hide();
		$("#WWD-solutions-wrapper").hide();
	});
	
	$(".wwd-two a").click(function(){
		$(this).css({ opacity: 1 });
		$(".wwd-one a").css({ opacity: 0.5 });
		$(".wwd-three a").css({ opacity: 0.5 });
		$("#WWD-about-wrapper").hide();
		$("#WWD-services").show();
		$("#WWD-solutions-wrapper").hide();
	});
	
	$(".wwd-three a").click(function(){
		$(this).css({ opacity: 1 });
		$(".wwd-two a").css({ opacity: 0.5 });
		$(".wwd-one a").css({ opacity: 0.5 });
		$("#WWD-about-wrapper").hide();
		$("#WWD-services").hide();
		$("#WWD-solutions-wrapper").show();
	});
	
	$(".dot1").click(function(){
		$("#page-one").show();
		$("#page-two").hide();
		$("#page-three").hide();
		$(this).addClass("active");
		$(this).removeClass("inactive");
		$(".dot2").removeClass("active");
		$(".dot2").addClass("inactive");
		$(".dot3").removeClass("active");
		$(".dot3").addClass("inactive");
	});	
	
	$(".dot-1").click(function(){
		$("#page-one-wwd").show();
		$("#page-two-wwd").hide();
		$(this).addClass("active");
		$(this).removeClass("inactive");
		$(".dot-2").removeClass("active");
		$(".dot-2").addClass("inactive");
	});	

	
	$(".dot2").click(function(){
		$("#page-one").hide();
		$("#page-two").show();
		$("#page-three").hide();
		$(this).addClass("active");
		$(this).removeClass("inactive");
		$(".dot1").removeClass("active");
		$(".dot1").addClass("inactive");
		$(".dot3").removeClass("active");
		$(".dot3").addClass("inactive");
	});
	
	$(".dot-2").click(function(){
		$("#page-one-wwd").hide();
		$("#page-two-wwd").show();
		$(this).addClass("active");
		$(this).removeClass("inactive");
		$(".dot-1").removeClass("active");
		$(".dot-1").addClass("inactive");
	});	
	
	$(".dot3").click(function(){
		$("#page-one").hide();
		$("#page-two").hide();
		$("#page-three").show();
		$(this).addClass("active");
		$(this).removeClass("inactive");
		$(".dot2").removeClass("active");
		$(".dot2").addClass("inactive");
		$(".dot1").removeClass("active");
		$(".dot1").addClass("inactive");
	});	
	
	
	
	
	
	
	$(".view-people-list .field-content").click(function(){
		var index = $(".view-people-list .field-content").index(this);
		$('#WWA-intro-column').hide();
		$('.view-people .field-content').hide();
		$('.view-people .field-content').eq(index).show();
	});
	
	
	$(".view-vacancies-list .field-content").click(function(){
		var index = $(".view-vacancies-list .field-content").index(this);
		$('#WWA-intro-column-2').hide();
		$('.view-vacancies .field-content').hide();
		$('.view-vacancies .field-content').eq(index).show();
	});
	
	$(".backtowwa").click(function(){
		$('.view-people .field-content').hide();
		$('#WWA-intro-column').show();
		
	});
	
	
	$("#vacancies a").click(function(){
		var link = $(this).text().replace(/ /g,'-');
		//alert("http://www.kodudigital.com/vacancies/"+link); 
		window.location.replace("http://www.kodudigital.com/vacancies/"+link);
	});

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
});
