function slideSwitch() {
    var $active = $('div.slideshow #slides img.active');

    if ( $active.length == 0 ) $active = $('div.slideshow #slides img:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('div.slideshow #slides img:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 500, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

$(function() {
			$('.home_categories ul li').hover(function(){
				$(this).find('.cat_text').animate({top:'35px'},{queue:false,duration:500});
			}, function(){
				$(this).find('.cat_text').animate({top:'168px'},{queue:false,duration:500});
			});
		});

/* Slideshow functions*/

Cufon.replace('.content h1', {
	hover: true,
	fontFamily: 'Sari'
});

Cufon.replace('.content h2', {
	hover: true,
	fontFamily: 'Sari'
});

Cufon.replace('.masthead .vcard .tel', {
	hover: true,
	fontFamily: 'Sari'
})

$(document).ready(function(){
	
	$("body").addClass("hasJS");
	$(".hasJS #testimonials_list div:even").addClass("first_row");
});






