/// <reference path="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" />
/// <reference path="json2.min.js" />

// JSONHelper: Contains methods for preparing and carrying out JSON requests.
var JSONHelper = {
    // ServicePath: Fully qualified path to the WebService
ServicePath: "/Webservices/madplan.asmx", //"http://superbrugsen.dk/wsopskrifter/madplan.asmx", //


    // MakeRequest: Carries out the actual JSON request.
    MakeRequest: function(requestName, requestData, onSuccess) {
        $.ajax({
            url: this.ServicePath + "/" + requestName,
            data: requestData,
            success: function(data) {
                onSuccess(data);
            }

        });

    }
};

// Global Ajax options
$.ajaxSetup({
    //    async: true,
    //contentType: "application/json",
    contentType: "application/json; charset=utf-8",
    dataType: "jsonp",
    //scriptCharset: "iso-8859-1",
    type: "GET"
});