jQuery(document).ready( function() {
	var captify_selector = '#lw-recent-photos .captify';
	if (jQuery(captify_selector)[0]) {
		// the empty albums need to have a spacer image in them to make the alignment work and the
		// page layout work with captify. However unlike an album with photos the empty album
		// displays text rather than just the spacer. Because we don't know in advance how tall the
		// text will render in pixels, calculate the height at runtime for the size of the empty spacer
		// by taking the height of a full-size cover and subtracting the height of the text node.
		jQuery('.lw-empty-album-spacer').height((jQuery('img.captify').first().height() - jQuery('.lw-empty-album-text').first().height()));
		jQuery(captify_selector).captify(
			{
				// all of these options are... optional
				speedOver: 'fast',           // speed of the mouseover effect
				speedOut:  'normal',         // speed of the mouseout effect
				hideDelay:  500,             // how long to delay the hiding of the caption after mouseout (ms)
				animation: 'slide',          // 'fade', 'slide', 'always-on'
				prefix:    '',               // text/html to be placed at the beginning of every caption
				opacity:   '0.7',            // opacity of the caption on mouse over
				className: 'caption-bottom', // the name of the CSS class to apply to the caption box
				position:  'bottom',         // position of the caption (top or bottom)
				spanWidth: '100%'            // caption span % of the image
			}
		);
	}
});

