      SUBROUTINE DEF_ZONE(X0,X1,Y0,Y1,IOPT)
      INCLUDE 'Parametres.f'
C
      IX0 = NINT(ORIGINE_X + FACTEUR_EN_X*X0)
      IX1 = NINT(ORIGINE_X + FACTEUR_EN_X*X1)
      IY0 = NINT(ORIGINE_Y + FACTEUR_EN_Y*Y0)
      IY1 = NINT(ORIGINE_Y + FACTEUR_EN_Y*Y1)
      IF (IOPT.EQ.0) THEN
        IX0_ZONE_CLICK = MIN(IX0,IX1)
        IX1_ZONE_CLICK = MAX(IX0,IX1)
        IY0_ZONE_CLICK = MIN(IY0,IY1)
        IY1_ZONE_CLICK = MAX(IY0,IY1)
      ELSE
        IX0_ZONE_CLICK2 = MIN(IX0,IX1)
        IX1_ZONE_CLICK2 = MAX(IX0,IX1)
        IY0_ZONE_CLICK2 = MIN(IY0,IY1)
        IY1_ZONE_CLICK2 = MAX(IY0,IY1)
      ENDIF
      END
C----------------------------------------------------------------
      SUBROUTINE DEF_ZONEI(IX0,IX1,IY0,IY1,IOPT)
      INCLUDE 'Parametres.f'
C
      IF (IOPT.EQ.0) THEN
        IX0_ZONE_CLICK = MIN(IX0,IX1)
        IX1_ZONE_CLICK = MAX(IX0,IX1)
        IY0_ZONE_CLICK = MIN(IY0,IY1)
        IY1_ZONE_CLICK = MAX(IY0,IY1)
      ELSE
        IX0_ZONE_CLICK2 = MIN(IX0,IX1)
        IX1_ZONE_CLICK2 = MAX(IX0,IX1)
        IY0_ZONE_CLICK2 = MIN(IY0,IY1)
        IY1_ZONE_CLICK2 = MAX(IY0,IY1)
      ENDIF
      END
