﻿ErrorTimeout = null;

function errorHandler(xhr, ajaxOptions, thrownError)
{
    alert(xhr.status + ': ' + thrownError);
    clearTimeout(ErrorTimeout);
    ErrorTimeout = setTimeout('Initialise()', ErrorRefreshInterval);
}

function callServer(header, clientdata, callback, busytype)
{
    showBusy(busytype);
    $.ajax({
        type: 'POST',
        url: 'Handler.ashx?r=' + header,
        data: JSON.stringify(clientdata),
        dataType: 'json',
        success: eval(callback),
        error: eval(errorHandler)
    });
}

