/*  ******************
parseArgs()
The goal of this function is to parse the arguments coming from the 'command line', presented in a form such as http://sa.rochester.edu/index.html?TOC=true&TOCsrc=missions&page=missions.

The function is designed so that a user can specify any number of the three arguments; if any is not specified, a default is supplied.

It returns the results [if TOC is true or false, where the TOC is to be loaded from, and where the main page is to be loaded from] as an array.

-Jeremy Wolcott  6/04
******************  */

function parseArgs()
{
	returnVals = new Array();
	if ( (typeof(args['TOC']) == "undefined") || (args['TOC'] == "") )
	{
		returnVals['TOC'] = true;
		if ( typeof(args['TOCsrc']) == "undefined" || args['TOCsrc'] == "" )
			returnVals['TOCsrc'] = "main";
		else
			returnVals['TOCsrc'] = args['TOCsrc'];
	}
	else if (args['TOC'] == "false")
		returnVals['TOC'] = false;
	else if (args['TOC'] == "true")
	{
		returnVals['TOC'] = true;
		if ( typeof(args['TOCsrc']) == "undefined" || args['TOCsrc'] == "" )
			returnVals['TOCsrc'] = "main";
		else
			returnVals['TOCsrc'] = args['TOCsrc']
	}
	else
		alert("Error in Javascript file 'index.js'.  Please contact the webmaster.");
	
	if ( typeof(args['page']) == "undefined" || args['page'] == "")
		returnVals['mainSrc'] = "main";
	else
		returnVals['mainSrc'] = args['page'];
		
	return returnVals;	
}