var date = new Date();
var timestamp = date.getTime();

function AjaxRequest(url, data, messageObject)
{
    var returnObj = null;
    $.ajax({
        method: "post",
        url: url + "?_t=" + timestamp,
        data: data,
        contentType: "application/json; charset=utf-8",
        dataType: "json", 
        beforeSend: function(){
            if(messageObject != null)
                messageObject.html("<img src='/image/load2.gif' />" + 
                                        "<font color='#777777' style='padding-left: 10px;'>Processing...</font>");
        }, 
        success: function(obj){
            if(messageObject != null)
                messageObject.html(obj.html);
            if(obj.reload)
            {
                window.location.reload();
            }
            returnObj = obj;
        }, 
        error: function(a, b, c)
        {
            if(messageObject != null)
                messageObject.html("ERROR" + a + " / " + b + " / " + c);
        }
    });
    
    timestamp = date.getTime();    
    return returnObj;
}
