﻿jQuery(document).ready(function () {
  jQuery("#crutch-feature")
        .cycle({
          fx: "fade", // fade, toss, shuffle, fadeZoom, scrollHorz, wipe, uncover, none
          timeout: 6000, // 6000 = 6 seconds | 0 to disable auto advance
          //timeoutFn: slideCustomTimeout,
          speed: 500,
          pause: true,
          pauseOnPagerHover: true,
          cleartype: true,
          cleartypeNoBg: true,
          prev: "#crutch-feature-prev",
          next: "#crutch-feature-next",
          pager: "#crutch-feature-slider-nav .slider-nav",
          pagerAnchorBuilder: function (idx, slide) { return "#crutch-feature-slider-nav .slider-nav li a:eq(" + idx + ")"; }
        });

  jQuery(".slider-button a").click(function () {
    jQuery("#crutch-feature").cycle("pause");
  });
});

// Timeouts per slide (in seconds) 
//var customTimeout = [3, 3, 3, 6];
//function slideCustomTimeout(currElement, nextElement, opts, isForward) {
//  var index = opts.currSlide;
//  return customTimeout[index] * 1000;
//}
