$(document).ready(function() { 
	
	//Alternates background-color of tables
	$('table.alternating tr:even').css('background-color','#f2f2f2');

	$("#giTable").tablesorter(); 
	
	
	//Sort giTable in alphanumeric order
	$("#giTableAlphaSort").click(function() { 
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero 
		var sorting = [[0,0]]; 
		
		// sort on the first column 
		$("#giTable").trigger("sorton",[sorting]); 
		
		$('table.alternating tr:even').css('background-color','#f2f2f2');
		$('table.alternating tr:odd').css('background-color','#FFFFFF');
		// return false to stop default link action 
		return false; 
	});    
	
	//Sort giTable in valueOrder
	$("#giTableValueSort").click(function() { 
		// set sorting column and direction, this will sort on the first and third column the column index starts at zero 
		var sorting = [[1,0]]; 
		
		// sort on the first column 
		$("#giTable").trigger("sorton",[sorting]); 
		
		$('table.alternating tr:even').css('background-color','#f2f2f2');
		$('table.alternating tr:odd').css('background-color','#FFFFFF');
		
		// return false to stop default link action 
		return false; 
	});    

});
