' Mystery At MyCroft Mews - Originally written for the C=64
' October 1985 issue of Ahoy! magazine. Originally written by : John R.Prager
' Converted to Creative BASIC by : Stafford White
' With help from :
'			1) Larry McCaughn
'			2) GWS
'			3) aurelCB
'			4) Egil
'			5} ZeroDog
' 			And a few others that I forgot to mention..

def frame,c1,c2,c3,c4:window
def a,building,bldg,bitmap,temp,temp2,i,j,mx,mv,mw,mr,name1,name2,pos,ix,iy,my,item,routine[12,17] :int
def l[75],u1[13],u2[13],g[13],al[13],h[13],l0[13],extra[4]:int
def al$[6],it$[17],item$[4],b$[17],s$[13],t$[4],h$[13],sx$[4,2],text$,cause$[5],extract$[4] :string

def z, pstep : float
def p,players,textW,textH,wW,wH,bW,bH :int
def run,irow,jcol,x,y :int
def a$,title$ :string
	my=1
def house[17,3]:int		:' House centre co-ordinates
' each building has an allocated centre of the image - the x,y co-ordinates 
' are stored in the house[ ] array.  'x' value in house[ ,1], and 'y' value in house[ ,2]
' (The zero elements of the array are not used, hence we specify the array as 17 by 3).

declare fnr(x:int)

	init          :' Set up variables

' set window size ...
	wW = 805
	wH = 670
' set button size ...
	bw = 70: bh = 30

AUTODEFINE "OFF"

	WINDOW frame,0,0,wW,wH,@MINBOX|@SIZE,0,"Mystery at Mycroft Mews",main
	WINDOW c1,0,0,wW,wH,@nocaption,frame,"",c1messages
	WINDOW c2,0,0,wW,wH,@nocaption,frame,"",c2messages
	WINDOW c3,0,0,wW,wH-50,@nocaption,frame,"",c3messages

	showwindow c1, @swrestore	:' Splash screen
	showwindow c2, @swhide		:' Buildings
	showwindow c3, @swhide		:'

'set up screen backgrounds ...
	setwindowcolor c1,rgb(0,0,30)
	setwindowcolor c2,rgb(0,40,0)
	setwindowcolor c3,rgb(0,0,60)

	centerwindow frame

' set button sizes ..
	bW = 70 : bH = 30

' set up Buildings screen controls ..
	control c1,"B,1 Player,.09(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,1"
	setfont c1, "MS Sans Serif",10,600,0,1
	setcontrolcolor c1,1,rgb(100,200,250),rgb(10,10,120)

	control c1,"B,2 Players,.45*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,2"
	setfont c1, "MS Sans Serif",10,600,0,2
	setcontrolcolor c1,2,rgb(100,200,250),rgb(10,10,120)

	control c1,"B,3 Players,.95*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,3"
	setfont c1, "MS Sans Serif",10,600,0,3
	setcontrolcolor c1,3,rgb(100,200,250),rgb(10,10,120)

	control c1,"B,4 Players,1.45*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,4"
	setfont c1, "MS Sans Serif",10,600,0,4
	setcontrolcolor c1,4,rgb(100,200,250),rgb(10,10,120)
	
	control c1,"B,5 Players,1.95*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,5"
	setfont c1, "MS Sans Serif",10,600,0,5
	setcontrolcolor c1,5,rgb(100,200,250),rgb(10,10,120)

	control c1,"B,6 Players,2.45*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,6"
	setfont c1, "MS Sans Serif",10,600,0,6
	setcontrolcolor c1,6,rgb(100,200,250),rgb(10,10,120)
	
	control c1,"B,Quit,2.95*(wW-bW)/3,560,bW,bH,@CTLBTNFLAT,7"
	setfont c1, "MS Sans Serif",10,600,0,7
	setcontrolcolor c1,7,rgb(100,200,250),rgb(10,10,120)

'do house scfreen
CONTROL c2,"T,,13,14,102,102,@CTLSTCBITMAP,1"



	' set up Selected Building screen control ..
	control c3,"B,Proceed,(wW-bW)/2,560,bW,bH,@CTLBTNFLAT,1"
	setfont c3, "MS Sans Serif",10,600,0,1
	setcontrolcolor c3,1,rgb(100,200,250),rgb(10,10,120)


	' draw a gradient fill in main splash window ..
	pstep = 300.0 / 256 + 1
	for band = 0 To 255
		rect c1, 0, int(band * pstep), wW, int((band+1) * pstep), rgb(0,0,band), rgb(0,0,band)
	next band

	' load splash image ..
	'splash = LOADIMAGE (getstartpath + "splash.jpg", 4)
	'showimage win,splash,4,(wW-200)/2,225

	' set intro text ...
	title$ = "Mystery at Mycroft Mews"
	setfont c1, "Arial",28,700,0
	gettextsize c1, title$, textW, textH
	'move c1,(wW - textW)/2,36
	frontpen c1, rgb(20,130,255)
	drawmode c1,@TRANSPARENT
	move c1, 150,160
	print c1,"Mystery at"
	move c1, 300, 280
	print c1, "Mycroft"
	move c1,450, 400
	print c1,"Mews"
	
	run = 1

	waituntil run = 0
	DELETEIMAGE bldg, @IMGSCALABLE
	closewindow c3
	closewindow c2
	closewindow c1
	closewindow frame
	end

main:
	' Frame window messages ..
	' not a lot to do with this window - shown only once.
	select @CLASS
		case @IDCLOSEWINDOW
			run = 0
	endselect
	return

sub c1messages
	' Splash window messages ..
	select @CLASS
		case @idcontrol
			if @controlid > 0 & @controlid < 7
				players= @controlid
			endif
			if @controlid = 7 then run = 0
			l[57] = players
			for j = 1 to p
				l[36+j] = 5: l[42+j] = 7: l[30+j] = 17
			next j
			p=1
			' show Buildings screen ..
			showwindow c2,@swrestore
			showwindow c1,@swhide
			bldg = LoadImage(getstartpath + "house.jpg",@IMGSCALABLE)

			for jcol = 1 to 4
				for irow = 1 to 4
				' a bit of tricky stuff to position the house images neatly ..
					x = 0.1*wW + 170*(irow-1)
					y = 0.015*wH + 150*(jcol-1)
					ShowImage c2,bldg,@IMGSCALABLE,x,y
					' save the co-ordinates of the centre point of each house ..
					' houses are numbered 1 to 4 in the first row, 5 to 8 in the second row, etc ..
					house[(jcol-1)*4 + irow,1] = x + 65	:' add half the image width
					house[(jcol-1)*4 + irow,2] = y + 65	:' add half the image height
				next irow
			next jcol
			' set instruction text to pick a residence ...
			y=0
			a$ = "Click on the building you wish to enter.."
			setfont c2, "Arial",12,700,0
			gettextsize c2, a$, textW, textH
			move c2,(wW - textW)/2,0.89*wH
			frontpen c2, rgb(20,130,255)
			drawmode c2,@TRANSPARENT 
			print c2,a$
	endselect
return

sub fnr(X)
return INT(RND(1.0)*X)+1

sub reset
	for y=0 to 11
		for x=0 to 16
			routine[y,x]=0
		next x
	next y
return

sub search
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3, "You find :  "
	temp = 310
	i=0
	for j = 1 to 16
		if l[j+12]<>-building then jump nothing
		if rnd(1)<.6 | l[50+p]=15
			i=1
			temp = temp + 15
			move c3, 300,temp
			print c3,"The",it$[j]
			l[j+12]=building
		i=1
		endif
label nothing
	next j
	temp = temp + 15
	move c3,300,temp
	if i=0 then print c3,"Nothing of interest..."
return

sub interrogate
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3, "Interrogate which suspect?"
	temp=325
	for j=1 to 12
		move c3, 300, temp
		if l[j]=building
			print c3, s$[j]
			routine[1,j]=1
		endif
		temp=temp+15
	next j
return

sub about-whom
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3, "Interrogate ",s$[name1]," about whom?"
	temp=325
	for j=1 to 12
		move c3, 300, temp
		print c3, s$[j]
		routine[2,j]=1
		temp=temp+15
	next j
	move c3,300, temp
	print c3,"<< An Item >>"
	routine[2,13]=1 
return

sub about-item
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3, "Interrogate ",s$[name1]," about which item?"
	temp=325
	for j=1 to 12
		move c3, 300, temp
		print c3, it$[j]
		routine[3,j]=1
		temp=temp+15
	next j
	move c3,300, temp
	print c3,"<< A suspect >>"
	routine[3,13]=1
return

sub interrogate-suspect
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3,"We interrogate ",s$[name1]," about ",s$[name2]," ..."
return

sub interrogate-item
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3,"We interrogate ",s$[name1]," about ",it$[item]," ..."
return

sub take-item
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	print c3, "Take which item?"
	temp=325
	for j=1 to 16
		move c3, 300, temp
		if l[j+12]=building
			print c3,it$[j]
			routine[4,j]=1
		endif
	temp=temp+15
	next j
return

sub have-item
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 300, 300
	j=l[50+p]
	if j
		print c3,"You drop the",it$[j]
		l[j+12]=building
		move c3, 300,335
	endif
	print c3,"You take the",it$[item]
	l[50+p]=item
	l[12+item]=100+p
return

sub fingerprint-item
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 200, 300
	print c3, "Police fingerprint an item!!"
return

sub accuse
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 200, 300
	print c3, "You accuse a suspect!!"
	solution
return

sub coroner-report
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3,200,280
	print c3,"Coroner's Report:"
	if mv<=6 then x=0 else x=1
	move c3,200,300
	print c3,"Subject is ",sx$[0,x],", approximately ",l[50],"years of age."
	temp=l[49]
	move c3,200,315
	print c3,"Subject apparently was",cause$[temp],"."
return

sub extract
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3,200,280
	print c3,"Extract from the ",it$[13]," of ",s$[mv]
	temp=310
	move c3,150,temp
	text$=extract$[mx]
	print c3,left$(extract$[mx],85)
	move c3,150,temp+15
	print c3,mid$(extract$[mx],86)
	a=extra[mx]
	temp=350
	move c3,150,temp
	for j=1 to 12
		if j=mv then g[j]=0
		x = g[j] & a
		move c3,150,temp
		if x 
			print c3,s$[j]
			temp=temp+15
		endif
	next j  
return

sub drop-hide
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 200, 300
	temp=l[50+p]
	print c3, "You drop the ",it$[temp],"."
	l[temp+12]=building
	l[50+p]=0
return

sub examine-records
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	move c3, 200, 300
	temp = rnd(12)+1
	print c3,b$[building]," report on ",s$[temp],"."
	temp = g[temp]&7
	move c3,200,325
	'print c3,
return

sub solution
	reset
	rect c3,0,50,335,200,rgb(0,0,60),rgb(0,0,60)
	rect c3,0,200,wW,wH,rgb(0,0,60),rgb(0,0,60)
	if mr<=6 then temp=0 else temp=1
	move c3,1,300
	print c3,"Here is the solution:"
	move c3,1,315
	print c3,s$[mr]," murdered ",s$[mv]," using the",it$[mw]
	move c3,1,330
	print c3,"because ",
	print c3,sx$[1,temp]," ",t$[mx],"."
return

sub In-the-building
	reset
	move c3, 75, 100
	a=l[58+building]
	if a<>mv then jump enter
	if l[26]=p+100 | abs (l[26])=mv | l[30+p]=mv then jump enter
	'if building = mv & l[50+p]<>14
		move c3,368,119
		print c3, "LOCKED"
		move c3, 300,300
		print c3, "Murder scene. No one my enter"
		move c3, 300, 315
		print c3, "without the Police Master Key!"
		return
	endif
label enter
	l[30+p]=a
	move c3,(wW - textW)/2,0.05*wH
	print c3,a$	
	move c3,1,100
	print c3, "You have ",
	if l[50+p] then print c3," the ",it$[item], "." else print c3,"no item."
	move c3,1,135
	i=0
	print c3, "You see:"
	temp=150
	for j=1 to 12
		move c3, 1, temp
		if l[j]=building
			print c3, s$[j]
			i=1 
			temp=temp+15
			u2[1]=u2[1]+1
			u2[5]=j
		endif
	next j
	temp=temp+15
	for j=1 to 16
		move c3, 1, temp
		if l[j+12] = building
			print c3, "The ",it$[j]
			temp=temp+15
			u2[2]=u2[2]+1
			i=1
		endif
	next j
	if i=0 then print c3,"Nothing worth mentioning."
	move c3,350,300
	print c3,"Turn options:"
	routine[0,0]=1
	temp = 325
	move c3,300,temp
	u1[1]=1
	print c3,"Search"
	routine[0,1]=1
	temp = temp +15
	u1[2]=2
	if u2[1]
		move c3,300,temp
		print c3,"Interrogate suspect"
		u1[2]=2
		routine[0,2]=1
	endif
	temp = temp +15
	if u2[2] | u2[4]
		move c3,300,temp
		print c3,"Take an item"
		routine[0,3]=1
	endif
	temp = temp +15
	if building=16 & (u2[2]|l[50+p])
		move c3,300,temp
		print c3,"Fingerprint an item"
		routine[0,4]=1
	endif
	temp = temp +15
	if building=16
		move c3,300,temp
		print c3,"Accuse a suspect"
		u1[2]=2
		routine[0,5]=1
	endif
	temp = temp +15
	if building=14
		move c3,300,temp
		print c3,"Read Coroner's Report"
		routine[0,6]=1
	endif
	temp = temp +15
	if l[25]=100+p | l[25]=building
		move c3,300,temp
		print c3,"Read ",it$[13]
		u1[2]=2
		routine[0,7]=1
	endif
	temp = temp +15
	if l[51]
		move c3,300,temp
		print c3,"Drop or Hide item carried"
		routine[0,8]=1
	endif
	temp = temp +15  
	if building<3 | building=7
		move c3,300,temp
		print c3,"Examine ",b$[building]," records"
		routine[0,9]=1
	endif
	u2[1]=0
	u2[2]=0
return

sub init
	mx = fnr(3)
	mw = fnr(12)
label redo
	mv = fnr(12)
	mr = fnr(12)
	if mv = mr 
		redo
	endif
	b$[1]="Law Office","Mental Health Clinic","Delicatessen","Theatre","Hotel","Art Gallery","Bank","Library","Bakery","Pawn Shop","Church","Pub","Shopping Mall","Morgue","Warehouse","Police Station"
	it$[1]=" elephant gun"," antique crossbow"," baseball bat"," box of rat poison"," arquebus"," scimitar"," brass candelstick"," jar of sleeping pills"," .45 Automatic"," knitting needle"," ball-peen hammer"," vial of snake venom","item"," master key"," magnifying glass"," police badge"
	item$[1]=" Ledger"," Will"," Diary"
	it$[13]=item$[mx]
	s$[1]="Phyllis Writ","Dr. Wilma Libido","Hannah Nosh","Edith Scrim","Cheryl Valise","Desiree Ochre"," Emilio Lucre"," Morton Screed"," Joseph Cruller"," Norman Hock"," Rev. Arthur Transept"," Edgar Quaff"
	h$[0]=" stamp collector"," big-game hunter","n archery expert"," sports fan"," pest exterminator"," gun collector"," master fencer"," candelabra fancier","n insomniac"," marksman"," champion knitter"," tool collector"," herpetologist"
	t$[1]=" was being blackmailed"," will inherit millions"," is a homicidal maniac"
	sx$[0,0]="female","she","her","her"
	sx$[0,1]="male","he","him","his"
	cause$[0]=" poisoned with an unidentified toxin"," shot with a gun"," impaled with a sharp weapon"," beaten with a blunt instrument"
	al$[0]=" at home alone"," sick in bed"," out of town"," at a party"," at the theatre"," at church"
	extract$[1]="I have threatened to tell the police all that I know about their criminal activities if any of these people doesn't pay me another $9000 by midnight Sunday..."
	extract$[2]="I hereby bequeath two million dollars to each of these loyal and faithful friends..."
	extract$[3]="Dear Diary---, I found another anonymous letter in the mail this morning. My life is in danger from a jealous lunatic. The handwriting could be any of these people..."  
	extra[1]=16,32,64
	p=1
	for j=1 to 12
		l[j]=j
		al[j]=fnr(6)-1
		h[j]=fnr(12)
		l0[j]=fnr(15)
		l[j+12]=-l0[j]
		g[j]=fnr(7)
		z = rnd(1)
		if z <.5 then g[j] = g[j] + 16
		z = rnd(1)
		if z <.5 then g[j] = g[j] + 32
		z = rnd(1)
		if z <.5 then g[j] = g[j] + 64
	next j

	for j=1 to 16
LABEL tryagain
		x=fnr(16)
		if l[58+x]>0 then goto tryagain
		l[58+x]=j 
		if j>12
			l[12+j]=16
		endif
	next j
	l[30]=mx
	l[49]=3&mw
	l[50]=fnr(40)+20
	l[51]=0
	l[mv]=0: l[25]=-mv: al[mr]=fnr(3)-1: l0[mw]=mr
	if -l[12+mw]= mr
		l[12+mw]= -fnr(15)
	endif

	g[mv]=fnr(7)-8*(mx=2)
	if mx<3 then g[mv]=g[mv]|6
	g[mr]=g[mr]|2^(mx+3)
	if mx<3 then g[mr]=g[mr]&251
return

sub c2messages
' messages for the buildings screen ..

select @CLASS
	case @IDLBUTTONDN
	
' the screen co-ordinates where the mouse was clicked ..
		ix = @mousex: iy = @mousey
' check whether the mouse click was inside a house circle of
' radius 70px at co-ordinates stored for each house centre point ...
' the equation of the circle is:  (x - xcentre)^2 + (y - ycentre)^2 = radius^2

		building = 0			:' no building selected yet ..

		for i = 1 to 16
' check for a mouse click within a radius of 65px of the centre of each image ..
			if ((ix - house[i,1])^2 + (iy - house[i,2])^2 < 65^2)
' the point is inside a house circle ...
' find which residence corresponds to the ix,iy mouse co-ordinates ...		
				building = l[58+i]
' exit the for loop ..
				i = 16
			endif
		next i

' show the screen for the selected residence ..
		if bldg
			showwindow c3,@swrestore
			' clear any previous selection message ..
			rect c3,0,0,wW,wH,rgb(0,0,60),rgb(0,0,60)
			showwindow c2,@swhide
			ShowImage c3,bldg,@IMGSCALABLE,(wW - 130)/2,wH*0.1

' describe which residence was selected ...
			a$ = "You are at the " + b$[building]+ "."
			setfont c3, "Arial",12,700,0
			gettextsize c3, a$, textW, textH
			move c3,(wW - textW)/2,0.05*wH
			frontpen c3, rgb(20,130,255)
			drawmode c3,@TRANSPARENT
			In-the-building
	    endif
	endselect
return

sub c3messages
' messages for the selected building screen ..
	select @CLASS
		case @IDLBUTTONUP
			' the screen co-ordinates where the mouse was clicked ..
			ix = @mousex: iy = @mousey
			
			if ((ix > 290)&(ix < 590)) 
				'  In-The-Building screen
				if iy > 330 & iy < 345 & routine[0,1]=1
					search:return
				endif
				if iy > 345 & iy < 360 & routine[0,2]=1
					interrogate:return
				endif
				if iy > 360 & iy < 375 & routine[0,3]=1
					take-item:return
				endif
				if iy > 375 & iy < 390 & routine[0,4]=1
					fingerprint-item:return
				endif
				if iy > 390 & iy < 405 & routine[0,5]=1
					accuse:return
				endif
				if iy > 405 & iy < 420 & routine[0,6]=1
					coroner-report:return
				endif
				if iy > 420 & iy < 435 & routine[0,7]=1
					extract:return
				endif
				if iy > 435 & iy < 450 & routine[0,8]=1
					drop-hide:return
				endif
				if iy > 450 & iy < 465 & routine[0,9]=1
					examine-records:return
				endif
				' Interrogate - section
				if iy > 330 & iy < 345 & routine[1,1]=1
					name1=1
					about-whom:return
				endif
				if iy > 345 & iy < 360 & routine[1,2]=1
					name1=2
					about-whom:return
				endif
				if iy > 360 &  iy < 375 & routine[1,3]=1
					name1=3
					about-whom:return
				endif
				if iy > 375 & iy < 390 & routine[1,4]=1
					name1=4
					about-whom:return
				endif
				if iy > 390 & iy < 405 & routine[1,5]=1
					name1=5
					about-whom:return
				endif
				if iy > 405 & iy < 420 & routine[1,6]=1
					name1=6
					about-whom:return
				endif
				if iy > 420 & iy < 435 & routine[1,7]=1
					name1=7
					about-whom:return
				endif
				if iy > 435 & iy < 450 & routine[1,8]=1
					name1=8
					about-whom:return
				endif
				if iy > 450 & iy < 465 & routine[1,9]=1
					name1=9
					about-whom:return
				endif
				if iy > 465 & iy < 480 & routine[1,10]=1
					name1=10
					about-whom:return
				endif
				if iy > 480 & iy < 495 & routine[1,11]=1
					name1=11
					about-whom:return
				endif
				if iy > 495 & iy < 510 & routine[1,12]=1
					name1=12
					about-whom:return
				endif
				if iy > 510 & iy < 525 & routine[1,13]=1
					about-item:return
				endif
				' About-Whom screen?
				if iy > 330 & iy < 345 & routine[2,1]=1
					name2=1
					interrogate-suspect:return
				endif
				if iy > 345 & iy < 360 & routine[2,2]=1
					name2=2
					interrogate-suspect:return
				endif
				if iy > 360 & iy < 375 & routine[2,3]=1
					name2=3
					interrogate-suspect:return
				endif
				if iy > 375 & iy < 390 & routine[2,4]=1
					name2=4
					interrogate-suspect:return
				endif
				if iy > 390 & iy < 405 & routine[2,5]=1
					name2=5
					interrogate-suspect:return
				endif
				if iy > 405 & iy < 420 & routine[2,6]=1
					name2=6
					interrogate-suspect:return
				endif
				if iy > 420 & iy < 435 & routine[2,7]=1
					name2=7
					interrogate-suspect:return
				endif
				if iy > 435 & iy < 450 & routine[2,8]=1
					name2=8
					interrogate-suspect:return
				endif
				if iy > 450 & iy < 465 & routine[2,9]=1
					name2=9
					interrogate-suspect:return
				endif
				if iy > 465 & iy < 480 & routine[2,10]=1
					name2=10
					interrogate-suspect:return
				endif
				if iy > 480 & iy < 495 & routine[2,11]=1
					name2=11
					interrogate-suspect:return
				endif
				if iy > 495 & iy < 510 & routine[2,12]=1
					name2=12
					interrogate-suspect:return
				endif
				if iy > 510 & iy < 525 & routine[2,13]=1
					about-whom:return
				endif
				' About-Item screen
				if iy > 330 & iy < 345 & routine[3,1]=1
					item=1
					about-whom:return
				endif
				if iy > 345 & iy < 360 & routine[3,2]=1
					item=2
					about-whom:return
				endif
				if iy > 360 &  iy < 375 & routine[3,3]=1
					item=3
					about-whom:return
				endif
				if iy > 375 & iy < 390 & routine[3,4]=1
					item=4
					about-whom:return
				endif
				if iy > 390 & iy < 405 & routine[3,5]=1
					item=5
					about-whom:return
				endif
				if iy > 405 & iy < 420 & routine[3,6]=1
					item=6
					about-whom:return
				endif
				if iy > 420 & iy < 435 & routine[3,7]=1
					name2=7
					about-whom:return
				endif
				if iy > 435 & iy < 450 & routine[3,8]=1
					item=8
					about-whom:return
				endif
				if iy > 450 & iy < 465 & routine[3,9]=1
					item=9
					about-whom:return
				endif
				if iy > 465 & iy < 480 & routine[3,10]=1
					item=10
					about-whom:return
				endif
				if iy > 480 & iy < 495 & routine[3,11]=1
					item=11
					about-whom:return
				endif
				if iy > 495 & iy < 510 & routine[3,12]=1
					item=12
					about-whom:return
				endif
				if iy > 510 & iy < 525 & routine[3,13]=1
					about-item:return
				endif
				' Take-Item screen
				if iy > 330 & iy < 345 & routine[4,1]=1
					item=1
					have-item:return
				endif
				if iy > 345 & iy < 360 & routine[4,2]=1
					item=2
					have-item:return
				endif
				if iy > 360 &  iy < 375 & routine[4,3]=1
					item=3
					have-item:return
				endif
				if iy > 375 & iy < 390 & routine[4,4]=1
					item=4
					have-item:return
				endif
				if iy > 390 & iy < 405 & routine[4,5]=1
					item=5
					have-item:return
				endif
				if iy > 405 & iy < 420 & routine[4,6]=1
					item=6
					have-item:return
				endif
				if iy > 420 & iy < 435 & routine[4,7]=1
					item=7
					have-item:return
				endif
				if iy > 435 & iy < 450 & routine[4,8]=1
					item=8
					have-item:return
				endif
				if iy > 450 & iy < 465 & routine[4,9]=1
					item=9
					have-item:return
				endif
				if iy > 465 & iy < 480 & routine[4,10]=1
					item=10
					have-item:return
				endif
				if iy > 480 & iy < 495 & routine[4,11]=1
					item=11
					have-item:return
				endif
				if iy > 495 & iy < 510 & routine[4,12]=1
					item=12
					have-item:return
				endif
				if iy > 510 & iy < 515 & routine[4,13]=1
					item=13
					have-item:return
				endif
				if iy > 515 & iy < 530 & routine[4,14]=1
					item=14
					have-item:return
				endif
				if iy > 530 & iy < 545 & routine[4,15]=1
					item=15
					have-item:return
				endif
		endif
		case @IDLBUTTONUP

		case @idcontrol
			select @controlid
				case 1
					showwindow c2,@swrestore
					showwindow c3,@swhide
			endselect
	endselect
return

sub c4messages

return
