C***   MAINT

       SUBROUTINE MAINT

C  SOMEONE SAID THE MAGIC WORD TO INVOKE MAINTENANCE MODE.  MAKE SURE HE'S A
C  WIZARD.  IF SO, LET HIM TWEAK ALL SORTS OF RANDOM THINGS, THEN EXIT SO CAN
C  SAVE TWEAKED VERSION.  SINCE MAGIC WORD MUST BE FIRST COMMAND GIVEN, ONLY
C  THING WHICH NEEDS TO BE FIXED UP IS ABB(1).

       IMPLICIT INTEGER(A-Z)
       LOGICAL YESM,BLKLIN,WIZARD
       DIMENSION HNAME(10)
       COMMON /BLKCOM/ BLKLIN
      INTEGER*4 LTEXT,STEXT
       COMMON /LTXCOM/ LTEXT(250),STEXT(250),KEY(250),ABB(250),LOCSIZ
      INTEGER*4 WKDAY,WKEND,HOLID
      DOUBLE PRECISION MAGIC,Y,WD
       COMMON /WIZCOM/ WKDAY,WKEND,HOLID,HBEGIN,HEND,HNAME,
     1  SHORT,MAGIC,MAGNM,LATNCY,SAVED,SAVET,SETUP

       IF(.NOT.WIZARD(.TRUE.))RETURN
       BLKLIN=.FALSE.
       IF(YESM(10,0,0))CALL HOURS
       IF(YESM(11,0,0))CALL NEWHRS
       IF(.NOT.YESM(26,0,0))GOTO 10
       CALL MSPEAK(27)
       READ(1,1)HBEGIN
1       FORMAT(I4)
       CALL MSPEAK(28)
       READ(1,1)HEND
       CALL DATIME(D,T)
       HBEGIN=HBEGIN+D
       HEND=HBEGIN+HEND-1
       CALL MSPEAK(29)
       READ(1,2)HNAME
2       FORMAT(10A2)
10      PRINT 12,SHORT
12      FORMAT(' LENGTH OF SHORT GAME (NULL TO LEAVE AT',I3,'):')
      READ(1,1)X
       IF(X.GT.0)SHORT=X
       CALL MSPEAK(12)
       CALL GETIN(WD,Y,Y,Y)
       IF(WD.NE.'        ')MAGIC=WD
       CALL MSPEAK(13)
      READ(1,1)X
       IF(X.GT.0)MAGNM=X
       PRINT 16,LATNCY
16      FORMAT(' LATENCY FOR RESTART (NULL TO LEAVE AT',I3,'):')
      READ(1,1)X
       IF(X.GT.0.AND.X.LT.45)CALL MSPEAK(30)
       IF(X.GT.0)LATNCY=MAX0(45,X)
       IF(YESM(14,0,0))CALL MOTD(.TRUE.)
       SAVED=0
       SETUP=2
       ABB(1)=0
       CALL MSPEAK(15)
       BLKLIN=.TRUE.
       CALL CIAO
       END
