/* message dictionary
	- these are the various messages which may be presented in confirm or alert dialogs
 */
 
function prepMessage(msg,project,run) { 
	// prepares messages by replacing dictionary-driven keywords with their current values
	var msg = (msg != null) ? msg : '';
	if(!msg.length) { return ''; }
	var project = (project != null) ? project : 'project';
	var run = (run != null) ? run : 'run';
	var projectupper = project.toUpperCase();
	var runupper = run.toUpperCase();
	
	msg = msg.replace(/project/g,project);
	msg = msg.replace(/PROJECT/g,projectupper);
	msg = msg.replace(/run/g,run);
	msg = msg.replace(/RUN/g,runupper);
	
	return msg;
}
 
var msgProjectPurgeRuns = 'PURGE PROJECT RUNS\n\nThis operation will:\n - delete previously parsed data for each run\n - delete previously fetched and stored source content for each run\n - delete any generated logs for each run\n\nThe project itself will be preserved.  This action cannot be undone.  Are you sure you wish to delete this project\'s previous runs?'; 
var msgProjectPurgeRunsHTML = '<span class="heavy">PURGE PROJECT RUNS</span><p>This operation will:</p><ul><li>delete previously parsed data for each run</li><li>delete previously fetched and stored source content for each run</li><li>delete any generated logs for each run</li></ul><p>The project itself will be preserved.  This action cannot be undone.  Are you sure you wish to delete this project\'s previous runs?</p>';

var msgProjectDelete = 'DELETE PROJECT\n\nThis operation will:\n - delete previously parsed data for each run\n - delete previously fetched and stored source content for each run\n - delete any generated logs for each run\n - delete the project\n\nThis action cannot be undone.  Are you sure you wish to delete this project?'; 
var msgProjectDeleteHTML = '<span class="heavy">DELETE PROJECT</span><p>This operation will:</p><ul><li>delete previously parsed data for each run</li><li>delete previously fetched and stored source content for each run</li><li>delete any generated logs for each run</li><li>delete the project</li></ul><p>This action cannot be undone.  Are you sure you wish to delete this project?</p>'; 

var msgProjectClone = 'CLONE PROJECT\n\nThis operation will:\n - allow a new project to be created using the current project\'s values as a starting point\n\nAre you sure you wish to clone this project?'; 
var msgProjectCloneHTML = '<span class="heavy">CLONE PROJECT</span><p>This operation will:</p><ul><li>allow a new project to be created using the current project\'s values as a starting point</li></ul><p>Are you sure you wish to clone this project?</p>'; 

var msgContinuePageRank = 'CONTINUE PAGERANK GATHERING\n\nThis operation will:\n - continue external PageRank gathering\n - no previously stored data will be deleted\n\nAre you sure you wish to continue?'; 
var msgContinuePageRankHTML = '<span class="heavy">CONTINUE PAGERANK GATHERING</span><p>This operation will:</p><ul><li>continue external PageRank gathering</li></ul><p>No previously stored data will be deleted.  Are you sure you wish to continue?</p>'; 

var msgRunReanalyze = 'RE-ANALYZE RUN\n\nThis operation will:\n - purge previous analysis data for this run\n - send the run to the analysis queue\n\nAre you sure you wish to continue?'; 
var msgRunReanalyzeHTML = '<span class="heavy">RE-ANALYZE RUN</span><p>This operation will:</p><ul><li>purge previous analysis data for this run</li><li>send the run to the analysis queue</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunReparse = 'REPARSE RUN\n\nThis operation will:\n - purge previously parsed data for this run\n - send the run to the parse queue\n\nStored source content on disk will not be affected.  Are you sure you wish to continue?'; 
var msgRunReparseHTML = '<span class="heavy">REPARSE RUN</span><p>This operation will:</p><ul><li>purge previously parsed data for this run</li><li>send the run to the parse queue</li></ul><p>Stored source content on disk will not be affected.  Are you sure you wish to continue?</p>'; 

var msgRunRerun = 'RERUN RUN\n\nThis operation will:\n - purge previously parsed data for this run\n - delete all stored source content from disk for this run\n - send the run to the fetch queue\n\nAre you sure you wish to continue?'; 
var msgRunRerunHTML = '<span class="heavy">RERUN RUN</span><p>This operation will:</p><ul><li>purge previously parsed data for this run</li><li>delete all stored source content from disk for this run</li><li>send the run to the fetch queue</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunReanalyzeAll = 'RE-ANALYZE ALL RUNS\n\nThis operation will:\n - purge previous analysis data for all runs\n - send all runs to the analysis queue\n\nAre you sure you wish to continue?'; 
var msgRunReanalyzeAllHTML = '<span class="heavy">RE-ANALYZE ALL RUNS</span><p>This operation will:</p><ul><li>purge previous analysis data for all runs</li><li>send all runs to the analysis queue</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunReparseAll = 'REPARSE ALL RUNS\n\nThis operation will:\n - purge previously parsed data for all runs\n - send all runs to the parse queue\n\nStored source content on disk will not be affected.  Are you sure you wish to continue?'; 
var msgRunReparseAllHTML = '<span class="heavy">REPARSE ALL RUNS</span><p>This operation will:</p><ul><li>purge previously parsed data for all runs</li><li>send all runs to the parse queue</li></ul><p>Stored source content on disk will not be affected.  Are you sure you wish to continue?</p>'; 

var msgRunRerunAll = 'RERUN ALL RUNS\n\nThis operation will:\n - purge previously parsed data for all runs\n - delete all stored source content from disk for all runs\n - send all runs to the fetch queue\n\nAre you sure you wish to continue?'; 
var msgRunRerunAllHTML = '<span class="heavy">RERUN ALL RUNS</span><p>This operation will:</p><ul><li>purge previously parsed data for all runs</li><li>delete all stored source content from disk for all runs</li><li>send all runs to the fetch queue</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunReaggregateAll = 'RE-AGGREGATE ALL RUN DATA\n\nThis operation will:\n - purge previous aggregate data for all runs\n - send all runs to the utility queue for re-aggregation\n\nAre you sure you wish to continue?'; 
var msgRunReaggregateAllHTML = '<span class="heavy">RE-AGGREGATE ALL RUN DATA</span><p>This operation will:</p><ul><li>purge previous aggregate data for all runs</li><li>send all runs to the utility queue for re-aggregation</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunReaggregateURIAll = 'RE-AGGREGATE ALL RUN / URI DATA\n\nThis operation will:\n - purge previous aggregate data for all runs and uris\n - send all runs to the utility queue for re-aggregation\n\nAre you sure you wish to continue?'; 
var msgRunReaggregateAllURIHTML = '<span class="heavy">RE-AGGREGATE ALL RUN / URI DATA</span><p>This operation will:</p><ul><li>purge previous aggregate data for all runs and uris</li><li>send all runs to the utility queue for re-aggregation</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgRunDelete = 'DELETE RUN\n\nThis operation will:\n - purge previously parsed data for this run\n - delete all stored source content from disk for this run\n - delete the run entry\n\nAre you sure you wish to continue?'; 
var msgRunDeleteHTML = '<span class="heavy">DELETE RUN</span><p>This operation will:</p><ul><li>purge previously parsed data for this run</li><li>delete all stored source content from disk for this run</li><li>delete the run entry</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgDBReindex = 'REINDEX DATABASE\n\nThis operation will:\n - reindex all tables in the database\n\nThis may take a few minutes.  Are you sure you wish to continue?'; 
var msgDBReindexHTML = '<span class="heavy">REINDEX DATABASE</span><p>This operation will:</p><ul><li>reindex all tables in the database</li></ul><p>This may take a few minutes.  Are you sure you wish to continue?</p>'; 

var msgAllPurgeRuns = 'PURGE ALL RUNS\n\nThis operation will:\n - delete previously parsed data for all runs\n - delete previously fetched and stored source content for all runs\n - delete any generated logs for all runs\n\nProjects will be preserved.  This action cannot be undone.  Are you sure you wish to continue?'; 
var msgAllPurgeRunsHTML = '<span class="heavy">PURGE ALL RUNS</span><p>This operation will:</p><ul><li>delete previously parsed data for all runs</li><li>delete previously fetched and stored source content for all runs</li><li>delete any generated logs for all runs</li></ul><p>Projects will be preserved.  This action cannot be undone.  Are you sure you wish to continue?</p>'; 

var msgAllPurgeData = 'PURGE ALL DATA\n\nThis operation will:\n - delete previously parsed data for all runs\n - delete previously fetched and stored source content for all runs\n - delete any generated logs for all runs\n - delete projects\n\nThis action effectively resets the entire database and cannot be undone.  Are you sure you wish to continue?'; 
var msgAllPurgeDataHTML = '<span class="heavy">PURGE ALL DATA</span><p>This operation will:</p><ul><li>delete previously parsed data for all runs</li><li>delete previously fetched and stored source content for all runs</li><li>delete any generated logs for all runs</li><li>delete projects</li></ul><p>This action effectively resets the entire database and cannot be undone.  Are you sure you wish to continue?</p>'; 

var msgPurgeCache = 'PURGE CACHE\n\nThis operation will:\n - purge all cached data from the memory cache\n\nAre you sure you wish to continue?'; 
var msgPurgeCacheHTML = '<span class="heavy">PURGE CACHE</span><p>This operation will:</p><ul><li>purge all cached data from the memory cache</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgPurgeFileCache = 'PURGE FILE CACHE\n\nThis operation will:\n - purge all cached data from the file cache\n\nAre you sure you wish to continue?'; 
var msgPurgeFileCacheHTML = '<span class="heavy">PURGE FILE CACHE</span><p>This operation will:</p><ul><li>purge all cached data from the file cache</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgResetLog = 'RESET LOG\n\nThis will purge the current log\'s contents.  Are you sure you wish to continue?'; 
var msgResetLogHTML = '<span class="heavy">RESET LOG</span><p>This will purge the current log\'s contents.</p><p>Are you sure you wish to continue?</p>'; 

var msgDeleteLog = 'DELETE LOG\n\nThis will delete the current log.  Are you sure you wish to continue?'; 
var msgDeleteLogHTML = '<span class="heavy">DELETE LOG</span><p>This will delete the current log.</p><p>Are you sure you wish to continue?</p>'; 

var msgPurgeReportCache = 'PURGE REPORT CACHE\n\nThis operation will:\n - purge all cached report data for this run allowing subsequent report requests to retrieve fresh data\n\nAre you sure you wish to continue?'; 
var msgPurgeReportCacheHTML = '<span class="heavy">PURGE REPORT CACHE</span><p>This operation will:</p><ul><li>purge all cached report data for this run allowing subsequent report requests to retrieve fresh data</li></ul><p>Are you sure you wish to continue?</p>'; 

var msgKillThread = 'KILL QUEUE THREAD\n\nThis operation will:\n - destroy and reinitialize the specified queue\'s monitoring thread.  Any job currently active in the queue will be lost.  Are you sure you wish to continue?'; 
var msgKillThreadHTML = '<span class="heavy">KILL QUEUE THREAD</span><p>This operation will:</p><ul><li>destroy and reinitialize the specified queue\'s monitoring thread</li></ul><p>Any job currently active in the queue will be lost.  Are you sure you wish to continue?</p>'; 

var msgRemoveFromQueue = 'REMOVE FROM QUEUE\n\nThis operation will:\n - remove the item from the queue.  Are you sure you wish to continue?'; 
var msgRemoveFromQueueHTML = '<span class="heavy">REMOVE FROM QUEUE</span><p>This operation will:</p><ul><li>remove the item from the queue</li></ul><p>Are you sure you wish to continue?</p>'; 