function populate(comboArray) {

	var output = "<table class='sortable' cellpadding='0' cellspacing='0' id='map-table'>";
	output += "<thead>";
	output += "<tr>";
	output += "<th width='7%'></th>";
	output += "<th width='10%'>Date</th>";
	output += "<th width='15%'>Location</th>";
	output += "<th width='15%'>Speaker</th>";
	output += "<th width='38%'>Type</th>";
	output += "<th width='15%'>Registration</th>";
	output += "</tr>";
	output += "</thead>";

	output += "<tbody>";

	for (var i = 0; i < comboArray.length; i++) {
		var splitValue = comboArray[i].split("||");

		var uri = (splitValue[4]) ? splitValue[4] : "";

		output += "<tr>";
		if(i < 9)
			output += "<td id='" + i + "'>" + "&nbsp;&nbsp;<span style='color:white;font-weight: bold;vertical-align:middle;'>" + (i + 1) + "&nbsp;</span></td>";
		else
			output += "<td id='" + i + "'>" + "&nbsp;<span style='color:white;font-weight: bold;vertical-align:baseline;'>" + (i + 1) + "&nbsp;</span></td>";
		output += "<td>" + splitValue[0] + "</td>";
		output += "<td>" + splitValue[1] + "</td>";
		output += "<td>" + splitValue[2] + "</td>";
		output += "<td>" + splitValue[3] + "</td>";
		output += "<td><a href='register.aspx" + uri + "'><img src='images/register-btn.jpg' alt='Register' width='99' height='22' border='0' /></a></td>";
		output += "</tr>";
	}

	output += "</tbody>";

	output += "<tfoot>";
	output += "<tr>";
	output += "<td colspan='6' class='footer'></td>";
	output += "</tr>";
	output += "</tfoot>";

	output += "</table>";

	document.getElementById("tableWrap").innerHTML = output;
	alternate('map-table');
	//sorttable.init();
	

	
}


function alternate(id) {
	if (document.getElementsByTagName) {
		var table = document.getElementById(id);
		var rows = table.getElementsByTagName("tr");
		var cols = table.getElementsByTagName("td");
		for (i = 0; i < rows.length; i++) {
			//manipulate rows 
			if (i % 2 == 0) {
				rows[i].className = "even";
			} else {
				rows[i].className = "odd";
			}
		}

		for (i = 0; i < cols.length; i++) {
			if (cols[i].id != "") {
				if (parseInt(cols[i].id) % 2 != 0) {
					cols[i].className = "tdMapHighlighted";
				}
				else {
					cols[i].className = "tdMap";
				}
			}
		}
	}
}

function test() {
	var array = new Array();
	array[0] = "02/14/2009 - 02/14/2009||Houston, TX||George Bush||Personal Finance";
	array[1] = "02/14/2009 - 02/14/2009||Houston, TX||George Bush||Personal Finance";

	populate(array);

}
