	$(document).ready(function() { 
	
		$(".fade").css("display", "none");

		$(".fade").fadeIn(1000);	
	
		$("#newwork-wrap").jCarouselLite({
			btnNext: "#next",
			btnPrev: "#prev",
			speed: 500,
			visible: 1,
			beforeStart: onBeforeStart,
			afterEnd: onAfterEnd
		});
		
		$(window).scroll(function() {
			var scrollTop = $(window).scrollTop();
			
			if (scrollTop > 0) {
				$("#scroll").fadeIn('slow');
			}
			else {
				$("#scroll").fadeOut('fast');
			}
		});

		 $('#scroll a').click(function(){ 
			$('html, body').animate({scrollTop:0}, 'slow'); 
			return false; 
		});
		
		$('a.read-more').click(function(){ 
			//$("#selected-text").css('height','auto');
			$('#selected-text-wrap').slideToggle();
			$(".read-less").show();
			$(this).hide();
		});		
		
		 $('a.read-less').click(function(){ 
			$('#selected-text-wrap').slideToggle();
			//$("#selected-text").css('height','200px');
			$(".read-more").show();
			$(this).hide();
		});				
		
		$("#selected-works img").click(function(){ 
			$.scrollTo(
				this, 
				800,
				{offset: {top: -25, left:0} }
				);
		});
		
	});
	
	function onBeforeStart(){
		$('.newwork-text').hide();
	}
	
	function onAfterEnd(){
		$('.newwork-text').fadeIn("fast");
	}	

	Cufon.replace('#navigation ul li,#navigation-beta ul li,#navigation-gamma ul li, .replace p, h2', {
		hover: true,
		hoverables: { a: true }
	});	
