I have two web applications setups:
david.example.com and john.example.com
David opens a new window to John:
You can always use iframes for cross domain communication and send messages via the hashbangs. See this for an example. It's basically the workings of stuff like Facebook connect. If one app opens the other window I'm guessing you can do that with normal windows as well.
You should be able to do this, as long as you set document.domain on both DOM's.
document.domain = location.host.replace(/^.*?([^.]+\.[^.]+)$/g,'$1');
Credited to Martin Jespersen