﻿function CoreRequestConfiguration(methodName, data)
{
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/Configuration.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: false, dataType: "json",

        success: function(x)
        {
            y = x.d;
        },
        error: function(x)
        {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return y;
}

function CoreRequestConfigurationAsync(methodName, data,func)
{
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/Configuration.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: true, dataType: "json",

        success: function(x)
        {
            if (func)
            {
                func(x.d);
            }
            return false;
        },
        error: function(x)
        {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return false;
}

function CoreRequestAsync(methodName, data, func)
{
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/WebService.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: true, dataType: "json",

        success: function(x)
        {
            if (func)
            {
                func(x.d);
            }
            return false;
        },
        error: function(x)
        {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return false;
}

function CoreRequest(methodName, data, isAsync)
{
    var y = "";

    $.ajax({ type: "POST", url: "/CMSPages/WebService.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: isAsync, dataType: "json",

        success: function(x)
        {
            y = x.d;
        },
        error: function(x)
        {
            //alert(methodName + " Fehler:" + x.responseText);			
        }
    });
    return y;
}

function CoreRequestVoid(methodName, data, isAsync)
{
    $.ajax({ type: "POST", url: "/CMSPages/WebService.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: isAsync, dataType: "json",

        success: function()
        {
            return false;
        },
        error: function()
        {
            return false;
        }
    });
    return false;
}

function CoreRequestAsync(methodName, data, func)
{
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/WebService.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: true, dataType: "json",

        success: function(x)
        {
            if (func)
            {
                func(x.d);
            }
            return false;
        },
        error: function(x)
        {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return false;
}

function CoreRequestJobTracking(methodName, data) {
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/JobTracking.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: false, dataType: "json",

        success: function(x) {
            y = x.d;
        },
        error: function(x) {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return y;
}

function CoreRequestJobTrackingAsync(methodName, data, func) {
    var y = "";
    $.ajax({ type: "POST", url: "/CMSPages/JobTracking.asmx/" + methodName, data: data, contentType: "application/json; charset=utf-8", async: true, dataType: "json",

        success: function(x) {
            if (func) {
                func(x.d);
            }
            return false;
        },
        error: function(x) {
            alert(methodName + " Fehler:" + x.responseText);
        }
    });
    return false;
}


function Navigate(url)
{
    window.location.href = url;
}

