// Jquery Cycle for steps
$(document).ready(function() {
   $('#switcher').cycle({
      fx:         'none', 
      speed:      200,
      timeout:    0,
      pager:      '#nav',
      pagerEvent: 'click',
      after: onAfter
   });
});

//Workaround div height not being set properly
function onAfter(curr, next, opts, fwd) {
   var index = opts.currSlide;
   $('#prev')[index == 0 ? 'hide' : 'show']();
   $('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
   //get the height of the current slide
   var $ht = $(this).height();
   //set the container's height to that of the current slide
   $(this).parent().css("height", $ht);
}


