function generateMatrix(categoryId, elementId)
{
	$.getJSON('ajax/getJobMatrix?categoryId='+categoryId, function(data) {
		
		var s='';
		
		//render table header
		//TODO: make this dynamic...
		s+='<thead><tr><th></th><th>Management</th><th>Generalist</th><th>Specialist</th></tr></thead>';

		var cellclass = new Array("cell","cellAlternate");
		var rowCnt = 0;

		for(key in data)
			{
				var line = data[key];
				s+="<tr><td class=\"title\">"+line[1]+"</td>";
				s+="<td class=\""+cellclass[rowCnt++%2]+"\" onclick=\"document.location.href='"+renderLink(categoryId, line[0], 1, line[2])+"'\">"+line[2]+"</td>";
				s+="<td class=\""+cellclass[rowCnt++%2]+"\" onclick=\"document.location.href='"+renderLink(categoryId, line[0], 2, line[3])+"'\">"+line[3]+"</td>";
				s+="<td class=\""+cellclass[rowCnt++%2]+"\" onclick=\"document.location.href='"+renderLink(categoryId, line[0], 3, line[4])+"'\">"+line[4]+"</td>";
				s+="</tr>";
			}
		$('#'+elementId).html(s);
		$('#'+elementId).tableHover({rowClass: 'hoverrow', colClass: 'hover', headRows: true, footRows: true, headCols: true, footCols: true, cellClass: 'hovercell', ignoreCols: [1], ignoreRows: [1]});
	});



}
  
function renderLink(categoryId, industryId, position, content)
{
	return 'jspJobBrowse.htm#&categoryId='+categoryId+'&industryId='+industryId+'&positionId='+position;
}

