
$(window).load(function () {
	$('.heatmap').each(function(){
		//find the maximum
		var mx=1;
		$(this).find('td').each(function() {
    		if(parseFloat($(this).text()) > mx){
				mx=parseFloat($(this).text());
			}
  		});
		
		$(this).find('td').each(function(){
			var fract = parseFloat($(this).text()) / mx;
			$(this).css({
      			'background-color' : '#C2017B',
				'color' : '#fff',
      			'filter' : 'alpha(opacity=' + (fract*100) + ')',
  				'opacity' : fract,
    		});
		}); // end each td
		
	}); //end each heatmap
});



