jQuery in JavaScript does not work
<p>The following code works except for the jQuery part.
The code makes 6 dots black and stops the interval, but does not fadeIn the div with the id "cs".</p>

<p>What's my mistake?</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;style type="text/css"&gt;
    .dot
    {
        background-color:#666;
        width:10px;
        height:10px;
        border:1px solid lightgray;
        margin-right:1px;
        float:left;
    }
    body {
            background:url('images/bg.png');
            width:100%;
    }
    #wrapper {
        margin-left: auto; 
        margin-right: auto; 
        width:1000px;
        position:relative;
    }
    #cs {
        visibility:hidden;
        float: left;
    }
    #loader {
        margin-top:20px;
        padding-left:10px;
    }
&lt;/style&gt;
&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;


(function() {
    var delayInSeconds = 0.5;                           
    var num = 0;
    var changeDot = function() {
        document.getElementById('dot' + num).style.backgroundColor = "#000";
        num++;
        if(num == 6)
        {
            $('#cs').fadeIn('slow');
            window.clearInterval(int);
        }
    };
   var int = window.setInterval(changeDot, delayInSeconds * 1000);
})();
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="wrapper"&gt;
    &lt;div id="name"&gt;
        &lt;img src="images/as.png"/&gt;
    &lt;/div&gt;
    &lt;div id="loader"&gt;
        &lt;div id="dot0" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot1" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot2" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot3" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot4" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot5" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot6" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot7" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot8" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot9" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot10" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot11" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot12" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot13" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot14" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot15" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot16" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot17" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot18" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot19" class="dot"&gt;&lt;/div&gt;
        &lt;div id="dot20" class="dot"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div id="cs"&gt;
        &lt;img src="images/cs.png"/&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>
</p>
