// when the user clicks the browser's back or forward buttons.
if(e.src().equals(Y.HistoryHash().SRC_HASH())) {
if(e.changed().objGetObj("tab")!=null) {
//e.changed.tab.newVal is a string containing the tab index
int i = parseInt(e.changed().objGetObj("tab").objGetString("newVal"), 0);
tb.selectChild(i);
}
else if(e.removed().objGetString("tab")!=null) {
// The tab selection was removed in the new state, so
// select the first tab by default.
tb.selectChild(0);