$(document).ready(function() {
	$(".gallery .image a").each(function(i) {
		var authorBox = $(this).children(".author");
		var height = authorBox.height();
			
		authorBox.css({"height": "13px", "overflow": "hidden"});
			
		authorBox.hover(
			function() {
        		if ( height > 14 ) {
        			authorBox.css({"height": "auto", "overflow": "hidden"});
        		}
      		}, 
      		function () {
        		authorBox.css({"height": "13px", "overflow": "hidden"});
      		});
	});
	
	$('.image a').imgPreview({
	    containerID: 'imgPreviewWithStyles',
	    imgCSS: {
	        // Limit preview size:
	        height: 300
	    },
	    // When container is shown:
	    onShow: function(link){
	        $('<span>' + $(link).text() + '</span>').appendTo(this);
	    },
	    // When container hides: 
	    onHide: function(link){
	        $('span', this).remove();
	    }
	});
});       
