0
You need programming with JavaScript based on checking the className of the tabs. For example:
var lis = document.getElementById("theULid").getElementsByTagName("li");
for(var i=0; i<lis; i++){
if(lis[i].className == "selected")
return i; //or return lis[i], or return lis[i].getElementsByTagName("a")[0]
}