i have two function in my project first:
function send(method,url,data,content_id,show_wait,small,aaa)
{
    if(content_id!='multipart'&&show_wait)
    {
        if(typeof(small) === 'undefined'){
            showwait(content_id);
        }else{
            smallshowwait(content_id);
        }
    }
    var XMLHttp=new XMLHttpRequest(); // is XMLHttpRequest httprequest class
    XMLHttp.onreadystatechange = function()
    {
        if(XMLHttp.readyState == 4 && XMLHttp.status == 200)
        {
            //alert(XMLHttp.responseText);
            if(content_id!='multipart')
            {
                MyResponse = XMLHttp.responseText.split('#$$#');
                if(typeof(aaa) === 'undefined'){
                    document.getElementById(content_id).style.display="none";
                    $(document.getElementById(content_id)).fadeIn("slow");
                }
            }
        }
    }
}
and second function is :
function aya(method,url,data,divid,isresponse){
    $(document).ready(function(){
        send(method,url,data,divid,isresponse,'small','aaa');
        $(document).ready(function(){
            alert('test');
            addActiveClass('inbox');
            send(method,'messages/showmessage.php',data,'messagecontent',true);
        });
    });
}
second function work correctly. but when i want remove alert('test'); error happen. 
in firebug error show :  
document.getElementById(...) is null
there is way that i can remove alert?
 
    