                var numero = 0;
                var movimentaEsq = true;
                var movimentaDir = true;
            function moveEsquerda() {
                            this.init = function(){
                                movimentaEsq = true;
                                move();
                            },
                       this.move = function(){
                            if (numero < 0) {
                                    numero += 10;
                                   var posicao = numero;
                                    document.getElementById("gallery").style.left = posicao +"px";
                                    if(movimentaEsq){
                                        setTimeout("move()","50");
                                        }
                                }
                       },
                       this.stop = function(){
                                  movimentaEsq = false;
                       }
                       init();
             }
                function moveDireita(limit) {

                            this.init = function(){
                                    movimentaDir = true;
                                    move();
                            },
                       this.move = function(){
                              if (numero > -limit) {
                                     numero -= 10;
                                    var posicao = numero;
                                    document.getElementById("gallery").style.left = posicao +"px";
                                    if(movimentaDir){
                                            setTimeout("move()","50");
                                        }
                                }
                       },
                       this.stop = function(){
                                  movimentaDir = false;
                       }
                       init();
             }
