C THIS SUBROUTINE OPENS THE BINARY FILE DEFINED BY ARRAY AN
C AND DISPLAYS THE APPROPRIATE PAGE NUMBER DEFINED BY THE
C ARGUMENT IP.
C IP IS SET TO -1 FOR AN INITIAL READIN;  TO 0 TO SWITCH A PAGE
C OFF;	TO AN INTEGER TO DISPLAY THAT PAGE NUMBER;  AND TO -2
C TO CLEAR THE DISPLAY FILES OF THAT MENU.
C
C
      SUBROUTINE MENU(A,B,IP)
      DIMENSION AN(2)
      COMMON/OIL/IVECT(200)
      AN(1)=A
      AN(2)=B
      CALL SEEK(1,AN)
      IF(IP.NE.(-1))GO TO 33
1     READ(1)ITAG
      IF(ITAG.NE.0)GO TO 1
2     READ(1)ISIZ,ITAG,(IVECT(K),K=1,ISIZ)
      IF(ITAG.EQ.0)GO TO 99
      CALL CRT(1,ITAG,IVECT,1,ISIZ)
      GO TO 2
33    IPG=0
3     IPG=IPG+1
      READ(1)ISIZ
      IF(ISIZ.EQ.0)GO TO 99
      IFCN=5
      IF(IPG.EQ.IP)IFCN=4
      IF(IP.EQ.(-2))IFCN=3
      DO 5 I=1,ISIZ
      READ(1)ITAG
5     CALL CRT(IFCN,ITAG)
      GO TO 3
99    CALL CLOSE(1)
      RETURN
      END
