function imagesLoaded($selector){

	var maxHeight = 0;

	jQuery.each($selector.find('img'), function(i, obj) {
		if ( jQuery(obj).height() > maxHeight ) {
			maxHeight = jQuery(obj).height();
		}
	});

	if (maxHeight > 0) {
		jQuery($selector).height(maxHeight + 10).css('overflow','hidden');
	}

	jQuery($selector).cycle({
		fx: 'fade',
		speed: 2500,
		height: maxHeight
	});

}

jQuery(document).ready(function(){

	if ( typeof jQuery('.product-image') != 'undefined' ) {
		jQuery('.product-image').onImagesLoad({
			selectorCallback: imagesLoaded
		});
	}

});

