JavaScript Program to Scroll text in status bar

Write a JavaScript program to scroll text in status bar.



Source Code
<html>
<head>
    <title>Scroll text in status bar</title>
</head>
<body onload="scrollIn()">
    <script>
        winObj = window.open("", "mywin", "toolbar=0, status=1, innerHeight=100, innerWidth=100");
        var msg = "This is a status bar";
        var place = 1;

        function scrollIn()
        {
            winObj.status = msg.substring(0, place);
            if(place >= msg.length)
            {
                place = 1;
                window.setTimeout("scrollOut()", 300);
            }
            else
            {
                place++;
                window.setTimeout("scrollIn()", 50);
            }
        }
        function scrollOut()
        {
            winObj.status = msg.substring(place, msg.length);
            if(place >= msg.length)
            {
                place = 1;
                window.setTimeout("scrollIn()", 100);
            }
            else
            {
                place++;
                window.setTimeout("scrollOut()", 50);
            }
        }
    </script>
</body>
</html>
Output