Not sure why you want to set a specific state to the whole document, as already $ is doing exactly that. As alternate state already indicates in the name, it gives you the possibilities to declare and use additional states to $.
Are you passing bookmark values or trying to impement document chaining?