jQuery(function($){
	//for each description div...

var captionWidth = parseInt($("#captionWidth").val());
var captionHeight = parseInt($("#captionHeight").val());
var descriptionHeight = parseInt($("#descriptionHeight").val());

	$('div.description').each(function(){
		$(this).css('opacity', 0);
		$(this).css('width', $(this).siblings('img').width());
		$(this).css('width', captionWidth);
		$(this).css('height', captionHeight);
		$(this).css('vertical-align', 'middle');
		$(this).css('line-height', descriptionHeight + 'px');
		$(this).parent().css('width', $(this).siblings('img').width());
		$(this).css('display', 'block');
	});

	$('div.wrapper').hover(function(){
		$(this).children('.description').stop().fadeTo(500, 0.8);
	},function(){
		$(this).children('.description').stop().fadeTo(500, 0);
	});	
});
