I don't quite understand what you're saying. How can you go back and close the window at the same time? If you close the window, what's the point of going back?
Anyway, the code you have to perform both actions is most likely javascript. In order to accomplish both tasks at the same time, you should just be able to set up your links like this:
Code:
<a href="javascript:close();" onClick="back();">Link</a>
where "close()" is your function that closes the window and "back()" is your function that goes back. That should accomplish both tasks at the same time. However, you may need to switch the back and close functions in that link, as I don't recall off the top of my head whether the link itself is called first, or if the onClick event handler is called first.