	/*
	____________________________________________________________________
	
	//WHAT:		BUBBLE SORT FUNCTIONS.
	//WHEN:		DECEMBER, 20 2001
	//WHO:		CURTIS JACKSON
	//REQUIRED: TO BE INCLUDED WITH "sideNavLogic.js" TO DIPLAY NAVIGATION.
	//COMMENTS: NONE.
	//HISTORY:  NONE.
	____________________________________________________________________
	*/

	//BUBBLE SORT FUNCTION:
	function bubbleSort(inputArray)
	{
		for (var i = inputArray.length - 1; i >= 0;  i--)
		{
			for (var j = 0; j <= i; j++)
			{
				if (inputArray[j+1] < inputArray[j]) 
				{
					var tempValue = inputArray[j];
					inputArray[j] = inputArray[j+1];
					inputArray[j+1] = tempValue;
				}				
			}
		}
		return inputArray;
	}
	
	//BUBBLE SORT FUNCTION WITH ENHANCEMENT TO SORT A MULTI-DIMENSIONAL ARRAY BY A SPECIFIC ELEMENT:
	function bubbleSortIndex(inputArray, index)
	{
		for (var i = inputArray.length - 1; i >= 0;  i--)
		{
			for (var j = 0; j < i; j++)
			{
				if (inputArray[j+1][index] < inputArray[j][index]) 
				{
					var tempValue = inputArray[j];
					inputArray[j] = inputArray[j+1];
					inputArray[j+1] = tempValue;
				}				
			}
		}
		return inputArray;
	}	