<html>
<head>
    <script>
        function call()
        {
            popup = window.open('http://www.google.co.in');         
            setInterval(function() {wait();},4000);
        }   
        function caller()
        {
            setInterval(function() {call();},5000);
        }
        function wait()
        {
            popup.close();
        }
    </script>
</head>
<body onload="caller();">
</body>
</html>