   screen close 2
   SCREEN 1,320,260,5,1
   WINDOW 2,,,128+16+32,1
   WINDOW OUTPUT 2
   REM $option y+,k240,l+,a+,v+,h3000,g+
	 DEFINT a-Z

10 CLEAR
   RANDOMIZE TIMER

	 LIBRARY "extend.library"
	 setwindow WINDOW(7)

   font SADD("rub.font"+CHR$(0)),8
   loadiff sadd("df0:footpic6"+chr$(0))
   x$="Football Boss"
   font sadd("courier.font"+chr$(0)),24
   locate 1,1
   color 4,0
   
   gosub length
   print ptab(160-(x2*7.5));x$
   font sadd("rub.font"+chr$(0)),8
   locate 5,30
   print  "by P.Harvey"
   
20 dim playername$(164)
	 dim coach%(64),coach.name$(64)
	 dim physio%(64),physio.name$(64)
	 dim p.off%(3,4)
	 dim lresult%(4,8,4)
	 DIM eskill%(100,4)
	 DIM egates&(164)
	 DIM ec%(32)
	 DIM cc%(32)
	 DIM uc%(32)
	 DIM crs%(16,2)
	 DIM urs%(16,2)
	 DIM ers%(16,2)
	 DIM fixture&(64,30,3)
	 DIM booked%(18)
   DIM sub.players(64)
   DIM team.score(64)
   DIM keeper!(164)
   DIM defense!(164)
   DIM midfield!(164)
   DIM attack!(164)
   DIM pt%(64,18)
   DIM transfers(10,2)
   DIM his&(64,60)
   DIM pog%(64,31)
   DIM profit&(64)
   DIM ball(32)
   DIM cgates&(64)
   DIM cap%(64)
   DIM a&(64)
   DIM playn$(200)
   DIM skills%(64)
   DIM l%(8,2),os%(18)
   DIM g%(16)
   DIM hg%(10,2)
   DIM gd%(17)
   DIM gf%(17)
   DIM posi%(17)
   DIM points%(17)
   DIM taken%(4,16),tact%(164,3),agg%(164)
   DIM results%(4,8,2,2)
   DIM scorers%(64,20,2)
   DIM lc%(64),fc%(64)
   DIM lres%(32,2)
   DIM ps!(64,18,4),pa%(64,18),pg%(64,18),pj%(64,18),pp%(64,18),pc%(64,18)
   DIM tn$(164)
   DIM wins%(64),draws%(64),lost%(64),gfor%(64),gag%(64)
   DIM m&(64),lo&(64),mo&(64)
   DIM ds%(4,16)
   DIM dp%(4,16)
   DIM dsp%(4,16)
   dim defm%(4,4)
   dim midm%(4,4)
   dim attm%(4,4)
   DIM sl$(64)
   dim txt$(340)

defdata:
	 data 0,0,0,0,2.5,0,2.5,-2.5,0,2.5,-2.5,0,-2.5,-2.5,0,2.5

middata:
	 data 0,0,0,0,2.5,0,-2.5,0,-2.5,2.5,0,0,0,-2.5,2.5,0

attdata:
   data 0,2.5,2.5,2.5,-2.5,0,-2.5,2.5,0,-2.5,2.5,0,2.5,0,-2.5,-2.5

   restore defdata
   for f=1 to 4
   	 for y=1 to 4
    	 read defm%(f,y)
 		 next y
   next f

   restore middata
   for f=1 to 4
   	 for y=1 to 4
     	 read midm%(f,y)
     next y
   next f

   restore attdata
   for f=1 to 4
     for y=1 to 4
       read attm%(f,y)
     next y
   next f

   RESTORE newsdata
   DIM new$(15),newsa&(15),news(15)
   FOR a=1 TO 15
	   READ newsa&(a)
   NEXT a

newsdata:
	 DATA 50000
   DATA -20000
	 DATA -10000
   DATA -1000
   DATA 10000
   DATA 20000
   DATA -10000
   DATA 10000
   DATA 10000
   DATA -10000
   DATA -20000
   DATA 20000
   DATA -20000
   DATA -3000
   DATA -10000

   FOR a=1 TO 64
  	 sl$(a)="      "
	   physio.name$(a)=space$(10)
	   coach.name$(a)=space$(10)
   NEXT a

	 FOR a=1 TO 100
		 eskill%(a,1)=INT(RND*30)+60
		 FOR b=2 TO 4
			 eskill%(a,b)=INT(RND*300)+600
		 NEXT b
	 NEXT a

euro.names:
	 data "Manchester Utd ","Leeds United   ","Liverpool      "
	 data "Manchester City","Sheffied Wed   ","Aston Villa    "
	 data "Arsenal        ","Chelsea        ","Crystal Palace "
	 data "Spurs          ","Everton        ","Nottingham F   "
	 data "Queens Park Rgr","Oldham         ","Norwich        "
	 data "Luton          "
	 data "Blackburn R    ","Southend       ","Ipswich        "
	 data "Middleborough  ","Leicester City ","Cambridge Town "
	 Data "Portsmouth     ","Charlton Town  ","Swindon Town   "
	 data "Wolves         ","Derby Town     ","Sunderland     "
	 data "Millwall       ","Tranmere       ","Port Vale      "
	 data "Oxford         "
	 data "Brentford      ","WBA            ","Stoke          "
	 data "Huddersfield   ","Stockport Town ","Shrewsby Town  "
	 data "Bolton W       ","Leyton Orient  ","Exeter         "
	 Data "Peterbrough    ","Reading        ","Swansea        "
	 data "Bradford       ","Preston        ","Torquay        "
	 Data "Chester        "
	 data "Burnley        ","Mansfield      ","Blackpool      "
	 data "Barnet Town    ","Rotherham      ","Rochdale       "
	 data "Cardiff        ","Crewe          ","Chesterfield   "
	 data "Walsall        ","Gillingham     ","Halifax Town   "
	 data "York           ","Carlise        ","Lincoln        "
	 data "Maidstone      "
	 DATA "Auxerre        ","FK Austria     ","Club Bruges    "
   DATA "Anderlecht     ","Mechelen       ","Antwerp        "
   data "Waregem        ","Club Liege     ","Standard Liege "
   data "Vitosha        ","CFKA Sredets   ","Slavia Sofia   "
   DATA "Trakia Plovdiv ","Perzoporikos   ","Omonia         "
   data "Nantes         ","AS Cannes      ","Niort          "
   data "Dynamo Berlin  ","Carl Zeiss Jena","Dynamo Dresden "
   data "Leipzig        ","Werder Bermen  ","E Frankfurt    "
   DATA "Bayern Munich  ","Stuttgart      ","Hamburg        "
   data "Nurembury      ","Dortmund       ","Larissa        "
   data "Panathinaikos  ","AC Milan       ","Sampdoria      "
   data "Juventus       ","Napoli         ","Internazionale "
   data "Roma           ","Fiorentina     ","Atalanta       "
   DATA "Bologna        ","Verona         ","Dundalk        "
   data "Derry City     ","Shamrock Rovers","Glentoran      "
   data "Bangor         ","Linfield       ","Apdel          "
   data "Sparta Pragus  ","Inter          ","Dukla          "
   data "Dunajska       ","Brondby        ","Aarhus         "
   data "HJK Helsinki   ","Kuusysi        ","TPS Turku      "
   data "Monaco         ","Ikast FS       ","Metz           "
   data "Bordeaux       ","Montpellier    ","Marseille      "
   data "AS St Etienne  ","Sochaux        ","P.A.O.K.       "
   data "AEK Athens     ","Feyenoord      ","Groningen      "
   data "Ajax           ","Wallwijk       ","VVV            "
   data "FC Twente      ","Volendam       ","Haarlem        "
   data "Honved         ","Pecsi Munka    ","Videoton       "
   DATA "Valur          ","Fram           ","Akranes        "
   data "Jeunesse Esch  ","Avenir Beggen  ","Aris Bonnevae  "
   data "Hamrun         ","Floriana       ","Slema Wanderers"
   data "Moss           ","Molde          ","Gornik Zabrie  "
   data "Lech Poznan    ","Legia Warsaw   ","Katowice       "
   data "FC Porto       ","Vic Guimaraes  ","Beleneses      "
   data "Benfica        ","Sporting Lisbon","Steaua         "
   DATA "Otelul         ","Rapid Bucharest","Dundee United  "
   data "Aberdeen       ","Hearts         ","Real Madrid    "
   data "Barcelona      ","Real Sociedad  ","Bilbao         "
   data "Athetico Madrid","RCD Espanol    ","Sporting Gijon "
   data "Real Mallorca  ","Torpedo Moscow ","Dynamo Tblisi  "
   data "Dynamo Kiev    ","RS Belgrade    ","Dinamo Zagreb  "
   data "Borac          ","Rapid Vienna   ","Malaga         "
   data "Seville        ","Valencia       ","Gothenburg     "
   DATA "Norrkoping     ","Brage          ","Malmo          "
   data "Osters         ","Neuchatel Xamax","Grasshoppers   "
   data "Aarau          ","Servette       ","Galatasaray    "
   data "Sakaryaspor    ","Besiktas       ","Moscow Spartak "
   data "Metallist      ","Dnepr          "

   DIM ca&(64),ccap&(64)
   DIM gt%(15,16)
   DIM re&(64)
   DIM gates&(64)
   DIM wages&(64)
   DIM pn%(64,18,2)
   DIM injury%(64,11,2),book%(64,18)

	 open "I",#1,"df0:text.data"
	 for t=1 to 340
	   input #1,txt$(t)
	 next t
	 close #1

   OPEN "I",#1,"df0:DATA"
   FOR t=1 TO 64
	   INPUT #1,tn$(t)
   NEXT t
	 FOR a=1 TO 15
   	 FOR b=1 TO 16
	   	 INPUT #1,gt%(a,b)
	   NEXT b
   NEXT a
   FOR f=1 TO 200
	   INPUT #1,playn$(f)
   NEXT f
   CLOSE #1

   RESTORE Euro.names
   FOR a=1 TO 164
		 READ tn$(a)
   NEXT a

   gosub conmou
	 goto 30

29 loadiff sadd("ram:footpic1"+chr$(0))
   font SADD("courier.font"+CHR$(0)),24
   LOCATE 1,1
   COLOR 10,0
   PRINT PTAB(62);txt$(1)
   font SADD("rub.font"+CHR$(0)),8

   COLOR 3,10
   locate 29,1
   print ptab(108);txt$(17)
   LOCATE 8,20
   LINE (240,88)-(310,112),10,bf
   LINE (240,88)-(310,112),4,b
   LOCATE 13,1
   PRINT PTAB(265);txt$(18)
   LINE (240,40)-(310,64),10,bf
   LINE (240,40)-(310,64),4,b
   LOCATE 7,1
   PRINT PTAB(265);txt$(19)

a29:
	 gosub MouseM
   started=1
   IF (x>240 AND x<310) AND (y>88 AND y<112) THEN GOTO 9500
   IF (x>240 AND x<310) AND (y>40 AND y<64) THEN goto 30
   goto a29

30 gosub colour.palette
   cls
	 x$=txt$(1)
   l=1
   color 4,0
   GOSUB prtitle
   locate 5,6
   print txt$(20)
   gosub numbers
   nop=x&
   IF nop<1 OR nop>8 THEN GOTO 30

   b=1
   d=0
50 color 4,0
   CLS
   LOCATE 4,1
   font SADD("courier.font"+CHR$(0)),24
   x$=txt$(1)
   l=1
   GOSUB prtitle
   font SADD("rub.font"+CHR$(0)),8
   FOR a=1 TO 16
	   LOCATE a+6,2
	   COLOR 7
	   PRINT TAB(5);tn$(a+d)
  	 LOCATE a+6,22
	   COLOR 7
  	 PRINT TAB(25);tn$(a+16+d)
   NEXT a
 	 color 3,5
   line (135,224)-(185,248),5,bf
 	 line (135,224)-(185,248),4,b
   locate 30,1
 	 print ptab(144);txt$(21)

60 COLOR 2,0
   x$=txt$(22)+STR$(b)
 	 x=INT(LEN(x$)*4)
   LOCATE 26,1
 	 PRINT PTAB(160-x);x$

61 gosub MouseM
	 team=-1
	 if y>224 and y<248 then
  	 if x>135 and x<185 then team=0
	   goto 69
	 end if
	 y=int(y/8)-5
	 if y<1 and y>16 then goto 61
	 if x>160 then team=y+16+d
	 if x<161 then team=y+d
	 if team=-1 then goto 61

69 IF (team<b AND team>0) OR team>64 THEN GOTO 61
   IF team=0 THEN
		 IF d=0 THEN
			 d=32
			 GOTO 50
		 ELSEIF d=32 THEN
			 d=0
			 GOTO 50
		 END IF
   END IF
 	 SWAP tn$(b),tn$(team)

managername:
   locate 26,1
 	 print space$(40)
   locate 26,5
 	 print txt$(23);
   input name$
 	 if len(name$)>10 then goto managername
   if len(name$)<=10 then
		 x=10-len(name$)
		 playername$(b)=name$+space$(x)
   end if

 	 incr b
   IF b<=nop THEN GOTO 50

   FOR a=1 TO 64
	   wins%(a)=0
	   draws%(a)=0
	   lost%(a)=0
	   gfor%(a)=0
	   gag%(a)=0
   NEXT a

   FOR a=1 TO 4
	   FOR b=1 TO 16
		   ds%(a,b)=(a-1)*16+b:dp%(a,b)=(a-1)*16+b
	   NEXT b
   NEXT a

   FOR a=1 TO nop
	   ds%(1,a)=65-a
  	 ds%(4,17-a)=a
   NEXT a
   FOR div=1 TO 4
	   FOR team=1 TO 16
  		 dp%(div,team)=team
	   NEXT team
   NEXT div

   loadiff sadd("ram:footpic6"+chr$(0))
   x$="Please Wait"
   font sadd("courier.font"+chr$(0)),24
   locate 1,1
   color 4,0
   print ptab(77);x$
   font sadd("rub.font"+chr$(0)),8

80 FOR a=1 TO 4
	   FOR b=1 TO 16
  		 d=ds%(a,b)
		   FOR c=1 TO 15
    		 GOSUB names
		     pn%(d,c,1)=a1
    		 pn%(d,c,2)=a2
		     d1=0
    		 if d<nop+1 then d1=3.5
			   IF c=1 OR c=12 THEN GOTO 82 ELSE GOTO 85
82 			 ps!(d,c,1)=INT (RND*20)+10+((5-a)*15)-d1
			   ps!(d,c,2)=0
			   ps!(d,c,3)=0
			   ps!(d,c,4)=0

85 			 IF c>1 AND c<6 OR c=13 THEN GOTO 86 ELSE GOTO 90
86       ps!(d,c,1)=0
			   ps!(d,c,2)=INT (RND*20)+10+((5-a)*15)-d1
			   ps!(d,c,3)=INT (RND*5)+5+((5-a)*10)-d1/2
			   ps!(d,c,4)=INT (RND*5)+5+((5-a)*10)-d1/2

90       IF c>5 AND c<9 OR c=14 THEN GOTO 91 ELSE GOTO 95
91       ps!(d,c,1)=0
			   ps!(d,c,2)=INT (RND*5)+5+((5-a)*10)-d1/2
			   ps!(d,c,3)=INT (RND*20)+10+((5-a)*15)-d1
			   ps!(d,c,4)=INT (RND*5)+5+((5-a)*10)-d1/2

95       IF c>8 AND c<12 OR c=15 THEN GOTO 96 ELSE GOTO 100
96       ps!(d,c,1)=0
			   ps!(d,c,2)=INT (RND*5)+5+((5-a)*10)-d1/2
			   ps!(d,c,3)=INT (RND*5)+5+((5-a)*10)-d1/2
			   ps!(d,c,4)=INT (RND*20)+10+((5-a)*15)-d1

100 		 pa%(d,c)=INT (RND*16)+18
		     pg%(d,c)=0
		     pj%(d,c)=0
		     pp%(d,c)=0
			 	 pc%(d,c)=int(rnd*80)+30
			   pt%(d,c)=0
       NEXT c

	     if a=1 then m&(d)=1000000
       if a=2 then m&(d)=600000
       if a=3 then m&(d)=300000
       if a=4 then m&(d)=150000
       lo&(d)=0
       mo&(d)=50
       ca&(d)=(4-a)*5600+4000+(INT(RND*1000)-INT(RND*2000))*(5-a)
       ccap&(d)=(5-a)*8000
       agg%(d)=5
     NEXT b
   NEXT a

	 for a=1 to 164
     tact%(a,1)=int(rnd*4)+1
		 tact%(a,2)=int(rnd*4)+1
		 tact%(a,3)=int(rnd*4)+1
		 agg%(a)=int(rnd*9)+1
	 next a

   GOSUB trans.market
   season=1
   week=1
   saves=5*nop
 	 faw=int(rnd*3)+10
	 lcw=int(rnd*3)+13
	 ecw=int(rnd*33)+65
	 ccw=int(rnd*33)+98
	 ucw=int(rnd*33)+131

   GOSUB cup.sort
   st=nop+1
   fh=64
   GOSUB team.sort

   for a=nop+1 to 164
	 	 gosub name3
	   playername$(a)=name$
   next a

150 GOSUB colour.palette
   cls
   LOCATE 4,1
   font SADD("courier.font"+CHR$(0)),24
   COLOR 4,0
   x$=txt$(1)
   l=1
   GOSUB prtitle
   font SADD("rub.font"+CHR$(0)),8
	 locate 7,1
	 print ptab(52);txt$(24)
   color 3,5
   line (111,160)-(135,184),5,bf
   line (111,160)-(135,184),4,b
   locate 22,1
	 print ptab(119);"2"
	 line (185,160)-(209,184),5,bf
   line (185,160)-(209,184),4,b
	 locate 22,1
	 print ptab(193);"3"

151	gosub mousem
	 if y<160 and y>184 then goto 151
	 pts=0
	 if x>111 and x<135 then pts=2
	 if x>185 and x<209 then pts=3
	 if pts=0 then goto 151

199 FOR s=1 TO 64
	   skills%(s)=0
   NEXT s
	 gosub rand.tact

MAIN.MENU:
		started=0
    play.game=0
    color 4,0
    CLS
    IF a>nop THEN a=1

    loadiff SADD("ram:menu-amiga"+CHR$(0))

    injured=0
    IF week=1 THEN GOSUB 980
    COLOR 20,0
    LOCATE 28,1
    x$=tn$(a)
    gosub length
    font SADD("courier.font"+CHR$(0)),24
    PRINT PTAB(160-(x2*7.5));tn$(a)
    font SADD("rub1.font"+CHR$(0)),8
    COLOR 16
    LOCATE 30,1:PRINT txt$(25);
    COLOR 19
    PRINT week
    locate 18,1
    if saves<10 then print ptab(96);saves
    if saves>9 then print ptab(92);saves

    FOR c=1 TO 4
	    FOR b=1 TO 16
  		  IF ds%(c,b)=a THEN GOTO 205
	    NEXT b
    NEXT c
205 FOR d=1 TO 16
	    IF dp%(c,d)=b THEN GOTO 210
    NEXT d

210 LOCATE 30,35
    COLOR 16
    PRINT txt$(26);
    COLOR 19
    PRINT c;":";d
    COLOR 16
    LOCATE 30,12
    PRINT txt$(27);
    COLOR 19
    PRINT ca&(a)
    COLOR 16

    IF m&(a)<0 THEN
      COLOR 19,0
      x$=txt$(28)
      LOCATE 30,1
      PRINT x$
    ELSEIF injured=1 THEN
      COLOR 19,0
      x$=txt$(29)
      LOCATE 30,1
      PRINT x$
    END IF

910 gosub MouseM
	  IF x>140 AND x<178 AND y>11 AND y<48 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 1000
		elseIF x>140 AND x<178 AND y>58 AND y<95 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 7000
		elseIF x>140 AND x<178 AND y>104 AND y<142 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 990
		elseIF x>140 AND x<178 AND y>151 AND y<189 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO view.league
	  elseIF y>31 AND y<70 AND x>89 AND x<127 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 8000
		elseIF y>31 AND y<70 AND x>192 AND x<230 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 3000
		elseIF y>82 AND y<119 AND x>70 AND x<106 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO view.cups
		elseIF y>82 AND y<119 AND x>211 AND x<249 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 2000
		elseIF y>131 AND y<169 AND x>89 AND x<127 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO 9000
		elseIF y>131 AND y<169 AND x>191 AND x<229 THEN
			line (0,0)-(320,260),0,bf
			GOSUB colour.palette
			GOTO newplayer
		end if
  	GOTO 910

980 lr=1
    fr=1
    RETURN

990 FOR a=1 TO nop
	    IF m&(a)<0 THEN GOTO main.menu
  	  FOR b=1 TO 13
		    IF pj%(a,b)>0 THEN injured=1: GOTO main.menu
    		if pa%(a,b)=0 and b<12 then injured=1:goto main.menu
	    NEXT b
    NEXT a
    GOTO 10000

1000 REM		  CHECK SQUAD

1010 GOSUB colour.palette
     COLOR 4,0
     CLS
     LOCATE 3,1
     font SADD("courier.font"+CHR$(0)),24
     x$=tn$(a)
		 gosub length
		 PRINT PTAB(128-(x2*7.5));x$
     font SADD("rub1.font"+CHR$(0)),8
     COLOR 2

     FOR x=1 TO 4
			 LINE (x,26+x)-(252+x,238-x),1,b
     NEXT x

     LOCATE 5,1
     PRINT TAB(6); "Name";
     PRINT TAB(21);"GKP";
     PRINT TAB(25);"DEF";
     PRINT TAB(29);"MID";
     PRINT TAB(33);"FOR"
     defense!(a)=0
     midfield!(a)=0
     attack!(a)=0

     FOR p=1 TO 11
			 LOCATE 5+p,2
			 IF pa%(a,p)=0 THEN GOTO 1011
		   ps1=INT(ps!(a,p,1))
	     ps2=INT(ps!(a,p,2))
			 ps3=INT(ps!(a,p,3))
		   ps4=INT(ps!(a,p,4))

		   IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
				 COLOR 6
       ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
				 COLOR 7
       ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
				 COLOR 4
       ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
				 COLOR 2
       END IF

       IF pa%(a,p)>36 THEN
				 PRINT "Ret";
       ELSEIF pt%(a,p)>0 THEN
				 PRINT "Trn";
       ELSEIF pj%(a,p)>20 THEN
				 PRINT "Int";
       ELSEIF pj%(a,p)>10 THEN
		     PRINT "Sup";
       ELSEIF pj%(a,p)>0 THEN
				 PRINT "Inj";
       END IF
       GOSUB name1
       if p>1 then
	       defense!(a)=defense!(a)+ps!(a,p,2)
				 midfield!(a)=midfield!(a)+ps!(a,p,3)
			   attack!(a)=attack!(a)+ps!(a,p,4)
	 		 end if
       PRINT TAB(6);name$;
       PRINT TAB(21);ps1;
       PRINT TAB(25);ps2;
       PRINT TAB(29);ps3;
       PRINT TAB(33);ps4;
1011
     NEXT p

     COLOR 4
     LOCATE 18,2
     PRINT "Sub"
     LOCATE 19,2
     PRINT "Sub"

     FOR p=12 TO 13
	     LOCATE 6+p,2
	     IF pa%(a,p)=0 THEN GOTO 1012
		   ps1=INT(ps!(a,p,1))
	     ps2=INT(ps!(a,p,2))
			 ps3=INT(ps!(a,p,3))
		   ps4=INT(ps!(a,p,4))

		   IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
				 COLOR 6
       ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
				 COLOR 7
       ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
				 COLOR 4
       ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
				 COLOR 2
       END IF

	     IF pt%(a,p)>0 THEN
		     PRINT "Trn";
			 ELSEIF pj%(a,p)>20 THEN
				 PRINT "Int";
	     ELSEIF pj%(a,p)>10 THEN
			   PRINT "Sup";
	  	 ELSEIF pj%(a,p)>0 THEN
				 PRINT "Inj";
	   	 END IF
		   GOSUB name1
	     PRINT TAB(6);name$;
		   PRINT TAB(21);ps1;
			 PRINT TAB(25);ps2;
		   PRINT TAB(29);ps3;
	     PRINT TAB(33);ps4;
1012
     NEXT p

     FOR p=14 TO 18
	     LOCATE 7+p,2
		   IF pa%(a,p)=0 THEN GOTO 1013
		   ps1=INT(ps!(a,p,1))
	     ps2=INT(ps!(a,p,2))
			 ps3=INT(ps!(a,p,3))
		   ps4=INT(ps!(a,p,4))

		   IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
				 COLOR 6
       ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
				 COLOR 7
       ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
				 COLOR 4
       ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
				 COLOR 2
       END IF

	     IF pt%(a,p)>0 THEN
		     PRINT "Trn";
			 ELSEIF pj%(a,p)>20 THEN
				 PRINT "Int";
	     ELSEIF pj%(a,p)>10 THEN
			   PRINT "Sup";
	  	 ELSEIF pj%(a,p)>0 THEN
				 PRINT "Inj";
	   	 END IF

		   GOSUB name1
	     PRINT TAB(6);name$;
		   PRINT TAB(21);ps1;
			 PRINT TAB(25);ps2;
	  	 PRINT TAB(29);ps3;
	     PRINT TAB(33);ps4;
1013
     NEXT p

1020 COLOR 3,5
		 LINE (260,8)-(320,32),5,bf
		 LINE (260,8)-(320,32),4,b
		 LOCATE 3,1
		 PRINT PTAB(265);txt$(30)
     LINE (260,40)-(320,64),5,bf
     LINE (260,40)-(320,64),4,b
     LOCATE 7,1
     PRINT PTAB(268);txt$(31)
     LINE (260,72)-(320,96),5,bf
     LINE (260,72)-(320,96),4,b
     LOCATE 11,1
     PRINT PTAB(276);txt$(32)
     LINE (260,104)-(320,128),5,bf
     LINE (260,104)-(320,128),4,b
     LOCATE 15,1
     PRINT PTAB(273);txt$(33)
     LINE (260,136)-(320,160),5,bf
     LINE (260,136)-(320,160),4,b
     LOCATE 19,1
     PRINT PTAB(268);txt$(34)
     LINE (260,168)-(320,192),5,bf
     LINE (260,168)-(320,192),4,b
     LOCATE 23,1
     PRINT PTAB(265);txt$(35)
     LINE (260,200)-(320,224),5,bf
		 LINE (260,200)-(320,224),4,b
		 LOCATE 27,1
     PRINT PTAB(266);txt$(36)
     LINE (260,232)-(320,256),5,bf
		 LINE (260,232)-(320,256),4,b
		 LOCATE 31,1
     PRINT PTAB(276);txt$(37)

     COLOR 2,0
     LOCATE 27,24
     team=a
     COLOR 7
     PRINT	   txt$(38);INT(defense!(a))
     COLOR 4
     PRINT TAB(24);txt$(39);INT(midfield!(a))
     COLOR 2
     PRINT TAB(24);txt$(40);INT(attack!(a))

     LOCATE 27,3
     PRINT	  txt$(41);playername$(a)
     PRINT TAB(3);txt$(42);coach.name$(a)
     PRINT TAB(3);txt$(43);physio.name$(a)

1030 gosub MouseM
     IF x>260 then 
	     IF (y>8 AND y<32) THEN
				 IF season=1 AND week=1 THEN
				   GOTO 1030
				 ELSE
					 GOTO 4500
				   REM History
			 	 END IF
			 end if		 
			 if (y>40 and y<64) then goto 1800: rem sack coach
	  	 IF (y>72 AND y<96) THEN abc=0:GOTO view.player: REM view
			 IF (y>104 AND y<128) THEN GOTO 1500: REM train
	     IF (y>136 AND y<160) THEN GOTO 1600: REM sack
	  	 IF (y>168 AND y<192) THEN GOSUB tactics: GOTO 1000: REM tactics
			 IF (y>200 AND y<224) THEN GOTO rename.player:rem rename
			 IF (y>232 AND y<256) THEN GOTO main.menu: REM main menu
	   end if

		 p=0
		 if x<250 then
			 IF y>40 AND y<128 THEN
		     p=INT(y/8)-4
			 ELSEIF y>136 AND y<152 THEN
		     p=INT(y/8)-5
	  	 ELSEif y>160 and y<200 then
				 p=int(y/8)-6
			 END IF
     end if
     IF p>0 THEN GOTO 1300
	   GOTO 1030

1300 LINE (260,5)-(320,260),0,bf
		 COLOR 4,0
		 ptime 4
     p1=p
     p=0
     LOCATE 14,1
     PRINT PTAB(269);txt$(44)
     PRINT PTAB(269);txt$(45)
     PRINT PTAB(266);txt$(46)
     PRINT PTAB(276);txt$(47)
     GOSUB pick.player

     IF (p<1 OR p>18) OR (p1<1 OR p1>18) THEN GOTO 1300
     SWAP pn%(a,p,1),pn%(a,p1,1)
     SWAP pn%(a,p,2),pn%(a,p1,2)
     SWAP pp%(a,p),pp%(a,p1)
     SWAP pc%(a,p),pc%(a,p1)
     SWAP pg%(a,p),pg%(a,p1)
     SWAP pj%(a,p),pj%(a,p1)
     SWAP pa%(a,p),pa%(a,p1)
     SWAP pt%(a,p),pt%(a,p1)
     FOR p2=1 TO 4
	     SWAP ps!(a,p,p2),ps!(a,p1,p2)
     NEXT p2
     SWAP book%(a,p),book%(a,p1)
     GOTO 1000

1500 COLOR 4,5
     LINE (260,5)-(320,260),0,bf
     IF skills%(a)=1 THEN GOTO 1000
     LINE (260,16)-(320,56),5,bf
     LINE (260,16)-(320,56),4,b
     LOCATE 5,1
     PRINT PTAB(269);txt$(48)
     LINE (260,72)-(320,112),5,bf
     LINE (260,72)-(320,112),4,b
     LOCATE 12,1
     PRINT PTAB(266);txt$(49)
     LINE (260,128)-(320,168),5,bf
     LINE (260,128)-(320,168),4,b
     LOCATE 19,1
     PRINT PTAB(262)txt$(50)
     LINE (260,184)-(320,224),5,bf
     LINE (260,184)-(320,224),4,b
     LOCATE 26,1
     PRINT PTAB(262);txt$(51)

1501 s=0
     color 6,0
     gosub MouseM
     IF (x<260 OR x>320) THEN GOTO 1500
     IF (y>16 AND y<56) THEN s=1
     IF (y>72 AND y<112) THEN s=2
     IF (y>128 AND y<168) THEN s=3
     IF (y>184 AND y<224) THEN s=4
     IF s=0 THEN GOTO 1501
     LINE (260,5)-(320,260),0,bf

     FOR p=1 TO 18
	     IF pa%(a,p)=0 THEN GOTO 1510
		   IF ps!(a,p,s)<1 THEN GOTO 1510
  		 if coach%(a)=1 then increase=(RND*2)-.7
	     if coach%(a)=0 then increase=(RND*1.5)-.75
	  	 ps!(a,p,s)=ps!(a,p,s)+increase
		   IF ps!(a,p,s)<1 THEN ps!(a,p,s)=0
	     IF ps!(a,p,s)>99 THEN ps!(a,p,s)=99
	     if p>0 and  p<12 then
				 locate 5+p,38
	     elseif p>11 and p<14 then
				 locate 6+p,38
	     elseif p>13 then
				 locate 7+p,38
	     end if
	     if increase>0 then print txt$(52)
	     if increase<0 then print txt$(53)
1510 NEXT p

     skills%(a)=1
     color 4,0

     font SADD("rub1.font"+CHR$(0)),8
     LINE (260,216)-(320,240),5,bf
     LINE (260,216)-(320,240),4,b
     LOCATE 29,1
     COLOR 3,5
     PRINT PTAB(262);txt$(54)

con2:
     gosub MouseM
     IF (x<260 OR x>320) OR (y<190 OR y>240) THEN GOTO con2
		 color 4,0
		 GOTO 1000

1600 LINE (260,5)-(320,260),0,bf
     LOCATE 14,1
     PRINT PTAB(269);txt$(44)
     PRINT PTAB(269);txt$(45)
     PRINT PTAB(266);txt$(55)
     GOSUB pick.player
     play=p

     LINE (260,5)-(320,260),0,bf
     color 4
     locate 6,1
     print ptab(266);txt$(56)
     locate 8,1
     print ptab(269);txt$(57)
     color 3,5
     line (270,104)-(310,128),5,bf
     line (270,104)-(310,128),4,b
     locate 15,1
     print ptab(278);txt$(18)
     line (270,136)-(310,160),5,bf
     line (270,136)-(310,160),4,b
     locate 19,1
     print ptab(286);txt$(19)
     color 4,0

1601 gosub MouseM
     if x<270 and x>310 then goto 1601
     if y>104 and y<128 then goto 1602
     if y>136 and y<160 then goto 1000
     goto 1601

1602 IF play<1 OR play>18 THEN GOTO 1600
     IF pa%(a,play)=0 THEN GOTO 1000
     pn%(a,play,1)=0
     pn%(a,play,2)=0
     pa%(a,play)=0
     pj%(a,play)=0
     pg%(a,play)=0
     pp%(a,play)=0
     pc%(a,play)=0
     FOR s=1 TO 4
     ps!(a,play,s)=0
     NEXT s
     book%(a,play)=0
     pt%(a,play)=0
     m&(a)=m&(a)-20000
     GOTO 1000

1800 LINE (260,5)-(320,260),0,bf
     locate 6,1
     print ptab(274);txt$(58)
     color 0,5
     line (260,104)-(320,128),5,bf
     line (260,104)-(320,128),4,b
     locate 15,1
     print ptab(270);txt$(59)
     line (260,136)-(320,160),5,bf
     line (260,136)-(320,160),4,b
     locate 19,1
     print ptab(266);txt$(60)
     color 4,0

1801 gosub mousem
     if x<260 and x>320 then goto 1801
     if y>104 and y<128 then
       sack=1
       goto 1802
     elseif y>136 and y<160 then
       sack=2
       goto 1802
     end if
     goto 1801

1802 LINE (260,5)-(320,260),0,bf
     color 4
     locate 6,1
     print ptab(266);txt$(56)
     locate 8,1
     print ptab(270);txt$(57)
     color 3,5
     line (270,104)-(310,128),5,bf
     line (270,104)-(310,128),4,b
     locate 15,1
     print ptab(278);txt$(18)
     line (270,136)-(310,160),5,bf
     line (270,136)-(310,160),4,b
     locate 19,1
     print ptab(282);txt$(19)
     color 4,0

1803 gosub MouseM
     if x<270 and x>310 then goto 1803
     if y>104 and y<128 then goto 1804
     if y>136 and y<160 then goto 1000
     goto 1803

1804 if sack=1 then
			 coach%(a)=0
			 coach.name$(a)=space$(10)
		 elseif sack=2 then
			 physio%(a)=0
			 physio.name$(a)=space$(10)
		 end if
		 goto 1000

2000 gosub colour.palette
     cls
     COLOR 4,0
     x$=txt$(61)
     l=1
     GOSUB prtitle
     font SADD("rub.font"+CHR$(0)),8
     LOCATE 6,5
     COLOR 2
     PRINT txt$(62);:COLOR 6:PRINT m&(a)
     LOCATE 8,5
     COLOR 2
     PRINT txt$(63);:COLOR 6:PRINT lo&(a)
     LOCATE 10,5
     fac&=150000&*(5-c)
     COLOR 2
     PRINT txt$(64);:COLOR 6:PRINT fac&
     LOCATE 12,5
     COLOR 1
     PRINT txt$(65);:COLOR 4:PRINT ccap&(a)
     LOCATE 14,5
     COLOR 1
     PRINT txt$(66);:COLOR 4:PRINT ca&(a)

     COLOR 3,5
     LINE (22,200)-(76,240),5,bf
     LINE (22,200)-(76,240),4,b
     LOCATE 28,1
     PRINT PTAB(25);txt$(67)
     LINE (96,200)-(150,240),5,bf
     LINE (96,200)-(150,240),4,b
     LOCATE 28,1
     PRINT PTAB(103);txt$(68)
     LINE (170,200)-(224,240),5,bf
     LINE (170,200)-(224,240),4,b
     LOCATE 28,1
     PRINT PTAB(177);txt$(69)
     LINE (244,200)-(298,240),5,bf
     LINE (244,200)-(298,240),4,b
     LOCATE 28,1
     PRINT PTAB(247);txt$(70)
     COLOR 4,0

2010 gosub MouseM1
     IF (y<200 OR y>240) THEN GOTO 2010
     IF (x>22 AND x<76) THEN GOTO 2100: REM borrow money
     IF (x>96 AND x<150) THEN GOTO 2500: REM pay off loan
     IF (x>170 AND x<224) THEN GOTO Main.menu: REM main menu
     IF (x>244 AND x<298) THEN GOTO 6000: REM change capacity
     GOTO 2010

2100 LINE (0,40)-(320,240),0,bf
     COLOR 7,0
     x$=txt$(71)
     x=INT(LEN(x$)*3.5)
     LOCATE 8,1
     PRINT PTAB(160-x);x$
     GOSUB numbers
     amount&=x&
     LINE (0,104)-(320,240),0,bf
     IF amount&>fac&-lo&(a) THEN GOTO 2200
     m&(a)=m&(a)+amount&
     lo&(a)=lo&(a)+amount&
     COLOR 4,0
     LOCATE 17,5
     PRINT txt$(72);lo&(a)
     LOCATE 18,5
     re&(a)=INT(lo&(a)*5/100)
     color 6
     PRINT txt$(73);re&(a)
     GOSUB conmou
     GOTO 2000

2200 LINE (0,40)-(320,240),0,bf
     x$=txt$(74)
     x=INT(LEN(x$)/2)
     LOCATE 8,20-x
     COLOR 5,0
     PRINT x$
     GOSUB conmou
     GOTO 2000

2500 LINE (0,40)-(320,240),0,bf
     COLOR 7,0
     x$=txt$(75)
     x=INT(LEN(x$)/2)
     LOCATE 8,20-x
     PRINT x$
     GOSUB numbers
     amount&=x&
     LINE (0,104)-(320,240),0,bf
     IF amount&>lo&(a) THEN amount&=lo&(a)
     IF amount&>m&(a) THEN GOTO 2600
     m&(a)=m&(a)-amount&
     lo&(a)=lo&(a)-amount&
     re&(a)=INT(lo&(a)*5/100)
     GOSUB conmou
     GOTO 2000

2600 LINE (0,40)-(320,240),0,bf
     x$=txt$(76)
     x=INT(LEN(x$)/2)
     LOCATE 8,20-x
     COLOR 5,0
     PRINT x$
     GOSUB conmou
     GOTO 2000

3000 play.game=0
     GOSUB trans.view
     GOTO main.menu

4000 loadiff sadd("ram:footpic5"+chr$(0))
		 color 3,0
     x$=txt$(77)
     x=int(len(x$)*7.5)
     font sadd("courier.font"+chr$(0)),24
     locate 1,1
     print ptab(160-x);x$
     font sadd("rub.font"+chr$(0)),8
     GOSUB div0
     GOSUB 4100
     gosub colour.palette
     color 4,0
     GOSUB 4015
     GOSUB conmou
     GOTO view.league

4100 FOR play=1 TO 10
			 FOR c=1 TO 2
		     hg%(play,c)=0
	     NEXT c
     NEXT play

     FOR teams=1 TO 16
	     team=ds%(div,teams)
		   FOR player=1 TO 18
			   IF pa%(team,player)=0 THEN GOTO 4150
				 FOR a=10 TO 1 STEP -1
					 IF pg%(team,player) =< pg%(hg%(a,1),hg%(a,2)) THEN GOTO 4150
			     IF a=10 THEN
			       hg%(a,1)=team
			       hg%(a,2)=player
			     END IF
			     IF a<10 THEN
			       SWAP hg%(a,1),hg%(a+1,1)
			       SWAP hg%(a,2),hg%(a+1,2)
			     END IF
				 NEXT a
4150	 NEXT player
     NEXT teams
     RETURN

4015 CLS
     x$=txt$(77)
     l=1
     color 4,0
		 GOSUB prtitle
     x$="For Division"+STR$(div)
     x=INT(LEN(x$)*7.5)
     font SADD("courier.font"+CHR$(0)),24
     LOCATE 2,1
     PRINT PTAB(160-x);x$
     font SADD("rub1.font"+CHR$(0)),8

     FOR b=1 TO 10
	     COLOR 7
			 IF b=1 THEN COLOR 6
	     a=hg%(b,1)
		   p=hg%(b,2)

			 IF a<nop+1 AND b=1 THEN COLOR 1
			 IF a<nop+1 AND b>1 THEN COLOR 4
			 if pg%(a,p)>0 then
				 LOCATE 8+b,5
				 GOSUB name1
			   PRINT name$
				 LOCATE 8+b,22
		  	 PRINT tn$(a)
		     LOCATE 8+b,38
				 PRINT pg%(a,p)
			 end if
	   NEXT b
     RETURN

4500 CLS
     x$=txt$(78)
     l=1
     color 4,0
		 GOSUB prtitle
     FOR f=1 TO 4
       LINE (4+f,32+f)-(310-f,192-f),1,b
     NEXT f

     LOCATE 6,5
     COLOR 2
     PRINT txt$(79);
     COLOR 7
     PRINT TAB(35);his&(a,1)
     LOCATE 7,5
     COLOR 4
     PRINT txt$(80);
     COLOR 6
     PRINT TAB(35);his&(a,2)
     LOCATE 8,5
     COLOR 2
     PRINT txt$(81);
     COLOR 7
     PRINT TAB(35);his&(a,3)
     LOCATE 9,5
     COLOR 4
     PRINT txt$(82);
     COLOR 6
     PRINT TAB(35);his&(a,4)
     LOCATE 10,5
     COLOR 2
     PRINT txt$(83);
     COLOR 7
     PRINT TAB(35);his&(a,5)
     LOCATE 11,5
     COLOR 4
     PRINT txt$(84);
     COLOR 6
     PRINT TAB(35);his&(a,6)
     LOCATE 12,5
     COLOR 2
     PRINT txt$(85);
     COLOR 7
     PRINT TAB(35);his&(a,7)
     LOCATE 13,5
     COLOR 4
     PRINT txt$(86);tn$(a);
     COLOR 6
     PRINT TAB(35);his&(a,8)
     COLOR 2
     LOCATE 14,5
     x$=STR$(his&(a,9))+txt$(87)+tn$(his&(a,10))
     IF his&(a,10)=0 THEN x$=txt$(88)
     PRINT txt$(90)
     locate 15,9
     COLOR 7
     print x$
     LOCATE 16,5
     x$=STR$(his&(a,11))+txt$(87)+tn$(his&(a,12))
     IF his&(a,12)=0 THEN x$=txt$(88)
     COLOR 4
     PRINT txt$(90)
     locate 17,9
     COLOR 6
     print x$
     COLOR 2
     LOCATE 18,5
     a1=his&(a,13)
     a2=his&(a,14)
     GOSUB name2
     x$=name$+txt$(91)+STR$(his&(a,15))
     IF name$="" or his&(a,15)<1 THEN x$=txt$(88)
     PRINT txt$(92)
     locate 19,10
     COLOR 7
     print x$
     COLOR 4
     LOCATE 20,5
     a1=his&(a,17)
     a2=his&(a,18)
     GOSUB name2
     x$=name$+txt$(91)+STR$(his&(a,16))
     IF name$="" THEN x$=txt$(88)
     PRINT txt$(93)
     locate 21,10
     COLOR 6
     print x$
     COLOR 2
     LOCATE 22,5
     x$=STR$(his&(a,19))+"-"+STR$(his&(a,20))+txt$(87)+tn$(his&(a,21))
     IF his&(a,21)=0 THEN x$=txt$(88)
     PRINT txt$(94)
     locate 23,10
     COLOR 7
     print x$
     gosub conmou

		 cls
		 x$=txt$(78)
     l=1
     color 4,0
		 GOSUB prtitle
     FOR f=1 TO 4
       LINE (4+f,32+f)-(310-f,192-f),1,b
     NEXT f

		 locate 6,3
		 color 4
		 print txt$(95)
	   x=22
		 for f=1 to 5
		   color 2
		   if f=1 then color 6
		   if his&(a,x)=0 then goto 4510
		   locate 6+f,5
		   a1=his&(a,x+1)
		   a2=his&(a,x+2)
		   gosub name2
		   print name$;txt$(96);his&(a,x)
4510 	 x=x+3
		 next f

		 locate 13,3
		 color 4
		 print txt$(97)
		 x=37
		 for f=1 to 5
		   color 7
		   if f=1 then color 6
		   if his&(a,x)=0 then goto 4520
		   locate 13+f,5
		   a1=his&(a,x+1)
		   a2=his&(a,x+2)
		   gosub name2
		   print name$;txt$(96);his&(a,x)
4520   x=x+3
		 next f

		 locate 20,3
		 color 4
		 print txt$(98)
		 x=52
		 for f=1 to 3
		   color 2
		   if f=1 then color 6
			 if his&(a,x)=0 then goto 4530
			 locate 20+f,5
			 print his&(a,x);"-";his&(a,x+1);txt$(87);tn$(his&(a,x+2))
4530   x=x+3
		 next f
		 gosub conmou
     GOTO 1000

5000 loadiff sadd("ram:footpic5"+chr$(0))
		 color 3,0
     x$=txt$(99)
     x=int(len(x$)*7.5)
     font sadd("courier.font"+chr$(0)),24
     locate 1,1
     print ptab(160-x);x$
     font sadd("rub.font"+chr$(0)),8
     GOSUB div0
     GOSUB 5010
     GOSUB 5015
     GOSUB conmou
     lt=0
     GOTO view.league

5010 FOR teams=1 TO 16
			 team=ds%(div,teams)
       points=wins%(team)*pts+draws%(team)
	     points%(teams)=points
		   posi%(teams)=teams
			 gd%(teams)=gfor%(team)-gag%(team)
			 gf%(teams)=gfor%(team)
     NEXT teams

     FOR teams=1 TO 15
		   FOR ti=1 TO 16-teams
		     IF points%(ti)>points%(ti+1) THEN GOTO 5011
				 IF points%(ti)=points%(ti+1) THEN
					 IF gd%(ti)>gd%(ti+1) THEN GOTO 5011
					 if gd%(ti)=gd%(ti+1) then
						 if gf%(ti)>gf%(ti+1) then goto 5011
					 end if
			   END IF
		     SWAP posi%(ti),posi%(ti+1)
			   SWAP points%(ti),points%(ti+1)
				 SWAP gd%(ti),gd%(ti+1)
				 SWAP gf%(ti),gf%(ti+1)
5011	 NEXT ti
     NEXT teams
     
5012 FOR team=1 TO 16
	     dp%(div,team)=posi%(team)
       IF lt=1 THEN pog%(ds%(div,dp%(div,team)),week)=team
     NEXT team
     RETURN

5015 CLS
     gosub colour.palette
     color 4,0
     x$=txt$(100)
     l=1
     GOSUB prtitle
     LOCATE 4,1
     x$=txt$(101)+STR$(div)
     x=INT(LEN(x$)*4)
     PRINT PTAB(160-x);x$

     font SADD("rub1.font"+CHR$(0)),8
     COLOR 4
     LOCATE 7,1
     PRINT " Pos Team             Pl. W  D  L  F  A  Pts"
     x=10
     FOR team=1 TO 16
	     t=dp%(div,team)
  	   ts=ds%(div,t)
	     COLOR 7
	     IF team=1 THEN COLOR 2
  	   IF team=2 AND div>1 THEN COLOR 2
    	 if team=2 and div=1 then color 8
	     if team>2 and team<7 and div>1 then color 6
  	   IF team=15 AND div<4 THEN COLOR 5
	     IF team=16 THEN COLOR 5
  	   IF ts<nop+1 THEN COLOR 4

	     points=wins%(ts)*pts+draws%(ts)
  	   LOCATE 8+team,1:PRINT team
    	 LOCATE 8+team,6:PRINT tn$(ts)
	     LOCATE 8+team,23:PRINT week-1
  	   LOCATE 8+team,27:PRINT wins%(ts)
    	 LOCATE 8+team,30:PRINT draws%(ts)
	     LOCATE 8+team,33:PRINT lost%(ts)
  	   LOCATE 8+team,36:PRINT gfor%(ts)
    	 LOCATE 8+team,39:PRINT gag%(ts)
	     LOCATE 8+team,42:PRINT points
  	 NEXT team
     RETURN

6000 CLS
     COLOR 4,0
     IF cap%(a)=1 THEN GOTO main.menu
     x$=txt$(102)
     l=1
     GOSUB prtitle
     LOCATE 8,5
	   COLOR 2
     PRINT txt$(103);ccap&(a)
     COLOR 6
     LOCATE 10,5
     PRINT txt$(104);ca&(a)
     COLOR 7
     LOCATE 12,5
     PRINT txt$(105);m&(a)
     COLOR 3,5
     LINE (30,104)-(130,128),5,bf
     LINE (30,104)-(130,128),4,b
     LOCATE 15,1
     PRINT PTAB(48);txt$(106)
     LINE (190,104)-(290,128),5,bf
     LINE (190,104)-(290,128),4,b
     LOCATE 15,1
     PRINT PTAB(200);txt$(107)
     COLOR 3,0

6010 gosub MouseM
     IF (x>30 AND x<130) AND (y>104 AND y<128) THEN GOTO 6100
     IF (x>190 AND x<290) AND (y>104 AND y<128) THEN GOTO 2000
     GOTO 6010

6100 CLS
     x$=txt$(108)
     l=1
     color 4,0
		 GOSUB prtitle
     COLOR 2
     LOCATE 8,5
     PRINT txt$(109)
     LOCATE 10,5
     PRINT txt$(110)
     LINE (55,96)-(105,136),5,bf
     LINE (55,96)-(105,136),4,b
     LOCATE 15,1
     COLOR 4,5
     PRINT PTAB(60);txt$(111)
     LINE (215,96)-(265,136),5,bf
     LINE (215,96)-(265,136),4,b
     LOCATE 15,1
     PRINT PTAB(228);txt$(111)
     COLOR 4,0

6110 gosub MouseM
     IF (x>55 AND x<105) AND (y>96 AND y<136) THEN m&(a)=m&(a)-50000:cap%(a)=1:ccap&(a)=ccap&(a)+1000:GOTO 2000
     IF (x>215 AND y<265) AND (y>96 AND y<136) THEN GOTO 2000
     GOTO 6110

7000 INCR a
     IF a=nop+1 THEN a=1
     GOTO main.menu

7500 CLS
     x2$=txt$(113)
     IF lr=1 THEN x1$=txt$(114):games=32
     IF lr=2 THEN x1$=txt$(115):games=16
     IF lr=3 THEN x1$=txt$(116):games=8
     IF lr=4 THEN x1$=txt$(117):games=4
     IF lr=5 THEN x1$=txt$(118):games=2
     IF lr=6 THEN x1$=txt$(119):games=1
     if lr=7 then
			 x1$=txt$(120)
       CLS
	     l=1
		   x$=x2$
		   color 4,0
			 GOSUB prtitle
	     x$=x1$
	  	 l=2
	     GOSUB prtitle
	     x$=tn$(lc%(team))
	     l=4
	     gosub prtitle
	     gosub conmou
	     goto view.cups
	   end if

     game=0
     team=1
7505 CLS
     l=1
     x$=x2$
     color 4,0
		 GOSUB prtitle
     x$=x1$
     l=2
     GOSUB prtitle
	   font sadd("rub1.font"+chr$(0)),8
		 locate 8,1
		 print "Div";tab(43);"Div"
7510 incr game
     team1=lc%(team)
     team2=lc%(team+1)
     FOR div=1 TO 4
	     FOR b=1 TO 16
		     IF ds%(div,b)=team1 THEN GOTO 7515
	     NEXT b
     NEXT div
     
7515 COLOR 2
		 game1=game
		 IF game1>8 THEN game1=game1-8
		 IF game1>8 THEN game1=game1-8
		 IF game1>8 THEN game1=game1-8
		 IF team1<nop+1 THEN COLOR 6
     x$=tn$(team1)
     gosub length
     locate 8+(game1*2),1
     print div
     LOCATE 8+(game1*2),20-x2
     PRINT tn$(team1);
     LOCATE 8+(game1*2),23
     COLOR 2
     PRINT "V"
     LOCATE 8+(2*game1),27
     FOR div=1 TO 4
	     FOR b=1 TO 16
		     IF ds%(div,b)=team2 THEN GOTO 7516
	     NEXT b
     NEXT div

7516 IF team2<nop+1 THEN COLOR 6
     PRINT tn$(team2)
     locate 8+(2*game1),44
     print div
7530 team=team+2
		 IF game>=games THEN GOTO 7520
     IF team>games*2 THEN GOTO 7520
     IF game=8 AND games>8 THEN
       GOSUB conmou
       GOTO 7505
     END IF
     IF game=16 AND games>16 THEN
       GOSUB conmou
       GOTO 7505
     END IF
     IF game=24 AND games>24 THEN
       GOSUB conmou
       GOTO 7505
     END IF
     GOTO 7510

7520 GOSUB conmou
	   font sadd("rub.font"+chr$(0)),8
     GOTO view.cups

7600 CLS
		 x2$=txt$(123)
		 IF cr=1 THEN
	     x1$=txt$(114)+" "+txt$(121)
			 games=16
			 leg=1
     ELSEIF cr=2 THEN
	     x1$=txt$(114)+" "+txt$(122)
       games=16
	     leg=2
     ELSEIF cr=3 THEN
 	     x1$=txt$(115)+" "+txt$(121)
	     games=8
	     leg=1
     ELSEIF cr=4 THEN
	     x1$=txt$(115)+" "+txt$(122)
	     games=8
	     leg=2
     ELSEIF cr=5 THEN
	     x1$=txt$(117)+" "+txt$(121)
	     games=4
	     leg=1
     ELSEIF cr=6 THEN
	     x1$=txt$(117)+" "+txt$(122)
	     games=4
	     leg=2
     ELSEIF cr=7 THEN
	     x1$=txt$(118)+" "+txt$(121)
	     games=2
	     leg=1
     ELSEIF cr=8 THEN
	     x1$=txt$(118)+" "+txt$(122)
	     games=2
	     leg=2
     ELSEIF cr=9 THEN
			 x1$=txt$(119)
			 games=1
			 leg=2
     elseif cr=10 then
	 		 x1$=txt$(120)
       CLS
	     l=1
		   x$=x2$
		   color 4,0
			 GOSUB prtitle
	     x$=x1$
	 	   l=2
	     GOSUB prtitle
	     x$=tn$(cc%(team))
	     l=4
	     gosub prtitle
	     gosub conmou
	     goto view.cups
	   end if

     game=0
     team=1
7605 CLS
     l=1
     x$=x2$
     color 4,0
		 GOSUB prtitle
     x$=x1$
     l=2
     GOSUB prtitle
7610 INCR game
     team1=cc%(team)
     team2=cc%(team+1)
     game1=game
		 IF game1>8 THEN game1=game1-8
		 IF team1<nop+1 THEN COLOR 6
     x$=tn$(team1)
     gosub length
     LOCATE 8+(game1*2),18-x2
     COLOR 2
		 PRINT tn$(team1);
     LOCATE 8+(game1*2),21
     COLOR 2
     PRINT "V"
     LOCATE 8+(game1*2),25
		 IF team2<nop+1 THEN COLOR 6
		 PRINT tn$(team2);
     if leg=2 then
       IF crs%(game,1)>crs%(game,2) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
			 LOCATE 8+(game1*2),18
       PRINT crs%(game,1);"   "
       LOCATE 8+(game1*2),22
       IF crs%(game,2)>crs%(game,1) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
       PRINT crs%(game,2)
     end if
		 team=team+2
     IF game>games THEN GOTO 7620
     IF team>games*2 THEN GOTO 7620
     IF game=8 AND games>8 THEN
       GOSUB conmou
       GOTO 7605
     END IF
     GOTO 7610
7620 GOSUB conmou
		 font SADD("rub.font"+CHR$(0)),8
     GOTO view.cups

7700 CLS
     x2$=txt$(124)
     IF ur=1 THEN
		   x1$=txt$(114)+" "+txt$(121)
		 	 games=16
	     leg=1
     ELSEIF ur=2 THEN
	     x1$=txt$(114)+" "+txt$(122)
	     games=16
		 	 leg=2
     ELSEIF ur=3 THEN
 	     x1$=txt$(115)+" "+txt$(121)
	     games=8
	     leg=1
     ELSEIF ur=4 THEN
	     x1$=txt$(115)+" "+txt$(122)
	     games=8
 	     leg=2
     ELSEIF ur=5 THEN
	     x1$=txt$(117)+" "+txt$(121)
	     games=4
	     leg=1
     ELSEIF ur=6 THEN
	     x1$=txt$(117)+" "+txt$(122)
	     games=4
	     leg=2
     ELSEIF ur=7 THEN
	     x1$=txt$(118)+" "+txt$(121)
	     games=2
	     leg=1
     ELSEIF ur=8 THEN
	     x1$=txt$(118)+" "+txt$(122)
	     games=2
	     leg=2
     ELSEIF ur=9 THEN
	     x1$=txt$(119)+" "+txt$(121)
	     games=1
	     leg=1
     ELSEIF ur=10 THEN
	     x1$=txt$(119)+" "+txt$(122)
	     games=1
	     leg=2
     elseif ur=11 then
	     x1$=txt$(120)
       CLS
	     l=1
		   x$=x2$
		   color 4,0
			 GOSUB prtitle
	     x$=x1$
	  	 l=2
	     GOSUB prtitle
	     x$=tn$(uc%(team))
	     l=4
	     gosub prtitle
	     gosub conmou
	     goto view.cups
	   end if

     game=0
     team=1
7705 CLS
     l=1
     x$=x2$
     color 4,0
		 GOSUB prtitle
     x$=x1$
     l=2
     GOSUB prtitle
7710 INCR game
     team1=uc%(team)
     team2=uc%(team+1)
     game1=game
		 IF game1>8 THEN game1=game1-8
     x$=tn$(team1)
     gosub length
		 LOCATE 8+(game1*2),18-x2
     COLOR 2
		 IF team1<nop+1 THEN COLOR 6
		 PRINT tn$(team1);
     LOCATE 8+(game1*2),21
     COLOR 2
     PRINT "V"
     LOCATE 8+(game1*2),25
		 IF team2<nop+1 THEN COLOR 6
		 PRINT tn$(team2);
     if leg=2 then
       IF urs%(game,1)>urs%(game,2) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
       LOCATE 8+(game1*2),18
       PRINT urs%(game,1);"   "
			 LOCATE 8+(game1*2),22
       IF urs%(game,2)>urs%(game,1) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
       PRINT urs%(game,2)
     end if
		 team=team+2
     IF game>games THEN GOTO 7720
     IF team>games*2 THEN GOTO 7720
     IF game=8 AND games>8 THEN
       GOSUB conmou
       GOTO 7705
     END IF
     GOTO 7710
7720 GOSUB conmou
		 font SADD("rub.font"+CHR$(0)),8
     GOTO view.cups

7800 CLS
     x2$=txt$(125)
     IF fr=1 THEN x1$=txt$(114):games=32
     IF fr=2 THEN x1$=txt$(115):games=16
     IF fr=3 THEN x1$=txt$(116):games=8
     IF fr=4 THEN x1$=txt$(117):games=4
     IF fr=5 THEN x1$=txt$(118):games=2
     IF fr=6 THEN x1$=txt$(119):games=1
     if fr=7 then
			 x1$=txt$(120)
       CLS
	     l=1
	  	 x$=x2$
		   color 4,0
			 GOSUB prtitle
	     x$=x1$
		   l=2
	     GOSUB prtitle
	     x$=tn$(fc%(team))
	     l=4
	     gosub prtitle
	     gosub conmou
	     goto view.cups
	   end if

     game=0
     team=1
7805 CLS
     l=1
     x$=x2$
     color 4,0
		 GOSUB prtitle
     x$=x1$
     l=2
     GOSUB prtitle
	   font sadd("rub1.font"+chr$(0)),8
		 locate 8,1
		 print "Div";tab(43);"Div"
7810 incr game
     team1=fc%(team)
     team2=fc%(team+1)
     FOR div=1 TO 4
	     FOR b=1 TO 16
		     IF ds%(div,b)=team1 THEN GOTO 7815
	     NEXT b
     NEXT div
7815
     COLOR 2
		 game1=game
		 IF game1>8 THEN game1=game1-8
		 IF game1>8 THEN game1=game1-8
		 IF game1>8 THEN game1=game1-8
		 IF team1<nop+1 THEN COLOR 6
     x$=tn$(team1)
     gosub length
     locate 8+(game1*2),1
     print div
     LOCATE 8+(game1*2),20-x2
     PRINT tn$(team1);
     LOCATE 8+(game1*2),23
     COLOR 2
     PRINT "V"
     LOCATE 8+(2*game1),27
     FOR div=1 TO 4
	     FOR b=1 TO 16
		     IF ds%(div,b)=team2 THEN GOTO 7816
	     NEXT b
     NEXT div
7816
		 IF team2<nop+1 THEN COLOR 6
     PRINT tn$(team2)
     locate 8+(2*game1),44
     print div
7830 team=team+2
		 IF game>=games THEN GOTO 7820
     IF team>games*2 THEN GOTO 7820
     IF game=8 AND games>8 THEN
       GOSUB conmou
       GOTO 7805
     END IF
     IF game=16 AND games>16 THEN
       GOSUB conmou
       GOTO 7805
     END IF
     IF game=24 AND games>24 THEN
       GOSUB conmou
       GOTO 7805
     END IF
     GOTO 7810
7820 GOSUB conmou
     GOTO view.cups

7900 CLS
     x2$=txt$(126)
     IF er=1 THEN
	     x1$=txt$(114)+" "+txt$(121)
	     games=16
	     leg=1
     ELSEIF er=2 THEN
	     x1$=txt$(114)+" "+txt$(122)
	     games=16
	     leg=2
     ELSEIF er=3 THEN
	     x1$=txt$(115)+" "+txt$(121)
	     games=8
	     leg=1
     ELSEIF er=4 THEN
	     x1$=txt$(115)+" "+txt$(122)
	     games=8
	     leg=2
     ELSEIF er=5 THEN
	     x1$=txt$(117)+" "+txt$(121)
	     games=4
	     leg=1
     ELSEIF er=6 THEN
	     x1$=txt$(117)+" "+txt$(122)
	     games=4
	     leg=2
     ELSEIF er=7 THEN
	     x1$=txt$(118)+" "+txt$(121)
	     games=2
	     leg=1
     ELSEIF er=8 THEN
	     x1$=txt$(118)+" "+txt$(122)
	     games=2
	     leg=2
     ELSEIF er=9 THEN
	     x1$=txt$(119)
	     games=1
	     leg=1
     elseif er=10 then
	     x1$=txt$(120)
       CLS
	     l=1
		   x$=x2$
		   color 4,0
			 GOSUB prtitle
	     x$=x1$
	  	 l=2
	     GOSUB prtitle
	     x$=tn$(ec%(team))
	     l=4
	     gosub prtitle
	     gosub conmou
	     goto view.cups
	   end if

     game=0
     team=1
7905 CLS
     l=1
     x$=x2$
     color 4,0
		 GOSUB prtitle
     x$=x1$
     l=2
     GOSUB prtitle
7910 game=game+1
     team1=ec%(team)
     team2=ec%(team+1)
     game1=game
		 IF game1>8 THEN game1=game1-8
     x$=tn$(team1)
     gosub length
		 LOCATE 8+(game1*2),18-x2
     COLOR 2
		 IF team1<nop+1 THEN COLOR 6
		 PRINT tn$(team1);
     LOCATE 8+(game1*2),21
     color 2
     PRINT "V"
     LOCATE 8+(game1*2),25
		 IF team2<nop+1 THEN COLOR 6
		 PRINT tn$(team2);
     if leg=2 then
       IF ers%(game,1)>ers%(game,2) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
       LOCATE 8+(game1*2),18
       PRINT ers%(game,1);"   "
			 LOCATE 8+(game1*2),22
       IF ers%(game,2)>ers%(game,1) THEN
				 COLOR 6
       ELSE
				 COLOR 7
       END IF
       PRINT ers%(game,2)
     end if
		 team=team+2
     IF game>=games THEN GOTO 7920
     IF team>games*2 THEN GOTO 7920
     IF game=8 AND games>8 THEN
       GOSUB conmou
       GOTO 7905
     END IF
     GOTO 7910
7920 GOSUB conmou
		 font SADD("rub.font"+CHR$(0)),8
     GOTO view.cups

8000 CLS
     FOR l=1 TO 16
	     g%(l)=0
     NEXT l

     loadiff sadd("ram:footpic6"+chr$(0))
		 color 10,0
     x$=txt$(127)
     x=int(len(x$)*7.5)
     font sadd("courier.font"+chr$(0)),24
     locate 1,1
     print ptab(160-x);x$
     font sadd("rub.font"+chr$(0)),8

     COLOR 5,10
     LINE (20,136)-(90,160),10,bf
     LINE (20,136)-(90,160),5,b
     LOCATE 19,1
     PRINT PTAB(27);txt$(128)
     LINE (20,184)-(90,208),10,bf
     LINE (20,184)-(90,208),5,b
     LOCATE 25,1
     PRINT PTAB(27);txt$(129)
     LINE (230,136)-(300,160),10,bf
     LINE (230,136)-(300,160),5,b
     LOCATE 19,1
     PRINT PTAB(237);txt$(130)+STR$(week)
     LINE (230,184)-(300,208),10,bf
     LINE (230,184)-(300,208),5,b
     LOCATE 25,1
     PRINT PTAB(249);txt$(131)
     COLOR 4,0

8001 gosub MouseM
     IF y>136 and y<160 and  x>20 AND x<90 THEN
		   gosub colour.palette
		   GOTO Season.fixture
		 end if
		 if y>136 and y<160 and x>230 AND x<300 and week>0 and week<31 THEN
		   gosub colour.palette
		   CLS
		   COLOR 4,0
		   GOTO 8002
		 END IF
		 if y>184 and y<208 and X>20 and x<90 then goto main.menu
		 if y>184 and y<208 and x>230 and x<300 and week>1 and week<31 then
			 gosub colour.palette
			 gosub last.week
			 goto 8000
		 end if
		 GOTO 8001

8002 loadiff sadd("ram:footpic5"+chr$(0))
		 color 3,0
     x$=txt$(132)+STR$(week)
		 l=1
		 gosub prtitle
     GOSUB div0

     team=1
     game=1
     week1=week
     w=week
     IF w>15 THEN w=w-15
8011 IF week1>1 THEN week1=week1-2:GOTO 8011
     IF week1=1 THEN team=1
     IF week1=0 THEN team=16
8010 g%(team)=1
     g%(gt%(w,team))=1
     l%(game,1)=team
     l%(game,2)=gt%(w,team)
8020 IF week1=1 THEN team=team+1
     IF week1=0 THEN team=team-1
     IF week1=0 AND team=0 THEN GOTO 8030
     IF week1=1 AND team=17 THEN GOTO 8030
     IF g%(team)=1 THEN GOTO 8020
     game=game+1
     GOTO 8010

8030 CLS
     gosub colour.palette
     color 4,0
     x$=txt$(132)+STR$(week)
		 l=1
     GOSUB prtitle

     FOR game=1 TO 8
	     t1=ds%(div,l%(game,1))
  	   t2=LEN (tn$(t1))
    	 LOCATE 8+game,16-t2
  	   COLOR 2
	     IF t1<nop+1 THEN COLOR 7
	     PRINT tn$(t1)
	     LOCATE 8+game,25
  	   COLOR 2
			 IF ds%(div,l%(game,2))<nop+1 THEN COLOR 7
    	 PRINT tn$(ds%(div,l%(game,2)))
	     LOCATE 8+game,18
  	   COLOR 4
    	 PRINT "- V -"
     NEXT game

     LINE (30,160)-(130,200),5,bf
     LINE (30,160)-(130,200),4,b
     LOCATE 23,1
     COLOR 3,5
     PRINT PTAB(44);txt$(133)
     LINE (190,160)-(290,200),5,bf
     LINE (190,160)-(290,200),4,b
     LOCATE 23,1
     PRINT PTAB(204);txt$(134)
     COLOR 4,0

8040:
     gosub MouseM
     IF y<160 OR y>200 THEN GOTO 8040
     IF x>30 AND x<130 THEN GOTO team.stats
     IF x>190 AND x<290 THEN GOTO 8000
     GOTO 8040

9000 if started=1 then goto 9500
	   if saves=0 then goto main.menu
     loadiff sadd("ram:footpic1"+chr$(0))
     x$=txt$(135)
     l=1
     color 10,0
     GOSUB prtitle
     locate 30,10
     print txt$(136);saves

     COLOR 3,10
     LINE (240,88)-(310,112),10,bf
     LINE (240,88)-(310,112),3,b
     LOCATE 13,1
     PRINT PTAB(249);txt$(137)
     LINE (240,40)-(310,64),10,bf
     LINE (240,40)-(310,64),3,b
     LOCATE 7,1
     PRINT PTAB(249);txt$(138)
     LINE (240,136)-(310,160),10,bf
     LINE (240,136)-(310,160),3,b
     LOCATE 19,1
     PRINT PTAB(249);txt$(139)

9010 gosub MouseM
     IF (x>240 AND x<310) AND (y>88 AND y<112) THEN GOTO 9500
     IF (x>240 AND x<310) AND (y>40 AND y<64) and saves>0 THEN GOTO 9100
     IF (x>240 AND x<310) AND (y>136 AND y<160) THEN GOTO main.menu
     GOTO 9010

9100 color 10,0
		 cls
     x$=txt$(140)
     l=1
     GOSUB prtitle

		 locate 10,11
		 print txt$(141)

		 color 3,10
		 LINE (112,104)-(200,176),10,bf
     LINE (112,104)-(200,176),3,b
		 locate 15,17
		 print txt$(142)
		 locate 17,17
		 print txt$(143)
		 locate 19,17
		 print txt$(144)
		 locate 21,16
		 print txt$(145)

9110 gosub mousem
     IF (y>112 AND y<120) THEN f$="save1.sav":goto 9120
     IF (y>128 AND y<136) then f$="save2.sav":goto 9120
     IF (y>144 AND y<152) THEN f$="save3.sav":goto 9120
     if (y>160 and y<168) then goto main.menu
     GOTO 9110

9120 gosub colour.palette
		 color 4,0
		 cls
		 x$=txt$(146)
     l=1
     GOSUB prtitle

		 locate 20,1
		 x$=txt$(147)
		 gosub length
		 print ptab(160-(x2*4));x$

		 gosub conmou

		 loadiff sadd("ram:footpic6"+chr$(0))
		 color 4,0
		 x$=txt$(146)
     l=1
     GOSUB prtitle
		 l=9
     x$=txt$(148)
     gosub prtitle

		 decr saves

     OPEN "O",#1,"df0:"+f$
     for a1=1 to 164
			 write #1,playername$(a1),tn$(a1),agg%(a1)
			 for a2=1 to 3
				 write #1,tact%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 64
			 write #1,coach%(a1),coach.name$(a1)
			 write #1,physio%(a1),physio.name$(a1)
			 write #1,skills%(a1),lc%(a1),fc%(a1)
			 write #1,wins%(a1),draws%(a1),lost%(a1)
			 write #1,gfor%(a1),gag%(a1)
			 write #1,m&(a1),lo&(a1),mo&(a1),sl$(a1)
			 write #1,ca&(a1),ccap&(a1),re&(a1)
			 for a2=1 to 18
				 write #1,pt%(a1,a2),pa%(a1,a2),pg%(a1,a2)
				 write #1,pj%(a1,a2),pp%(a1,a2),pc%(a1,a2)
				 for a3=1 to 4
					 write #1,ps!(a1,a2,a3)
				 next a3
				 write #1,pn%(a1,a2,1),pn%(a1,a2,2)
			 next a2
			 for a2=1 to 30
				 for a3=1 to 3
					 write #1,fixture&(a1,a2,a3)
				 next a3
			 next a2
			 for a2=1 to 60
				 write #1,his&(a1,a2)
			 next a2
			 for a2=1 to 31
				 write #1,pog%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 100
			 for a2=1 to 4
				 write #1,eskill%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 32
			 write #1,ec%(a1),cc%(a1),uc%(a1)
		 next a1
		 for a1=1 to 16
			 write #1,crs%(a1,1),urs%(a1,1),ers%(a1,1)
			 write #1,crs%(a1,2),urs%(a1,2),ers%(a1,2)
		 next a1
		 for a1=1 to 4
			 for a2=1 to 16
				 write #1,ds%(a1,a2),dp%(a1,a2),dsp%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 4
			 for a2=1 to 8
				 for a3=1 to 4
					 write #1,lresult%(a1,a2,a3)
				 next a3
			 next a2
		 next a1
		 for a1=1 to 3
			 for a2=1 to 4
				 write #1,p.off%(a1,a2)
			 next a2
		 next a1
		 write #1,nop,season,week,lr,fr,er,cr,ur,saves,pts
     CLOSE #1

		 cls
		 locate 20,1
		 x$=txt$(149)
		 gosub length
		 print ptab(160-(x2*4));x$

		 gosub conmou

     GOTO main.menu

9500 color 10,0
		 cls
     x$=txt$(150)
     l=1
     GOSUB prtitle

		 locate 10,11
		 print txt$(151)

		 color 3,10
		 LINE (112,104)-(200,176),10,bf
     LINE (112,104)-(200,176),3,b
		 locate 15,17
		 print txt$(142)
		 locate 17,17
		 print txt$(143)
		 locate 19,17
		 print txt$(144)
		 locate 21,16
		 if started=0 then print txt$(145)

9510 gosub mousem
     IF (y>112 AND y<120) THEN f$="save1.sav":goto 9520
     IF (y>128 AND y<136) then f$="save2.sav":goto 9520
     IF (y>144 AND y<152) THEN f$="save3.sav":goto 9520
     if (y>160 and y<168) and started=0 then goto main.menu
     GOTO 9510

9520 gosub colour.palette
     color 4,0
     cls
     x$=txt$(152)
     l=1
     GOSUB prtitle
     
		 locate 20,1
		 x$=txt$(147)
		 gosub length
		 print ptab(160-(x2*4));x$

		 gosub conmou

		 if not fexists("df0:"+f$) then goto 9000

		 color 10,0
		 cls
		 loadiff sadd("ram:footpic6"+chr$(0))
     x$=txt$(152)
     l=1
     GOSUB prtitle
		 l=9
     x$=txt$(148)
     gosub prtitle

     OPEN "I",#1,"df0:"+f$
     for a1=1 to 164
			 input #1,playername$(a1),tn$(a1),agg%(a1)
			 for a2=1 to 3
				 input #1,tact%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 64
			 input #1,coach%(a1),coach.name$(a1)
			 input #1,physio%(a1),physio.name$(a1)
			 input #1,skills%(a1),lc%(a1),fc%(a1)
			 input #1,wins%(a1),draws%(a1),lost%(a1)
			 input #1,gfor%(a1),gag%(a1)
			 input #1,m&(a1),lo&(a1),mo&(a1),sl$(a1)
			 input #1,ca&(a1),ccap&(a1),re&(a1)
			 for a2=1 to 18
				 input #1,pt%(a1,a2),pa%(a1,a2),pg%(a1,a2)
				 input #1,pj%(a1,a2),pp%(a1,a2),pc%(a1,a2)
				 for a3=1 to 4
					 input #1,ps!(a1,a2,a3)
				 next a3
				 input #1,pn%(a1,a2,1),pn%(a1,a2,2)
			 next a2
			 for a2=1 to 30
				 for a3=1 to 3
					 input #1,fixture&(a1,a2,a3)
				 next a3
			 next a2
			 for a2=1 to 60
				 input #1,his&(a1,a2)
			 next a2
			 for a2=1 to 31
				 input #1,pog%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 100
			 for a2=1 to 4
				 input #1,eskill%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 32
			 input #1,ec%(a1),cc%(a1),uc%(a1)
		 next a1
		 for a1=1 to 16
			 input #1,crs%(a1,1),urs%(a1,1),ers%(a1,1)
			 input #1,crs%(a1,2),urs%(a1,2),ers%(a1,2)
		 next a1
		 for a1=1 to 4
			 for a2=1 to 16
				 input #1,ds%(a1,a2),dp%(a1,a2),dsp%(a1,a2)
			 next a2
		 next a1
		 for a1=1 to 4
			 for a2=1 to 8
				 for a3=1 to 4
					 input #1,lresult%(a1,a2,a3)
				 next a3
			 next a2
		 next a1
		 for a1=1 to 3
			 for a2=1 to 4
				 input #1,p.off%(a1,a2)
			 next a2
		 next a1
		 INPUT #1,nop,season,week,lr,fr,er,cr,ur,saves,pts
     CLOSE #1
    
     gosub colour.palette
     color 4,0
     cls
     x$=txt$(152)
     l=1
     GOSUB prtitle

		 locate 25,1
		 x$=txt$(149)
		 gosub length
		 print ptab(160-(x2*4));x$

		 gosub conmou

     GOTO main.menu

10000 REM		     PLAY MATCHES
      loadiff sadd("ram:footpic6"+chr$(0))
      x$=txt$(153)
      font sadd("courier.font"+chr$(0)),24
      locate 1,1
      color 4,0
      print ptab(77);x$
      font sadd("rub.font"+chr$(0)),8
      play.game=1

      cod=0
      for a=1 to 64
				for b=1 to 18
					if pt%(a,b)>0 then
						if rnd>.60 then
							if a<nop+1 then cod=1
							team=a
							player=b
							gosub trans.bids.3
						end if
					end if
					if a=nop+1 and b=1 and cod=1 then
			      loadiff sadd("ram:footpic6"+chr$(0))
				    x$=txt$(153)
			      font sadd("courier.font"+chr$(0)),24
			      locate 1,1
			      color 4,0
			      print ptab(77);x$
			      font sadd("rub.font"+chr$(0)),8
			    end if
				next b
      next a

      st=33
      fh=64
      GOSUB team.sort

      w=week
      FOR a=1 TO 64
	      cgates&(a)=0
		    sub.players(a)=0
			  team.score(a)=0
	      keeper!(a)=0
		    defense!(a)=0
			  midfield!(a)=0
				attack!(a)=0
      NEXT a

      if w=31 then goto po1
      if w=32 then goto po2
      IF w=3 OR w=9 OR w=15 OR w=21 OR w=26 OR w=29 THEN gosub colour.palette:GOSUB league
      IF w=6 OR w=12 OR w=18 OR w=24 OR w=28 OR w=30 THEN gosub colour.palette:GOSUB FACup
      IF w=2 OR w=6 OR w=10 OR w=14 OR w=17 OR w=22 OR w=25 OR w=28 OR w=30 THEN gosub colour.palette:GOSUB euro.cup
      IF w=3 OR w=7 OR w=12 OR w=15 OR w=18 OR w=21 OR w=24 OR w=26 OR w=28 THEN gosub colour.palette:GOSUB cup.cup
      IF w=3 OR w=7 OR w=9 OR w=12 OR w=15 OR w=18 OR w=21 OR w=24 OR w=26 OR w=29 THEN gosub colour.palette:GOSUB uefa.cup

      IF w>15 THEN w=w-15

      FOR div=1 TO 4
	      game=1
  	    counter=0
    	  week1=week
10011	  IF week1>1 THEN week1=week1-2:GOTO 10011
      	IF week1=1 THEN team=1
   	    IF week1=0 THEN team=16
10010   taken%(div,team)=1
        taken%(div,gt%(w,team))=1
	      results%(div,game,1,1)=team
  	    results%(div,game,2,1)=gt%(w,team)
10020 	IF week1=1 THEN team=team+1
   	    IF week1=0 THEN team=team-1
     	  IF week1=0 AND team=0 THEN GOTO 10025
      	IF week1=1 AND team=17 THEN GOTO 10025
      	IF taken%(div,team)=1 THEN GOTO 10020
       	game=game+1
      	GOTO 10010
10025 NEXT div

10030 cls
      gosub colour.palette
      COLOR 4

15500 FOR abcd=1 TO 32
	      ball(abcd)=3
      NEXT abcd

      GOSUB print.games
			for f=1 to 500
				x=mouse(0)
			next f

      LINE (120,224)-(200,248),5,bf
      LINE (120,224)-(200,248),4,b
      COLOR 3,5
      LOCATE 30,1
      PRINT PTAB(132);txt$(154)
      COLOR 7,0
			gosub game.agg

16000 FOR tim=1 TO 90

	      COLOR 4
  	    l=1
    	  x$=txt$(155)+STR$(tim)
	      GOSUB prtitle
        COLOR 7

	      gp=0
	      g=0
	      ga=0

	      FOR div=1 TO 4
		      FOR games=1 TO 8
						gl=0
			      team1=ds%(div,results%(div,games,1,1))
			      team2=ds%(div,results%(div,games,2,1))


			      ds=INT((defense!(team1)+attack!(team2))*2)
			      ms=INT((midfield!(team1)+midfield!(team2))*2)
			      fs=INT((attack!(team1)+defense!(team2))*2)
			      ks1=INT(keeper!(team1))
			      ks2=INT(keeper!(team2))
			      ds1=INT(defense!(team1))
			      ds2=INT(defense!(team2))
			      ms1=INT(midfield!(team1))
			      ms2=INT(midfield!(team2))
			      fs1=INT(attack!(team1))
			      fs2=INT(attack!(team2))

			      mat.1=1
			      ball=ball((div-1)*8+games)
			      GOSUB match
			      ball((div-1)*8+games)=ball

			      if team1<nop+1 or team2<nop+1 then incr ga
						IF gl>0 THEN GOSUB store.scores

16200       play.game.1=1

			      IF MOUSE(0)<>0 THEN
							x=MOUSE(1)
							y=MOUSE(2)
							IF (x>120 AND x<224) AND (y>224 AND y<248) THEN
					      font SADD("rub.font"+CHR$(0)),8
							  GOSUB game.tactics
								gosub game.agg
							END IF
			      END IF

  		    NEXT games
      	NEXT div
	      gma=ga
      NEXT tim

      font SADD("rub.font"+CHR$(0)),8
      play.game.1=0
      LINE (0,220)-(320,250),0,bf

17000 FOR div=1 TO 4
  	    FOR games=1 TO 8
		      team1=results%(div,games,1,1)
		      team2=results%(div,games,2,1)
		      s1=results%(div,games,1,2)
		      s2=results%(div,games,2,2)
		      t1=ds%(div,results%(div,games,1,1))
		      t2=ds%(div,results%(div,games,2,1))
					lresult%(div,games,1)=t1
					lresult%(div,games,4)=t2
					lresult%(div,games,2)=s1
					lresult%(div,games,3)=s2
		
		      IF s2>=s1 THEN GOTO 17100
	
					for x=3 to 1 step-1
						if x=3 then
							hi=58
					    IF (s1-s2)>(his&(t1,hi)-his&(t1,hi+1)) THEN
								his&(t1,hi)=s1
								his&(t1,hi+1)=s2
								his&(t1,hi+2)=t2
				      END IF
				    end if
				    if x<3 then
							hi=52+((x-1)*3)
							hi1=52+(x*3)
					    IF (s1-s2)>(his&(t1,hi)-his&(t1,hi+1)) THEN
								swap his&(t1,hi),his&(t1,hi1)
								swap his&(t1,hi+1),his&(t1,hi1+1)
								swap his&(t1,hi+2),his&(t1,hi1+2)
				      END IF
				    end if
				  next x

		      IF (s1-s2)>(his&(t2,19)-his&(t2,20)) THEN
						his&(t2,19)=s1
						his&(t2,20)=s2
						his&(t2,21)=t1
		      END IF

		      sl$(t1)=RIGHT$(sl$(t1),5)+"W"
		      sl$(t2)=RIGHT$(sl$(t2),5)+"L"
	
		      wins%(t1)=wins%(t1)+1
		      lost%(t2)=lost%(t2)+1
		      gfor%(t1)=gfor%(t1)+results%(div,games,1,2)
		      gag%(t1)=gag%(t1)+results%(div,games,2,2)
		      gfor%(t2)=gfor%(t2)+results%(div,games,2,2)
		      gag%(t2)=gag%(t2)+results%(div,games,1,2)
		      fixture&(t1,week,1)=s1
		      fixture&(t1,week,2)=s2
		      fixture&(t2,week,1)=s1
		      fixture&(t2,week,2)=s2
		      GOTO 17250

17100     IF s1>=s2 THEN GOTO 17200
					for x=3 to 1 step-1
						if x=3 then
							hi=58
					    IF (s2-s1)>(his&(t2,hi)-his&(t2,hi+1)) THEN
								his&(t2,hi)=s2
								his&(t2,hi+1)=s1
								his&(t2,hi+2)=t1
				      END IF
				    end if
				    if x<3 then
							hi=52+((x-1)*3)
							hi1=52+(x*3)
					    IF (s2-s1)>(his&(t2,hi)-his&(t2,hi+1)) THEN
								swap his&(t2,hi),his&(t2,hi1)
								swap his&(t2,hi+1),his&(t2,hi1+1)
								swap his&(t2,hi+2),his&(t2,hi1+2)
					    END IF
					  end if
				  next x

		      IF (s2-s1)>(his&(t1,19)-his&(t1,20)) THEN
						his&(t1,19)=s2
						his&(t1,20)=s1
						his&(t1,21)=t2
		      END IF

		      sl$(t1)=RIGHT$(sl$(t1),5)+"L"
		      sl$(t2)=RIGHT$(sl$(t2),5)+"W"
		      wins%(t2)=wins%(t2)+1
		      lost%(t1)=lost%(t1)+1
		      gfor%(t2)=gfor%(t2)+results%(div,games,2,2)
		      gag%(t2)=gag%(t2)+results%(div,games,1,2)
		      gfor%(t1)=gfor%(t1)+results%(div,games,1,2)
		      gag%(t1)=gag%(t1)+results%(div,games,2,2)
		      fixture&(t1,week,1)=s1
		      fixture&(t1,week,2)=s2
		      fixture&(t2,week,1)=s1
		      fixture&(t2,week,2)=s2
		      GOTO 17250

17200     IF s1<>s2 THEN GOTO 17250
		      sl$(t1)=RIGHT$(sl$(t1),5)+"D"
		      sl$(t2)=RIGHT$(sl$(t2),5)+"D"
		      draws%(t1)=draws%(t1)+1
		      draws%(t2)=draws%(t2)+1
		      gfor%(t2)=gfor%(t2)+results%(div,games,2,2)
		      gag%(t2)=gag%(t2)+results%(div,games,1,2)
		      gfor%(t1)=gfor%(t1)+results%(div,games,1,2)
		      gag%(t1)=gag%(t1)+results%(div,games,2,2)
		      t1=ds%(div,results%(div,games,1,1))
		      t2=ds%(div,results%(div,games,2,1))
		      fixture&(t1,week,1)=s1
		      fixture&(t1,week,2)=s2
		      fixture&(t2,week,1)=s1
		      fixture&(t2,week,2)=s2
	
17250     gates&(t1)=INT((ca&(t1)+ca&(t2))/2)
		      gates&(t1)=INT(gates&(t1)+INT(RND*gates&(t1)/10)-(gates&(t1)/20))
		      IF gates&(t1)>ccap&(t1) THEN gates&(t1)=ccap&(t1)
		      fixture&(t1,week,3)=gates&(t1)
		      fixture&(t2,week,3)=gates&(t1)
		      IF season=1 AND week=1 THEN
						his&(t1,9)=gates&(t1)
						his&(t1,10)=t2
						his&(t1,11)=gates&(t1)
						his&(t1,12)=t2
						his&(t2,9)=gates&(t1)
						his&(t2,10)=t1
						his&(t2,11)=gates&(t1)
						his&(t2,12)=t1
					END IF
		      IF his&(t1,9)<gates&(t1) THEN
						his&(t1,9)=gates&(t1)
						his&(t1,10)=t2
					ELSEIF his&(t1,11)>gates&(t1) THEN
						his&(t1,11)=gates&(t1)
						his&(t1,12)=t2
					END IF
		      IF his&(t2,9)<gates&(t1) THEN
						his&(t2,9)=gates&(t1)
						his&(t2,10)=t1
					ELSEIF his&(t2,11)>gates&(t1) THEN
						his&(t2,11)=gates&(t1)
						his&(t2,12)=t1
					END IF
	
		      gates&(t1)=INT(gates&(t1)*(5-div))
		      gates&(t2)=gates&(t1)
		      IF s1>s2 THEN ca&(t1)=ca&(t1)+INT(RND*300):ca&(t2)=ca&(t2)-INT(RND*100)
		      IF s2>s1 THEN ca&(t2)=ca&(t2)+INT(RND*300):ca&(t1)=ca&(t1)-INT(RND*100)
		      IF s1=s2 THEN ca&(t1)=ca&(t1)+INT(RND*150):ca&(t2)=ca&(t2)+INT(RND*150)
		      IF ca&(t1)>ccap&(t1) THEN ca&(t1)=ccap&(t1)
		      IF ca&(t2)>ccap&(t2) THEN ca&(t2)=ccap&(t2)
		      IF ca&(t1)<500 THEN ca&(t1)=500
		      IF ca&(t2)<500 THEN ca&(t2)=500
	      NEXT games

	      lt=1
	      GOSUB 5010

18000 NEXT div

      FOR a=1 TO 4
	      FOR b=1 TO 16
			    taken%(a,b)=0
	      NEXT b

	      FOR b=1 TO 8
		      results%(a,b,1,1)=0
				  results%(a,b,1,2)=0
		      results%(a,b,2,1)=0
			    results%(a,b,2,2)=0
	      NEXT b
      NEXT a

      GOSUB conmou

weekly.news:
      inter=0
      IF RND>.90 THEN inter=1
      FOR a=1 TO nop
		    gosub profit.sort
		    FOR P=1 TO 11
			    injury%(a,p,1)=0
			  NEXT p
			  FOR p=1 TO 18
					booked%(p)=0
			  NEXT p
			  IF RND>.98 and week<31 THEN
					joboffer=1
					GOSUB job.offer
					IF job=0 THEN joboffer=0
			  ELSE
					joboffer=0
			  END IF

			  a2=0
				for a1=1 to 18
					if pa%(a,a1)>1 then incr a2
			  next a1

				if week<31 and a2>12 then GOSUB injuried
  	    IF inter=1 and week<31 and a2<13 THEN GOSUB international

	      CLS
  	    item=13
    	  items=0
	      COLOR 4
		    x$=tn$(a)
	      gosub length
  	    font SADD("courier.font"+CHR$(0)),24
    	  locate 1,1
	      print ptab(160-x2*7.5);x$
  	    font SADD("rub1.font"+CHR$(0)),8
	
  	    FOR l=1 TO 4
    		  LINE (8-l,30-l)-(312-l,86-l),1,b
		      LINE (8-l,90+l)-(312-l,212-l),1,b
	      NEXT l
  	    COLOR 2
    	  LOCATE 6,5
	      PRINT txt$(156);
  	    COLOR 7
    	  PRINT TAB(30);lo&(a)
      	COLOR 2
	      LOCATE 7,5
  	    PRINT txt$(157);
   	    COLOR 7
	      PRINT tab(28);"-";TAB(30);re&(a)
  	    COLOR 2
    	  LOCATE 8,5
      	PRINT txt$(158);
	      COLOR 7
  	    PRINT tab(28);"+";TAB(30);gates&(a)
    	  COLOR 2
      	LOCATE 9,5
	      PRINT txt$(159);
  	    COLOR 7
    	  PRINT tab(28);"-";TAB(30);wages&(a)
      	COLOR 2
	      IF cgates&(a)>0 THEN
					GOSUB newspage.print
					PRINT txt$(160);
					COLOR 7
					PRINT tab(28);"+";TAB(30);cgates&(a)
					COLOR 2
	      END IF
  	    IF week=32 THEN
					GOSUB newspage.print
					sea&=INT(ca&(a)*8*(RND*3))
					PRINT txt$(161);
					COLOR 7
					PRINT tab(28);"+";TAB(30);sea&
					COLOR 2
					m&(a)=m&(a)+sea&
					profit&(a)=profit&(a)+sea&
	      END IF
  	    gates&(a)=0

				COLOR 7
	      newsitem=INT(RND*3)+2
				newsloop=1

	      FOR f=1 TO 15
					news(f)=0
	      NEXT f

  	    DO
Dailynews:
					NI=INT(RND*15)+1
					IF news(NI)=1 THEN GOTO dailynews
					news(ni)=1
					COLOR 2
		      GOSUB newspage.print
					PRINT txt$(ni+1);
					x&=newsa&(ni)
					x&=INT(((RND*x&/2)+x&/2)/div)
					m&(a)=m&(a)+x&
					profit&(a)=profit&(a)+x&
					COLOR 7
	     	  if x&<0 then print tab(28);"-"; else print tab(28);"+";
					PRINT TAB(30);ABS(x&)
					INCR newsloop
	      LOOP UNTIL newsloop>newsitem

  	    sacked=0
    	  IF m&(a)<0 THEN
			  	FOR c=1 TO 4
						FOR b=1 TO 16
					    IF ds%(c,b)=a THEN GOTO sack1
				    NEXT b
		    	NEXT c
sack1:
					m&(a)=m&(a)+((5-c)*150000-lo&(a))
					lo&(a)=(5-c)*150000

					if m&(a)<0 then
						COLOR 4
		   	    GOSUB newspage.print
				    PRINT txt$(162);
					  x&=ABS(m&(a))+INT(10000*RND)
						m&(a)=m&(a)+x&
		  	    profit&(a)=profit&(a)+x&
			  	  COLOR 6
					  PRINT tab(28);"+";tab(30);x&
			      IF RND>.25 THEN
							sacked=1
							joboffer=1
sack:
		 				  GOSUB job.offer
						  IF job=0 THEN GOTO sack
			  	    incr item
			    	  GOSUB newspage.print
					    PRINT txt$(163)
					  END IF
		  	  END IF
		  	end if

				x&=0
				if div=1 then
					if m&(a)>4000000 then x&=m&(a)-4000000
				elseif div=2 then
					if m&(a)>2000000 then x&=m&(a)-2000000
				elseif div=3 then
					if m&(a)>1000000 then x&=m&(a)-1000000
				elseif div=4 then
					if m&(a)>750000 then x&=m&(a)-750000
				end if

				if x&>0 then
					color 6,0
		      GOSUB newspage.print
			    PRINT txt$(164);
				  m&(a)=m&(a)-x&
		      profit&(a)=profit&(a)-x&
			    COLOR 6
				  PRINT tab(28);"-";tab(30);x&
				end if

	      LOCATE 10,5
  	    COLOR 2
	      PRINT txt$(165);
  	    COLOR 7
    	  if profit&(a)<0 then print tab(28);"-"; else print tab(28);"+";
	      PRINT TAB(30);abs(profit&(a))
  	    COLOR 2
	      LOCATE 5,5
  	    PRINT txt$(166);
    	  COLOR 7
      	PRINT TAB(30);m&(a)
	      items=0
  	    incr item
    	  gosub newspage.print
	      COLOR 6
	      PRINT txt$(165);
  	    COLOR 6
    	  if profit&(a)<0 then print tab(28);"-"; else print tab(28);"+";
      	PRINT TAB(30);abs(profit&(a))

				book3=CINT(agg%(a)*RND/3)
				IF book3>0 THEN book2=80/book3
				book4=0
				book5=0
				time=1
				if book3>0 then incr item
book1:
	      IF book3>0 and week<31 THEN
					play=INT(RND*11)+1
					if rnd>.9 then
						if book5=1 then
							for play1=1 to 11
								if booked%(play1)=1 then
									play=play1
									goto book6
								end if
							next play1
						end if
					end if
book6:
		      IF injury%(a,play,1)=1 THEN GOTO book1
					IF pa%(a,play)=0 THEN GOTO book1
					IF booked%(play)=2 THEN GOTO book1
					INCR booked%(play)
					IF booked%(play)=1 THEN
					  time=INT(RND*book2)+INT(book2*book4)
					  book%(a,play)=book%(a,play)+2
			      GOSUB newspage.print
			      COLOR 2
	  		    p=play
	      		GOSUB name1
						PRINT name$;
						COLOR 6
						PRINT txt$(167);time;" min"
					END IF
					IF booked%(play)=2 THEN
					  pj%(a,play)=13
					  INCR book%(a,play)
			      GOSUB newspage.print
	  		    COLOR 2
	      		p=play
			      GOSUB name1
						PRINT name$;
						COLOR 4
						PRINT txt$(168);(90-int(rnd*10));" min"
					END IF
    	  END IF

				book5=1
	      INCR book4
  	    DECR book3
    	  IF book3>0 THEN GOTO book1

	      FOR play=1 TO 11
		      IF book%(a,play)>22 THEN
	  		    pj%(a,play)=13
				    book%(a,play)=0
		      END IF
  	    NEXT play
    	  items=0

	      b=0
	      FOR p=1 TO 11
		      IF injury%(a,p,1)>0 THEN incr b
    	  next p

	      if b>0 then incr item

  	    FOR p=1 TO 11
    		  IF injury%(a,p,1)=1 THEN
						GOSUB newspage.print
						COLOR 2
						GOSUB name1
						PRINT name$;
						COLOR 4
						PRINT txt$(169);pj%(a,p)-1;txt$(170)
		      END IF
  	    NEXT p

    	  b=0
      	FOR p=1 TO 18
		      IF pj%(a,p)>20 THEN incr b
  	    next p
	      if b>0 then incr item

  	    FOR p=1 TO 18
    		  IF pj%(a,p)>20 THEN
						GOSUB newspage.print
						COLOR 2
						GOSUB name1
						PRINT name$;
						COLOR 7
						PRINT txt$(171)
		      END IF
	      NEXT p

  	    b=0
    	  FOR pl=1 TO 10
	    	  IF scorers%(a,pl,1)>0 THEN incr b
  	    next pl
    	  if b>0 then incr item

      	FOR pl=1 TO 10
		      IF scorers%(a,pl,1)>0 THEN
						GOSUB newspage.print
						p=scorers%(a,pl,1)
						COLOR 2
						GOSUB name1
						PRINT name$;
						COLOR 7
						PRINT txt$(172);scorers%(a,pl,2);" min"
		      END IF
	      NEXT pl

				GOSUB youth

				cod=0
				if coach%(a)=1 then
					if rnd>.99 then
						incr item
						if item+1>25 then item=26
						gosub newspage.print
						color 6,0
						print txt$(173);coach.name$(a)
						gosub newspage.print
						print txt$(174)
						coach%(a)=0
						coach.name$(a)=space$(10)
						cod=1
					end if
				elseif coach%(a)=0 and cod=0 then
					if rnd>.9 then
						incr item
						if item+2>25 then item=26
			    	gosub name3
						color 6,0
						gosub newspage.print
						print name$
						gosub newspage.print
						print txt$(175)
						gosub newspage.print
						print txt$(176)
						gosub accept
						if yes=1 then
							coach.name$(a)=name$
							coach%(a)=1
						end if
						line (0,216)-(320,240),0,bf
					end if
				end if

				cod=0
				if physio%(a)=0 then
					if rnd>.9 then
						incr item
						if item+2>25 then item=26
						color 4,0
						gosub name3
						gosub newspage.print
						print name$
						gosub newspage.print
						print txt$(177)
						gosub newspage.print
						print txt$(176)
						gosub accept
						if yes=1 then
							physio.name$(a)=name$
							physio%(a)=1
							cod=1
						end if
						line (0,216)-(320,240),0,bf
					end if
				elseif physio%(a)=1 and cod=0 then
					if rnd>.99 then
						incr item
						if item+1>25 then item=26
						gosub newspage.print
						color 4,0
						print txt$(178);physio.name$(a)
						gosub newspage.print
						print txt$(174)
						physio%(a)=0
						physio.name$(a)=space$(10)
					end if
				end if

				pic=0
				IF joboffer<>0 THEN
			    INCR item
					if item+1>25 then item=26
					GOSUB newspage.print
					COLOR 4,0
					PRINT playername$(team)
					GOSUB newspage.print
					print txt$(179);tn$(team)
					GOSUB conmou
					GOSUB job.3
					pic=1
				END IF

reqt:
				IF rnd>.95 and joboffer=0 THEN
					p=int(rnd*18)+1
					if pa%(a,p)=0 then goto reqt
	  		  INCR item
					if item+1>25 then item=26
					GOSUB newspage.print
					COLOR 4,0
					gosub name1
					print name$
					GOSUB newspage.print
					print txt$(180)
					gosub conmou
					gosub quest
					pic=1
				END IF

    	  IF a<nop THEN
					if pic=0 then GOSUB conmou
	      else
					if pic=0 then GOSUB conmou
		      loadiff sadd("ram:footpic6"+chr$(0))
			    x$=txt$(148)
				  font sadd("courier.font"+chr$(0)),24
					locate 1,1
		      color 4,0
				  print ptab(77);x$
			    font sadd("rub.font"+chr$(0)),8
	  		  pic=1
				end if

      NEXT a

			REM GET YOUTH PLAYERS

      FOR a=nop+1 TO 64
				GOSUB youth
				gosub profit.sort
      NEXT a

      FOR a=1 TO 64
	      FOR b=1 TO 10
			    FOR c=1 TO 2
			      scorers%(a,b,c)=0
		      NEXT c
	      NEXT b

	      FOR b=1 TO 18
		      if pa%(a,b)>0 then decr pc%(a,b)
				  IF pt%(a,b)>0 THEN INCR pt%(a,b)
					IF pa%(a,b)=0 THEN GOTO 19999
			    IF pj%(a,b)>0 and pj%(a,b)<10 THEN
						if physio%(a)=0 then pj%(a,b)=pj%(a,b)-1
						if physio%(a)=1 then pj%(a,b)=pj%(a,b)-int((rnd*2)+1)
						if pj%(a,b)<0 then pj%(a,b)=0
			    end if
			    IF pj%(a,b)>10 THEN pj%(a,b)=pj%(a,b)-1
				  IF pj%(a,b)=10 THEN pj%(a,b)=0
					IF pj%(a,b)=20 THEN pj%(a,b)=0
					IF b<12 THEN INCR pp%(a,b)

					if pa%(a,b)>0 then
						if ps!(a,b,1)>0 then s=1 else s=int(rnd*3)+2
						ps!(a,b,s)=ps!(a,b,s)+(rnd*2)-1
					end if

		      FOR s=1 TO 4
				    IF ps!(a,b,s)<2 THEN ps!(a,b,s)=0
			   	  IF ps!(a,b,s)>99 THEN ps!(a,b,s)=99
					NEXT s

		      IF pp%(a,b)>his&(a,16) THEN
			  		his&(a,16)=pp%(a,b)
				    his&(a,17)=pn%(a,b,1)
					  his&(a,18)=pn%(a,b,2)
		      END IF

19999	  NEXT b
				m&(a)=INT(m&(a))
      NEXT a

      GOSUB trans.market
      st=nop+1
      fh=32
      GOSUB team.sort

      IF week=30 THEN GOTO play.offs
      if week=31 then goto play.offs.2
      if week=32 then goto 20000
      incr week

			for a=1 to 16
				for b=1 to 18
					if pa%(a,b)>0 then
						if pc%(a,b)<1 then
							if a<nop+1 then
								gosub contract
							else
								pc%(a,b)=int(rnD*100)+30
							end if
						end if
					end if
				next b
			next a

      RANDOMIZE TIMER
      gosub rand.tact

			w=week
			l=0:f=0:e=0:u=0:c=0
      IF w=3 OR w=9 OR w=15 OR w=21 OR w=26 OR w=29 THEN l=1
      IF w=6 OR w=12 OR w=18 OR w=24 OR w=28 OR w=30 THEN f=1
      IF w=2 OR w=6 OR w=10 OR w=14 OR w=17 OR w=22 OR w=25 OR w=28 OR w=30 THEN e=1
      IF w=3 OR w=7 OR w=12 OR w=15 OR w=18 OR w=21 OR w=24 OR w=26 OR w=28 THEN c=1
      IF w=3 OR w=7 OR w=9 OR w=12 OR w=15 OR w=18 OR w=21 OR w=24 OR w=26 OR w=29 THEN u=1

      if l=1 or f=1 or e=1 or u=1 or c=1 then
				gOSUB colour.palette
				cls
				locate 5,1
				if l=1 then print txt$(181):print
				if f=1 then print txt$(182):print
				if e=1 then print txt$(183):print
				if u=1 then print txt$(184):print
				if c=1 then print txt$(185):print
				gosub conmou
      end if
      goto 199

20000 gosub colour.palette
      CLS
      x$=txt$(186)
      l=2
      color 4,0
		  GOSUB prtitle
      week=31
      GOSUB conmou

20150 CLS
      locate 3,1
      x$=txt$(187)+tn$(ds%(1,dp%(1,1)))
      gosub length
      color 6
      print ptab(160-(x2*4));x$
      INCR his&(ds%(1,dp%(1,1)),1)
      m&(ds%(1,dp%(1,1)))=m&(ds%(1,dp%(1,1)))+800000

      color 4
      FOR a=1 TO 64
	      FOR b=1 TO 18
		      IF pa%(a,b)=0 THEN GOTO 20200
			    pa%(a,b)=pa%(a,b)+1
		      IF pa%(a,b)>36 THEN GOSUB 40000
			    pg%(a,b)=0
				  pj%(a,b)=0
		      pp%(a,b)=0
20200   NEXT b
	      incr his&(a,8)
      NEXT a
      FOR a=1 TO 64
		    wins%(a)=0
	  		lost%(a)=0
				draws%(a)=0
	      gfor%(a)=0
		    gag%(a)=0
	  		sl$(a)="      "
	    NEXT a

		  FOR b=1 TO 16
				IF ds%(2,b)=p.off%(1,1) THEN GOTO 20001
	    NEXT b

20001 swap ds%(1,dp%(1,14)),ds%(2,dp%(2,1))
      m&(ds%(1,dp%(1,14)))=m&(ds%(1,dp%(1,14)))+450000
      swap ds%(1,dp%(1,15)),ds%(2,dp%(2,2))
      m&(ds%(1,dp%(1,15)))=m&(ds%(1,dp%(1,15)))+375000
      swap ds%(1,dp%(1,16)),ds%(2,b)
      m&(ds%(1,dp%(1,16)))=m&(ds%(1,dp%(1,16)))+250000
      INCR his&(ds%(1,dp%(1,14)),2)

			COLOR 4
      LOCATE 7,5:PRINT txt$(188):LOCATE 7,25:PRINT txt$(189)
      COLOR 2
      LOCATE 9,5:PRINT tn$(ds%(2,dp%(2,1)))
      COLOR 7
      LOCATE 9,25:PRINT tn$(ds%(1,dp%(1,14)))
      color 2
      LOCATE 10,5:PRINT tn$(ds%(2,dp%(2,2)))
      COLOR 7
      LOCATE 10,25:PRINT tn$(ds%(1,dp%(1,15)))
      color 2
      LOCATE 11,5:PRINT tn$(ds%(2,b))
      COLOR 7
      LOCATE 11,25:PRINT tn$(ds%(1,dp%(1,16)))


	  	FOR b=1 TO 16
				IF ds%(3,b)=p.off%(2,1) THEN GOTO 20002
	    NEXT b

20002 swap ds%(2,dp%(2,14)),ds%(3,dp%(3,1))
      swap ds%(2,dp%(2,15)),ds%(3,dp%(3,2))
      swap ds%(2,dp%(2,16)),ds%(3,b)
      m&(ds%(2,dp%(2,14)))=m&(ds%(2,dp%(2,14)))+300000
      m&(ds%(2,dp%(2,15)))=m&(ds%(2,dp%(2,15)))+250000
      m&(ds%(2,dp%(2,16)))=m&(ds%(2,dp%(2,16)))+200000
      INCR his&(ds%(2,dp%(2,14)),3)
      COLOR 2
      LOCATE 14,5:PRINT tn$(ds%(3,dp%(3,1)))
      COLOR 7
      LOCATE 14,25:PRINT tn$(ds%(2,dp%(2,14)))
      COLOR 2
      LOCATE 15,5:PRINT tn$(ds%(3,dp%(3,2)))
      COLOR 7
      LOCATE 15,25:PRINT tn$(ds%(2,dp%(2,15)))
      COLOR 2
      LOCATE 16,5:PRINT tn$(ds%(3,b))
      COLOR 7
      LOCATE 16,25:PRINT tn$(ds%(2,dp%(2,16)))

	  	FOR b=1 TO 16
				IF ds%(4,b)=p.off%(3,1) THEN GOTO 20003
	    NEXT b

20003 swap ds%(3,dp%(3,14)),ds%(4,dp%(4,1))
      swap ds%(3,dp%(3,15)),ds%(4,dp%(4,2))
      swap ds%(3,dp%(3,16)),ds%(4,b)
      m&(ds%(3,dp%(3,14)))=m&(ds%(3,dp%(3,14)))+150000
      m&(ds%(3,dp%(3,15)))=m&(ds%(3,dp%(3,15)))+100000
      m&(ds%(3,dp%(3,16)))=m&(ds%(3,dp%(3,16)))+50000
      INCR his&(ds%(3,dp%(3,14)),4)
      COLOR 2
      LOCATE 19,5:PRINT tn$(ds%(4,dp%(4,1)))
      COLOR 7
      LOCATE 19,25:PRINT tn$(ds%(3,dp%(3,14)))
      COLOR 2
      LOCATE 20,5:PRINT tn$(ds%(4,dp%(4,2)))
      COLOR 7
      LOCATE 20,25:PRINT tn$(ds%(3,dp%(3,15)))
      COLOR 2
      LOCATE 21,5:PRINT tn$(ds%(4,b))
      COLOR 7
      LOCATE 21,25:PRINT tn$(ds%(3,dp%(3,16)))
      LOCATE 25,5
      COLOR 4
      PRINT txt$(190)
      COLOR 2
      LOCATE 25,25
      PRINT tn$(ds%(4,dp%(4,16)))
      INCR his&(ds%(4,dp%(4,16)),5)
      gosub conmou

      cls
      LOCATE 4,5
      COLOR 4
      PRINT txt$(191)
      COLOR 2
      LOCATE 6,25
      PRINT tn$(lc%(1))
      m&(lc%(1))=m&(lc%(1))+500000
      INCR his&(lc%(1),6)
      LOCATE 8,5
      COLOR 4
      PRINT txt$(192)
      COLOR 2
      LOCATE 10,25
      PRINT tn$(fc%(1))
      m&(fc%(1))=m&(fc%(1))+500000
      INCR his&(fc%(1),7)
      LOCATE 12,5
      COLOR 4
      PRINT txt$(193)
      COLOR 2
      LOCATE 14,25
      PRINT tn$(ec%(1))
      IF ec%(1)<65 THEN
				m&(ec%(1))=m&(ec%(1))+1000000
      END IF
      LOCATE 16,5
      COLOR 4
      PRINT txt$(194)
      COLOR 2
      LOCATE 18,25
      PRINT tn$(cc%(1))
      IF cc%(1)<65 THEN
				m&(cc%(1))=m&(cc%(1))+750000
      END IF
      LOCATE 20,5
      COLOR 4
      PRINT txt$(195)
      COLOR 2
      LOCATE 22,25
      PRINT tn$(uc%(1))
      IF uc%(1)<65 THEN
				m&(uc%(1))=m&(uc%(1))+600000
      END IF

      FAW=fc%(1)
      LCW=lc%(1)
      ECW=ec%(1)
      CCW=cc%(1)
      ucw=uc%(1)

      GOSUB cup.sort
      week=1
      season=season+1
      FOR a=1 TO 64
	      FOR s=1 TO 30
		      FOR p=1 TO 3
			      fixture&(a,s,p)=0
		      NEXT p
	      NEXT s
	      FOR p=1 TO 18
		  	  book%(a,p)=0
			  NEXT p
	      FOR p=1 TO 30
		      pog%(a,p)=0
	      NEXT p
      NEXT a
      saves=5*nop
      GOSUB conmou
      GOTO 199

View.team:
			COLOR 4,0
      CLS
	    x$=tn$(team)
      gosub length
      font SADD("courier.font"+CHR$(0)),24
      locate 1,1
      print ptab(160-x2*7.5);x$
      font SADD("rub1.font"+CHR$(0)),8
      FOR p=1 TO 18
	      COLOR 2
		    LOCATE 6+p,2
			  a$=""
				a=team
	      GOSUB name1

		    ps1=INT(ps!(team,p,1))
	      ps2=INT(ps!(team,p,2))
			  ps3=INT(ps!(team,p,3))
		    ps4=INT(ps!(team,p,4))

		    IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
				  COLOR 6
				ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
				  COLOR 7
				ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
				  COLOR 4
				ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
				  COLOR 2
				END IF

	      PRINT p;name$

		    FOR s=1 TO 4
				  LOCATE 6+p,25+(s-1)*4
				  PRINT INT(ps!(team,p,s))
	  	  NEXT s
      NEXT p

			gosub conmou

	    cls
	    x$=tn$(team)
      gosub length
      font SADD("courier.font"+CHR$(0)),24
      locate 1,1
      print ptab(160-x2*7.5);x$
      font SADD("rub1.font"+CHR$(0)),8

      LOCATE 8,7
      COLOR 2
      PRINT txt$(196);ccap&(team)
      LOCATE 10,10
      COLOR 5
      PRINT txt$(197);ca&(team)
      FOR b=1 TO 16
	      IF ds%(div,b)=team THEN GOTO 30021
      NEXT b
30021 FOR d=1 TO 16
  	    IF dp%(div,d)=b THEN GOTO 30020
      NEXT d
30020 LOCATE 12,15
      COLOR 2
      PRINT txt$(198);div
      LOCATE 14,15
      COLOR 5
      PRINT txt$(199);d

      defense!(team)=0
      midfield!(team)=0
      attack!(team)=0
      
      FOR l=2 TO 11
	      defense!(team)=defense!(team)+ps!(team,l,2)
	  	  midfield!(team)=midfield!(team)+ps!(team,l,3)
			  attack!(team)=attack!(team)+ps!(team,l,4)
      NEXT l
      LOCATE 18,16
      COLOR 2
      PRINT txt$(200);int(defense!(team))
      LOCATE 19,15
      color 5
			print txt$(201);int(midfield!(team))
			locate 20,17
			color 2
			print txt$(202);int(attack!(team))

      locate 24,16
      color 5
      PRINT txt$(203);playername$(team)

      GOSUB conmou
      RETURN

40000 pn%(a,play,1)=0
      pn%(a,play,2)=0
      pa%(a,play)=0
      pj%(a,play)=0
      pg%(a,play)=0
      pp%(a,play)=0
      pc%(a,play)=0
      FOR s=1 TO 4
	      ps!(a,play,s)=0
      NEXT s
      book%(a,play)=0
      pt%(a,play)=0
      RETURN

League:
      game=1
      team=1
lc.1:
      CLS
      x1$=txt$(113)
      IF lr=1 THEN x2$=txt$(114):games=32
      IF lr=2 THEN x2$=txt$(115):games=16
      IF lr=3 THEN x2$=txt$(116):games=8
      IF lr=4 THEN x2$=txt$(117):games=4
      IF lr=5 THEN x2$=txt$(118):games=2
      IF lr=6 THEN x2$=txt$(119):games=1
      l=1
      x$=x1$
      color 4,0
		  GOSUB prtitle
      l=2
      x$=x2$
      GOSUB prtitle

      FOR a=1 TO 64
	      sub.players(a)=0
  	    team.score(a)=0
    	  keeper!(a)=0
      	defense!(a)=0
	      midfield!(a)=0
  	    attack!(a)=0
      NEXT a

60000 team1=lc%(team)
      team2=lc%(team+1)
      GOSUB cup.data

leaguend:
      IF lres%(game,1)=lres%(game,2) THEN tim1=30:GOSUB 60100:goto leaguend
      GOSUB report

      IF lr=5 THEN gates&=60000
      IF lr=6 THEN gates&=80000
      cgates&(team1)=gates&
      cgates&(team2)=gates&

      IF lres%(game,1)>lres%(game,2) THEN
				lc%(game)=team1
      ELSE
				lc%(game)=team2
      END IF
65300 team=team+2
      incr game
      IF game>games THEN GOTO 65400
      IF team>games*2 THEN GOTO 65400
      IF game=9 and games>8 THEN
				GOSUB conmou
				GOTO lc.1
      END IF
      IF game=17 and games>16 THEN
				GOSUB conmou
				GOTO lc.1
      END IF
      IF game=25 and games>24 THEN
				GOSUB conmou
				GOTO lc.1
      END IF
      GOTO 60000
65400 lr=lr+1
      GOSUB conmou
      CLS
      RETURN

cup.data:
      FOR a100=1 TO 2
	      IF a100=1 THEN t=team1
  	    IF a100=2 THEN t=team2
    	  keeper!(t)=ps!(t,1,1)

	      FOR p=2 TO 11
  		    IF pj%(t,p)>0 THEN GOTO 60031
		      defense!(t)=defense!(t)+ps!(t,p,2)
		      midfield!(t)=midfield!(t)+ps!(t,p,3)
    		  attack!(t)=attack!(t)+ps!(t,p,4)
60031   NEXT p
	      GOSUB aggression
  	  NEXT a100

      ks1=INT(keeper!(team1))
      ks2=INT(keeper!(team2))
      ds1=INT(defense!(team1))
      ds2=INT(defense!(team2))
      ms1=INT(midfield!(team1))
      ms2=INT(midfield!(team2))
      fs1=INT(attack!(team1))
      fs2=INT(attack!(team2))

      lres%(game,1)=0
      lres%(game,2)=0
      ball=3
      ds=INT((ds1+fs2)*1.5)
      ms=INT((ms1+ms2)*1.5)
      fs=INT((fs1+ds2)*1.5)
      mat.1=0
      euro=0
      tim1=90
60100 FOR tim=1 TO tim1
	      GOSUB match
      NEXT tim
			RETURN

FACUP:
      game=1
      team=1
fa.1:
      CLS
      x1$=txt$(125)
      IF fr=1 THEN x2$=txt$(114):games=32
      IF fr=2 THEN x2$=txt$(115):games=16
      IF fr=3 THEN x2$=txt$(116):games=8
      IF fr=4 THEN x2$=txt$(117):games=4
      IF fr=5 THEN x2$=txt$(118):games=2
      IF fr=6 THEN x2$=txt$(119):games=1
      l=1
      x$=x1$
      color 4,0
		  GOSUB prtitle
      l=2
      x$=x2$
      GOSUB prtitle

      FOR a=1 TO 64
	      sub.players(a)=0
  	    team.score(a)=0
    	  keeper!(a)=0
      	defense!(a)=0
	      midfield!(a)=0
  	    attack!(a)=0
      NEXT a

56000 team1=fc%(team)
      team2=fc%(team+1)
      GOSUB cup.data

FAend:
      IF lres%(game,1)=lres%(game,2) THEN tim1=30:GOSUB 60100:goto faend
      GOSUB report
      IF fr=5 THEN gates&=60000
      IF fr=6 THEN gates&=80000

      cgates&(team1)=gates&
      cgates&(team2)=gates&

      IF lres%(game,1)>lres%(game,2) THEN
				fc%(game)=team1
      ELSE
				fc%(game)=team2
      END IF
      
58300 team=team+2
      INCR game
      IF game>games THEN GOTO 58400
      IF team>games*2 THEN GOTO 58400
      IF game=9 and games>8 THEN
				GOSUB conmou
				GOTO fa.1
      END IF
      IF game=17 and games>16 THEN
				GOSUB conmou
				GOTO fa.1
      END IF
      IF game=25 and games>24 THEN
				GOSUB conmou
				GOTO fa.1
      END IF
      GOTO 56000

58400 fr=fr+1
      GOSUB conmou
      CLS
      RETURN

conmou:
      font SADD("rub1.font"+CHR$(0)),8
      LINE (130,216)-(190,240),5,bf
      LINE (130,216)-(190,240),4,b
      LOCATE 29,1
      COLOR 3,5
      PRINT PTAB(132);txt$(204)

con1:
      gosub MouseM
      IF (x<130 OR x>353) OR (y<190 OR y>240) THEN GOTO con1
			color 4,0
			RETURN

div0:
	    COLOR 3,13
  	  LINE (190,152)-(230,176),13,bf
    	LINE (190,152)-(230,176),3,b
	    LOCATE 21,1
  	  PRINT PTAB(198);"1st"
    	LINE (250,152)-(290,176),13,bf
	    LINE (250,152)-(290,176),3,b
  	  LOCATE 21,1
    	PRINT PTAB(258);"2nd"
	    LINE (190,184)-(230,208),13,bf
  	  LINE (190,184)-(230,208),3,b
    	LOCATE 25,1
      PRINT PTAB(198);"3rd"
      LINE (250,184)-(290,208),13,bf
      LINE (250,184)-(290,208),3,b
      LOCATE 25,1
      PRINT PTAB(258);"4th"
 
div1:
      gosub MouseM
      div=0
      IF (y>152 and y<176) and (x>190 AND x<230) THEN div=1
      IF (y>152 and y<176) and (x>250 AND x<290) THEN div=2
      IF (y>184 and y<208) and (x>190 AND x<230) THEN div=3
      IF (y>184 and y<208) and (x>250 AND x<290) THEN div=4
      IF div=0 THEN GOTO div1
      color 4,0
      RETURN

match:
			gl=0
      IF ball=1 THEN GOSUB 11000:RETURN
      IF ball=2 THEN GOSUB 12000:RETURN
      IF ball=3 THEN GOSUB 13000:RETURN
      IF ball=4 THEN GOSUB 14000:RETURN
      IF ball=5 THEN GOSUB 15000:RETURN

11000 s=INT(RND*50)+1
		  IF s>0 THEN sc=2
		  IF s>2 THEN sc=3
		  IF s>4 THEN sc=4
		  IF s>6 THEN sc=5
		  IF s>10 THEN sc=6
		  IF s>14 THEN sc=7
		  IF s>18 THEN sc=8
		  IF s>23 THEN sc=9
		  IF s>32 THEN sc=10
		  IF s>41 THEN sc=11
		  ford=INT(RND*100)+1
			IF team2<65 THEN
				IF ford<ps!(team2,sc,4)*.9 THEN GOTO 11100
			ELSEIF team2>64 THEN
				IF ford<(fs2/10)*.9 THEN GOTO 11100
			END IF
		  ball=3
			RETURN

11100 goal=INT(RND*100)+1
		  IF goal>1 AND goal<ks1 THEN ball=3:RETURN
		  IF mat.1=1 THEN
			  if results%(div,games,2,2)<=int(rnd*6) then
	  			INCR results%(div,games,2,2)
		    	score=results%(div,games,2,2)
	  	    scorers%(team2,score,1)=sc
		  	  scorers%(team2,score,2)=tim
  				INCR pg%(team2,sc)
	    		IF pa%(team1,sc)>0 THEN DECR pg%(team1,1)
			    gl=10
			  end if
		  ELSEif mat.1=0 then
  			if lres%(game,2)<=int(rnd*6) then
			  	INCR lres%(game,2)
  			end if
		  END IF
		  ball=3
			RETURN

12000 defs=INT(RND*ds)
      IF defs>1 AND defs<ds1+1 THEN ball=3:RETURN
      IF defs>ds1 AND defs<ds1+fs2+1 THEN ball=1:RETURN
      ball=2
      RETURN

13000 mid=INT(RND*ms)
      IF mid>1 AND mid<ms1+1 THEN ball=4:RETURN
      IF mid>ms1 AND mid <ms1+ms2+1 THEN ball=2:RETURN
      ball=3
      RETURN

14000 defs=INT(RND*fs)
		  IF defs>1 AND defs<fs1+1 THEN ball=5:RETURN
		  IF defs>fs1 AND defs<fs1+ds2+1 THEN ball=3:RETURN
		  ball=4
		  RETURN

15000 s=INT(RND*50)+1
		  IF s>0 THEN sc=2
		  IF s>2 THEN sc=3
		  IF s>4 THEN sc=4
		  IF s>6 THEN sc=5
		  IF s>10 THEN sc=6
		  IF s>14 THEN sc=7
		  IF s>18 THEN sc=8
		  IF s>23 THEN sc=9
		  IF s>32 THEN sc=10
		  IF s>41 THEN sc=11
		  ford=INT(RND*100)+1
			IF team1<65 THEN
				IF ford<ps!(team1,sc,4)*.9 THEN GOTO 15100
			ELSEIF team1>64 THEN
				IF ford<(fs1/10)*.9 THEN GOTO 15100
			END IF
  		ball=3
			RETURN

15100 goal=INT(RND*100)+1
		  IF goal>1 AND goal<ks2*.9 THEN ball=3:RETURN
  		IF mat.1=1 THEN
		    if results%(div,games,1,2)<=int(rnd*6) THEN
  				INCR results%(div,games,1,2)
			  	score=results%(div,games,1,2)
	  		  scorers%(team1,score,1)=sc
		      scorers%(team1,score,2)=tim
	  		  INCR pg%(team1,sc)
				  IF pa%(team2,sc)>0 THEN DECR pg%(team2,1)
	  		  gl=10
			  end if
		  ELSEif mat.1=0 then
  			if lres%(game,1)<=int(rnd*6) then
			  	INCR lres%(game,1)
  			end if
		  END IF
		  ball=3
			RETURN

report:
		  game1=game
		  IF game1>8 THEN game1=game1-8
		  IF game1>8 THEN game1=game1-8
		  IF game1>8 THEN game1=game1-8
  		gam=game-INT(game/2)*2
		  x$=tn$(team1)
		  gosub length
  		LOCATE 8+(2*game1),16-x2
		  COLOR 2
		  IF team1<nop+1 THEN COLOR 7
		  PRINT tn$(team1)
		  LOCATE 8+(2*game1),24
		  COLOR 2
		  IF team2<nop+1 THEN COLOR 7
		  PRINT tn$(team2)
		  LOCATE 8+(2*game1),18
		  IF lres%(game,1)>lres%(game,2) THEN
			  COLOR 6
		  ELSE
			  COLOR 7
		  END IF
		  PRINT lres%(game,1)
		  LOCATE 8+(2*game1),20
		  IF lres%(game,2)>lres%(game,1) THEN
			  COLOR 6
		  ELSE
		  	cOLOR 7
		  END IF
		  PRINT lres%(game,2)
		  gates&=ca&(team1)+ca&(team2)
		  gates&=INT(gates&)
		  cgates&(team1)=gates&
		  cgates&(team2)=gates&
			RETURN

numbers:
  		COLOR 4,0
		  LINE (25,159)-(605,225),0,bf
		  FOR f=18 TO 29
		    LOCATE f,1
  		  PRINT SPACE$(80)
			NEXT f
		  x$=""
		  COLOR 4,5
		  LINE (60,160)-(80,184),5,bf
		  LINE (60,160)-(80,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(66);"1"
		  LINE (90,160)-(110,184),5,bf
		  LINE (90,160)-(110,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(96);"2"
		  LINE (120,160)-(140,184),5,bf
		  LINE (120,160)-(140,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(126);"3"
		  LINE (150,160)-(170,184),5,bf
		  LINE (150,160)-(170,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(156);"4"
		  LINE (180,160)-(200,184),5,bf
		  LINE (180,160)-(200,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(186);"5"
		  LINE (210,160)-(260,184),5,bf
		  LINE (210,160)-(260,184),4,b
		  LOCATE 22,1
		  PRINT PTAB(211);txt$(206)
		  LINE (60,200)-(80,224),5,bf
		  LINE (60,200)-(80,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(66);"6"
		  LINE (90,200)-(110,224),5,bf
		  LINE (90,200)-(110,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(96);"7"
		  LINE (120,200)-(140,224),5,bf
		  LINE (120,200)-(140,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(126);"8"
		  LINE (150,200)-(170,224),5,bf
		  LINE (150,200)-(170,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(156);"9"
		  LINE (180,200)-(200,224),5,bf
		  LINE (180,200)-(200,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(186);"0"
		  LINE (210,200)-(260,224),5,bf
		  LINE (210,200)-(260,224),4,b
		  LOCATE 27,1
		  PRINT PTAB(215);txt$(205)
		
nu1:
		  gosub MouseM
		  IF (y<160 OR y>224) or (y>184 and y<200) THEN GOTO nu1
  		IF (y>160 AND y<184) THEN
		    IF (x>60 AND x<80) and len(x$)<8 THEN x$=x$+"1"
		    IF (x>90 AND x<110) and len(x$)<8 THEN x$=x$+"2"
		    IF (x>120 AND x<140) and len(x$)<8 THEN x$=x$+"3"
		    IF (x>150 AND x<170) and len(x$)<8 THEN x$=x$+"4"
		    IF (x>180 AND x<200) and len(x$)<8 THEN x$=x$+"5"
		  	IF (x>210 AND x<260) THEN
			  	x=LEN(x$)
			  	if x>0 then
			  	  x$=LEFT$(x$,x-1)
			  	end if
		    	font SADD("courier.font"+CHR$(0)),24
		    	locate 6,1
		  	 	print SPACE$(45)
			    font SADD("rub.font"+CHR$(0)),8	  	 	
			  end if
  		ELSEIF (y>200 AND y<224) THEN
		    IF (x>60 AND x<80) and len(x$)<8 THEN x$=x$+"6"
		    IF (x>90 AND x<110) and len(x$)<8 THEN x$=x$+"7"
    		IF (x>120 AND x<140) and len(x$)<8 THEN x$=x$+"8"
		    IF (x>150 AND x<170) and len(x$)<8 THEN x$=x$+"9"
    		IF (x>180 AND x<200) and len(x$)<8 THEN x$=x$+"0"
		   	IF (x>210 AND x<260) THEN
			    x&=VAL(x$)
	  		  font SADD("rub.font"+CHR$(0)),8
		  	 	RETURN
	    	end if
  		END IF
		  l=6
		  color 4,0
			GOSUB prtitle
		  GOTO nu1
		  return

posit:
		  COLOR 4,0
		  CLS
		  x1$=txt$(207)
		  l=1
  		x$=x1$
		  GOSUB prtitle
		  COLOR 2,0
	
			FOR a=1 TO nop
				LOCATE 7+a,1
				x$=tn$(a)
				gosub length
				PRINT PTAB(160-(x2*4));x$
			NEXT a

posit.1:
			gosub MouseM
			y=INT(y/8)-6
			IF y<1 OR y>nop THEN GOTO posit.1
			a=y
		
		  CLS
		  COLOR 4
		  x$=tn$(a)
			l=1
			gosub prtitle
		  x$=txt$(208)
			l=2
			gosub prtitle
		
		  color 7
		  locate 12,7
		  print "1"
		  locate 23,6
		  print "16"
			locate 24,9
			print "1"
			locate 24,33
			print "3"
			locate 25,33
			print "0"
			locate 26,18
			print txt$(209)
		
		  COLOR 4
		  LINE (60,80)-(61,185),7,bf
		  LINE (60,180)-(261,185),7,bf
		  COLOR 6
		  FOR w=1 TO week-1
			  if w/2>int (w/2) then color 5 else color 6
			  y1=80+INT(pog%(a,w)*6.25)
			  x1=57+INT(w*20/3)
			  x2=57+INT((w+1)*20/3)
			  if w/2>int (w/2) then
				  LINE (x1,y1)-(x2,184),6,bf
			  else
	  			LINE (x1,y1)-(x2,184),5,bf
			  end if
		  NEXT w
		  GOSUB conmou
		  GOTO view.league

tactics:
      COLOR 4,0
		  CLS
		  x$=txt$(210)
		  l=1
		  GOSUB prtitle
		  x$=tn$(a)
		  l=2
		  GOSUB prtitle

			color 7,0
			locate 8,1
			print ptab(27);txt$(211);ptab(128);txt$(212);ptab(241);txt$(213)
			line (10,68)-(310,68),5
			line (108,56)-(108,105),5
			line (213,56)-(213,105),5
			locate 10,1
			if tact%(a,1)=1 then color 6,0 else color 4,0
			print ptab(31);txt$(214);
			if tact%(a,2)=1 then color 6,0 else color 4,0
			print ptab(136);txt$(214);
			if tact%(a,3)=1 then color 6,0 else color 4,0
			print ptab(241);txt$(214)
			if tact%(a,1)=2 then color 6,0 else color 4,0
			print ptab(27);txt$(215);
			if tact%(a,2)=2 then color 6,0 else color 4,0
			print ptab(120);txt$(216);
			if tact%(a,3)=2 then color 6,0 else color 4,0
			print ptab(245);txt$(217)
			if tact%(a,1)=3 then color 6,0 else color 4,0
			print ptab(14);txt$(218);
			if tact%(a,2)=3 then color 6,0 else color 4,0
			print ptab(124);txt$(219);
			if tact%(a,3)=3 then color 6,0 else color 4,0
			print ptab(233);txt$(220)
			if tact%(a,1)=4 then color 6,0 else color 4,0
			print ptab(18);txt$(221);
			if tact%(a,2)=4 then color 6,0 else color 4,0
			print ptab(124);txt$(222);
			if tact%(a,3)=4 then color 6,0 else color 4,0
			print ptab(233);txt$(223)
			color 7,0
	
  		locate 17,15
		  print txt$(224)
		  line (24,140)-(296,172),4,b
		  line (24,156)-(296,156),4
		  agg=agg%(a)-1
		  x=52+agg*32
		  if agg%(a)=9 then x=295
		  line (25,157)-(x,171),6,bf
		  locate 19,1
		  color 2,0
		  print ptab(28);"1   2   3   4   5   6   7   8   9"
		
		  IF play.game.1=0 THEN
			  COLOR 3,5
				LINE (125,200)-(195,224),5,bf
			  LINE (125,200)-(195,224),3,b
			  LOCATE 27,1
				PRINT PTAB(136);txt$(225)
		  elseIF play.game.1=1 THEN
				color 3,5
				LINE (40,200)-(140,224),5,bf
			  LINE (40,200)-(140,224),3,b
			  LOCATE 27,1
				PRINT PTAB(71);txt$(225)
		    LINE (170,200)-(270,224),5,bf
		    LINE (170,200)-(270,224),3,b
		    LOCATE 27,1
		    PRINT PTAB(180);txt$(226)
		  END IF

tact1:
		  gosub MouseM
		  if (y>71 and y<105) then
				if (y>71 and y<81) then
					if x>10 and x<110 then tact%(a,1)=1
					if x>115 and x<205 then tact%(a,2)=1
					if x>220 and x<310 then tact%(a,3)=1
				end if
				if (y>80 and y<89) then
					if x>10 and x<110 then tact%(a,1)=2
					if x>115 and x<205 then tact%(a,2)=2
					if x>220 and x<310 then tact%(a,3)=2
				end if
				if (y>88 and y<97) then
					if x>10 and x<110 then tact%(a,1)=3
					if x>115 and x<205 then tact%(a,2)=3
					if x>220 and x<310 then tact%(a,3)=3
				end if
				if (y>96 and y<105) then
					if x>10 and x<110 then tact%(a,1)=4
					if x>115 and x<205 then tact%(a,2)=4
					if x>220 and x<310 then tact%(a,3)=4
				end if
				gosub tactics
			end if

		  if (y>200 and y<224) then
				if play.game=0 then
					if (x>125 and x<195) then return
				elseif play.game=1 then
					if (x>40 and x<140) then
						return
					elseif (x>170 and x<270) then
						goto sub.player
					end if
				end if
			end if

		  if (y>140 and y<156) then
			  if x<295 then agg%(a)=9
			  if x<276 then agg%(a)=8
	  		if x<244 then agg%(a)=7
			  if x<212 then agg%(a)=6
			  if x<180 then agg%(a)=5
			  if x<148 then agg%(a)=4
			  if x<116 then agg%(a)=3
	  		if x<84 then agg%(a)=2
			  if x>25 and x<52 then agg%(a)=1
				goto tactics
			end if
			GOTO tact1

names:
		  a1=INT(RND*26)+65
		  a$=CHR$(a1)
   		IF a$="Z" OR a$="U" OR a$="X" OR a$="Y" OR a$="Q" THEN GOTO names
   		a2=(INT (RND *200)+1)
   		RETURN

name1:
   		name$=CHR$(pn%(a,p,1))+"."+playn$(pn%(a,p,2))
   		IF pn%(a,p,1)=0 OR pn%(a,p,2)=0 THEN name$=""
   		RETURN

name2:
   		name$=CHR$(a1)+"."+playn$(a2)
   		RETURN

name3:
   		a1=INT(RND*26)+65
   		a$=CHR$(a1)
   		IF a$="Z" OR a$="U" OR a$="X" OR a$="Y" OR a$="Q" THEN GOTO name3
   		a2=(INT (RND *200)+1)
   		name$=CHR$(a1)+"."+playn$(a2)
   		if len(name$)>10 then goto name3
   		if len(name$)<10 then name$=name$+space$(10-len(name$))
   		RETURN

transfer:
     FOR a1=1 TO 64
       a&(a1)=0
     NEXT a1
     transfered=1
		 IF play.game=0 THEN GOSUB view.player.2
1409 IF play.game=1 THEN
 		   gosub value.player
		   GOTO 1449
		 end if
     LOCATE 23,1
     PRINT SPACE$(80)
     IF a>0 THEN a&(a)=0
     FOR b=1 TO nop

     play100=0
     for p100=1 to 18
       if pa%(b,p100)>0 then incr play100
     next p100
     if play100=18 then goto 1405

     IF b=a THEN GOTO 1405
	   LOCATE 24,1
     PRINT SPACE$(80)
     x$=tn$(b)
     gosub length
     x$=txt$(227)+mid$(tn$(b),1,x2)+txt$(228)
     x=INT(LEN(x$)/2)
     LOCATE 23,20-x
     COLOR 6
     PRINT x$

		 gosub accept
     IF yes=0 THEN a&(b)=0:GOTO 1405

1402 COLOR 4,0
     FOR x=15 TO 31
	     LOCATE x,1
	     PRINT SPACE$(80)
     NEXT x
     x$=tn$(b)
     gosub length
     x$=txt$(229)+mid$(tn$(b),1,x2)
     x=INT(LEN(x$)/2)
     LOCATE 15,20-x
     PRINT x$
     GOSUB numbers
     if x&>m&(b) then x&=m&(b)
     a&(b)=x&
     FOR x=15 TO 31
	     LOCATE x,1
  	   PRINT SPACE$(80)
     NEXT x
     IF a&(b)<value&*3/4 THEN a&(b)=0
     FOR x=15 TO 31
	     LOCATE x,1
		   PRINT SPACE$(80)
     NEXT x
1405 COLOR 4,0
     FOR x=23 TO 31
	     LOCATE x,1
		   PRINT SPACE$(80)
     NEXT x
		 NEXT b

     bids=0
1449 FOR div=1 TO 4
	     FOR d=1 TO 16
  		   b=ds%(div,d)
		     IF b<nop+1 THEN GOTO 1416
    		 GOSUB 1406
1416 	 NEXT d
     NEXT div
     GOTO 1419

1406 a&(b)=0
     skillt=1000
     ply=0
     FOR player=2 TO 18
	     skill1=0
		   IF pa%(b,player)>0 THEN
			   INCR ply
				 IF player<12 AND player>1 THEN
					 FOR s=2 TO 4
						 skill1=skill1+INT(ps!(b,player,s))
					 NEXT s
		     END IF
			 END IF
	     IF skillt>skill1 AND skill1>0 THEN skillt=skill1
		 NEXT player
		 IF ps1>5 THEN skillt=INT(ps!(b,1,1)*2.5)
1417 IF skill>(skillt+10) AND ply<18 THEN GOSUB 1418
     RETURN

1418 skilld=skill-skillt
     bid&=value&+INT(skilld*RND*1000)
     bid&=bid&+INT(RND*bid&/10)-INT(RND*bid&/20)
     a&(b)=INT(bid&)
     IF a&(b)<value&*.95 THEN a&(b)=0
     bids=bids+1
     IF div=4 AND a&(b)>200000 THEN a&(b)=200000-INT(RND*20)*10000
     IF div=3 AND a&(b)>600000 THEN a&(b)=600000-INT(RND*35)*10000
     IF div=2 AND a&(b)>1000000 THEN a&(b)=1000000-INT(RND*50)*10000
     value1&=value&*((rnd*1)+1)
     if a&(b)>value1& then a&(b)=value1&-int((rnd*10)*1000)
     a&(b)=int(a&(b)/1000)*1000
     RETURN

1419 FOR d=1 TO 64
	     e=0
		 	 FOR c=1 TO 64
		     IF d=c THEN GOTO 1414
		     IF a&(d)>a&(c) THEN GOTO 1414
		     if d>nop then e=e+1
		     IF e>3 and d>nop THEN a&(d)=0:GOTO 1413
1414   NEXT c
1413 NEXT d

     IF play.game=0 THEN CLS
     x$=txt$(230)
     l=1
     color 4,0
		 IF play.game=0 THEN GOSUB prtitle
     COLOR 7
     x$=name$
     gosub length
     locate 7,1
     font SADD("courier.font"+CHR$(0)),24
     if play.game=0 then print ptab(160-x2*7.5);name$
     font SADD("rub.font"+CHR$(0)),8

1420 d=1
     x=1
     c=1
1430 if c=a then c=c+1:goto 1430
     IF c>64 THEN GOTO 1440
     IF a&(c)=0 THEN c=c+1:GOTO 1430
     x$=tn$(c)+txt$(231)+STR$(a&(c))
     x1=LEN(x$)*4
     LOCATE 8+x,1
     color 4
     if c<nop+1 then color 6
     IF play.game=0 THEN PRINT PTAB(160-x1);x$
     x=x+1
     IF a&(c)>a&(d) THEN d=c
     c=c+1
     IF c<65 THEN GOTO 1430
1440 COLOR 2
     non=1
     IF a&(d)<1 then 
       IF RND>.6 THEN
				 xx=1
				 LOCATE 22,1
				 non=0
				 d=0
				 value&=INT(value&+(RND*value&/10)-(RND*value&/20))
				 a&(d)=value&
				 x3$=txt$(232)+STR$(value&)
				 x3=INT(LEN(x3$)*4)
				 IF play.game=0 THEN
					 PRINT PTAB(102);txt$(233)
				   print
	   			 print ptab(156-x3);x3$
				 end if
				 yes=1
				 if a<nop+1 then
					 if play.game=0 then gosub conmou
					 gosub trans.accept
				 end if
				 if yes=1 then
			     m&(a)=m&(a)+a&(d)
			     GOSUB trans.highest
			     non=1
	       else
					 xx=2
				 end if
       ELSE
	       xx=2
	       LOCATE 22,1
	  	   x$=name$
				 gosub length
				 IF play.game=0 THEN
			 		 PRINT PTAB(112);txt$(234)
					 print
					 print ptab(160-(x2*4));x$
				 end if
	     END IF
       RETURN
     END IF
     
1450 x$=tn$(d)
		 gosub length
     x1=x2
     x2$=txt$(232)+STR$(a&(d))
     x2=INT(LEN(x2$)*4)
     LOCATE 22,1
     yes=1
     IF play.game=0 THEN
			 PRINT pTAB(160-(x1*4));x$
			 print
			 print ptab(160-x2);x2$
	   end if
     if a<nop+1 then
			 if play.game=0 then gosub conmou
			 gosub trans.accept
     end if
	   if yes=1 then
		   m&(d)=m&(d)-a&(d)
			 m&(a)=m&(a)+a&(d)
	     IF d>nop AND m&(d)<0 THEN m&(d)=0
		   non=1
	     xx=0
		   GOSUB trans.highest
	  	 FOR p1=18 TO 1 STEP -1
				 IF pa%(d,p1)=0 THEN RETURN
			 NEXT p1
     else
			 xx=2
     end if
     RETURN

trans.highest:
	for x=5 to 1 step -1
		if x=5 then
		  y=34
			IF a&(d)>his&(a,y) THEN
				his&(a,y)=a&(d)
				his&(a,y+1)=pn%(a,p,1)
				his&(a,y+2)=pn%(a,p,2)
			END IF
		elseif x<5 then
			y=22+((x-1)*3)
			y1=22+(x*3)
			if a&(d)>his&(a,y) then
				swap his&(a,y),his&(a,y1)
				swap his&(a,y+1),his&(a,y1+1)
				swap his&(a,y+2),his&(a,y1+2)
			end if
		end if
	next x

	if non=1 then
		for x=5 to 1 step -1
			if x=5 then
			  y=49
				IF a&(d)>his&(d,y) THEN
					his&(d,y)=a&(d)
					his&(d,y+1)=pn%(a,p,1)
					his&(d,y+2)=pn%(a,p,2)
				END IF
			elseif x<5 then
				y=37+((x-1)*3)
				y1=37+((x)*3)
				if a&(d)>his&(d,y) then
					swap his&(d,y),his&(d,y1)
					swap his&(d,y+1),his&(d,y1+1)
					swap his&(d,y+2),his&(d,y1+2)
				end if
			end if
		next x
	end if
	RETURN

prtitle:
     font SADD("courier.font"+CHR$(0)),24
     gosub length
     LOCATE l,1
     PRINT PTAB(160-(x2*7.5));x$
     font SADD("rub.font"+CHR$(0)),8
     RETURN

value.player:
     value&=0
     value&=value&+ps2
     value&=value&+ps3
     value&=value&+ps4
     if value=0 then value&=value&+ps1*3 else value&=value&+ps1
     skill=value&
     value&=value&-pa+28
     IF pj>10 THEN
	   	 value&=value&-pj+10
     ELSE
			 value&=value&-pj
     END IF
     IF value&<10 THEN value&=10
     IF pa=0 THEN value&=0
     value&=INT(value&)
     IF value&<41 THEN value&=value&*150:RETURN
     IF value&<51 THEN value&=value&*250:RETURN
     IF value&<61 THEN value&=value&*400:RETURN
     IF value&<71 THEN value&=value&*600:RETURN
     IF value&<81 THEN value&=value&*800:RETURN
     IF value&<91 THEN value&=value&*950:RETURN
     IF value&<101 THEN value&=value&*1100:RETURN
     IF value&<121 THEN value&=value&*1400:RETURN
     IF value&<141 THEN value&=value&*1700:RETURN
     IF value&<161 THEN value&=value&*2000:RETURN
     IF value&<181 THEN value&=value&*2400:RETURN
     IF value&<201 THEN value&=value&*2900:RETURN
     IF value&<221 THEN value&=value&*3500:RETURN
     IF value&<241 THEN value&=value&*4750:RETURN
     IF value&<251 THEN value&=value&*5500:RETURN
     IF value&<261 THEN value&=value&*6250:RETURN
     IF value&<271 THEN value&=value&*7500:RETURN
     IF value&<281 THEN value&=value&*8750:RETURN
     value&=value&*10500
     RETURN

pick.player:
1210 gosub MouseM
pick.player.1:
     IF y>40 AND y<128 THEN
       p=INT(y/8)-4
     ELSEIF y>136 AND y<152 THEN
       p=INT(y/8)-5
     ELSEif y>160 and y<200 then
			 p=int(y/8)-6
     else
       GOTO 1210
     END IF
     IF p=0 THEN GOTO 1210
     RETURN

view.player:
		 transfered=0
		 LINE (260,5)-(320,260),0,bf
  	 LOCATE 14,1
		 PRINT PTAB(269);txt$(235)
		 PRINT PTAB(269);txt$(236)
		 PRINT PTAB(266);txt$(237)
		 GOSUB pick.player
		 if pa%(a,p)<1 then goto view.player
view.player.2:
     ps1=INT(ps!(a,p,1))
     ps2=INT(ps!(a,p,2))
     ps3=INT(ps!(a,p,3))
     ps4=INT(ps!(a,p,4))
     pa=pa%(a,p)
     pj=pj%(a,p)
     COLOR 5,0
     CLS
     LOCATE 5,1
     GOSUB name1
     x$=name$
     gosub length
     font SADd("courier.font"+CHR$(0)),24
     locate 1,1
     PRINT PTAB(160-(x2*7.5));x$
     font SADD("rub.font"+CHR$(0)),8
     color 7
     locate 5,5
     print txt$(238);tn$(a)
     COLOR 6
     LOCATE 7,5
     PRINT txt$(239);INT(ps!(a,p,1))
     LOCATE 9,7
     COLOR 7
     PRINT txt$(240);INT(ps!(a,p,2))
     LOCATE 11,5
     COLOR 4
     PRINT txt$(241);INT(ps!(a,p,3))
     LOCATE 13,7
     COLOR 2
     PRINT txt$(242);INT(ps!(a,p,4))
     LOCATE 7,21
     COLOR 5
     PRINT txt$(243);pa%(a,p)
     LOCATE 9,21
     color 4
     PRINT txt$(244);pp%(a,p)
     LOCATE 11,21
     color 2
     IF ps!(a,p,1)>ps!(a,p,2) and ps!(a,p,1)>ps!(a,p,3) and ps!(a,p,1)>ps!(a,p,4) THEN
       PRINT txt$(245);ABS(pg%(a,p))
     ELSE
       PRINT txt$(246);pg%(a,p)
     END IF
     locate 13,21
     color 1
     if transfered=0 and abc=0 then print txt$(247);pc%(a,p)
     LOCATE 15,5
     color 7
     PRINT txt$(248);book%(a,p)
     LOCATE 17,5
     IF pj%(a,p)>20 and transfered=0 and abc=0 THEN
       x$=txt$(249)
       x=INT(LEN(x$)*4)
       PRINT PTAB(160-x);x$
     ELSEIF pj%(a,p)>10 and transfered=0 and abc=0 THEN
       x$=txt$(250)+STR$(pj%(a,p)-10)+txt$(251)
       x=INT(LEN(x$)*4)
       PRINT PTAB(160-x);x$
     ELSEIF pj%(a,p)>0 and transfered=0 and abc=0 THEN
       x$=txt$(252)+STR$(pj%(a,p))+txt$(251)
       x=INT(LEN(x$)*4)
       PRINT PTAB(160-x);x$
     elseIF pt%(a,p)>0 THEN
       PRINT txt$(253);pt%(a,p)
     END IF
     if abc=2 then return
     COLOR 7,0
     GOSUB value.player
     LOCATE 21,1
     font SADD("courier.font"+CHR$(0)),24
     x$=txt$(254)+STR$(value&)
     x=INT(LEN(x$)*7.5)
     PRINT PTAB(160-x);x$
     font SADD("rub.font"+CHR$(0)),8
     IF transfered=1 THEN RETURN
     IF abc=1 THEN
       GOSUB conmou
       RETURN
     END IF
     COLOR 3,5
     LINE (55,200)-(265,224),5,bf
     LINE (55,200)-(265,224),3,b
     LOCATE 27,1
     IF pt%(a,p)=0 THEN
       PRINT PTAB(80);txt$(255)
     ELSE
       PRINT PTAB(60);txt$(256)
     END IF
     LINE (120,232)-(200,256),5,bf
     LINE (120,232)-(200,256),3,b
     LOCATE 31,1
     PRINT PTAB(144);txt$(257)
  
view.player.1:
     gosub MouseM
     IF y>200 AND y<224 THEN
   	   IF x>55 AND x<265 THEN
		 	   IF pt%(a,p)=0 THEN
           pt%(a,p)=1
    	   ELSEIF pt%(a,p)>0 THEN
	         pt%(a,p)=0
	       END IF
	       GOTO view.player.2
	     END IF
	   END IF
     IF y>232 AND y<256 THEN
		   IF x>120 AND x<200 THEN GOTO 1000
     END IF
     GOTO view.player.1

team.stats:
     LINE (0,150)-(320,210),0,bf
     LOCATE 23,1
     COLOR 4,0
     PRINT PTAB(76);txt$(258)

team.stats.1:
     game=0
     gosub MouseM
     IF y<64 OR y>127 THEN GOTO team.stats.1
     game=INT(y/8)-7
     IF game<1 OR game>8 THEN GOTO team.stats.1
     COLOR 4,0

     CLS
     team1=ds%(div,l%(game,1))
     team2=ds%(div,l%(game,2))

     team=team1
     keeper!(team)=ps!(team,1,1)
     defense!(team)=0
     midfield!(team)=0
     attack!(team)=0
     FOR p=2 TO 11
       defense!(team)=ps!(team,p,2)+defense!(team)
       midfield!(team)=ps!(team,p,3)+midfield!(team)
       attack!(team)=ps!(team,p,4)+attack!(team)
     NEXT p

     team=team2
     keeper!(team)=ps!(team,1,1)
     defense!(team)=0
     midfield!(team)=0
     attack!(team)=0
     FOR p=2 TO 11
       defense!(team)=ps!(team,p,2)+defense!(team)
       midfield!(team)=ps!(team,p,3)+midfield!(team)
       attack!(team)=ps!(team,p,4)+attack!(team)
     NEXT p

     LOCATE 2,1
     COLOR 4
     x$=tn$(team1)
     gosub length
     PRINT PTAB(60-x2*4);tn$(team1)
     LOCATE 2,1
     x$=tn$(team2)
     gosub length
     PRINT PTAB(240-x2*4);tn$(team2)
     LOCATE 2,1
     COLOR 5
     PRINT PTAB(152);"Vs"
     LOCATE 8,15
     COLOR 6
     PRINT txt$(259)
     LOCATE 8,5
     PRINT INT(keeper!(team1));TAB(30);INT(keeper!(team2))
     LOCATE 10,1
     COLOR 7
     PRINT PTAB(132);txt$(260)
     LOCATE 10,5
     PRINT INT(defense!(team1));TAB(30);INT(defense!(team2))
     LOCATE 12,1
     COLOR 4
     PRINT PTAB(128);txt$(261)
     LOCATE 12,5
     PRINT INT(midfield!(team1));TAB(30);INT(midfield!(team2))
     LOCATE 14,1
     COLOR 2
     PRINT PTAB(140);txt$(262)
     LOCATE 14,5
     PRINT INT(attack!(team1));TAB(30);INT(attack!(team2))
     LOCATE 18,1
     COLOR 5
     PRINT PTAB(108);txt$(263)
     LOCATE 18,5
     PRINT ca&(team1);TAB(30);ca&(team2)
     LOCATE 20,1
     PRINT PTAB(120);txt$(264)
     LOCATE 20,3
     FOR a=1 TO 16
       IF l%(game,1)=dp%(div,a) THEN GOTO team.stats.3
     NEXT a

team.stats.3:
     FOR b=1 TO 16
       IF l%(game,2)=dp%(div,b) THEN GOTO team.stats.2
     NEXT b

team.stats.2:
     PRINT div;":";a;TAB(29);div;":";b

     color 3,5
     LINE (30,192)-(130,232),5,bf
     LINE (30,192)-(130,232),3,b
     LOCATE 27,1
     PRINT PTAB(44);txt$(265)
     LINE (190,192)-(290,232),5,bf
     LINE (190,192)-(290,232),3,b
     LOCATE 27,1
     PRINT PTAB(204);txt$(266)

team.stats.4:
	   gosub MouseM
	   IF y<192 AND y>232 THEN GOTO team.stats.4
	   IF x>30 AND x<130 THEN GOTO team.stats.5
	   IF x>190 AND x<290 THEN GOTO main.menu
	   GOTO team.stats.4

team.stats.5:
	   LINE (0,190)-(320,232),0,bf
	   LOCATE 27,1
	   x$=txt$(267)
	   x=INT(LEN(x$)*4)
	   color 4,0
	   PRINT PTAB(160-x);x$

team.stats.6:
	   gosub mousem
	   IF x<160 THEN
		   team=team1
		   GOSUB view.team
		   GOTO main.menu
	   END IF
	   IF x>159 THEN
		   team=team2
		   GOSUB view.team
		   GOTO main.menu
   	 END IF
	   GOTO team.stats.6

trans.market:
  no.trans=INT(RND*4)+3
  trans=0
  FOR a=nop+1 TO 64
    IF trans>no.trans THEN RETURN
    IF RND<.075 THEN
			INCR trans
			GOSUB trans.market.2
    END IF
  NEXT a
  RETURN

trans.market.2:
  l.skill=1000
  player=0
  no.play=0
  if rnd>.7 then
		goal=0
		for p=1 to 18
			if pa%(a,p)=0 then goto trans.market.4
			incr no.play
			IF ps!(a,p,1)>=ps!(a,p,2) AND ps!(a,p,1)>=ps!(a,p,3) AND ps!(a,p,1)>=ps!(a,p,4) THEN
				skill=ps!(a,p,1)
				if l.skill>skill then
		    	IF pt%(a,p)>0 THEN
						INCR no.trans
						DECR trans
						RETURN
				  END IF
		  	  incr goal
			    l.skill=skill
		  		player=p
				end if
				incr market
		  end if
trans.market.4:
		next p
		if goal=1 then
			INCR no.trans
			decr trans
			return
		end if
	else
		FOR p=1 TO 18
	    IF pa%(a,p)=0 THEN GOTO trans.market.3
			INCR no.play
			IF ps!(a,p,1)>=ps!(a,p,2) AND ps!(a,p,1)>=ps!(a,p,3) AND ps!(a,p,1)>=ps!(a,p,4) THEN goto trans.market.3
			FOR s=2 TO 4
	      skill=skill+ps!(a,p,s)
		  NEXT s
			IF l.skill>skill THEN
	      IF pt%(a,p)>0 THEN
					INCR no.trans
					DECR trans
					RETURN
	      END IF
		    l.skill=skill
			  player=p
	    END IF
trans.market.3:
	  NEXT p
	end if
  IF no.play<15 THEN
		INCR no.trans
		DECR trans
		RETURN
  END IF
  IF player<1 OR player>18 THEN
		INCR no.trans
		DECR trans
		RETURN
  END IF
  pt%(a,player)=1
  RETURN

trans.view:
  team.start=1
  player.start=1
trans.view.1:
  for f=1 to 10
		transfers(f,1)=0
		transfers(f,2)=0
  next f

  color 4,0
  CLS
  LOCATE 5,1
  font SADD("courier.font"+CHR$(0)),24
  COLOR 4,0
  PRINT PTAB(62);txt$(268)
  font SADD("rub.font"+CHR$(0)),8
  b=0
  c=1
trans.view.5:
  team=team.start
  player=player.start

	if pt%(team,player)>0 then
	  transfers(c,1)=team
		transfers(c,2)=player

    skill=0
	  ps1=INT(ps!(team,player,1))
		ps2=INT(ps!(team,player,2))
	  ps3=INT(ps!(team,player,3))
		ps4=INT(ps!(team,player,4))
	  pa=pa%(team,player)
		pj=pj%(team,player)
	  GOSUB value.player
		LOCATE 7+c,1
	  COLOR 6,0
		a=team
	  p=player
		IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
	    COLOR 6
		ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
	    COLOR 7
		ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
	    COLOR 4
		ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
	    COLOR 2
		END IF

	  GOSUB name1
		font SADD("rub1.font"+CHR$(0)),8
	  PRINT TAB(1);name$;
		PRINT TAB(16);tn$(team);
	  PRINT TAB(31);value&;

		IF ps1>=ps2 AND ps1>=ps3 AND ps1>=ps4 THEN
	    PRINT TAB(40);" GOAL"
		ELSEIF ps2>=ps1 AND ps2>=ps3 AND ps2>=ps4 THEN
	    PRINT TAB(40);"  DEF"
		ELSEIF ps3>=ps1 AND ps3>=ps2 AND ps3>=ps4 THEN
	    PRINT TAB(40);"  MID"
		ELSEIF ps4>=ps1 AND ps4>=ps2 AND ps4>=ps3 THEN
	    PRINT TAB(40);"  ATT"
		END IF
	  font SADD("rub.font"+CHR$(0)),8
		incr c
	end if

	incr player.start
	if player.start>18 then
		incr team.start
		player.start=1
	end if
	if team.start<65 and c<11 then goto trans.view.5

	if c<11 then
		for b=c to 10
			transfers(b,1)=0
			transfers(b,2)=0
		next b
	end if

trans.view.4:
  COLOR 3,5
  LINE (20,160)-(100,200),5,bf
  LINE (20,160)-(100,200),3,b
  LOCATE 23,1
  PRINT PTAB(24);txt$(269)
  LINE (120,160)-(200,200),5,bf
  LINE (120,160)-(200,200),3,b
  LOCATE 23,1
  PRINT PTAB(144);txt$(270)
  LINE (220,160)-(300,200),5,bf
  LINE (220,160)-(300,200),3,b
  LOCATE 23,1
  PRINT PTAB(248);txt$(271)
  LINE (120,208)-(200,232),5,bf
  LINE (120,208)-(200,232),3,b
  LOCATE 28,1
  PRINT PTAB(124);txt$(272)

trans.view.2:
  gosub MouseM
  IF y>160 AND y<200 THEN
	  IF x>20 AND x<100 THEN
		  if team.start>64 then gOTO trans.view
	  	color 4,0
		  GOTO trans.view.1
	  END IF
		IF x>120 AND x<200 THEN
	  	color 6,0
	    LINE (0,155)-(320,240),0,bf
		  LOCATE 23,10
			PRINT txt$(273)
trans.view.3:
	    gosub mousem
	    y=INT(y/8)-6
	    IF y<1 OR y>10 THEN GOTO trans.view.3
		  y=y
			IF y>c THEN y=c
		  a=transfers(y,1)
	    p=transfers(y,2)
			CLS
	    abc=1
		  transfered=0
		  if pt%(a,p)>0 then
				GOSUB view.player.2
			end if
	    GOTO trans.view
		END IF
	  IF x>220 AND x<300 THEN
			GOSUB trans.bids
			GOTO trans.view
	  end if
	END IF
	IF y>208 AND y<232 THEN
		IF x>120 AND x<200 THEN RETURN
  END IF
  GOTO trans.view.2

trans.bids:
  COLOR 4,0
  LINE (0,155)-(320,240),0,bf
  LOCATE 23,8
  PRINT txt$(274)

trans.bids.2:
  gosub MouseM
  y=INT(y/8)-6
  IF y<0 OR y>10 THEN GOTO trans.bids.2
  IF y>c THEN GOTO trans.bids.2
  picked.trans=y
  team=transfers(picked.trans,1)
  player=transfers(picked.trans,2)

trans.bids.3:
	if pt%(team,player)>0 then
	  IF play.game=0 THEN CLS
  	t=team
	  play=player
	  a=team
  	p=player
	  t$=tn$(t)
  	ps1=INT(ps!(t,play,1))
	  ps2=INT(ps!(t,play,2))
  	ps3=INT(ps!(t,play,3))
	  ps4=INT(ps!(t,play,4))
  	GOSUB name1
	  pa=pa%(t,play)
  	pp=pp%(t,play)
	  pg=pg%(t,play)
  	pj=pj%(t,play)

	  IF ps1>ps2 AND ps1>ps3 AND ps1>ps4 THEN goal=1

 	 	GOSUB transfer

	  IF xx=1 THEN
  	  pn%(t,play,1)=0
	    pn%(t,play,2)=0
  	  FOR s=1 TO 4
				ps!(t,play,s)=0
	    NEXT s
  	  book%(t,play)=0
    	pp%(t,play)=0
	    pa%(t,play)=0
  	  pj%(t,play)=0
    	pg%(t,play)=0
	    pt%(t,play)=0
  	  IF play.game=0 THEN GOSUB conmou
    	RETURN
	  END IF

  	IF xx=2 THEN
			IF play.game=0 THEN GOSUB conmou
			RETURN
  	END IF

	  SWAP pn%(d,p1,1),pn%(t,play,1)
  	SWAP pn%(d,p1,2),pn%(t,play,2)
	  FOR s=1 TO 4
		  SWAP ps!(t,play,s),ps!(d,p1,s)
	  NEXT s
  	book%(t,play)=0
	  book%(d,p1)=0
  	SWAP pp%(t,play),pp%(d,p1)
	  SWAP pa%(t,play),pa%(d,p1)
  	SWAP pj%(t,play),pj%(d,p1)
	  SWAP pg%(t,play),pg%(d,p1)
  	pc%(d,p1)=int(rnd*100)+30
	  pt%(d,p1)=0
  	pt%(t,play)=0
	  IF play.game=0 THEN GOSUB conmou
  	RETURN
  end if
  return

aggression:
  defense!(team1)=defense!(team1)*((agg%(team1)+95)/100)
  midfield!(team1)=midfield!(team1)*((agg%(team1)+95)/100)
  attack!(team1)=attack!(team1)*((agg%(team1)+95)/100)
  defense!(team2)=defense!(team2)*((agg%(team2)+95)/100)
  midfield!(team2)=midfield!(team2)*((agg%(team2)+95)/100)
  attack!(team2)=attack!(team2)*((agg%(team2)+95)/100)

	defense!(team1)=defense!(team1)*((defm%(tact%(team1,1),tact%(team2,3))+100)/100)
	midfield!(team1)=midfield!(team1)*((midm%(tact%(team1,2),tact%(team2,2))+100)/100)
	attack!(team1)=attack!(team1)*((attm%(tact%(team1,3),tact%(team2,1))+100)/100)
	defense!(team2)=defense!(team2)*((defm%(tact%(team2,1),tact%(team1,3))+100)/100)
	midfield!(team2)=midfield!(team2)*((midm%(tact%(team2,2),tact%(team1,2))+100)/100)
	attack!(team2)=attack!(team2)*((attm%(tact%(team2,3),tact%(team1,1))+100)/100)
  RETURN

print.games:
			COLOR 4,0
      CLS
      ga=0
		  font SADD("rub1.font"+CHR$(0)),8
      FOR div=1 TO 4
	      FOR games=1 TO 8

	    	  COLOR 2
  		    team1=ds%(div,results%(div,games,1,1))
    	  	team2=ds%(div,results%(div,games,2,1))
	
  	    	t1=LEN(tn$(team1))
    		  IF team1<nop+1 OR team2<nop+1 THEN
						INCR ga
						x$="Div"+STR$(div)
						t1=LEN(tn$(team1))
						x$=x$+" "+SPACE$(15-t1)+tn$(team1)
						x$=x$+" "+STR$(results%(div,games,1,2))
				  	x$=x$+" "+STR$(results%(div,games,2,2))
						x$=x$+"  "+tn$(team2)
						t1=LEN(tn$(team2))
						x$=x$+SPACE$(15-t1)
						LOCATE 5+ga,2
						IF div=1 THEN COLOR 8
						IF div=2 THEN COLOR 9
						IF div=3 THEN COLOR 10
						IF div=4 THEN COLOR 11
						PRINT x$
		  	  END IF
  	    NEXT games
	    NEXT div

	    FOR l=1 TO 4
		    LINE (l,((7+ga)*8)+l)-(321-l,208-l),5,b
	    NEXT l
		  font SADD("rub.font"+CHR$(0)),8
		  RETURN

sub.player:
  IF sub.players(a)=2 THEN RETURN
  COLOR 4,0
  CLS
  x$=txt$(275)
  l=2
  GOSUB prtitle
  COLOR 7
  LOCATE 7,1
  PRINT PTAB(19);txt$(276)
  COLOR 6
  GOSUB print.sub
  IF x<1 OR x>11 THEN goto sub.player
  play=x
sub.player.1:
  LOCATE 7,1
	PRINT SPACE$(40)
  LOCATE 7,10
  PRINT txt$(277)
  COLOR 6
  GOSUB print.sub
  IF x<12 OR x>13 THEN Goto sub.player.1
  pl=x
  t=a
  incr sub.players(a)
	gosub swap.player
  goto tactics

game.tactics:
  d1=div
  games1=games
  COLOR 4,0
  CLS
  x1$=txt$(278)
  x2$=txt$(279)
  l=1
  x$=x1$
  GOSUB prtitle
  l=2
  x$=x2$
  GOSUB prtitle
  COLOR 2,0

	FOR a=1 TO nop
		LOCATE 7+a,1
		x$=tn$(a)
		gosub length
		PRINT PTAB(160-(x2*4));x$
	NEXT a

game.tact.1:
	gosub MouseM
	y=INT(y/8)-6
	IF y<1 OR y>nop THEN GOTO game.tact.1
	a=y

  CLS
  GOSUB tactics
game.tactics.1:
  COLOR 4,0
  CLS
  GOSUB print.games
  COLOR 3,5
  LINE (120,224)-(200,248),5,bf
  LINE (120,224)-(200,248),3,b
  LOCATE 30,1
  PRINT PTAB(132);txt$(280)
  COLOR 7,0

  team=a
  keeper!(team)=ps!(team,1,1)
  defense!(a)=0
  midfield!(a)=0
  attack!(a)=0
  FOR p=1 TO 11
    defense!(team)=defense!(team)+ps!(team,p,2)
    midfield!(team)=midfield!(team)+ps!(team,p,3)
    attack!(team)=attack!(team)+ps!(team,p,4)
  NEXT p
  GOSUB aggression
  games=games1
  div=d1
  RETURN

print.sub:
  defense!(a)=0
  midfield!(a)=0
  attack!(a)=0
  LOCATE 10,1
  PRINT TAB(5); "Name               GKP DEF MID FOR"
  FOR p=1 TO 11
	  LOCATE 11+p,1
	  ps1=INT(ps!(a,p,1))
	  ps2=INT(ps!(a,p,2))
	  ps3=INT(ps!(a,p,3))
	  ps4=INT(ps!(a,p,4))
	  IF ps1>ps2 AND ps1>ps3 AND ps1>ps4 THEN COLOR 6
	  IF ps2>ps1 AND ps2>ps3 AND ps2>ps4 THEN COLOR 7
	  IF ps3>ps1 AND ps3>ps2 AND ps3>ps4 THEN COLOR 4
	  IF ps4>ps1 AND ps4>ps2 AND ps4>ps3 THEN COLOR 2
		defense!(a)=defense!(a)+ps!(a,p,2)
	  midfield!(a)=midfield!(a)+ps!(a,p,3)
	  attack!(a)=attack!(a)+ps!(a,p,4)
	  GOSUB name1
	  PRINT TAB(5);name$;
	  PRINT TAB(20);ps1;
		PRINT TAB(24);ps2;
		PRINT TAB(28);ps3;
		PRINT TAB(32);ps4;
  NEXT p

	FOR p=12 TO 13
	  LOCATE 11+p,1
	  PRINT TAB(2);"Sub";
	  GOSUB name1
		ps1=INT(ps!(a,p,1))
	  ps2=INT(ps!(a,p,2))
		ps3=INT(ps!(a,p,3))
	  ps4=INT(ps!(a,p,4))
		IF ps1>ps2 AND ps1>ps3 AND ps1>ps4 THEN COLOR 6
	  IF ps2>ps1 AND ps2>ps3 AND ps2>ps4 THEN COLOR 7
		IF ps3>ps1 AND ps3>ps2 AND ps3>ps4 THEN COLOR 4
	  IF ps4>ps1 AND ps4>ps2 AND ps4>ps3 THEN COLOR 2
		PRINT TAB(5);name$;
	  PRINT TAB(20);ps1;
		PRINT TAB(24);ps2;
	  PRINT TAB(28);ps3;
		PRINT TAB(32);ps4;
	NEXT p

  team=a
  GOSUB aggression
  LOCATE 28,1
  PRINT TAB(12);" DEF - MID - ATT"
  PRINT TAB(12);INT(defense!(a));"-";INT(midfield!(a));"-";INT(attack!(a))

print.sub.1:
  gosub MouseM
  y=INT(y/8)+1
  IF y>11 OR y<23 THEN
		x=y-11
		RETURN
  END IF
	IF y>23 OR y<26 THEN
		x=y-12
		RETURN
	END IF
  GOTO print.sub.1

newplayer:
	loadiff sadd("ram:footpic10"+chr$(0))
	x$=txt$(281)
	l=1
	color 4,0
	GOSUB prtitle
	palette 32,0,0,1

  COLOR 32,8
  LINE (10,192)-(70,216),8,bf
  LINE (10,192)-(70,216),32,b
  LOCATE 26,1
  PRINT PTAB(24);txt$(282)
  LINE (120,232)-(200,256),8,bf
  LINE (120,232)-(200,256),32,b
  LOCATE 31,1
  PRINT PTAB(124);txt$(283)
  LINE (250,192)-(310,216),8,bf
  LINE (250,192)-(310,216),32,b
  LOCATE 26,1
  PRINT PTAB(256);txt$(284)

newplayer.1:
	gosub MouseM
  IF y>192 AND y<216 and x>10 AND x<70 THEN
		GOSUB join.game
		GOTO main.menu
  elseIF y>232 and y<256 and x>120 AND x<200 THEN
		goto main.menu
  elseIF y>192 AND y<216 and x>250 AND x<310 THEN
		LINE (0,104)-(320,225),0,bf
		GOSUB resign
		GOTO main.menu
  END IF
  GOTO newplayer.1

join.game:
	gosub colour.palette
	color 4,0
  CLS
  b=nop+1
  IF b>16 THEN
    x$=txt$(285)
    l=3
    color 4,0
		GOSUB prtitle
    GOSUB conmou
    RETURN
  END IF

  DO
    c=INT(RND*16)+1
    IF ds%(4,c)<b THEN c=0
  LOOP UNTIL c>0

  d=ds%(4,c)

  FOR d1=1 TO 4
	  FOR team=1 TO 16
	  IF ds%(d1,team)=b THEN GOTO join.game.1
	  NEXT team
  NEXT d1

join.game.1:
  CLS
  x$=txt$(286)
	l=2
	color 4,0
	GOSUB prtitle
  font SADD("courier.font"+CHR$(0)),24
  x$=tn$(d)
  gosub length
	locate 4,1
	PRINT PTAB(128-(x2*7.5));x$
  font SADD("rub.font"+CHR$(0)),8

  SWAP ds%(4,c),ds%(d1,team)

  GOSUB team.swaps
  INCR nop

join.game.2:
	locate 15,7
	print space$(25)
	locate 15,7
	print txt$(287)
	locate 17,7
	input name$
  if len(name$)>10 then goto join.game.2
  if len(name$)<=10 then
	  x=10-len(name$)
    playername$(b)=name$+space$(x)
  end if

  saves=saves+5
  GOSUB conmou
  RETURN

resign:
	IF nop=1 THEN SYSTEM

	IF a<nop THEN
	  FOR div=1 TO 4
  		FOR team=1 TO 16
		    IF ds%(div,team)=a THEN GOTO resign.1
		  NEXT team
	  NEXT div
resign.1:
	  d1=div
  	team1=team

		FOR div=1 TO 4
  		FOR team=1 TO 16
				IF ds%(div,team)=nop THEN GOTO resign.2
		  NEXT team
		NEXT div
resign.2:

		SWAP ds%(d1,team1),ds%(div,team)

	  d=a
  	b=nop

	  GOSUB team.swaps

	END IF
	DECR nop
	saves=saves-5
	if saves<1 then saves=1
	RETURN

View.League:
	loadiff sadd("ram:footpic3"+chr$(0))
	x$=txt$(288)
	font sadd("courier.font"+chr$(0)),24
	locate 1,1
	color 13,0
	x=int(len(x$)*7.5)
	print ptab(160-x);x$
	font sadd("rub.font"+chr$(0)),8
	color 5,13

	LINE (5,64)-(65,96),13,bf
	LINE (5,64)-(65,96),5,b
	LOCATE 10,1
	PRINT PTAB(11);txt$(289)
	PRINT PTAB(11);txt$(290)
	LINE (5,128)-(65,160),13,bf
	LINE (5,128)-(65,160),5,b
	LOCATE 18,1
	PRINT PTAB(23);txt$(291)
	PRINT PTAB(7);txt$(292)
	LINE (250,64)-(310,96),13,bf
	LINE (250,64)-(310,96),5,b
	LOCATE 10,1
	PRINT PTAB(1);""
	PRINT PTAB(260);txt$(293)
	LINE (250,128)-(310,160),13,bf
	LINE (250,128)-(310,160),5,b
	LOCATE 18,1
	PRINT PTAB(260);txt$(294)
	PRINT PTAB(256);txt$(295)
	LINE (120,200)-(200,224),13,bf
	LINE (120,200)-(200,224),5,b
	LOCATE 27,1
	PRINT PTAB(124);txt$(296)
	color 4,0

view.league.1:
	gosub MouseM
	IF (y>64 AND y<96) THEN
		IF (x>5 AND x<65) AND week>1 THEN gosub colour.palette:GOTO 5000: REM League
		IF (x>250 AND x<310) AND week>2 THEN gosub colour.palette:GOTO posit: REM Positional Graph
	elseif (y>128 and y<160) then
		IF (x>5 AND x<65) AND week>1 THEN gosub colour.palette:GOTO 4000: REM Goalscorers
		IF (x>250 AND x<310) AND week>1 THEN gosub colour.palette:GOTO short.league
	END IF
	IF (y>200 AND y<224) THEN
		IF (x>120 AND x<200) THEN gosub colour.palette:GOTO Main.Menu: REM Main Menu
	END IF
	GOTO view.league.1

view.cups:
	loadiff sadd("ram:footpic3"+chr$(0))
	x$=txt$(297)
	color 13,0
	font sadd("courier.font"+chr$(0)),24
	x=int(len(x$)*7.5)
	locate 1,1
	print ptab(160-x);x$
	font sadd("rub.font"+chr$(0)),8

	color 3,13
	LINE (10,104)-(110,128),13,bf
	LINE (10,104)-(110,128),3,b
	LOCATE 15,1
	PRINT PTAB(12);txt$(126)
	LINE (210,104)-(310,128),13,bf
	LINE (210,104)-(310,128),3,b
	LOCATE 15,1
	PRINT PTAB(216);txt$(298)
	LINE (10,152)-(110,176),13,bf
	LINE (10,152)-(110,176),3,b
	LOCATE 21,1
	PRINT PTAB(20);txt$(113)
	LINE (210,152)-(310,176),13,bf
	LINE (210,152)-(310,176),3,b
	LOCATE 21,1
	PRINT PTAB(236);txt$(125)
	LINE (10,200)-(110,224),13,bf
	LINE (10,200)-(110,224),3,b
	LOCATE 27,1
	PRINT PTAB(24);txt$(299)
	LINE (210,200)-(310,224),13,bf
	LINE (210,200)-(310,224),3,b
	LOCATE 27,1
	PRINT PTAB(228);txt$(124)
	color 4,0

view.cups.1:
	gosub MouseM
	IF (y>104 AND y<128) THEN
		IF (x>10 AND x<110) THEN
			gosub colour.palette
			GOTO 7900
			REM European Cup
		elseIF (x>210 AND x<310) THEN
			gosub colour.palette
			GOTO 7600
			REM Cup Winners Cup
		end if
	elseIF (y>152 AND y<176) THEN
		IF (x>10 AND x<110) THEN
			gosub colour.palette
			GOTO 7500
			REM league cup
		elseIF (x>210 AND x<310) THEN
			gosub colour.palette
			GOTO 7800
			REM FA Cup
		end if
	elseIF (y>200 AND y<224) THEN
		IF (x>10 AND x<110) THEN
			gosub colour.palette
			GOTO Main.Menu
			REM main menu
		elseIF (x>210 AND x<310) THEN
			gosub colour.palette
			GOTO 7700
			REM main menu
		end if
	END IF
	GOTO view.cups.1

short.league:
	loadiff sadd("ram:footpic5"+chr$(0))
	color 3,0
  x$=txt$(300)
  x=int(len(x$)*7.5)
  font sadd("courier.font"+chr$(0)),24
  locate 1,1
  print ptab(160-x);x$
  font sadd("rub.font"+chr$(0)),8
  GOSUB div0
  GOSUB short.league.sort

	CLS
  gosub colour.palette
  x$=txt$(301)
  x1$=txt$(302)+STR$(div)
  font SADD("courier.font"+CHR$(0)),24
  LOCATE 1,1
  x=INT(LEN(x$)*7.5)
  x1=INT(LEN(x1$)*4)
  PRINT PTAB(160-x);x$
  font SADD("rub.font"+CHR$(0)),8
  COLOR 6,0
  PRINT PTAB(160-x1);x1$

  COLOR 4
	LOCATE 7,1
	PRINT TAB(1);"Pos Team";TAB (23);"Form";TAB(35);"Pts"
	x=10
	FOR team=1 TO 16
		COLOR 7
		IF team=1 THEN COLOR 2
		IF team=2 AND div>1 THEN COLOR 2
		IF team=15 AND div<4 THEN COLOR 2
		IF team=16 THEN COLOR 2
		if team<nop+1 then color 4
		t=dsp%(div,team)
		ts=ds%(div,t)
		points=0
		FOR game1=1 TO 6
			IF MID$(sl$(ts),game1,1)="D" THEN points=points+1
			IF MID$(sl$(ts),game1,1)="W" THEN points=points+pts
			IF MID$(sl$(ts),game1,1)="L" THEN points=points
		NEXT game1
		LOCATE 8+team,2:PRINT team
		LOCATE 8+team,6:PRINT tn$(ts)
		LOCATE 8+team,22:PRINT sl$(ts)
		LOCATE 8+team,35:PRINT points
	NEXT team
	GOSUB conmou
	GOTO view.league

short.league.sort:
	FOR teams=1 TO 16
		team=ds%(div,teams)
		points=0
		FOR game1=1 TO 6
			IF MID$(sl$(team),game1,1)="D" THEN points=points+1
			IF MID$(sl$(team),game1,1)="W" THEN points=points+pts
			IF MID$(sl$(team),game1,1)="L" THEN points=points
		NEXT game1
    points%(teams)=points
    posi%(teams)=teams
    gd%(teams)=gfor%(team)-gag%(team)
  NEXT teams

  FOR teams=1 TO 15
	  FOR ti=1 TO 16-teams
		  IF points%(ti)>points%(ti+1) THEN GOTO 17700
      IF points%(ti)=points%(ti+1) THEN
				IF gd%(ti)>gd%(ti+1) THEN GOTO 17700
      END IF
      SWAP posi%(ti),posi%(ti+1)
	    SWAP points%(ti),points%(ti+1)
      SWAP gd%(ti),gd%(ti+1)

17700 NEXT ti
      NEXT teams
17800 FOR team=1 TO 16
		    dsp%(div,team)=posi%(team)
		  NEXT team
			RETURN

newspage.print:
	if item>25 then
		gosub conmou
		cls
    COLOR 4
    x$=tn$(a)
    gosub length
    font SADD("courier.font"+CHR$(0)),24
    locate 1,1
    print ptab(160-x2*7.5);x$
	  font SADD("rub1.font"+CHR$(0)),8
    FOR l=1 TO 4
		  LINE (8-l,30-l)-(312-l,212-l),1,b
	  NEXT l
		item=6
	end if

	LOCATE item,5
	INCR item

	RETURN

youth:
  COLOR 6
  FOR c=1 TO 4
	  FOR b=1 TO 16
		  IF ds%(c,b)=a THEN GOTO youth.1
    NEXT b
  NEXT c
youth.1:
  FOR player=18 TO 1 STEP -1
    IF pa%(a,player)=0 THEN
      IF RND>.95 THEN
				d1=0
				if a<nop+1 then d1=5
				GOSUB names
				pn%(a,player,1)=a1
				pn%(a,player,2)=a2
				pa%(a,player)=INT(RND*4)+18
				pj%(a,player)=0
				pp%(a,player)=0
				pg%(a,player)=0
				pc%(a,player)=int(rnd*10)+10
				book%(a,player)=0
				IF RND>.8 THEN
				  ps!(a,player,1)=INT(RND*20)+10+(4-c)*15+int(rnd*15)-d1
				  ps!(a,player,2)=0
				  ps!(a,player,3)=0
				  ps!(a,player,4)=0
				ELSE
				  ps!(a,player,1)=0
				  ps!(a,player,2)=INT(RND*20)+10+(4-c)*15-d1
				  ps!(a,player,3)=INT(RND*20)+10+(4-c)*15-d1
				  ps!(a,player,4)=INT(RND*20)+10+(4-c)*15-d1
				  sk=INT(RND*3)+2
				  ps!(a,player,sk)=ps!(a,player,sk)+INT(RND*15)
				  p=player
				END IF
				p=player
				GOSUB name1
				IF a<nop+1 THEN
					incr item
					GOSUB newspage.print
					color 7
					PRINT txt$(303);name$
				end if
      END IF
      RETURN
    END IF
  NEXT player
	RETURN

job.offer:
  job=0
  FOR c=1 TO 4
		FOR b=1 TO 16
			IF ds%(c,b)=a THEN GOTO job.1
	  NEXT b
  NEXT c
job.1:
	FOR d=1 TO 16
	  IF dp%(c,d)=b THEN GOTO job.1.1:
  NEXT d
job.1.1:

	job=CINT(RND*15)-8
	IF sacked=1 THEN job=CINT(RND*15)*-1
	IF job=0 THEN RETURN
	b=b-job
	IF b<1 THEN
		IF c>1 THEN
			c=c-1
			b=b+16
		ELSE
			b=CINT(RND*4)
		END IF
	END IF
	IF b>16 THEN
		IF c<4 THEN
			c=c+1
			b=b-16
		ELSE
			b=16-CINT(RND*8)
		END IF
	END IF
	team=ds%(c,dp%(c,b))
	div=c
	IF team<nop+1 THEN
		job=0
		team=0
		RETURN
	END IF
	job=1
	RETURN

job.3:
	CLS
	x$=tn$(a)
	l=1
	color 4,0
	GOSUB prtitle
	LOCATE 10,1
	x$=txt$(304)
	x=INT(LEN(x$)*4)
	PRINT PTAB(160-x);x$
	LOCATE 12,1
	x$=txt$(305)+tn$(team)
	gosub length
	PRINT PTAB(160-(x2*4));x$

	COLOR 3,5
	LINE (30,192)-(100,232),5,bf
	LINE (30,192)-(100,232),3,b
	LOCATE 27,1
	PRINT PTAB(49);txt$(306)
	IF sacked=0 THEN
		LINE (125,192)-(195,232),5,bf
		LINE (125,192)-(195,232),3,b
		LOCATE 27,1
		PRINT PTAB(136);txt$(307)
	END IF
	LINE (220,192)-(290,232),5,bf
	LINE (220,192)-(290,232),3,b
	LOCATE 27,1
	PRINT PTAB(231);txt$(308)
	COLOR 4,0

job.2:
	gosub MouseM
	IF y<192 AND y>232 THEN GOTO job.2
	IF x>30 AND x<100 THEN
		a1=a
		GOSUB view.team
		a=a1
		GOTO job.3
	END IF
	IF x>125 AND x<195 AND sacked=0 THEN CLS: RETURN
	IF x>220 AND x<290 THEN CLS: GOSUB job.4: RETURN
	GOTO job.2
	RETURN

team.swaps:
  coach%(d)=0
  physio%(d)=0
  coach.name$(d)=space$(10)
  physio.name$(d)=space$(10)

  coach%(b)=0
  physio%(b)=0
  coach.name$(b)=space$(10)
  physio.name$(b)=space$(10)

  SWAP wins%(d),wins%(b)
  SWAP draws%(d),draws%(b)
  SWAP lost%(d),lost%(b)
  SWAP gfor%(d),gfor%(b)
  SWAP gag%(d),gag%(b)
  SWAP sl$(d),sl$(b)

  SWAP tn$(d),tn$(b)
  swap playername$(d),playername$(b)
  SWAP ccap&(d),ccap&(b)
  SWAP ca&(d),ca&(b)
  for a1=1 to 3
	  SWAP tact%(d,a1),tact%(b,a1)
  next a1
  SWAP agg%(d),agg%(b)

	for p=1 to 64
	  FOR f=1 TO 60
			if f=10 or f=12 or f=21 or f=54 or f=57 or f=60 then
				a1=0
				if his&(p,f)=d then
					his&(p,f)=b
					a1=1
				elseif his&(p,f)=b and a1=0 then
					his&(p,f)=d
				end if
			end if
		NEXT f
	NEXT p

	for f=1 to 60
		his&(d,f)=0
		his&(b,f)=0
	next f

  FOR f=1 TO 64
		a1=0
		IF fc%(f)=d THEN
			fc%(f)=b
			a1=1
		ELSEIF fc%(f)=b and a1=0 THEN
			fc%(f)=d
		END IF
		a1=0
		IF lc%(f)=d THEN
			lc%(f)=b
			a1=1
		ELSEIF lc%(f)=b and a1=0 THEN
			lc%(f)=d
		END IF
		a1=0
	next f

	for f=1 to 32
		IF ec%(f)=d THEN
			ec%(f)=b
			a1=1
		ELSEIF ec%(f)=b and a1=0 THEN
			ec%(f)=d
		END IF
		a1=0
		IF cc%(f)=d THEN
			ec%(f)=b
			a1=1
		ELSEIF cc%(f)=b and a1=0 THEN
			cc%(f)=d
		end if
		a1=0
		IF uc%(f)=d THEN
			uc%(f)=b
			a1=1
		ELSEIF uc%(f)=b and a1=0 THEN
			uc%(f)=d
		END IF
  NEXT f

  FOR p=1 TO 31
	  SWAP pog%(d,p),pog%(b,p)
  NEXT p

  FOR p=1 TO 30
	  FOR s=1 TO 3
			SWAP fixture&(d,p,s),fixture&(b,p,s)
		NEXT s
  NEXT p

  FOR p=1 TO 18
    SWAP pg%(d,p),pg%(b,p)
    SWAP pt%(d,p),pt%(b,p)
    SWAP pa%(d,p),pa%(b,p)
    SWAP pj%(d,p),pj%(b,p)
    swap pc%(d,p),pc%(b,p)
    SWAP pp%(d,p),pp%(b,p)

    FOR p1=1 TO 4
      SWAP ps!(d,p,p1),ps!(b,p,p1)
    NEXT p1

    SWAP pn%(d,p,1),pn%(b,p,1)
    SWAP pn%(d,p,2),pn%(b,p,2)
  NEXT p

  m&(b)=150000
  lo&(b)=0
  re&(b)=0
  m&(d)=150000
  lo&(d)=0
  re&(d)=0

  for a1=1 to 4
		for a2=1 to 8
			a3=0
			if lresult%(a1,a2,1)=d then
				lresult%(a1,a2,1)=b
				a3=1
			elseif lresult%(a1,a2,4)=b and a3=0 then
				lresult%(a1,a2,4)=d
			end if
		next a2
  next a1

	FOR div=1 TO 4
		lt=0
		GOSUB 5010
	NEXT div

	RETURN

job.4:
	d=1
	t=0
  FOR c=1 TO 4
		FOR b=1 TO 16
			IF ds%(c,b)=a THEN GOTO job.4.1
	  NEXT b
  NEXT c
job.4.1:
	d1=c
	t1=b

	d=1
	t=0
  FOR c=1 TO 4
		FOR b=1 TO 16
			IF ds%(c,b)=team THEN GOTO job.4.2
	  NEXT b
  NEXT c
job.4.2:
	d2=c
	t2=b

  SWAP ds%(d1,t1),ds%(d2,t2)

	d=a
	b=team

	GOSUB team.swaps
	RETURN

injuried:
  injury=INT((agg%(a)*RND/7)+.4)
  IF agg%(a)>8 THEN injury=injury+INT(RND*2.5+.75)
  if injury<1 then injury=0
  if injury=0 then if rnd>.95 then injury=1

injury1:
  IF injury>0 THEN
    play=INT(RND*11)+1
    IF pa%(a,play)=0 THEN GOTO injury1
    IF injury%(a,play,1)=1 THEN GOTO injury1
    injury%(a,play,1)=1
    pj%(a,play)=INT(RND*9)+1
    if physio%(a)=1 then pj%(a,play)=pj%(a,play)-int(rnd*4)
    if pj%(a,play)<3 then pj%(a,play)=3
  END IF
  injury=injury-1
  IF injury>0 THEN GOTO injury1
	RETURN

international:
	min.skill=INT(RND*60)+220
  FOR f=1 TO 18
    skill=0
    FOR s=2 TO 4
      skill=skill+ps!(a,f,s)
    NEXT s
		IF pj(a,f)>0 THEN skill=0
	  IF skill>min.skill THEN
		  pj%(a,f)=22
	  END IF
	NEXT f
	RETURN

swap.player:
  FOR s=1 TO 4
    SWAP ps!(t,play,s),ps!(t,pl,s)
	NEXT s
  SWAP pp%(t,play),pp%(t,pl)
  SWAP pc%(t,play),pc%(t,pl)
  SWAP pa%(t,play),pa%(t,pl)
	SWAP pj%(t,play),pj%(t,pl)
	SWAP pg%(t,play),pg%(t,pl)
	swap pt%(t,play),pt%(t,pl)
  SWAP book%(t,play),book%(t,pl)
  SWAP pn%(t,play,1),pn%(t,pl,1)
  SWAP pn%(t,play,2),pn%(t,pl,2)
	RETURN

team.sort:
  FOR t=st TO fh

    FOR p=1 TO 18
	    os%(p)=0
			FOR s=2 TO 4
				os%(p)=os%(p)+INT(ps!(t,p,s))
	  	NEXT s
      IF ps!(t,p,1)>os%(p) THEN
				os%(p)=-ps!(t,p,1)
		  END IF
    NEXT p

    FOR ply=1 TO 17
	    FOR p=1 TO 18-ply
		    IF os%(p) > os%(p+1) THEN GOTO 10034
			  pl=p
				play=p+1
				SWAP os%(pl),os%(play)
	      GOSUB swap.player
10034	
			NEXT p
    NEXT ply
10035 
		play=18
		pl=1
		GOSUB swap.player
		pl=11
		GOSUB swap.player

    IF pa%(t,16)>0 THEN
			pp%(t,16)=0
			FOR s=1 TO 4
				ps!(t,16,s)=0
			NEXT s
			pa%(t,16)=0
			pj%(t,16)=0
			pg%(t,16)=0
			pt%(t,16)=0
			pn%(t,16,1)=0
			pn%(t,16,2)=0
	    book%(t,16)=0
	  END IF
  NEXT t
	RETURN

season.fixture:
  d1=div
  games1=games
  COLOR 4,0
  CLS
  x1$=txt$(309)
  l=1
  x$=x1$
  GOSUB prtitle
  COLOR 2,0

	FOR a=1 TO nop
		LOCATE 7+a,1
		x$=tn$(a)
		gosub length
		PRINT PTAB(160-(x2*4));x$
	NEXT a

sef.1:
	gosub MouseM
	y=INT(y/8)-6
	IF y<1 OR y>nop THEN GOTO sef.1
	a=y

	COLOR 4,0
  FOR c=1 TO 4
		FOR b=1 TO 16
			IF ds%(c,b)=a THEN GOTO s.f
	  NEXT b
  NEXT c
s.f:
	week2=1
  pl=0
  div=c
sf.10:
	CLS
	x$=tn$(a)
	gosub length
  font SADD("courier.font"+CHR$(0)),24
	locate 1,1
  print ptab(160-x2*7.5);x$
  font SADD("rub1.font"+CHR$(0)),8
  FOR l=1 TO 4
		LINE (8-l,28-l)-(312-l,204-l),1,b
  NEXT l
  COLOR 6
	LOCATE 5,5
	PRINT txt$(310)
	LOCATE 5,25
	PRINT txt$(311)
	LOCATE 5,32
	PRINT txt$(312)
	COLOR 2
	LOCATE 24,30
	PRINT txt$(313)
	COLOR 7
	LOCATE 24,10
	PRINT txt$(314)
sf:
	FOR b=1 TO 16
		g%(b)=0
	NEXT b
	FOR b=1 TO 8
		FOR c=1 TO 2
			l%(b,c)=0
		NEXT c
	NEXT b

	week1=week2
  IF week2>15 THEN w=week2-15 ELSE w=week2
sf.1:
	IF week1>1 THEN week1=week1-2:GOTO sf.1
  IF week1=1 THEN team=1
  IF week1=0 THEN team=16
  game=1
sf.2:
  g%(team)=1
  g%(gt%(w,team))=1
  l%(game,1)=team
  l%(game,2)=gt%(w,team)
sf.3:
  IF week1=1 THEN team=team+1
  IF week1=0 THEN team=team-1
  IF week1=0 AND team=0 THEN GOTO sf.4
  IF week1=1 AND team=17 THEN GOTO sf.4
  IF g%(team)=1 THEN GOTO sf.3
  game=game+1
  GOTO sf.2
sf.4:

	FOR b=1 TO 8
		t1=ds%(div,l%(b,1))
		t2=ds%(div,l%(b,2))
		IF t1=a THEN
			home=1
			GOSUB print.fix
			GOTO sf.5
		ELSEIF t2=a THEN
			home=0
			GOSUB print.fix
		END IF
sf.5:
	NEXT b

	INCR week2
	IF week2=<15 AND pl=0 THEN GOTO sf
	IF week2=16 THEN
		GOSUB conmou
		CLS
		pl=1
		GOTO sf.10
	END IF
	IF week2<=30 AND pl=1 THEN GOTO sf
	GOSUB conmou
	GOTO 8000

print.fix:
	l=5
	wk=week2
	IF wk>15 THEN wk=wk-15
	LOCATE 6+wk,l
	IF home=1 THEN
		COLOR 2
		PRINT tn$(t2)
	END IF
	IF home=0 THEN
		COLOR 7
		PRINT tn$(t1)
	END IF
	IF week>week2 THEN
		LOCATE 6+wk,l+19
		PRINT fixture&(a,week2,1);"-";fixture&(a,week2,2)
		LOCATE 6+wk,l+28
		PRINT fixture&(a,week2,3)
	END IF
	RETURN

Euro.Cup:
  CLS
  x1$=txt$(126)
  IF er=1 THEN
		x2$=txt$(114)+" "+txt$(121)
		games=16
		leg=1
  ELSEIF er=2 THEN
		x2$=txt$(114)+" "+txt$(122)
		games=16
		leg=2
  ELSEIF er=3 THEN
		x2$=txt$(115)+" "+txt$(121)
		games=8
		leg=1
  ELSEIF er=4 THEN
		x2$=txt$(115)+" "+txt$(122)
		games=8
		leg=2
  eLSEIF er=5 THEN
		x2$=txt$(117)+" "+txt$(121)
		games=4
		leg=1
  ELSEIF er=6 THEN
		x2$=txt$(117)+" "+txt$(122)
		games=4
		leg=2
  ELSEIF er=7 THEN
		x2$=txt$(118)+" "+txt$(121)
		games=2
		leg=1
  ELSEIF er=8 THEN
		x2$=txt$(118)+" "+txt$(122)
		games=2
		leg=2
  ELSEIF er=9 THEN
		x2$=txt$(120)
		games=1
		leg=2
  END IF

  l=1
  x$=x1$
  color 4,0
  GOSUB prtitle
  l=2
  x$=x2$
  GOSUB prtitle

  FOR a=1 TO 164
	  keeper!(a)=0
		defense!(a)=0
	  midfield!(a)=0
	  attack!(a)=0
  NEXT a

  game=0
  team=1
euro.cup.1:
  INCR game
  IF leg=1 THEN
		team1=ec%(team)
	  team2=ec%(team+1)
  ELSEIF leg=2 THEN
		team2=ec%(team)
	  team1=ec%(team+1)
  END IF
  GOSUB euro.cup.data

euro.end:
  IF leg=1 THEN
		ers%(game,1)=lres%(game,1)
		ers%(game,2)=lres%(game,2)
  END IF
  IF leg=2 THEN
		IF (ers%(game,1)+lres%(game,2))=(ers%(game,2)+lres%(game,1)) THEN
			tim1=30
			GOSUB ecd.2
			goto euro.end
    END IF
    ers%(game,1)=ers%(game,1)+lres%(game,2)
    ers%(game,2)=ers%(game,2)+lres%(game,1)
  END IF
  GOSUB euro.report

  IF leg=2 THEN
		IF ers%(game,1)>ers%(game,2) THEN
			ec%(game)=team2
	  ELSE
	    ec%(game)=team1
		END IF
  END IF

  team=team+2
  IF game>games THEN GOTO euro.cup.2
  IF team>games*2 THEN GOTO euro.cup.2
  IF game=8 AND games>8 THEN
		GOSUB conmou
		CLS
	  l=1
	  x$=x1$
	  color 4,0
	  GOSUB prtitle
	  l=2
	  x$=x2$
		GOSUB prtitle
	END IF
  GOTO euro.cup.1
euro.cup.2:
	INCR er
  GOSUB conmou
  CLS
  RETURN

euro.cup.data:
  FOR a100=1 TO 2
		IF a100=1 THEN t100=team1
		IF a100=2 THEN t100=team2

		IF t100<65 THEN
			keeper!(t100)=ps!(t100,1,1)
			FOR p=2 TO 11
				defense!(t100)=defense!(t100)+ps!(t100,p,2)
				midfield!(t100)=midfield!(t100)+ps!(t100,p,3)
				attack!(t100)=attack!(t100)+ps!(t100,p,4)
		  NEXT p
		ELSEIF t100>64 THEN
			keeper!(t100)=eskill%((t100-64),1)
			defense!(t100)=eskill%((t100-64),2)
			midfield!(t100)=eskill%((t100-64),3)
			attack!(t100)=eskill%((t100-64),4)
		END IF
ECD.1:
  NEXT a100

  ks1=INT(keeper!(team1))
  ks2=INT(keeper!(team2))
  ds1=INT(defense!(team1))
  ds2=INT(defense!(team2))
  ms1=INT(midfield!(team1))
  ms2=INT(midfield!(team2))
  fs1=INT(attack!(team1))
  fs2=INT(attack!(team2))

  lres%(game,1)=0
  lres%(game,2)=0
  ball=3
  ds=INT((ds1+fs2)*2)
  ms=INT((ms1+ms2)*2)
  fs=INT((fs1+ds2)*2)
  mat.1=0
  euro=1
  tim1=90
ecd.2:
	FOR tim=1 TO tim1
    GOSUB match
  NEXT tim
	RETURN

euro.report:
	game1=game
	IF game>8 THEN game1=game-8
  x$=tn$(team1)
  gosub length
  LOCATE 8+(game1*2),18-x2
  COLOR 2
  IF team1<nop+1 THEN COLOR 7
  PRINT tn$(team1)
  LOCATE 8+(game1*2),25
  COLOR 2
  IF team2<nop+1 THEN COLOR 7
	pRINT tn$(team2)
  LOCATE 8+(game1*2),18
  IF lres%(game,1)>lres%(game,2) THEN
		coLOR 6
  ELSE
		COLOR 7
  END IF
  PRINT lres%(game,1)
	LOCATE 8+(game1*2),22
  IF lres%(game,2)>lres%(game,1) THEN
		COLOR 6
  ELSE
		COLOR 7
  END IF
  PRINT lres%(game,2)
  IF leg=2 THEN
		COLOR 4,0
		iF ers%(game,1)>ers%(game,2) THEN
			x$=tn$(team2)
			gosub length
			x$=mid$(x$,1,x2)+txt$(315)+STR$(ers%(game,1))+" -"+STR$(ers%(game,2))
			gosub length
			locate 9+(game1*2),1
			PRINT ptab(160-(x2*4));x$
		ELSE
			x$=tn$(team1)
			gosub length
			x$=mid$(x$,1,x2)+" Won"+STR$(ers%(game,2))+" -"+STR$(ers%(game,1))
			gosub length
			locate 9+(game1*2),1
			PRINT ptab(160-(x2*4));x$
		END IF
  END IF
  IF team1<65 AND team2<65 THEN
		gates&=(ca&(team1)+ca&(team2))/2
		IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
  END IF
  IF team1<65 AND team2>64 THEN
		gates&=(ca&(team1)+15000)/2
		IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
  END IF
  IF team1>64 AND team2<65 THEN
		gates&=(ca&(team2)+15000)/2
		IF gates&>20000 THEN gates&=20000
  END IF
  gates&=INT(gates&*2.5)
  IF er=7 OR er=8 THEN gates&=100000
  IF er=9 THEN gates&=150000
  egates&(team1)=gates&
  egates&(team2)=gates&
  RETURN

cup.sort:
    FOR a=1 TO 64
	    fc%(a)=0
		  lc%(a)=0
			IF a<33 THEN ec%(a)=0
			IF a<33 THEN cc%(a)=0
			if a<33 then uc%(a)=0
		NEXT a

		FOR a=1 TO 164
			egates&(a)=0
		NEXT a

		a=1
cs.1:
		b=CINT(RND*100)+64
		IF a=1 THEN b=ds%(1,dp%(1,1))
		if a=3 and egates&(ecw)=0 then b=ecw
		IF egates&(b)=1 THEN GOTO cs.1
		ec%(a)=b
		egates&(b)=1
		INCR a
		IF a<33 THEN GOTO cs.1

		a=1
cs.2:
		b=CINT(RND*100)+64
		IF a=1 THEN
			IF egates&(faw)=0 THEN
				b=faw
			ELSEIF egates&(law)=0 THEN
				b=lcw
			END IF
		END IF
		IF a=3 and egates&(ccw)=0 THEN b=ccw
		IF egates&(b)=1 THEN GOTO cs.2
		cc%(a)=b
		egates&(b)=1
		INCR a
		IF a<33 THEN GOTO cs.2

		a=1
		c=2
cs.3:
		b=CINT(RND*100)+64
		IF a=1 THEN
			IF egates&(ds%(1,dp%(1,c)))=0 THEN
				b=ds%(1,dp%(1,c))
			ELSE
				INCR c
				GOTO cs.3
			END IF
		END IF
		incr c
cs.3.1:
		IF a=3 THEN
			IF egates&(ds%(1,dp%(1,c)))=0 THEN
				b=ds%(1,dp%(1,c))
			ELSE
				INCR c
				GOTO cs.3.1
			END IF
		END IF
		if a=5 and egates&(ucw)=0 then b=ucw
		IF egates&(b)=1 THEN GOTO cs.3
		uc%(a)=b
		egates&(b)=1
		INCR a
		IF a<33 THEN GOTO cs.3

    a=1
180 b=INT(RND*64)+1
    FOR c=1 TO a
	    IF lc%(c)=b THEN GOTO 180
    NEXT c
    lc%(a)=b
    INCR a
    IF a<65 THEN GOTO 180

    a=1
183 b=INT(RND*64)+1
    FOR c=1 TO a
	    IF fc%(c)=b THEN GOTO 183
    NEXT c
    fc%(a)=b
    INCR a
    IF a<65 THEN GOTO 183

    lr=1
    fr=1
    er=1
    cr=1
    ur=1
		RETURN

colour.palette:
   PALETTE 0,0,0,0
   PALETTE 1,1,0.13,0.93
   PALETTE 2,.33,.87,0
   PALETTE 3,0,0,1
   PALETTE 4,1,.1,0
   PALETTE 5,.4,1,.6
   PALETTE 6,1,1,.13
   PALETTE 7,.4,.6,1
	 palette 8,.5,.4,1
	 palette 9,.8,.4,.7
	 palette 10,.3,.95,.3
	 palette 11,.8,.8,.4

	 COLOR 4,0
	 RETURN

cup.Cup:
  CLS
	x2$=txt$(123)
  IF cr=1 THEN
		x1$=txt$(114)+" "+txt$(121)
		games=16
		leg=1
  ELSEIF cr=2 THEN
		x1$=txt$(114)+" "+txt$(122)
		games=16
		leg=2
  ELSEIF cr=3 THEN
		x1$=txt$(115)+" "+txt$(121)
		games=8
		leg=1
  ELSEIF cr=4 THEN
		x1$=txt$(115)+" "+txt$(122)
		games=8
		leg=2
	ELSEIF cr=5 THEN
		x1$=txt$(117)+" "+txt$(121)
		games=4
		leg=1
	ELSEIF cr=6 THEN
		x1$=txt$(117)+" "+txt$(122)
		games=4
		leg=2
	ELSEIF cr=7 THEN
		x1$=txt$(118)+" "+txt$(121)
		games=2
		leg=1
  ELSEIF cr=8 THEN
		x1$=txt$(118)+" "+txt$(122)
		games=2
		leg=2
  ELSEIF cr=9 THEN
		x1$=txt$(119)
		games=1
		leg=2
  END IF

  l=1
  x$=x2$
  color 4,0
  GOSUB prtitle
  l=2
  x$=x1$
  GOSUB prtitle

  FOR a=1 TO 164
	  keeper!(a)=0
		defense!(a)=0
	  midfield!(a)=0
		attack!(a)=0
  NEXT a

  game=0
  team=1
cup.cup.1:
  INCR game
  IF leg=1 THEN
		team1=cc%(team)
	  team2=cc%(team+1)
  ELSEIF leg=2 THEN
		team2=cc%(team)
	  team1=cc%(team+1)
	END IF
  GOSUB euro.cup.data

cup.end:
  IF leg=1 THEN
		crs%(game,1)=lres%(game,1)
		crs%(game,2)=lres%(game,2)
  END IF
  IF leg=2 THEN
		IF (crs%(game,1)+lres%(game,2))=(crs%(game,2)+lres%(game,1)) THEN
			tim1=30
			GOSUB ecd.2
			goto cup.end
	  END IF
    crs%(game,1)=crs%(game,1)+lres%(game,2)
    crs%(game,2)=crs%(game,2)+lres%(game,1)
  END IF
  GOSUB cup.report

  IF leg=2 THEN
		IF crs%(game,1)>crs%(game,2) THEN
			cc%(game)=team2
    ELSE
	    cc%(game)=team1
		END IF
  END IF

  team=team+2
  IF game>games THEN GOTO cup.cup.2
  IF team>games*2 THEN GOTO cup.cup.2
	iF game=8 AND games>8 THEN
		GOSUB conmou
		CLS
	  l=1
	  x$=x2$
	  color 4,0
		GOSUB prtitle
	  l=2
	  x$=x1$
	  GOSUB prtitle
	END IF
  GOTO cup.cup.1
cup.cup.2:
	iNCR cr
  GOSUB conmou
  RETURN

cup.report:
	game1=game
	IF game>8 THEN game1=game-8
  x$=tn$(team1)
  gosub length
  LOCATE 8+(game1*2),18-x2
  COLOR 2
  IF team1<nop+1 THEN COLOR 7
  PRINT tn$(team1)
	LOCATE 8+(game1*2),25
  COLOR 2
  IF team2<nop+1 THEN COLOR 7
	pRINT tn$(team2)
  LOCATE 8+(game1*2),18
  IF lres%(game,1)>lres%(game,2) THEN
		coLOR 6
  ELSE
		COLOR 7
  END IF
  PRINT lres%(game,1)
	lOCATE 8+(game1*2),22
  IF lres%(game,2)>lres%(game,1) THEN
		COLOR 6
  ELSE
		COLOR 7
  END IF
  PRINT lres%(game,2)
  IF leg=2 THEN
		color 4
		IF crs%(game,1)>crs%(game,2) THEN
			x$=tn$(team2)
			gosub length
			x$=mid$(x$,1,x2)+txt$(315)+STR$(crs%(game,1))+" -"+STR$(crs%(game,2))
			gosub length
			locate 9+(game1*2),1
			PRINT ptab(160-(x2*4));x$
		ELSE
			x$=tn$(team1)
			gosub length
			x$=mid$(x$,1,x2)+txt$(315)+STR$(crs%(game,2))+" -"+STR$(crs%(game,1))
			gosub length
			locate 9+(game1*2),1
			PRINT ptab(160-(x2*4));x$
		END IF
  END IF
  IF team1<65 AND team2<65 THEN
		gates&=(ca&(team1)+ca&(team2))/2
		IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
  END IF
  IF team1<65 AND team2>64 THEN
		gates&=(ca&(team1)+15000)/2
		IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
  END IF
  IF team1>64 AND team2<65 THEN
		gates&=(ca&(team2)+15000)/2
		IF gates&>20000 THEN gates&=20000
  END IF
  gates&=INT(gates&)*2.5
  IF cr=7 OR cr=8 THEN gates&=100000
  IF cr=9 THEN gates&=150000
  egates&(team1)=gates&
  egates&(team2)=gates&
  RETURN

uefa.Cup:
  		CLS
			x2$=txt$(124)
      IF ur=1 THEN
				x1$=txt$(114)+" "+txt$(121)
				games=16
				leg=1
      ELSEIF ur=2 THEN
				x1$=txt$(114)+" "+txt$(122)
				games=16
				leg=2
      ELSEIF ur=3 THEN
				x1$=txt$(115)+" "+txt$(121)
				games=8
				leg=1
		  ELSEIF ur=4 THEN
				x1$=txt$(115)+" "+txt$(122)
				games=8
				leg=2
      ELSEIF ur=5 THEN
				x1$=txt$(117)+" "+txt$(121)
				games=4
				leg=1
      ELSEIF ur=6 THEN
				x1$=txt$(117)+" "+txt$(122)
				games=4
				leg=2
      ELSEIF ur=7 THEN
				x1$=txt$(118)+" "+txt$(121)
				games=2
				leg=1
      ELSEIF ur=8 THEN
				x1$=txt$(118)+" "+txt$(122)
				games=2
				leg=2
      ELSEIF ur=9 THEN
				x1$=txt$(119)+" "+txt$(121)
				games=1
				leg=1
  	  ELSEIF ur=10 THEN
				x1$=txt$(119)+" "+txt$(122)
				games=1
				leg=2
	    END IF
      l=1
      x$=x2$
      color 4,0
		  GOSUB prtitle
      l=2
      x$=x1$
      GOSUB prtitle

      FOR a=1 TO 164
			  keeper!(a)=0
				defense!(a)=0
	      midfield!(a)=0
	    	attack!(a)=0
      NEXT a

      game=0
      team=1
uefa.cup.1:
      INCR game
      IF leg=1 THEN
				team1=uc%(team)
	      team2=uc%(team+1)
	    ELSEIF leg=2 THEN
				team2=uc%(team)
	      team1=uc%(team+1)
	    END IF
      GOSUB euro.cup.data

uefa.end:
      IF leg=1 THEN
				urs%(game,1)=lres%(game,1)
				urs%(game,2)=lres%(game,2)
      END IF
      IF leg=2 THEN
				IF (urs%(game,1)+lres%(game,2))=(urs%(game,2)+lres%(game,1)) THEN
					tim1=30
					GOSUB ecd.2
					goto uefa.end
		    END IF
		    urs%(game,1)=urs%(game,1)+lres%(game,2)
	  	  urs%(game,2)=urs%(game,2)+lres%(game,1)
      END IF
      GOSUB uefa.report

      IF leg=2 THEN
				IF urs%(game,1)>urs%(game,2) THEN
					uc%(game)=team2
		    ELSE
			    uc%(game)=team1
				END IF
      END IF

      team=team+2
      IF game>games THEN GOTO uefa.cup.2
      IF team>games*2 THEN GOTO uefa.cup.2
			IF game=8 AND games>8 THEN
				GOSUB conmou
				CLS
	      l=1
		    x$=x2$
		  	color 4,0
			  GOSUB prtitle
	      l=2
		    x$=x1$
			  GOSUB prtitle
			END IF
      GOTO uefa.cup.1
uefa.cup.2:
			INCR ur
      GOSUB conmou
      RETURN

uefa.report:
			game1=game
			IF game>8 THEN game1=game-8
      x$=tn$(team1)
      gosub length
      LOCATE 8+(game1*2),18-x2
      COLOR 2
      IF team1<nop+1 THEN COLOR 7
      PRINT tn$(team1)
	    LOCATE 8+(game1*2),25
      COLOR 2
      IF team2<nop+1 THEN COLOR 7
			PRINT tn$(team2)
      LOCATE 8+(game1*2),18
      IF lres%(game,1)>lres%(game,2) THEN
				COLOR 6
      ELSE
				COLOR 7
      END IF
      PRINT lres%(game,1)
			LOCATE 8+(game1*2),22
      IF lres%(game,2)>lres%(game,1) THEN
				COLOR 6
      ELSE
				COLOR 7
      END IF
      PRINT lres%(game,2)
      IF leg=2 THEN
				COLOR 4,0
				IF urs%(game,1)>urs%(game,2) THEN
					x$=tn$(team2)
					gosub length
					x$=mid$(x$,1,x2)+txt$(315)+STR$(urs%(game,1))+" -"+STR$(urs%(game,2))
					gosub length
					locate 9+(game1*2),1
					PRINT ptab(160-(x2*4));x$
				ELSE
					x$=tn$(team1)
					gosub length
					x$=mid$(x$,1,x2)+txt$(315)+STR$(urs%(game,2))+" -"+STR$(urs%(game,1))
					gosub length
					locate 9+(game1*2),1
					PRINT ptab(160-(x2*4));x$
				END IF
      END IF
      IF team1<65 AND team2<65 THEN
				gates&=(ca&(team1)+ca&(team2))/2
				IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
      END IF
      IF team1<65 AND team2>64 THEN
				gates&=(ca&(team1)+15000)/2
				IF gates&>ccap&(team1) THEN gates&=ccap&(team1)
      END IF
      IF team1>64 AND team2<65 THEN
				gates&=(ca&(team2)+15000)/2
				IF gates&>20000 THEN gates&=20000
      END IF
      gates&=INT(gates&*2.5)
      IF ur=7 OR ur=8 THEN gates&=100000
      IF ur=9 OR ur=10 THEN gates&=150000
      egates&(team1)=gates&
      egates&(team2)=gates&
      RETURN

store.scores:
  font SADD("rub1.font"+CHR$(0)),8
	scroll (8,(8+gma)*8)-(314,200),0,-8
	IF div=1 THEN COLOR 8
	IF div=2 THEN COLOR 9
	IF div=3 THEN COLOR 10
	IF div=4 THEN COLOR 11
	x$="Div"+str$(div)
	x$=x$+" "+tn$(team1)
  x$=x$+" "+STR$(results%(div,games,1,2))
  x$=x$+" "+STR$(results%(div,games,2,2))
	x$=x$+"  "+tn$(team2)
	LOCATE 25,2
	PRINT x$

	if team1<nop+1 or team2<nop+1 then
		IF div=1 THEN COLOR 8
		IF div=2 THEN COLOR 9
		IF div=3 THEN COLOR 10
		IF div=4 THEN COLOR 11
		x$="Div"+str$(div)
		x$=x$+" "+tn$(team1)
	  x$=x$+" "+STR$(results%(div,games,1,2))
	  x$=x$+" "+STR$(results%(div,games,2,2))
		x$=x$+"  "+tn$(team2)
		LOCATE 5+ga,2
		PRINT x$
	end if

  font SADD("rub.font"+CHR$(0)),8
  RETURN

MouseM:
	for f=1 to 1000
		x=mouse(0)
	next f

mm1:
	if mouse(0)=0 then goto mm1
	x=mouse(1)
	y=mouse(2)
	return

MouseM1:
	for f=1 to 1000
		x=mouse(0)
	next f

mm2:
	if ucase$(inkey$)="Y" then m&(a)=m&(a)+100000
	if mouse(0)=0 then goto mm2
	x=mouse(1)
	y=mouse(2)
	return

play.offs:
	gosub colour.palette
	cls
	for div=2 to 4
		p.off%(div-1,1)=ds%(div,dp%(div,3))
		p.off%(div-1,2)=ds%(div,dp%(div,6))
		p.off%(div-1,3)=ds%(div,dp%(div,4))
		p.off%(div-1,4)=ds%(div,dp%(div,5))
	next div

	x$=txt$(316)
	l=2
	color 4,0
	gosub prtitle

	locate 8,5
	print txt$(317)
	locate 14,5
	print txt$(318)
	locate 20,5
	print txt$(319)

	for a=1 to 3
		if a=1 then
			b=9
			color 2
		elseif a=2 then
			b=15
			color 7
		elseif a=3 then
			b=21
			color 6
		end if

		team1=p.off%(a,1)
		x$=tn$(team1)
		gosub length
		team2=p.off%(a,2)

		locate b+1,1
		print tab(18-x2);tn$(team1);
		locate b+1,20
		print "V  ";tn$(team2)

		team1=p.off%(a,3)
		x$=tn$(team1)
		gosub length
		team2=p.off%(a,4)

		locate b+2,1
		print tab(18-x2);tn$(team1);
		locate b+2,20
		print "V  ";tn$(team2)

	next a

	gosub conmou
	incr week
	goto 199

play.offs.2:
	gosub colour.palette
	cls
	x$=txt$(320)
	l=2
	color 4,0
	gosub prtitle

	locate 8,5
	print txt$(317)
	locate 14,5
	print txt$(318)
	locate 20,5
	print txt$(319)

	for a=1 to 3
		if a=1 then
			b=9
			color 2
		elseif a=2 then
			b=15
			color 7
		elseif a=3 then
			b=21
			color 6
		end if

		team1=p.off%(a,1)
		x$=tn$(team1)
		gosub length
		team2=p.off%(a,2)

		locate b+1,1
		print tab(18-x2);tn$(team1);
		locate b+1,20
		print "V  ";tn$(team2)

	next a

	gosub conmou
	incr week
	goto 199

po1:
  gosub colour.palette
  cls
  x$=txt$(316)
  l=2
  color 4,0
	gosub prtitle
  FOR a=1 TO 164
	  keeper!(a)=0
	defense!(a)=0
    midfield!(a)=0
    attack!(a)=0
  NEXT a

  div=1
  team=1
  game=1
po1.1:
	team1=p.off%(div,team)
	team2=p.off%(div,team+1)
  GOSUB po.data

po1.end:
	IF lres%(div,1)=lres%(div,2) THEN
		if rnd>.5 then incr lres%(div,1) else incr lres%(div,2)
  END IF
  GOSUB po.report

  cgates&(team1)=40000
  cgates&(tesm2)=40000

	IF lres%(div,1)>lres%(div,2) THEN
    p.off%(div,game)=team1
  ELSE
    p.off%(div,game)=team2
	END IF

  incr team
  incr team
  incr game
  if game<3 then goto po1.1
po1.2:
	incr div
	game=1
	team=1
	if div<4 then goto po1.1
  GOSUB conmou
  goto weekly.news

po.data:
  FOR a100=1 TO 2
		IF a100=1 THEN t100=team1
		IF a100=2 THEN t100=team2

		keeper!(t100)=ps!(t100,1,1)
		FOR p=2 TO 11
			defense!(t100)=defense!(t100)+ps!(t100,p,2)
			midfield!(t100)=midfield!(t100)+ps!(t100,p,3)
			attack!(t100)=attack!(t100)+ps!(t100,p,4)
	 	NEXT p
poD.1:
  NEXT a100

  ks1=INT(keeper!(team1))
  ks2=INT(keeper!(team2))
  ds1=INT(defense!(team1))
  ds2=INT(defense!(team2))
  ms1=INT(midfield!(team1))
  ms2=INT(midfield!(team2))
  fs1=INT(attack!(team1))
  fs2=INT(attack!(team2))

  lres%(game,1)=0
  lres%(game,2)=0
  ball=3
  ds=INT((ds1+fs2)*1.5)
  ms=INT((ms1+ms2)*1.5)
  fs=INT((fs1+ds2)*1.5)
  mat.1=0
  euro=1
  tim1=90
pod.2:
  FOR tim=1 TO tim1
	  GOSUB match
  NEXT tim
  RETURN

po.report:
	font sadd("rub1.font"+chr$(0)),8
	if div=1 and team=1 then
		locate 8,5
		color 2
		print txt$(317)
	end if
	if div=1 then
		locate 9+team,1
		x$=tn$(team1)
		gosub length
		print tab(18-x2);tn$(team1);
		locate 9+team,20
		print lres%(div,1);lres%(div,2)
		locate 9+team,26
		print tn$(team2)
	end if

	if div=2 and team=1 then
		locate 14,5
		color 4
		print txt$(318)
	end if
	if div=2 then
		locate 15+team,1
		x$=tn$(team1)
		gosub length
		print tab(18-x2);tn$(team1);
		locate 15+team,20
		print lres%(div,1);lres%(div,2)
		locate 15+team,26
		print tn$(team2)
	end if

	if div=3 and team=1 then
		locate 20,5
		color 6
		print txt$(319)
	end if
	if div=3 then
		locate 21+team,1
		x$=tn$(team1)
		gosub length
		print tab(18-x2);tn$(team1);
		locate 21+team,20
		print lres%(div,1);lres%(div,2)
		locate 21+team,26
		print tn$(team2)
	end if
	return

po2:
  gosub colour.palette
  cls
  x$=txt$(320)
  l=2
  color 4,0
	gosub prtitle
  FOR a=1 TO 164
	  keeper!(a)=0
		defense!(a)=0
    midfield!(a)=0
    attack!(a)=0
  NEXT a

  div=1
  team=1
po2.1:
	team1=p.off%(div,team)
	team2=p.off%(div,team+1)
  GOSUB po.data

po2.end:
	IF lres%(div,1)=lres%(div,2) THEN
		if rnd>.5 then incr lres%(div,1) else incr lres%(div,2)
  END IF
  GOSUB po.report

  cgates&(team1)=80000
  cgates&(tesm2)=80000

	IF lres%(div,1)>lres%(div,2) THEN
    p.off%(div,1)=team1
  ELSE
    p.off%(div,1)=team2
	END IF

	incr div
	team=1
	if div<4 then goto po2.1
  GOSUB conmou
  goto weekly.news

contract:
	gosub colour.palette
	cls
	p=b
  FOR c=1 TO 4
		FOR b1=1 TO 16
		  IF ds%(c,b1)=a THEN GOTO contract1
	  NEXT b1
  NEXT c
contract1:
	abc=2
	gosub view.player.2
	con.length=int(rnd*100)+30
	locate 22,1
	x$=txt$(321)
	gosub length
	print ptab(160-(x2*4));x$
	x$=txt$(322)+str$(con.length)+txt$(323)
	gosub length
	locate 24,1
	print ptab(160-(x2*4));x$
	skill=0
	for s=1 to 4
		skill=skill+int(ps!(a,p,s))
	next s
	wage=(skill*10)*(5-c)
	x$=txt$(324)+str$(wage)+"0"
	gosub length
	locate 26,1
	print ptab(160-((x2)*4));x$

	gosub accept
	if yes=1 then
		pc%(a,b)=con.length
		for a1=1 to 10
			m&(a)=m&(a)-wage
		next a1
		color 4,0
		for l=22 to 31
			locate l,1
			print space$(45)
		next l
		return
	end if
	if yes=0 then
     pn%(a,b,1)=0
     pn%(a,b,2)=0
     pa%(a,b)=0
     pj%(a,b)=0
     pg%(a,b)=0
     pp%(a,b)=0
     FOR s=1 TO 4
       ps!(a,b,s)=0
     NEXT s
     book%(a,b)=0
     pt%(a,b)=0
     return
	end if

last.week:
	for div=1 to 4
		cls
		x$=txt$(325)
		l=1
		color 4,0
		gosub prtitle
		locate 5,1
		x$=txt$(326)+str$(div)
		gosub length
		print ptab(160-x2);x$

		for games=1 to 8
			t1=lresult%(div,games,1)
			s1=lresult%(div,games,2)
			s2=lresult%(div,games,3)
			t2=lresult%(div,games,4)
			color 7,0
			if t1<nop+1 then color 6,0
			locate 7+(games*2),2
			x$=tn$(t1)
			gosub length
			print tab(17-x2);x$
			locate 7+(games*2),2
			color 7,0
			if t2<nop+1 then color 6,0
			print tab(18);s1;" ";s2;" ";tn$(t2)
		next games
		gosub conmou

	next div

	return

rand.tact:
	for a=nop+1 to 164
		tact%(a,1)=int(rnd*4)+1
		tact%(a,2)=int(rnd*4)+1
		tact%(a,3)=int(rnd*4)+1
		agg%(a)=int(rnd*9)+1
	next a
	return

length:
	x2=len(x$)
	for x=len(x$) to 1 step -1
	if mid$(x$,x,1)=" " then decr x2
	if mid$(x$,x,1)<>" " then return
	next x
	return

accept:
  font SADD("rub1.font"+CHR$(0)),8
  LINE (60,216)-(100,240),5,bf
  LINE (60,216)-(100,240),4,b
  LOCATE 29,1
  COLOR 3,5
  PRINT PTAB(68);txt$(327)
  LINE (220,216)-(260,240),5,bf
  LINE (220,216)-(260,240),4,b
  LOCATE 29,1
  COLOR 3,5
  PRINT PTAB(232);txt$(328)
  font SADD("rub.font"+CHR$(0)),8

accept1:
  gosub MouseM
  IF (y<190 OR y>240) THEN GOTO accept1
  if (x>60 and x<100) then
		yes=1
		return
  end if
  if (X>220 and x<260) then
		yes=0
		return
  end if

	color 4,0
	RETURN

rename.player:
	LINE (260,5)-(320,260),0,bf
  locate 14,1
  PRINT PTAB(269);txt$(329)
  PRINT PTAB(269);txt$(330)
  PRINT PTAB(266);txt$(331)
  PRINT PTAB(269);txt$(332)
  GOSUB pick.player

	cls
	x$=txt$(333)
	l=1
	color 4,0
	gosub prtitle

	a1=pn%(a,p,1)
	a2=pn%(a,p,2)

	gosub name1

	locate 5,5
	color 4
	print txt$(334);
	color 7
	print name$

	for p1=1 to 4
		line (17+p1,97+p1)-(40-p1,152-p1),6,b
		line (49+p1,97+p1)-(224-p1,152-p1),6,b
	next p1

  LINE (17,65)-(40,88),5,bf
  LINE (17,65)-(40,88),4,b
	color 4,5
	locate 10,4
	print "U"

  LINE (129,65)-(152,88),5,bf
  LINE (129,65)-(152,88),4,b
	color 4,5
	locate 10,18
	print "U"

  LINE (17,161)-(40,184),5,bf
  LINE (17,161)-(40,184),4,b
	color 4,5
	locate 22,4
	print "D"

  LINE (129,161)-(152,184),5,bf
  LINE (129,161)-(152,184),4,b
	color 4,5
	locate 22,18
	print "D"

  LINE (233,113)-(296,136),5,bf
  LINE (233,113)-(296,136),4,b
	color 4,5
	locate 16,31
	print txt$(335)

rename.1:
	color 4,0
	for p1=-2 to 2
		x=a2+p1
		if x<1 then x=x+200
		if x>200 then x=x-200
		locate 16+p1,8
		print space$(20)
		color 4,0
		if p1=0 then color 7,0
		locate 16+p1,8
		print playn$(x)

		x=a1+p1
		if x<65 then x=x+26
		if x>90 then x=x-26
		locate 16+p1,4
		color 4,0
		if p1=0 then color 7,0
		print chr$(x)
	next p1

rename.2:
	gosub mousem
	if (y>65 and y<88) then
		if (x>17 and x<40) then
			decr a1
			if a1<65 then a1=90
			goto rename.1
		elseif (x>129 and x<152) then
			decr a2
			if a2<1 then a2=200
			goto rename.1
		end if
	elseif (y>161 and y<184) then
		if (x>17 and x<40) then
			incr a1
			if a1>90 then a1=65
			goto rename.1
		elseif (x>129 and x<152) then
			incr a2
			if a2>200 then a2=1
			goto rename.1
		end if
	elseif (y>113 and y<136) then
		if (x>233 and x<296) then
			pn%(a,p,1)=a1
			pn%(a,p,2)=a2
			goto 1000
		end if
	end if
	goto rename.2

game.agg:
      FOR div=1 TO 4
  	    FOR games=1 TO 8
					gl=0
	      	team1=ds%(div,results%(div,games,1,1))
  		    team2=ds%(div,results%(div,games,2,1))

					defense!(team1)=0
					midfield!(team1)=0
					attack!(team1)=0
			    FOR p=2 TO 11
					  IF pj%(team1,p)>0 THEN GOTO 16010
			      defense!(team1)=defense!(team1)+ps!(team1,p,2)
		  			midfield!(team1)=midfield!(team1)+ps!(team1,p,3)
			      attack!(team1)=attack!(team1)+ps!(team1,p,4)
16010 		NEXT p

					defense!(team2)=0
					midfield!(team2)=0
					attack!(team2)=0
	  		  FOR p=2 TO 11
					  IF pj%(team2,p)>0 THEN GOTO 16020
	    			defense!(team2)=defense!(team2)+ps!(team2,p,2)
					  midfield!(team2)=midfield!(team2)+ps!(team2,p,3)
	    			attack!(team2)=attack!(team2)+ps!(team2,p,4)
16020 		NEXT p
					gosub aggression
				next games
			next div
			return

trans.accept:
	gosub colour.palette
	trans.accpt=0
	if play.game=1 then play.game=0:trans.accpt=1
	gosub view.player.2
	locate 25,1

	if d=0 or d=a then
		x$=txt$(336)
	else
		x$=tn$(d)
		gosub length
		x$=mid$(x$,1,x2)+txt$(337)
	end if
	print ptab(160-(len(x$)*4));x$
	locate 27,1
	x$=str$(a&(d))
	print ptab(160-(len(x$)*4));x$
	gosub accept
	if trans.accpt=1 then play.game=1
	for l=25 to 31
		color 4,0
		locate l,1
		print space$(45)
	next l
	return

profit.sort:
    team.score(a)=0
    FOR player=1 TO 18
	    FOR f=1 TO 4
	      IF ps!(a,player,f)<1 THEN ps!(a,player,f)=0
		    IF ps!(a,player,f)>99 THEN ps!(a,player,f)=99
		  NEXT f
	    IF pg%(a,player)>his&(a,15) THEN
				his&(a,15)=pg%(a,player)
				his&(a,13)=pn%(a,player,1)
				his&(a,14)=pn%(a,player,2)
	    END IF
    NEXT player

    FOR div=1 TO 4
	    FOR b=1 TO 16
		    IF ds%(div,b)=a THEN GOTO profit.sort.1
	    NEXT b
    NEXT div
profit.sort.1:
    wages&(a)=0
    cap%(a)=0

	  FOR b=1 TO 18
      FOR c=1 TO 4
	      IF ps!(a,b,c)<1 OR pa%(a,b)=0 THEN ps!(a,b,c)=0
	      wages&(a)=INT(wages&(a)+ps!(a,b,c))
	    NEXT c
	  NEXT b
	  wages&(a)=wages&(a)*4
		if coach%(a)=1 then wages&(a)=wages&(a)+1000
		if physio%(a)=1 then wages&(a)=wages&(a)+1000
	  wages&(a)=wages&(a)*(5-div)

    IF a<nop+1 THEN GOTO 18778
	  FOR p=1 TO 18
		  s=INT(RND*3)+2
	    if ps!(a,p,s)=0 then s=int(rnd*3)+2
	    IF pa%(a,p)=0 THEN GOTO 18779
	    IF ps!(a,p,1)>1 THEN s=1
	    ps!(a,p,s)=ps!(a,p,s)+(RND*3)-1
	    IF ps!(a,p,s)<1 THEN ps!(a,p,s)=0
	    IF ps!(a,p,s)>99 THEN ps!(a,p,s)=99
18779 NEXT p

18778	profit&(a)=0
    lo&(a)=INT(lo&(a)-re&(a))
    IF lo&(a)<0 THEN re&(a)=0:lo&(a)=0
	  lo&(a)=INT(lo&(a)*102/100)
		m&(a)=INT(m&(a)-wages&(a)-re&(a)+gates&(a)+cgates&(a))
    profit&(a)=INT(gates&(a)-wages&(a)-re&(a)+cgates&(a))
		return

quest:
	gosub colour.palette
	cls
	b=p
	abc=2
	gosub view.player.2

	locate 22,1
	x$=txt$(338)+name$+txt$(339)
	gosub length
	print ptab(160-(x2*4));x$

	locate 24,1
quest.1:
	team=int(rnd*64)+1
	if team<nop+1 then goto quest.1
	for pl=18 to 1 step -1
		if pa%(team,pl)=0 then goto quest.2
	next pl
	goto quest.1
quest.2:
	x$=tn$(team)
	gosub length
	print ptab(160-(x2*4));x$

	gosub value.player
	value&=value&+(rnd*value/10)-(rnd*value&/10)
	value&=value&*1.2
	value&=int(value&/1000)*1000
	x$=txt$(340)+str$(value&)
	gosub length
	locate 26,1
	print ptab(160-((x2-1)*4));x$

	gosub accept
	if yes=0 then
		for l=1 to 4
			if ps!(a,b,l)>0 then ps!(a,b,l)=ps!(a,b,l)-(rnd*3)
			if ps!(a,b,l)<1 then ps!(a,b,l)=0
		next l
		color 4,0
	elseif yes=1 then
		for x=5 to 1 step -1
			if x=5 then
			  y=34
				IF value&>his&(a,y) THEN
					his&(a,y)=value&
					his&(a,y+1)=pn%(a,b,1)
					his&(a,y+2)=pn%(a,b,2)
				END IF
			elseif x<5 then
				y=22+((x-1)*3)
				y1=22+(x*3)
				if value&>his&(a,y) then
					swap his&(a,y),his&(a,y1)
					swap his&(a,y+1),his&(a,y1+1)
					swap his&(a,y+2),his&(a,y1+2)
				end if
			end if
		next x

	  m&(a)=m&(a)+value&
	  FOR s=1 TO 4
	    SWAP ps!(a,b,s),ps!(team,pl,s)
		NEXT s
	  SWAP pp%(a,b),pp%(team,pl)
	  SWAP pc%(a,b),pc%(team,pl)
		SWAP pa%(a,b),pa%(team,pl)
		SWAP pj%(a,b),pj%(team,pl)
		SWAP pg%(a,b),pg%(team,pl)
		swap pt%(a,b),pt%(team,pl)
		SWAP book%(a,b),book%(team,pl)
	  SWAP pn%(a,b,1),pn%(team,pl,1)
		SWAP pn%(a,b,2),pn%(team,pl,2)
		color 4,0
	end if
	return

