JavaScript Program for Scrolling text message in status bar

Write a JavaScript program for scrolling text message in status bar.



Source Code
<html>
<head>
    <title>Scrolling text message in status bar</title>
</head>
<body onload="scrollIn()">
    <script>
        win = window.open('', 'win', 'width=100, height=100, status=1, menubar=1, innerHeight=100, innerWidth=100')
        var msg = 'Text is moving';
        var place = 1;
        function scrollIn()
        {
            window.status = msg.substring(0, place)
            if(place >= msg.length)
            {
                place = 0;
                window.setTimeout('scrollOut()', 300);
            }
            else
            {
                place++;
                window.setTimeout('scrollIn()', 50);
            }
        }
        function scrollOut()
        {
            window.status = msg.substring(place, msg.length)
            if(place >= msg.length)
            {
                place = 1;
                window.setTimeout('scrollIn()', 100);
            }
            else
            {
                place++;
                window.setTimeout('scrollOut()', 1000);
            }
        }
    </script>
</body>
</html>
Output