Check if window is open, if not call another javascript function
<p>I am using the following javascript to open another window and I want to check if that window is actually open, but then I want it to call a "pause()" function if the window is not open.  I have no clue how to do this even after 3 days of researching, can anybody guide me with this?</p>

<p>The javascript to open the window:</p>

<pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        var windowSizeArray = ["width=300,height=300",
                                "width=200,height=400,scrollbars=yes"];

        $(document).ready(function () {
            $('#newWindow').click();
            window.open($('#newWindow').attr('href'), 'window name', 'window settings')
            $('.newWindow').click(function (event) {

                var url = $(this).attr("href");
                var windowName = "popUp"; //$(this).attr("name");
                var windowSize = windowSizeArray[$(this).attr("rel")];

                window.open(url, windowName, windowSize);

                event.preventDefault();

            });
        });


    &lt;/script&gt;
</code></pre>

<p>If that window is not open I want it to call a pause function:</p>

<pre><code>&lt;a href="javascript:void(0);" onclick="pause();"&gt;&lt;img name="b1" src="system/modules/surf/stop.png" border="0" alt="Pause" title="Pause" style="position:absolute;top:28px;margin-left:5px"&gt;&lt;/a&gt;
</code></pre>
