$(document).ready(function(){
	
	//~ $('.ciclo_immagini_home').load(function() {
		//~ var maxWidth = 320; // Larghezza massima delle immagini
		//~ var maxHeight = 290;    // Altezza massima delle immagini
		//~ var ratio = 0;  // Rapporto di grandezza
		//~ var width = $(this).width();    // Larghezza dell'immagine ricavata in automatico
		//~ var height = $(this).height();  // Altezza dell'immagine presa in automatico
//~ 
	//~ 
//~ 
		//~ alert('maxWidth: '+maxWidth+' maxHeight: '+maxHeight+' ratio: '+ratio+' width: '+width+' height: '+height);
		//~ // Controllo se la larghezza è superiore al massimo impostato
		//~ if(width > maxWidth){
			//~ ratio = height/width;
			//~ $(this).css("width", maxWidth); // imposto la nuova larghezza
			//~ $(this).css("height", maxWidth * ratio);  // Scalo l'immagine in base al rapporto
			//~ //height = height * ratio;    // Imposto l'altezza dell'immagine in base alla nuova larghezza ed al rapporto di grandezza
		//~ alert('x: '+$(this).width()+' y: '+$(this).height());
		//~ }
		//~ 
		//~ width = $(this).width();
		//~ height = $(this).height();
		//~ 
		//~ // Controllo se l'altezza è superiore al massimo consentito
		//~ if(height > maxHeight){
			//~ ratio = width/height;
			//~ $(this).css("height", maxHeight);   // imposto la nuova altezza
			//~ $(this).css("width", maxHeight * ratio);    // imposto la nuova larghezza basata sul rapporto di grandezza
			//~ //width = width * ratio;    // Reimposto la larghezza in basse all'immagine scalata
		//~ alert('x: '+$(this).width()+' y: '+$(this).height());
		//~ }
	//~ 
	//~ 
	//~ });
	//~ 
	$('#ciclo_macchine_nuove').cycle({
		fx:    'fade', 
		speed:  2500,
		timeout:  5000,
		fit: 1,
		width: 320
	});
	
	$('#loghi').cycle({
		fx:    'scrollLeft', 
		speed:  2500,
		timeout:  5000
	});
	
});

