I was looking for this myself.
In some cases, you should be able to use the SP object for this.
Thought it may come in handy in case someone else bumps into this post.
SP.ListOperation.Selection.getSelectedList()
http://stackoverflow.com/questions/6422939/get-currently-selected-list-in-javascript-on-load-sharepoint-2010https://stackoverflow.com/questions/6422939/get-currently-selected-list-in-javascript-on-load-sharepoint-2010