var sg_spotlight = {
  paused: false,
  
  init: function() {
    $("#spotlight-slideshow").cycle({
      fx: "fade",
      after: function(curr, next, opts) {
        $('#status-text').html("<strong>" + (opts.currSlide + 1) + "/" + (opts.slideCount) + "</strong> " + $("#spotlight-"+opts.currSlide+" .slideshow_content_title").text());
        $('.spotlightitem').css('background', 'transparent');
      },
      prev: '#spotlight_prev',
      next: '#spotlight_next',
      timeout: 5000
    });
    
    $('#spotlight_playpause').click(function(e) {
    	if (this.paused) {
    	  $('#spotlight-slideshow').cycle('resume');
    	  this.paused = false;
    	}
    	else {
    	  $('#spotlight-slideshow').cycle('pause');
    	  this.paused = true;
    	}
      return false;
    });
  }
}

$(document).ready(function(){
  sg_spotlight.init();
});
