refs bug 969248: added event.state check to prevent #anchor reloads

Splitting this patch out into a separate branch so that it can be merged before the multi-select patch in a different pull request.