$(document).ready(function() {
	
	$("#recent a").hover(function(){
		$(this).find('img').stop(true,true).animate({opacity: 1}, 200);
	}, function(){
		$(this).find('img').stop(true,true).animate({opacity: 0.5}, 200);
	});	
	
	$(".images div").jCarouselLite({
	    btnNext: ".next",
	    btnPrev: ".prev",
	    visible: 1,
	    speed: 400
	});

	// ------------------------------------------
	// Align Func
	// ------------------------------------------
	// Centres an object within a given one, vertically

	$.fn.vAlign = function() {
		var bh = $(this).height();				
		var ah = $(window).height();
		var mh = (ah - bh) / 2;
		$(this).css({ paddingTop: mh-115 });
	};
	
	$("#page_index #billboard").vAlign();
	$(window).resize(function(){
		$("#page_index #billboard").vAlign();
	});
	

	// ------------------------------------------
	// Lettering.js
	// ------------------------------------------
	// Allows access to each word as a CSS class
	
	$("#box_availablity").lettering('words').children("span").lettering();
	$("#box_contact a").lettering('words');
	$("#box_twitter a").lettering('words');

});

