// JavaScript Document

$(function(){
  // assign the slider to a variable
  var slider = $('#slider').bxSlider({
    controls: false,
	mode: 'fade'
  });
  var slider_titles = $('#slider_titles').bxSlider({
    controls: false,
	mode: 'fade'
  });

  // assign a click event to the external thumbnails
  $('.slider_nav a').click(function(){
		var thumbIndex = $('.slider_nav a').index(this);
		// call the "goToSlide" public function
		slider.goToSlide(thumbIndex);
		slider_titles.goToSlide(thumbIndex);
		
		// remove all active classes
		$('.slider_nav a').removeClass('pager_active');
		// assisgn "pager-active" to clicked thumb
		$(this).addClass('pager_active');
		// very important! you must kill the links default behavior
		return false;
  });

  // assign "pager-active" class to the first thumb
  $('.slider_nav a:first').addClass('pager_active');
});


