setting document.domain must come before all references to the parent window