$(document).ready(function() {	
	//Set Default State of each portfolio piece
	//$(".paging").show();
	$(".paging_banner a:first").addClass("active");	
		
	//Get size of images, how many there are, then determin the size of the image reel.
	//Banner small
	var imageWidth = $(".window").width();	
	var imageSum = $(".image_reel img").size();	
	var imageReelWidth = imageWidth * imageSum;
		
	//Adjust the image reel to its new size
	$(".image_reel").css({'width' : imageReelWidth});
	
	
	//Paging + Slider Function
	rotateNormal = function(){	
		var triggerID = $active.attr("rel") - 1; //Get number of times to slide
		
		
	
		var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide
		

		$(".paging_banner a").removeClass('active'); //Remove all active class
		
		$active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)
		
		
		//Slider Animation
		$(".image_reel").animate({ 
			left: -image_reelPosition
		}, 800 );
		
		
		
	}; 
	
	//Rotation + Timing Event
	rotateSwitchNormale = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			$active = $('.paging_banner a.active').next();
			
			if ( $active.length === 0) { //If paging reaches the end...
				$active = $('.paging_banner a:first'); //go back to first
			}
			
			rotateNormal(); //Trigger the paging and slider function
		}, 8000); //Timer speed in milliseconds (3 seconds)
	};
	
	rotateSwitchNormale(); //Run function on launch
	
	
			
});



$(document).ready(function() {	
	//Set Default State of each portfolio piece
	//$(".paging").show();	
	$(".paging_banner a:first").addClass("activeLarge");
		
	//Banner large
	var imageWidth_large = $(".window_large").width();
	var imageSum_large = $(".image_reel_large img").size();	
	var imageReelWidth_large = imageWidth_large * imageSum_large;	
	//Adjust the image reel to its new size	
	$(".image_reel_large").css({'width' : imageReelWidth_large});
	
	//Paging + Slider Function
	rotateLarge = function(){			
		var triggerID_large = $activeLarge.attr("rel") - 1; //Get number of times to slide					
		var image_reelPosition_large = triggerID_large * imageWidth_large; //Determines the distance the image reel needs to slide
		
		$(".paging_banner_large a").removeClass('activeLarge'); //Remove all active class		
		$activeLarge.addClass('activeLarge'); //Add active class (the $active is declared in the rotateSwitch function)
				
		
		$(".image_reel_large").animate({ 
			left: -image_reelPosition_large
		}, 800 );
		
	}; 
	
	//Rotation + Timing Event
	rotateSwitchLarge = function(){		
		play = setInterval(function(){ //Set timer - this will repeat itself every 3 seconds
			
			$activeLarge = $('.paging_banner_large a.activeLarge').next();			
			if ( $activeLarge.length === 0) { //If paging reaches the end...
				$activeLarge = $('.paging_banner_large a:first'); //go back to first
			}
			rotateLarge(); //Trigger the paging and slider function
		}, 5000); //Timer speed in milliseconds (3 seconds)
	};
	
	rotateSwitchLarge(); //Run function on launch
	
			
	
});
$(document).ready(function(){	
	$("#slider").easySlider({
		auto: true,
		continuous: true,
		speed:4000		
	});
});	



