function createSlide() {
    this.idContent = 'contentAllBox';
    this.classBox = 'contentBox';    
    this.activeClass = 'activ';
    this.nextId = 'next';
    this.prevId = 'prev';
    this.min = 1;
    this.max = 0;
    this.nr = 0;
    this.speed1 = 1500;
    this.speed2 = this.speed1 - (this.speed1/3)
    
    this.countDivs = function ()
    {
        var x = 1;
        var min = this.min;
        var activeClass = this.activeClass;
        var divs = $( '#'+this.idContent+' div.'+this.classBox );
        var nr = divs.length;
        $.each(divs  , function() {      
            if ( x == min ) $(this).addClass( activeClass ); 
            $(this).attr( 'id', x );
            x+=1;
        });
        return nr; 
    }           
    
    this.nextSlide = function()
    {
        var min = this.min;
        var max = this.countDivs();
        var nextId = 0;
        var prevId = 0;
        var activeClass = this.activeClass;     
        var idContent = this.idContent;
        var classBox = this.classBox;
        var width = $( '.'+classBox ).outerWidth();   
        var speed1 = this.speed1;
        var speed2 = this.speed2;
        
        //next
        $( '#'+this.nextId ).click( function(){   
            if ( max != min ) {
                $( '.'+classBox ).css( 'left', 0 );     
                /*id-ul div-ului curent*/
                var currentId = parseInt ( $( '#'+idContent ).children('.activ').attr( 'id' ) );

                if ( currentId == max ) nextId = min; else nextId = currentId + 1; 
                $( '#'+nextId ).css( 'left', width+'px' );        
                
                $( '#'+nextId ).addClass( activeClass );
                $( '#'+nextId ).animate({ left:0 }, speed1);
                $( '#'+currentId ).animate({ left: - width }, speed2, function() { 
                    $( '#'+currentId ).removeClass( activeClass );
                });
            }
            return false;
        });   
    }
    
    this.prevSlide = function()
    {
        var min = this.min;
        var max = this.countDivs();
        var nextId = 0;
        var prevId = 0;
        var activeClass = this.activeClass;     
        var idContent = this.idContent;
        var classBox = this.classBox;
        var width = $( '.'+classBox ).outerWidth(); 
        var speed1 = this.speed1;
        var speed2 = this.speed2;  

        //prev
        $( '#'+this.prevId ).click( function(){
            if ( max != min ) {        
                $( '.'+classBox ).css( 'left', 0 );     
                /*id-ul div-ului curent*/
                var currentId = parseInt ( $( '#'+idContent ).children('.activ').attr( 'id' ) );
                
                if ( currentId == min ) prevId = max; else prevId = currentId - 1;   
                $( '#'+prevId ).css( 'left', '-'+width+'px' );     
                
                $( '#'+prevId ).addClass( activeClass );
                $( '#'+prevId ).animate({ left:0 }, speed1);
                $( '#'+currentId ).animate({ left: width }, speed2, function() { 
                    $( '#'+currentId ).removeClass( activeClass );
                });
            }
            return false;
        });
    }
    
    this.makeMovement = function ()
    {
        this.nextSlide();
        this.prevSlide();   
    }  
    
}


