Tax Topic 409 would seem to address your question.
In short, it seems to say that you can write off up to $3000 ($1500 if married filing separately) in capital losses, with any more able to be held over for later year(s). You have to add all your capital gains and losses together, though, so if you lost $2000 with the dot-bomb stocks but got $2000 from other stocks, then you don't get any capital loss advantage, but you probably won't have to pay any taxes on the amount you gained, either, as they add up to zero.