
/*
*** JAVASCRIPT FOR SLIDESHOW ON HOME PAGE ***
Dependencies:
1) jquery
2) jquery.cycle
3) jquery.easing (optional - to use non-default easing )
*/

$(document).ready(function() {

  $('#slider')
    .cycle({
      fx: 'scrollHorz',                           // transistion type
      timeout: 10000,                             // transition interval
      before:  onBefore,                          // callback fn used to set picture title
      next: '#nextbutt',                          // selector for 'next' button
      pager:  '#slidenav',                        // selector for pager/navigation section
      pagerAnchorBuilder: function(idx, slide) {  // callback fn that creates custom pager anchors
        return '<a href="#"><img src="images/blank.gif" width="15" height="15" title="Click for picture ' + (idx+1) +'"></a>';
      }
  });

});

function onBefore() {
  if      (this.alt)            { $('#sliderTitle').html(this.alt); }
  else if (this.firstChild.alt) { $('#sliderTitle').html(this.firstChild.alt); }
  else                          { $('#sliderTitle').html(''); }
}

