This is for PVP and takes into account the possibility of swithing "Mains" on the fly.

As far as I know, there is no reliable way to determine which client session is party2, party3, etc...

If I could figure that out, I would use the party options instead of focus.