var $test = null;
$(document).ready(function(){
	
	$tests = $('.home-item-list-2 li');

	var $theight = 0;
	
	$tests.each(function(){
		var $this = $(this);
		var height = $this.outerHeight();
		$theight = $theight < height ? height : $theight;
		$this.addClass('hide').hide();
	});
	
	$tests.first().removeClass('hide').show();
	var h = $theight + $('#testimonial h1').outerHeight();
	$('.home-item-list-2').css({'height':h+'px'});
	
	setTimeout( 'nextItem()' , 5000 );
});

function nextItem()
{
	var $cur	=	$('.home-item-list-2 li:not(.hide)');
	var $index	=	$('.home-item-list-2 li').index( $cur );
	var next 	=	$index >= ($tests.length-1) ? 0 : $index+1;
	//console.log('Current: '+$index+' Next: '+next+' SUM: '+$index+' >= '+($tests.length-1));
	$tests.eq($index).addClass('hide').slideUp(1000,function(){
		$tests.eq(next).removeClass('hide').slideDown(1000);
	});
	setTimeout( 'nextItem()' , 5000 );
}







