
$(document).ready(function(){

	
	if ( $("#front-header #block-views-Testimonials-block_1 .views-row").length != 0 ) {

		$("#front-header #block-views-Testimonials-block_1 .views-field-body .field-content").each(function (){
			var target = $(this);
			var c1 = '<p class="quoteopen">&nbsp;</p>';
			var c2 = '<p class="quoteclose">&nbsp;</p>';
			target.html(c1 + target.html() + c2);
		});
		
		
		$("#front-header #block-views-Testimonials-block_1 .views-row").show();
		$("#front-header #block-views-Testimonials-block_1 .views-row").css({opacity: 0.0});
		$("#front-header #block-views-Testimonials-block_1 .views-row:first").addClass('active')
			.css({opacity: 1.0});
		
		setInterval( "slideSwitch()", 10000 );
	}
});



function slideSwitch() {

        
    //quote
    var $activeQ = $('#front-header #block-views-Testimonials-block_1 .view-content .active');

    if ( $activeQ.length == 0 ) $activeQ = $('#front-header #block-views-Testimonials-block_1 .views-row:first');

    var $nextQ =  $activeQ.next().length ? $activeQ.next()
        : $('#front-header #block-views-Testimonials-block_1 .views-row:first');

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

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


    
        
    
}

