﻿// Add service provider to users my revolution.
function AddToMyRev(url, desc, userID) {
	if (userID > 0) {
        RevOnline.Modules.MemberProfile.ProviderSvc.AddToMyRevolutions(url, desc, userID, AddToRevSuccess, AddToRevFailure);
	}
	else {
	    alert("You need to login before you can Add to My Revolution.");
	}
	
	return false;
}

// This is the callback function invoked if the Web service succeeded.
// It accepts the result object as a parameter.
function AddToRevSuccess(result, userContext, methodName)
{
    if (result == 1)
        alert("Page has been added to My Revolution in your profile.");
}

function AddToRevFailure(exception, userContext, methodName)
{
    //Ignore for now.
}

// Add service provider to users my revolution.
function SPAddToMyRev(svcProvID, userID) {
	if (userID > 0) {
        RevOnline.Modules.MemberProfile.ProviderSvc.AddSPToMyRevolutions(svcProvID, userID, SPAddToRevSuccess, SPAddToRevFailure, svcProvID);
	}
	else {
	    alert("You need to login before you can Add to My Revolution.");
	}
	
	return false;
}

// This is the callback function invoked if the Web service succeeded.
// It accepts the result object as a parameter.
function SPAddToRevSuccess(result, userContext, methodName)
{
    if (result == 1)
        alert("Service provider has been added to My Revolution in your profile.");
}

function SPAddToRevFailure(exception, userContext, methodName)
{
    //Ignore for now.
}

if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
