Javascript version of AS2's Array.sortOn() method

I have an array of objects and I’m looking for a Javascript prototype (or something) that will work as nicely as AS2’s Array.sortOn() method, namely being able to pass it an array of object keys to sort and sub sort on, and a matching array of type of sort (ascending, descending, numeric, or a combo of those).

Current use in AS2 functionality test:

var totalArr:Array = [];

function addEntry(rating:Number, importance:Number) {
	totalArr.push({competency: competencyNum, total: (11 - rating) * importance, rating: rating , importance: importance});
	totalArr.sortOn(["total", "rating", "importance"], [Array.NUMERIC|Array.DESCENDING, Array.NUMERIC, Array.NUMERIC|Array.DESCENDING]);
}