// JavaScript Document
/***********************************************
* QS-Switch script- by David Joynson, 10/16/09
*
* Function to read the query string and then pass 
* the parameters to the SwitchMenu function. This
* is a specific functional add-on for the SwitchMenu
* function. We only neede to 
*
***********************************************/

// Array to hold the query string parameters
var qsParm = new Array();

// Function to read the parameters and call the SwitchMenu function.
function qs() 
{
	// Variable to hold the query string
	var query = window.location.search.substring(1);
	// Variable array to hold the parameter as it is worked with. query split at the '&'.
	var parms = query.split('&');
	// Loop through the parameter array
	for (var i=0; i<parms.length; i++) 
	{
		// Find the index position of '='
		var pos = parms[i].indexOf('=');
		// If >0 then
		if (pos > 0) 
		{
			// Get the parameters (key & value) on either side of the '='
			var key = parms[i].substring(0,pos);
			var val = parms[i].substring(pos+1);
			// Assign the value to the key
			qsParm[key] = val;
		}
	}
	// If the 'menu' key and the 'name' key are not empty values call the SwitchMenu function.
	if (qsParm['menu'])// && qsParm['name'])
	{
		SwitchMenu(qsParm['menu']);//,qsParm['name']);
	}
} 
