Use location.hash to remember active window