

jQuery(function($){
	var items = $('#customer-quotes .item');
	quotesRoute(items);
	
	items = $('#content .visual .visual-info');
	var images = items.find('img');
	var ulList = items.find('ul');
	
	if(jQuery.browser.msie && jQuery.browser.version == '6.0') {		
		var loading = images.length;
		images.load(function(){
			loading--;
			if(loading == 0) {				
				items.slice(1).hide();
				images.show();
				ulList.show();				
				quotesRoute(items);
			}
		});
	}else{
		items.slice(1).hide();
		images.show(); 
		ulList.show();		
		quotesRoute(items);	
	}
	
});

function quotesRoute(items, speed, delay){
	if(typeof(speed) == 'undefined') speed = 2000;
	if(typeof(delay) == 'undefined') delay = 7000;
	
	var next = function(index){
		var current = items.eq(index);
		
		current.fadeIn(speed).delay(delay).fadeOut(speed, function(){
			next((index + 1) % items.length);
		});
	};
	next(0);
}