The version number is typically part of the directory name, so 4.0.5 is a good guess. The best way is to look at the console log or boot.log file - one of the entries there will give the exatc version, something like this:
18:56:15,320 INFO [Server] Release ID: JBoss [Trinity] 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)