<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
$(function() {
	$.fn.sort_select_box = function(){
		var my_select = this; // the select list being sorted
		var my_selected = this.val(); // selected item(s), works for multi-select!
		var my_options = my_select.find('option');

		my_options.sort(function(a,b) {
			// convert strings to numbers with +<string> for numerical sorting,
			// but only when appropriate (otherwise would convert to "NaN"),
			// and convert strings to lowercase for proper alphabetical order
			myA = (isNaN(a.text)) ? a.text.toLowerCase() : +a.text;
			myB = (isNaN(b.text)) ? b.text.toLowerCase() : +b.text;

			// JavaScript .sort() voodoo 
			// first, sort numbers before strings
			if (isNaN(myA) && !isNaN(myB)) return 1;
			else if (!isNaN(myA) && isNaN(myB)) return -1;
			// if both are same type, sort as normal for that type
			else if (myA > myB) return 1;
			else if (myA < myB) return -1;
			else return 0;
		});

	   // Replace original options with sorted my_options;
	   my_select.empty().append( my_options );

	   // Re-select sorted elements
	   my_select.val(my_selected);
	}
	
	// Use $("select") to alphabetize all select lists on page
	// Or replace #testSelectContainer with container ID of your choice
	// to limit alphabetization to select lists within this element
	// $("#selectContainer select").each(function() {
	$("select").each(function() {
		$(this).sort_select_box();
	});
});
</script>