Agreed, it is a very annoying practice. I think you use javascript to do it, maybe combined with something like <body onLoad="">, obviously not onLoad but onExit or whatever the equivalent is..