$(document).ready(function(){
	$.ajax({
		type: "GET",
		url: "phpScriptTest/members_xml.php",
		dataType: "xml",
		success: function(xml){
			$(xml).find("rank").each(function(){
				var columnName;
				if ($(this).attr("index") < 5)
				{
					columnName = "leftCol";
				}
				else
				{
					columnName = "rightCol";
				}
				$("#memberList #"+columnName).append("<h3>" + $(this).attr("title") + "</h3>");
				if ($(this).find("member").length > 0 && $(this).find("member:first").attr("name") != "")
				{
					$(this).find("member").each(function(){
						$("#memberList #"+columnName).append("<br />&nbsp;&nbsp;" + $(this).attr("name"));
						//$("#memberList #"+columnName).append("<br /><span style='color: " + $(this).parent().attr('fontColor') +"'>" + $(this).attr("name") + "</span>");
					});
				}
				else
				{
					$("#memberList #"+columnName).append("<br />&nbsp;&nbsp;<i>There are currently no members of this rank</i>");
				}
			});
			/*$("#leftCol").append("<div id='specRankList'><h3>Specialty Ranks</h3></div>");
			$(xml).find("specialtyRank").each(function(){
				$("#specRankList").append("<h4>" + $(this).attr("title") + "</h4>");
				if ($(this).find("member").length > 0)
				{
					$(this).find("member").each(function(){
						$("#specRankList").append("<br />&nbsp;&nbsp;" + $(this).attr("name"));
						//$("#memberList #"+columnName).append("<br /><span style='color: " + $(this).parent().attr('fontColor') +"'>" + $(this).attr("name") + "</span>");
					});
				}
				else
				{
					$("#specRankList").append("<br />&nbsp;&nbsp;There are currently no members of this rank");
				}
			});*/
		},
		error: function(){
			$("#memberList").append("<p>There was an error during processing</p><h1>OMG IT'S GOING TO BLOW UP!!!!</h1>");
		}
	});
});
