My 2 fish do this kind of thing quite a lot. Do you test the pH or nitrate levels in the water? It could be that one of these is out of whack. You can get a test kit for about �6 in most pet shops, these include testing tablets, a little water pot and some other bits and bobs, they're very simple to do. One reason for hanging about at the top of the tank can be a lack of oxygen in the tank. If they are 'gasping' at the top this will be the explanation. To fix this you need to increase the surface area of the water by either using a filter (if you don't already) or an air pump to get some bubbles up on the top. And make sure the water is reasonably clean.