Forum "read/unread" in JavaScript
No big issues that I can see, but here are a few tips.



When using for-in loops, add a hasOwnProperty check, like this:

for (var i in obj) {
    if (obj.hasOwnProperty(i) {
        // do stuff
    }
 }


Otherwise the loop will also iterate over properties of Object.prototype.



data can more simply and efficiently be declared like this:

data = localStorage[USERID + '.forumhistory'] ?
    JSON.parse(localStorage[USERID+'.forumhistory']) :
    {forum:{},thread:{}};




The switch statement might be more legibly written as a series of if else-if statements (with nesting), but that's mostly a stylistic choice.



data is, actually, the worst variable name there is. It is impossible to create a less specific name. I would suggest renaming it.



In loops where you iterate over an array, like this:

var i, l = forums.length;
for (i = 0; i &lt; l; i++) {
    // use `forums[i]`
}


If you know every element in forums is truthy (not 0, null, undefined, false, or ""), you can use this loop, which is shorter and more efficient, and in my opinion more legible.

var i, forum;
for (i = 0; forum = forums[i]; i++) {
    // use `forum`
}