jQuery.fn.eiInitJSRotator = function(animation,animationSpeed,timeout,navType,prev,next) {
    var rotatorContainer = jQuery(this).find('div.slidesContainer'),
        rotatorItems = rotatorContainer.find('div.rotatorItem')
        effect = parseInt(animation,10)===1?'slide':'fade';
        
    if (rotatorItems[0]) {
        jQuery(this).slides({
			container: 'slidesContainer',
            generateNextPrev: true,
            next: next,
            prev: prev,
            pagination: true,
            paginationClass: 'slidesPagination',
			effect: effect?effect.toLowerCase():'fade',
            fadeSpeed: animationSpeed, //Set the speed of the fading animation in milliseconds.
            slideSpeed: animationSpeed, //Set the speed of the sliding animation in milliseconds
            play: timeout, //Autoplay slideshow, a positive number will set to true and be the time between slide animation in milliseconds
            pause: timeout, //Pause slideshow on click of next/prev or pagination. A positive number will set to true and be the time of pause in milliseconds.
            bigTarget: false,
            hoverPause: true
        })
        .addClass('slidesInitialized');
        if(navType===1){ // style navigation as text
            var rotatorPager = jQuery(this).children('ul.slidesPagination');
            if (rotatorPager[0]) {
                rotatorPager.addClass('asText').find('a').each( function(index) {
                    jQuery(this).html(rotatorItems.eq(index).attr('title'));
                });
            }
        }
    }
}
        
