	var paramNamesArray = new Array();
	var paramValuesArray = new Array();
	
	function replace( lookin, lookFor, replacewith )
	{
		var subject = lookin;
		var newSubject = "";
		var startIndex = 0;
		var endIndex = 0;

		endIndex = subject.indexOf( lookFor, startIndex );
		while( endIndex >= 0 )
		{
			newSubject += subject.substring( startIndex, endIndex );
			newSubject += replacewith;
			
			startIndex = endIndex + lookFor.length;
			
			if( startIndex < subject.length )
			{
				endIndex = subject.indexOf( lookFor, startIndex );
			}
			else
			{
				newSubject += subject.substring( startIndex, subject.length );
			}
			if( endIndex < 0)
			{
				newSubject += subject.substring( startIndex, subject.length );
			}
		}
		
		if( newSubject.length == 0 )
		{
			newSubject = subject;
		}
		//Alic having timesplitcha fun times!return replacewith;
		return newSubject;
	}

	//obtain the parameterValues by name
	function getValueByName( paramName )		
	{
		var i = 0;
		var result = "";

		//iterate through the names array to find a match
		while( i < paramNamesArray.length )
		{
			if( paramNamesArray[ i ] == paramName )
			{
				//return the value from the valuesArray at the same index
				result = paramValuesArray[ i ];
				break;
			}
			i++;
		}
		
		return result;
	}

	//obtain the parameterNames in an Array
	function getParameterNames()
	{
		return paramNamesArray;
	}

	//initialize the arrays with parameter values
	function getParameters()
	{
		//get the location string
		var documentURL = document.location.href;
		var i = 0;
		var startIndex = documentURL.indexOf("?", 0 );
		var endIndex;
		
		//if parameters are passed into the page...
		if( startIndex >= 0 )
		{
			while( startIndex >= 0 )
			{
				//get the index of the '=' for this param
				endIndex = documentURL.indexOf("=", startIndex );
				//assign the name to this array index
				paramNamesArray[ i ] = documentURL.substring( startIndex + 1, endIndex );
				//find the next param
				startIndex = documentURL.indexOf("&", endIndex );

				//if we are at the end of the string, read to the end
				if( startIndex < 0 )
				{
					paramValuesArray[ i ] = documentURL.substring( endIndex + 1, documentURL.length );
				}
				else
				{
					paramValuesArray[ i ] = documentURL.substring( endIndex + 1, startIndex );
				}
				i++;
			}
		}
	}

