﻿$$$ = function() {};
$$$.ActiveRequest = new Array();

$$$.NewSystemRequest = function(ServiceUrl, ServiceParams, onSucessFnc, extraParam) {
    $$$.ActiveRequest.push(
        $.ajax({
            type: "POST",
            url: ServiceUrl,
            data: ServiceParams,
            dataType: "json",
            error: function(errorRequest) {
                throw (errorRequest)
                //errorRequest.AgoraParam = ServiceParams;
                //errorRequest.AgoraService = ServiceUrl;
            },
            success: function(loadedContent) {
                if (onSucessFnc != null && onSucessFnc != undefined)
                    onSucessFnc(loadedContent, extraParam);
            }
        })
    );
}

$$$.SerializeForm = function(formId){
    var params = $('#'+formId).fastSerialize();
    var fragment = $.param( params );
    return fragment;
}
