services.subscriptions = function() {

	var baseUrl = "/ajax/subscriptions.aspx";
	var makeRequest = function(params, callback) {
		$.getJSON(baseUrl, params, callback);
	}

	return {
		addMember: function(memberId, callback) {
			makeRequest({ id: memberId, type: 6, add: true, url: encodeURIComponent(window.location.href) }, function(data) {
				callback(data);
			});
		},
		removeMember: function(memberId, callback) {
			makeRequest({ id: memberId, type: 6, remove: true, url: encodeURIComponent(window.location.href) }, function(data) {
				callback(data);
			});
		},
		addCategory: function(categoryId, callback) {
			makeRequest({ id: categoryId, type: 7, add: true, url: encodeURIComponent(window.location.href) }, function(data) {
				callback(data);
			});
		},
		removeCategory: function(categoryId, callback) {
			makeRequest({ id: categoryId, type: 7, remove: true, url: encodeURIComponent(window.location.href) }, function(data) {
				callback(data);
			});
		}
	}
}();



