Javascript DIV positioning
<p>I am working on some JS to display a Twitter-eque error/success banner. I would like the banner to be visible at the top of the browser (FF, Chrome, Safari) for the duration of the time it is in view (including if the user decides to scroll somewhere else). I can't figure out the solution however.</p>

<p>Another issue I am having is with jQuery not appending a passed in message to the #alert div I am using for all of this.</p>

<pre><code>var alertBanner = function(msg){
    var $alert = $('#alert');
    if($alert.length) {
        $('#alert').empty();
        $(msg).appendTo('#alert');
        var alerttimer = window.setTimeout(function () {
            $alert.trigger('click');
        }, 3000);
        $alert.animate({height: $alert.css('line-height') || '50px'}, 200)
        .click(function () {
            window.clearTimeout(alerttimer);
            $alert.animate({height: '0'}, 200);
        });
    }
}
</code></pre>
