jquery show and hide image after x seconds
<p>I want to show and image for 2 seconds and the hide it to show a chart. I have the part were the chart appers after 2 seconds but I don't know how to put the image.</p>

<pre><code>$("li").click(function(){
    //Toggle List
    $(this).toggleClass("active");
    $(this).next("div").stop('true','true').slideToggle();
    //SHOW image for 2 seconds and then HIDE IT
    var did = $(this).attr('id');
    var graphic;

    if($(this).next("div").html() == '')
        {
        graphic = '';
            $.ajax({
               url: 'pulse.php?did='+did, success: function(data)
             {
             graphic = data;
             }
        });
    }

    //Here I show the chart after 2 seconds pulling the data from pulse.php...
delay(function(){               
    $("#"+did).next("div").html(graphic);
    }, 2000 );
});


    //Delay function
var delay = (function(){
var timer = 0;
         return function(callback, ms){
         clearTimeout (timer);
         timer = setTimeout(callback, ms);
     };
})();
</code></pre>
