$(document).ready(function(e) {
	
	
	if($(".homeRef").length){
		var animationSpeed = 1000;
		var pauseDuration = 2000;
		var animationCheck = true;
		var hover = false;
		var currentItem = 0;
		var totalSlides = $(".homeRef > img").size();
		var previousItem = totalSlides;
		$('.homeRef > img:not(:first)').css('opacity','0');
		
		if(totalSlides > 0){
			requestInterval(function(){	
				previousItem = currentItem;
				currentItem++;
				if(currentItem > totalSlides-1){
					currentItem = 0;
				}
				$(".homeRef > img:eq("+previousItem+")").animate({
					opacity:0
				}, animationSpeed);
				$(".homeRef img:eq("+currentItem+")").animate({
					opacity:1
				}, animationSpeed);
			},pauseDuration);
		}
	}
});
