$(document).ready(function(){
	var ttl = $(".pagingq a:first").attr('title');
	$("#image_reelqText").show().html( ttl );
	$(".pagingq").show();
	$(".pagingq a:first").addClass("active");
		
	var imageHeight = $(".windowq").height();
	var imageSum = $(".image_reelq img").size();
	var imageReelHeight = imageHeight * imageSum;
	
	$(".image_reelq").css({'height' : imageReelHeight});
	
	rotate = function(){	
		var triggerID = $active.attr("rel") - 1;
		ttl = $active.attr('title');
		var image_reelPosition = triggerID * imageHeight; 

		$(".pagingq a").removeClass('active');
		$active.addClass('active'); 
		
		if ( ttl > '' ) $("#image_reelqText").show().html( ttl ); else $("#image_reelqText").hide();
		$(".image_reelq").animate({ 
			top: -image_reelPosition
		}, 300 );
		
	}; 
	
	rotateSwitch = function(){		
		play = setInterval(function(){ 
			$active = $('.pagingq a.active').next();
			if ( $active.length === 0) { 
				$active = $('.pagingq a:first'); 
			}
			rotate(); 
			
		}, 5000); 
	};
	
	rotateSwitch(); 
	
	$(".image_reelq a").hover(
		function() { clearInterval(play);}, 
		function() { rotateSwitch(); }
		);	
	
	$(".pagingq a").hover(function() { 
		$active = $(this); 
		
		clearInterval(play); 
		rotate(); 
		rotateSwitch(); 
		return false; 
	});	



});
