$(function(){
$('.mainSlides').slides({
        preload: true,
        play: 8000,
        generateNextPrev: false,
        effect: 'fade',
        crossfade: false,
        pagination: false,
        generatePagination: false
});

$('.landingSlideContainer').slides({
        preload: true,
        play: 8000,
        generateNextPrev: false,
        effect: 'fade',
        crossfade: false,
        pagination: false,
        generatePagination: false
});
});

Cufon.replace('.theMenu > ul > li > a, h1, h2:not(.nocufon), h3.widget-title', { fontFamily: 'Sancoale Medium', hover: true });

$(document).ready(function(){
lastBlock = $("#a1");
maxWidth = 227;
minWidth = 22;	

$("ul.accordian div.acSlide").click(
  function(){
        //if( $(lastBlock).is(':animated') ) {return;}
        
        $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:400 });
        $(lastBlock).removeClass('active');
        
        $(this).addClass('active');
        $(this).animate({width: maxWidth+"px"}, { queue:false, duration:400});
        lastBlock = this;
  }
);

$(".featuredCaseStudy").hover(
        function(){
                $(this).css("z-index", "500");
                $(this).animate({height: "367px", top: "-47px"}, {queue:false, duration:600});
                $(this).children(".caseStudyImage").animate({top: 47+"px"}, {queue:false, duration:600});
                $(this).children(".caseStudyOverview").animate({top: 47+"px"}, {queue:false, duration:600});
        },function(){
                $(this).animate({height: "170px", top: "0px"}, {queue:false, duration:600});
                $(this).children(".caseStudyImage").animate({top: 0+"px"}, {queue:false, duration:600});
                $(this).children(".caseStudyOverview").animate({top: 0+"px"}, {queue:false, duration:600});		
                $(this).css("z-index", "1");
        }
        
);

// Work on the menu's to add first and last item selectors
$('ul.sub-menu > li:first-child').addClass('first-item');
$('ul.sub-menu > li:last-child').addClass('last-item');

});
