$(document).ready(function() { 

	$(".paging1").show(); 
	$(".paging1 a:first").addClass("active"); 
	var imageWidth = $(".window1").width(); 
	var imageSum = $(".image_reel1 img").size(); 
	var imageReelWidth = imageWidth * imageSum; 

	$(".image_reel1").css({'width' : imageReelWidth}); 
	
	rotate1 = function(){ 
		var triggerID = $active.attr("rel") - 1; 
		var image_reelPosition = triggerID * imageWidth; 
		$(".paging1 a").removeClass('active'); 
		$active.addClass('active'); 
		$(".image_reel1").animate({ left: -image_reelPosition }, 500 ); 
		}; 

	rotateSwitch1 = function(){ 
		play = setInterval(function(){ $active = $('.paging1 a.active').next(); 
		if ( $active.length === 0) { $active = $('.paging1 a:first'); } 
		rotate1(); }, 8000); 
	}; 

	rotateSwitch1(); 
	$(".image_reel1 a").hover(
		function() { clearInterval(play); }, 
		function() { rotateSwitch1(); }
		); 

	$(".paging1 a").click(function() {  
		$active = $(this); 
		clearInterval(play); 
		rotate1(); 
		rotateSwitch1(); 
		return false; 
		}); 

}); 
