jQuery(function(){
	

	
	jQuery('#gallery .e2g').cycle({ 
	    fx:      'fade', 
	    speed:    1300, 
	    timeout:  5000,
	    before: function(currSlideElement, nextSlideElement, options, forwardFlag){
			var imgHeight = jQuery(nextSlideElement).height();
			var imgContainerHeight = jQuery(nextSlideElement).parent().height();
			jQuery(nextSlideElement).css('top',imgContainerHeight-imgHeight);
			jQuery("#title").animate({opacity:0},1000);
		
			
		},
	    after: function(currSlideElement, nextSlideElement, options, forwardFlag){
		//	console.log(jQuery(nextSlideElement));
			jQuery(nextSlideElement).animate(
					{'top':0,},										
					options.timeout*1.5);
			jQuery("#title").stop().html(jQuery(nextSlideElement).attr('alt')).animate({opacity:1},2000);
		
		}	
	});	
	

	
})
