use .text() instead of .html() in the comparison between tab text and layer title.  this fixes the problem of escaped ampersands failing to compare correctly.