(function($) {
             
                    $(function() {                        
                        $('.memberteaser').slideshow({
                            selector : 'p',
														fadetime : 1000,
														imagetime: 3000
                        });
                        
                    });
				
            
                   $.fn.extend({
                        slideshow: function( settings ) {
                            if( this.length == 0 ) { return }                    
                            var op = $.extend({
                                fadetime : 600,
                                imagetime : 2000,
                                play_button : $('#slide-play'),
                                pause_button : $('#slide-pause'),
                                start : false,
                                pause: false,
                                autostart : true,
                                selector : 'img'
                            }, settings);
                    
                            this.each(function() {
                                var $wrap = $(this),
                                $images = $wrap.find(op.selector),
                                timer,
                                init_zindex = $wrap.find(op.selector + ':first').css('z-index'),
                                slideto_zindex = parseInt(init_zindex) + 1;
                            
                                $images.not(op.selector +':first').css('opacity', 0);
                                $wrap.find(op.selector +':first').addClass('sh_first');
                                $wrap.find(op.selector +':last').addClass('sh_last');    
                                
                                op.play_button.addClass('sh_show');
                                op.pause_button.addClass('sh_show');
                            
                                function startSlide() {
                                    if( $.isFunction( op.start ) ) { op.start(); } ;
                                    timer = setInterval(function() { slideOver(); }, op.imagetime);
                                    op.play_button.hide();
                                    op.pause_button.show();
                                }
                            
                                function pauseSlide() {
                                    if( $.isFunction( op.pause ) ) { op.pause(); } ;
                                    clearInterval( timer );
                                    op.play_button.show();
                                    op.pause_button.hide();
                                }
                            
                                function slideOver() {
                                    var $current = $wrap.find(op.selector +'.active');
                                    if( $current.length == 0 ) { $current = $wrap.find(op.selector +':first'); }
                                    var $next = $current.next(op.selector);
                                    if( $next.length == 0 ) { $next = $wrap.find(op.selector +':first') }
                                
                                    $current.animate({
                                        'opacity' : 0
                                    }, op.fadetime, function() { $(this).removeClass('active').css({ 'z-index' : init_zindex }); });
                                
                                    $next.animate({ 
                                        'opacity' : 1
                                    }, op.fadetime, function() { $(this).addClass('active').css({ 'z-index' : slideto_zindex}); });
                                }
                            
                                // bindings
                                op.play_button.bind('click.slideshow', function(event) {
                                    startSlide();
                                    event.preventDefault();
                                });
                            
                                op.pause_button.bind('click.slideshow', function(event) {
                                    pauseSlide();
                                    event.preventDefault();
                                });
                            
                                if( op.autostart ) { startSlide(); }
                            });
                        } 
                    });
                })(jQuery)            
