how can I find which window is open child or Parent to prevent copying of URL and using it in a different page of the browser
<p>I have an application in which I preventing copy paste of URL from Child Window to parent window
I want to know at the time of load which window is open.
I want to know which window is Used wheather it is Browser window or browser child window</p>

<p>How can I do that</p>

<pre><code> &lt;script language="javascript" type="text/javascript"&gt;
            function Load() {
                var i = 0;
                if (typeof window.opener != "undefined") {
                    alert("I was opened from within " + window.opener.location.href);
                    window.opener =null;
                }
                else if (i == 0)
                { window.location.href = 'Index.htm'; }
                else
                {alert(i);}
            }
        &lt;/script&gt;
</code></pre>

<p>Friends I m using this javascript to handle this Please Tell me what is wrong with this script 
Else condition is nt working for either case</p>
