jQuery.fn.setMaxWidth=function(additional)
{
	if(isNaN(additional)) additional=0;

	var maxWidth=0;
	this.each(function(){
		var itemWidth=$(this).width();
		if(itemWidth>maxWidth) maxWidth=itemWidth;
	});
	this.width(maxWidth+additional);
	
	return this;
}

jQuery.fn.setMaxHeight=function(additional)
{
	if(isNaN(additional)) additional=0;

	var maxHeight=0;
	this.each(function(){
		var itemHeight=$(this).height();
		if(itemHeight>maxHeight) maxHeight=itemHeight;
	});
	this.height(maxHeight+additional);
	
	return this;
}

jQuery.fn.horizontalCenter=function()
{
	this.each(function(){
		var $parent=$(this).parent();
		var size=($parent.width()-$(this).width())/2;
		$parent.css('position','relative');
		$(this)
			.css('position','relative')
			.css('left',size+'px')
		;
	})
	
	return this;
}

jQuery.fn.verticalCenter=function()
{
	this.each(function(){
		var $parent=$(this).parent();
		var size=($parent.height()-$(this).height())/2;
		$parent.css('position','relative');
		$(this)
			.css('position','relative')
			.css('top',size+'px')
		;
	})
	
	return this;
}

