﻿function Report(entityType, entityId, reasonMessage, entityUrl, language) {
    Dvoted.CMS.Services.AjaxScriptService.Report(entityType, entityId, reasonMessage, entityUrl, language, Report_Callback);
}

function Report_Callback(result) {
    if (result) {
        confirmation(result);
    }
    else {
        confirmation("System error - Please try again later");
    }
}

function Rate(entityType, entityId, language) {
    Dvoted.CMS.Services.AjaxScriptService.Rate(entityType, entityId, language, Rate_Callback);
}

function Rate_Callback(result) {
    if (result) {
        confirmation(result);
    }
    else {
        confirmation("System error - Please try again later");
    }
}

function Favorite(entityType, entityId, language) {
    Dvoted.CMS.Services.AjaxScriptService.Favorite(entityType, entityId, language, Favorite_Callback);
}

function Favorite_Callback(result) {
    if (result) {
        confirmation(result);
    }
    else {
        confirmation("System error - Please try again later");
    }
}

function RemoveFavorite(entityType, entityId) {
    Dvoted.CMS.Services.AjaxScriptService.RemoveFavorite(entityType, entityId, RemoveFavorite_Callback);
}

function RemoveFavorite_Callback(result) {
    if (result) {
        confirmation(result);
    }
    else {
        confirmation("System error - Please try again later");
    }
}
