Function ShowW3DButton(Bn)
	HD=PeekInt(W3DButton_Bank,(BN-1)*4)
	If HD=0 Then Return
	lx=PeekInt(HD,0)
	rx=PeekInt(hd,4)
	oy=PeekInt(hd,8)
	uy=PeekInt(hd,12)
	x=PeekInt(hd,16)
	y=PeekInt(hd,20)
	Buttonred=ColorRed()
	Buttongreen=ColorGreen()
	Buttonblue=ColorBlue()
	Button_Width=rx-lx
	Button_Height=uy-oy
	If W3DButtonFlag=Bn Then
		If Button_Width<=240 Then
			DrawImageRect W3DButton,lx,oy,240,0,Button_Width-2,23
			DrawImageRect W3DButton,lx+Button_Width-2,oy,478,0,2,23
		Else
			If Button_Width<=476 Then
				Rest=Button_Width-238
				DrawImageRect W3DButton,lx,oy,240,0,238,23
				DrawImageRect W3DButton,lx+238,oy,480-Rest,0,Rest,23
			Else
				Rest=Button_Width-238
				DrawImageRect W3DButton,lx,oy,240,0,238,23
				sPos=2
				While Rest=>236
					Rest=Rest-236
					sPos=sPos+236
					DrawImageRect W3DButton,lx+sPos,oy,242,0,236,23
				Wend
				DrawImageRect W3DButton,lx+sPos+236,oy,480-Rest,0,Rest,23
			EndIf
		EndIf
		W3DButtonFlag=0
	Else
		If Button_Width<=240 Then
			DrawImageRect W3DButton,lx,oy,0,0,Button_Width-2,23
			DrawImageRect W3DButton,lx+Button_Width-2,oy,238,0,2,23
		Else
			If Button_Width<=476 Then
				Rest=Button_Width-238
				DrawImageRect W3DButton,lx,oy,0,0,238,23
				DrawImageRect W3DButton,lx+238,oy,240-Rest,0,Rest,23
			Else
				Rest=Button_Width-238
				DrawImageRect W3DButton,lx,oy,0,0,238,23
				sPos=2
				While Rest=>236
					Rest=Rest-236
					sPos=sPos+236
					DrawImageRect W3DButton,lx+sPos,oy,2,0,236,23
				Wend
				DrawImageRect W3DButton,lx+sPos+236,oy,240-Rest,0,Rest,23
			EndIf
		EndIf
	EndIf
	Color 0,0,0
	Text x,y,PeekShortString(hd,24),True,True
	Color Buttonred,Buttongreen,Buttonblue
End Function
;+ PeekShortString