I have a multi level array.
I want to remove duplicates from the array and then sort it.
Problem is I want to do this to different columns of the array at different times.
So, first time I sort by workinstructure[i][0] and remove any duplicates in [i][0], next time I need to do the same but for column [i][3]

Code:
	//create copy of the array to work with	
	var workingstructure = structure;

	//initialise
	if (document.getElementById) {
	document.getElementById("Division").disabled=true;
	document.getElementById("DivisionalLevels").disabled=true;
	document.getElementById("BusUnitLevels").disabled=true;
	document.getElementById("RegionalLevels").disabled=true;
	document.getElementById("CostCentreLevels").disabled=true;
	}

	//sort the array, remove duplicates, etc.
	workingstructure.sort; //i actually need to sort by different columns here, in this example it's [i][0] of the array
	//for (i = 0; i < workingstructure.length; i++) {
	//	if (workingstructure[i][0] == some duplicate check here) {
	//		workingstructure.splice(i);
	//	}
	//}

	//fill with data from the copy javascript array
	for (i = 0; i < workingstructure.length; i++) {
		var optn = document.createElement("OPTION");
		optn.text = workingstructure[i][1];
		optn.value = workingstructure[i][0];
		document.getElementById("Division").options.add(optn);
	}

	//destroy the array
	workingstructure = null;