top is a global variable that refers to the top-level window containing the current frame (possibly within more framesets, each of whose containing window object can be obtained recursively using each window's parent property). opener refers to the window that opened the current window using window.open().
If your document isn't within a frame, just drop the top and use window.opener or just opener. opener is already a reference to the window you want, so no need for the window that follows it, though I wouldn't expect it to do any harm: a window object has a property called window that refers to itself. Also, you should check whether the opener window has been closed before doing anything to it using its closed property.