/**
 * Causes each image with the class "verticalcenter" to be vertically centered within its respective grandparent element.
 */
$(window).load( function() {

	$(".verticalcenter").each( function() {

		//get the width of the grandparent  (the parent is an anchor tag - so go up one more level to get the container)
		var parent_height = $(this).parent().parent().height();

		//get the width of the image
		var image_height = $(this).height();

		//calculate how far from top the image should be
		var top_margin = Math.floor( (parent_height - image_height)/2 );

		//and change the margin-top css attribute of the image
		$(this).css( 'margin-top' , top_margin);

	} );

} );
