$(document).ready(function() {

	// Project selector carousel
	if (typeof(carousel_start) != "undefined") {
		$('#projects_navigation').jcarousel({
			visible: 6,
			scroll: 6,
			start: carousel_start
		});
	}	

	// Project pages: big image and text selector

	// Auto-select first text
	$(".copy_switchable").css("display", "none");
	$("#copy_switchable_1").css("display", "block");

	// Hide all big images and switchable text blocks
	function _hide() {
		$("#project_image img").attr("class", "hidden");
		$(".copy_switchable").css("display", "none");
	}

	$("#image_switcher_1").click(function() {
		_hide();
		$("#project_image_1").removeAttr("class");
		$("#copy_switchable_1").css("display", "block");
	});
	$("#image_switcher_2").click(function() {
		_hide();
		$("#project_image_2").removeAttr("class");
		$("#copy_switchable_2").css("display", "block");
	});
	$("#image_switcher_3").click(function() {
		_hide();
		$("#project_image_3").removeAttr("class");
		$("#copy_switchable_3").css("display", "block");
	});
	$("#image_switcher_4").click(function() {
		_hide();
		$("#project_image_4").removeAttr("class");
		$("#copy_switchable_4").css("display", "block");
	});
	$("#image_switcher_5").click(function() {
		_hide();
		$("#project_image_5").removeAttr("class");
		$("#copy_switchable_5").css("display", "block");
	});

});