function receiveArguments()
{
	var recentFiles = null;
	var i;
	var menuItem = arguments[0];

	i=parseInt(menuItem);
	recentFiles = dw.getRecentFileList();
	dw.openDocument(recentFiles[i]);
}

function canAcceptCommand()
{
	var recentFiles = null;
	recentFiles = dw.getRecentFileList();
	return (recentFiles && recentFiles.length > 0 && arguments[0] != 'dummy');
}

function getDynamicContent(itemID)
{
	var recentFiles = null;
	var i=0;
	var separatorChar='/';

	recentFiles = new Array(4);
	var recentFilesList = dw.getRecentFileList();

	if (recentFilesList.length > 0)
	{
		for (i=0; i<recentFilesList.length; i++)
		{
			recentFiles[i] = new String(recentFilesList[i].substring(recentFilesList[i].lastIndexOf(separatorChar)+1));
			recentFiles[i] += ";id='"+i+"'";

			// if the filename contains an underscore, we need to put a % sign
			// in front of it so that it doesn't get removed.
			recentFiles[i] = recentFiles[i].replace(/_/g,"%_");
		}
		for (i=recentFilesList.length; i < 4; i++)
		{
			recentFiles[i] = new String(MENU_RecentFile);
			recentFiles[i] += ";id='dummy'";
		}
	}
	else 
	{
		for (i=0; i < recentFiles.length; i++)
		{
			recentFiles[i] = new String(MENU_RecentFile);
			recentFiles[i] += ";id='dummy'";
		}
	}
	// On windows, prefix the items with underscored numbers
	if (navigator.platform == "Win32")
	{
		for (i = 0; i < recentFiles.length; i++)
		{
			recentFiles[i] = "_"+(i+1)+" " + recentFiles[i];
		}
	}
	return recentFiles;
}
