//____________________________________________________________
function TextPostProcessor(){
// adds necessarly classes and containers to images in the page to
// enable styling to work correctly with them
	
	//________________________________________________________
	this.execute = function(containerElement_htm){

		// extract images from element
		var images_arr	= containerElement_htm.getElementsByTagName('img');	
		for(var index=0; index<images_arr.length; index++){
			var currImg_htm	= images_arr[index];
			switch (currImg_htm.align){
				case 'middle':
					var container_htm		= document.createElement('div');
					container_htm.className	= 'imageContainer';
					currImg_htm				= currImg_htm.parentNode.replaceChild(container_htm,currImg_htm);
					container_htm.appendChild(currImg_htm);
					currImg_htm.className	= 'centeredImage';
					break;
				case 'left':
					currImg_htm.className	= 'leftImage';
					break;
				case 'right':
					currImg_htm.className	= 'rightImage';
					break;
			}
			currImg_htm.setAttribute('align','');
		}
	}; 
};	//________________________________________________________
//____________________________________________________________