﻿var activeElement = 0;

$(document).ready(function(){

    // start up the rotater for the questions
    $('#divEventsRotate').cycle({
        fx:      'fade',
        speed:    3000,
        timeout:  4000,
        pause: 1,
        prev: '#lnkPrev',
        next: '#lnkNext',
        before: afterChange,
        pauseOnPagerHover: 1,
        prevNextClick: stopAll,
        pager: '#pagerNav',
        fastOnEvent: 1,
        pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#pagerNav span:eq(' + idx + ')'; 
    } 
        
        
    });
    
    // turn on the image icons as we need them
    
    for (i = 1; i <= $(".imgrotate").length; i++){
    
         $("#switch_" + i).show();
    
    }

});

function afterChange(currentz) {


    activeElement = $(currentz).attr("id").replace("event_", "");
    $("#switch_" + activeElement).attr("class", "pickOff");
    activeElement = $( this ).attr("id").replace("event_", "");
    $("#switch_" + activeElement).attr("class", "pickOn");
   
}

function stopAll(current) {


    //$('#divEventsRotate').cycle('stop');

}