function getRecentForumPosts(maxItems, categoryKey) {
	//default max items
	maxItems = maxItems || 10;

	//set the max age to match the SiteLife config in days
	var maxAge = 15;

	//create arrays of Sections and Categories
	var sections   = [ ];
	var categories = [ ];

	var parentKeys = categoryKey;		// Edited to make this universally usable
	// parent keys specify individual forums
	// var parentKeys = [ new ForumCategoryKey(categoryKey) ]; //this is how to limit to categories
	// var parentKeys = [ new ForumKey("Cat:SportsForum:9692"), new ForumKey("Cat:SportsForum:9687") ]; //this limits to forums

	//what do we want to discover?
	var activity = new Activity("Recent");
	var contentType = new ContentType("Discussion");

	//who from?
	var tiersToAllow = [];

	//create the request, add it to a batch, and dispatch
	var discoveryAction = new DiscoverContentAction(null, null,
		tiersToAllow, activity, contentType, maxAge, maxItems, false, parentKeys);

	var request = new RequestBatch();
	request.AddToRequest(discoveryAction);
	request.BeginRequest(daapiServerUrl, processRecentForumPosts);
}
function processRecentForumPosts(responseBatch) {
	//konsole.dir(responseBatch);
	var response;
	for (var respIdx = 0; respIdx < responseBatch.Responses.length; respIdx++) {
		response = responseBatch.Responses[respIdx];
		if (response.DiscoverContentAction) {
			displayRecentForumPosts( {
				items: response.DiscoverContentAction.DiscoveredContent
			} );
			break;
		}
	}
}
function displayRecentForumPosts(content) {
	var result = TrimPath.processDOMTemplate("recentForumPostTemplate", content);
	var outElem = document.getElementById("recentForumPostOutput");
	if (outElem != null) {
		if (outElem.length) outElem = outElem[0];
		//konsole.warn(result);
		outElem.innerHTML = result;
	}
}