$(document).ready(function()     
	{
		//$('.datatable table').tableHover();

		// add table sorter functionality to all tables, 
		// set all columns except name to false 
		$(".datatable table").tablesorter({
			sortList: [[0,0]], 
			headers: { 1:{sorter: false}, 2:{sorter: false}, 3:{sorter: false}, 4:{sorter: false}, 5:{sorter: false}, 6:{sorter: false}}
		});

		// show all sort images if js is used and add tooltips to their parent cells
		$(".sortimage").each(function() {
		    $(this).show();
		    $(this).parent().parent().attr('title', $(this).attr('title')).tooltip({showURL: false, delay: 0, top:0});
		});
		    
		// add toggle to switch between sort images
		// probably no more than 6 product tables, if there is add more
		//
		// move this into a loop to reduce code repetition
		$('#table1 .header').toggle(function(){$('#table1 .sortimage').attr('src','/img/sort-icon-up.png');}, function() {$('#table1 .sortimage').attr('src','/img/sort-icon-down.png');});
		
		// add tooltips apply to all images within #content .datatable
		$('#content .datatable img').tooltip({showURL: false, delay: 0, top:0});
			
	}
);
