Event.observe(document,'dom:loaded',function() {
	$$('.textWithPosition').each(function(e) {
		var id = e.id.substring(17);
		var innerDiv = $('textWithPositionInnerDiv_'+id); 
		if (innerDiv.getHeight() < e.getHeight() - 10) {
			if (e.hasClassName('textWithPositionMiddle')) {
				innerDiv.setStyle({
					'top': Math.round((e.getHeight()-innerDiv.getHeight()) / 2) +'px' 
				});
			} else if (e.hasClassName('textWithPositionBottom')) {
				innerDiv.setStyle({
					'top': e.getHeight()-innerDiv.getHeight()-5 +'px' 
				});
			}
		}
	});
});