﻿function CallServiceMethod(serviceMethod, dataString, successFunction, errorFunction)
{
    return jQuery.ajax({
                type: "POST",
                url: serviceMethod,
                async: false,
                data: dataString,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: successFunction,
                error: errorFunction
        }).responseText;
}

function CallServiceMethodWithWait(serviceMethod, dataString, successFunction, errorFunction)
{
    jQuery("#modalWait").jqmShow();
    var returnValue = jQuery.ajax({
                type: "POST",
                url: serviceMethod,
                async: false,
                data: dataString,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: successFunction,
                error: errorFunction
        }).responseText;
    jQuery("#modalWait").jqmHide();
    return returnValue;
}
