page template: add JS to set document.domain to main domain
rationale: hack around same-origin policy