function mouseListener(){
    lockScroll(false);

  $(window).mousemove(function(mouse){
    mouseX = mouse.pageX;
    mouseY = mouse.pageY;
    windowX = $(window).width();
    windowY = $(window).height();

    differenceX = windowX-mouseX;
    differenceY = windowY-mouseY;

    if(typeof(moveu)=="undefined") siteScroll();
  });
}

function siteScroll(){

  moveu = true;

  windowX = $(window).width();
  windowY = $(window).height();

  moverX = windowX/100;
  moverY = windowX/100;

  mouseX = 0;
  mouseY = 0;

  differenceX = 0;
  differenceY = 0;

  limiteX = 100;
  limiteY = 200;

  $(".background").everyTime(30, function(){
    blindPoint = (mouseX == 0 && mouseY == 0);

    scrolledX = -parseInt($(this).css("left"));
    scrolledY = -parseInt($(this).css("top"));

    heightWithoutFooter = $(window).height()-$(".filtro_footer").outerHeight()-10;
    touchingFooter = mouseY > heightWithoutFooter

     if(blindPoint || touchingFooter || lockedScroll) return;

     if(differenceX<limiteX && scrolledX < $(".background").width() - windowX - moverX){
      $(this).css({left: "-="+moverX});
      $("#overlay-image").css({left: "-="+moverX});
    }

    if(differenceX>windowX-limiteX && scrolledX-moverX >= 0 && scrolledX){
      $(this).css({left: "+="+moverX});
      $("#overlay-image").css({left: "+="+moverX});
    }

    if(differenceY<$(".filtro_footer").outerHeight()+30 && scrolledY < $(".background").height() - windowY - moverY){
      $(this).css({top: "-="+moverY});
      $("#overlay-image").css({top: "-="+moverY});
    }

    if(differenceY>windowY-limiteY && scrolledY-moverY >= 0){
      $(this).css({top: "+="+moverY});
      $("#overlay-image").css({top: "+="+moverY});
    }

  });
}


