﻿
function jsonService_GatewayPodMoveUp(index, cb){
    MuchLoved.Web.UI.WebServices.JSONService.GatewayPodMoveUp(index, cb, jsonService_OnError, null);
};

function jsonService_GatewayPodMoveDown(index, cb){
    MuchLoved.Web.UI.WebServices.JSONService.GatewayPodMoveDown(index, cb, jsonService_OnError, null);
};

function jsonService_GatewayPodDelete(index, cb){
    MuchLoved.Web.UI.WebServices.JSONService.GatewayPodDelete(index, cb, jsonService_OnError, null);
};

function jsonService_GatewayPodNew(index, cb){
    MuchLoved.Web.UI.WebServices.JSONService.GatewayPodNew(index, cb, jsonService_OnError, null);
};

function jsonService_IsTributeNameAvailable(tributeName, cb){
    MuchLoved.Web.UI.WebServices.JSONService.IsTributeNameAvailable(tributeName, cb, jsonService_OnError, null);
};

function jsonService_IsTributeExists(tributeName, cb){
    MuchLoved.Web.UI.WebServices.JSONService.IsTributeExists(tributeName, cb, jsonService_OnError, null);
};

function jsonService_LoadTribute(tributeName, cb){
    MuchLoved.Web.UI.WebServices.JSONService.LoadTribute(tributeName, cb, jsonService_OnError, null);
};

function jsonService_LoadImageGroup(id, cb){
    MuchLoved.Web.UI.WebServices.JSONService.LoadImageGroup(id, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_SetVisibility(value, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_SetVisibility(value, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_UpdateText(heading, subHeading, shortDescription, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_UpdateText(heading, subHeading, shortDescription, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_GetCurrent(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_GetCurrent(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_UseFirstImageOnHomePage(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_UseFirstImageOnHomePage(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_UseImageFromLibrary(id, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_UseImageFromLibrary(id, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_RevertToDefault(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_RevertToDefault(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_CancelChanges(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_CancelChanges(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_CommitChanges(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_CommitChanges(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_CropAvatarImage(sourceImageID, size, x, y, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_CropAvatarImage(sourceImageID, size, x, y, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_GetSettings(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_GetSettings(cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_RemoveTribute(gardenID, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_RemoveTribute(gardenID, cb, jsonService_OnError, null);
};

function jsonService_GardenSettings_AddTribute(gardenID, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.GardenSettings_AddTribute(gardenID, cb, jsonService_OnError, null);
};

function jsonService_LoadGarden(path, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.LoadGarden(path, cb, jsonService_OnError, null);
};

var jsonService_IsGardenPathAvailableUrl = APP_ROOT + "WebServices/JSONService.asmx/IsGardenPathAvailable";
function jsonService_IsGardenPathAvailable(parentID, value, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.IsGardenPathAvailable(parentID, value, cb, jsonService_OnError, null);
};

function jsonService_LoadSearchInfo(tid, cb) {
    MuchLoved.Web.UI.WebServices.JSONService.LoadSearchInfo(tid, cb, jsonService_OnError, null);
};

function jsonService_ClearActiveAudioPlaylist(cb) {
    MuchLoved.Web.UI.WebServices.JSONService.ClearActiveAudioPlaylist(cb, jsonService_OnError, null);
};


function jsonService_OnError(ex) {
    if(true == IS_DEBUG){
        alert('Error in jsonService: ' + ex._message);
    };
    document.location.href = APP_ROOT + 'g_error.aspx';
};