Yeah, you have a point there, passing in the index doesn't make much sense, so what would be better again is:
```javascript
window.filter = {
	classPick: "All",
	racePick: "All",
	...
};

function filterSelect(selectId) {
	var select = document.getElementById(selectId);
	if (select.selectedIndex == -1)
		window.filter[selectId] = "All";
	else
		window.filter[selectId] = select.options[select.selectedIndex].value;
	applyFilter();
}
```
That way you only have to pass in the select id (which you have available in the php function since it sets it), and the id has to be unique anyway, so using it as the key isn't a problem.  You could also call it as `onchange="filterSelect(event)"` and then get the id from the event object, but it'd require handling the difference in event objects between browsers (not necessary to use the event, but it's an option)

The reason I prefer this is you can then only have the code in one place, which means that you only have to fix it in one place (trust me it's not fun fixing a bug for the 4th time because code was copy/pasted everywhere and you didn't find all the places it needed changing - I had that happen a few times with the SMR code when I first took over)