$(document).ready(function() {

	// Cache the elements we are working on
	var $slide_gallery = $('#teaser .slideshow');
	var $slide_nav = $('#teaser .navigation a');
	var $first_nav = $('#teaser .navigation li:first-child a');
	
	// Set the cycle plugin on the teaser slideshow area
	$slide_gallery.cycle({ 
		timeout: 0, 
		speed:   300, 
		startingSlide: 0 
	});
	
	// Add the active CSS class to the first link in the slideshow navigation
	$first_nav.addClass('activeSlide');
	
	// Set the link actions (loop through and assign a slide number for each)
	$slide_nav.each(function(index){
		
		$(this).click(function(){
			// Call the slide
			$slide_gallery.cycle(index);
			// Remove active CSS class from others & add it to this one
			$slide_nav.removeClass('activeSlide');
			$(this).addClass('activeSlide');
    		return false;
		})
		
	});



});
