function makeThumbs(classe) {
   
    var thumbW = jQuery("."+classe).width();
    var thumbH = jQuery("."+classe).height();
	
	/*alert('thumbW=' + thumbW + ' thumbH=' + thumbH);*/
	
	rappThumb = thumbW / thumbH;
    
    jQuery.each(jQuery("div."+classe+" img"), function(i) {
		
      rappImg = jQuery(this).width() / jQuery(this).height();									 
	  
	  if (rappImg > rappThumb) {
		  // Se il rapporto fra larghezza e altezza dell'immagine è maggiore del rapporto fra larghezza e altezza del thumbnail
		  // allora fisso l'altezza dell'immagine al valore dell'altezza del mio thumbnail e ricalcolo in proporzione la larghezza
		  newH = thumbH;
		  newW = Math.floor(newH * (jQuery(this).width() / jQuery(this).height()));
		  // Lo scostamento (riposizionamento) sara' in orizzontale
		  offsetX = Math.floor((newW - thumbW) / 2);
		  offsetY = 0;
	  } else {
		  // Se il rapporto fra larghezza e altezza dell'immagine è minore o uguale al rapporto fra larghezza e altezza del thumbnail
		  // allora fisso la larghezza dell'immagine al valore della larghezza del mio thumbnail e ricalcolo in proporzione l'altezza
		  newW = thumbW;
		  newH = Math.floor(newW * (jQuery(this).height() / jQuery(this).width()));
		  // Lo scostamento (riposizionamento) sara' in verticale
		  offsetX = 0;
		  offsetY= Math.floor((newH - thumbH) / 2);
	  } 
	  jQuery(this).css({ "position":"absolute", 
	                "width":  newW + "px", 
	                "height": newH + "px", 
	                "top":    "-" + offsetY + "px", 
	                "left":   "-" + offsetX + "px" });
    });

}
