
$(document).ready(function () {
	
			// ---- Last Class  ----------------------------------------------------------------------------------------------------------

			$('#main-menu li:last,#what-we-say li:last,#service-menu li:last,#main .tabs li:last').addClass('last');
			$('<span id="shadow-l"></span><span id="shadow-r"></span>').appendTo('#content');
			
			
			// ---- Banner Image Shadow   -----------------------------------------------------------------------------------------
			
			$('#banner .image').each(function(){
				if($(this).find('img').length != 0){
				$('<span></span>').appendTo(this);
				};
			});
			
			
			// ---- Sidebar  -------------------------------------------------------------------------------------------------------------
			
			$('<span id="cbl"></span><span id="cbr"></span>').appendTo('#sidebar');
			$('#sidebar li:first').attr('id','first');
			
			$('#archive-menu > li').hover(function(){
				$(this).addClass('hover');	
			},function(){
				$(this).removeClass('hover');
			});
	
			
			// ---- Related  -------------------------------------------------------------------------------------------------------------
			
			$('<span id="cbl"></span><span id="cbr"></span>').appendTo('#related');
			$('#related li:first').attr('id','first');
			
			
			// ---- People  -------------------------------------------------------------------------------------------------------------
			
			$('#people > div > ul').easyListSplitter({ 
				colNumber: 2,
				direction: 'horizontal'
			});
			
			$('#people li').each(function(){
				$('<span class="people-top"></span><span class="people-bottom"></span>').appendTo(this);
				var bioElement = $(this).find('.bio');
				$('<a class="read-bio open">Read Biography [+]</a>').insertBefore(bioElement);
			});
			
			$('.read-bio').click(function(){
				if($(this).hasClass('open')){
					$(this).removeClass('open').addClass('close').html('Hide Biography [-]');
					$(this).next().slideDown();
				} else {
					$(this).removeClass('close').addClass('open').html('Read Biography [+]');
					$(this).next().slideUp();
				}
			});
			
			
	
	
			// ---- Image Shadow   ---------------------------------------------------------------------------------------------------
			
			$('.shadow').each(function(){
				$(this).wrap('<div class="shadow-tl" />').wrap('<div class="shadow-br" />');
				$('<span class="shadow-ct"></span><span class="shadow-cb"></span>').insertAfter(this);
				if($(this).hasClass('right')){
					$(this).removeClass('right');
					$(this).parents('.shadow-tl').addClass('right');
					var elementWidth = $(this).width() + 18;
					$(this).parents('.shadow-tl').width(elementWidth);
				};
				
			});
			
			
			// ---- Banners Clickable  ------------------------------------------------------------------------------------------------
			
			$('.banner').click(function(){
				window.location = $(this).find('a').attr('href');
			});
			
			
			// ---- Members  -----------------------------------------------------------------------------------------------------------
			
			$("#members div").jCarouselLite({
				btnNext: ".members-next",
				btnPrev: ".members-prev",
				auto: 4000,
				speed: 1200,
				visible:6,
				scroll:6
			});

			
			// ---- Tabs ----------------------------------------------------------------------------------------------------------
	
			$(".tab-content").hide(); // Hide all content
			$("ul.tabs li:first").addClass("active").show(); // Activate first tab
			$(".tab-content:first").show(); // Show first tab content
			$("ul.tabs li").click(function() { // onClick
				$("ul.tabs li").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).find("a").attr("href"); // Find the href attribute value to identify the active tab + content
				$(activeTab).fadeIn(); // Fade in the active content
				return false; // Prevent the default link behaviour
			});



            

				
});

