change content of div twice in one go
===

So i'm doing this simple ajax thing its working fine but the response is slow and i don't want the user to click twice thinking it hasn't worked therefore i want to show a message "like converting please wait" before receiving the response. here is the code that i'm using but its not doing what i want


    function postajax()
    {
    document.getElementById('linksarea').innerHTML = "<img src='images/waiting.gif'> Converting please wait...";
    var xmlhttp;
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        document.getElementById("links").innerHTML=xmlhttp.responseText;
        }
      }
    var links= window.document.getElementById('linksarea').value;
    xmlhttp.open("POST","ajax.php",true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send("links="+links+"&username=xxxx");
    }

help will be appreciated