(function($){
  $(document).ready(function($){
    $('.slides').cycle({
      pager : '#slider-nav',
      pagerAnchorBuilder : function( index, el ){
        var label = ( $(el).find('h2').attr('title') ) ? $(el).find('h2').attr('title') : $(el).find('h2').text();
        return '<li><a href="#">' + label + '</a></li>';
      },
      width: 900,
      height: 220
    }); 

    var slidesCount = $('.slides li').size();
    $('#slider-nav').find('li').css({ width: Math.floor(100/slidesCount) + '%' });
  });
})(jQuery);
