// JavaScript Document
function sortDate() {
	var rows = [];
	
	$("#listSort li").each(function(){
		rows[rows.length] = [$(this).find("span.date").html().toLowerCase(),this];
		$(this).find("span.date").show();
	});
	
	rows.sort(function(a,b){
		if (a[0] < b[0]) {
		return -1
		} else if (a[0] > b[0]) {
		return 1
		} else {
		return 0;
		}
	});
	
	$.each(rows, function() {
		this[1].parentNode.appendChild(this[1]);
	});
}

function sortAlpha() {
	var rows = [];
	
	$("#listSort li").each(function(){
		rows[rows.length] = [$(this).find("span.lastName").html().toLowerCase(),this];
		$(this).find("span.date").hide();
	});
	
	rows.sort(function(a,b){
		if (a[0] < b[0]) {
		return -1
		} else if (a[0] > b[0]) {
		return 1
		} else {
		return 0;
		}
	});
	
	$.each(rows, function() {
		this[1].parentNode.appendChild(this[1]);
	});
}

