roundedImages = function() {
	var content = document.getElementById('content');
	var imgs = content.getElementsByTagName('img');
 
	for (var i = 0; i < imgs.length; i++) {         // start loop
 
		if(imgs[i].className == "rounded"){ 

			var wrapper = document.createElement('div');  // Create the outer-most div (wrapper)
			wrapper.className = 'wrapper';                // Give it a classname - wrapper
			wrapper.style.width = imgs[i].width+'px';     // give wrapper the same width as the current img
			var original = imgs[i];                       // take the next image  
			/* Swap out the original img with our wrapper div (we'll put it back later) */
			if(original.parentNode.tagName.toUpperCase()=='A') original = original.parentNode; // if you link the image this will help the script find the right parent wrapper
			original.parentNode.replaceChild(wrapper, original);
			// IE crash fix - c/o Joshua Paine - http://fairsky.us/home
				
				
			/* Create the two other inner nodes and give them classnames */
			var tl = document.createElement('div');
			tl.className = 'tl';
			var bl = document.createElement('div');
			bl.className = 'bl';
			var tr = document.createElement('div');
			tr.className = 'tr';
			var br = document.createElement('div');
			br.className = 'br';
			/* Glue the nodes back inside the wrapper */
			wrapper.appendChild(tl);
			wrapper.appendChild(tr);
			wrapper.appendChild(br);
			wrapper.appendChild(bl);
			/* And glue the img back in after the DIVs */
			
			wrapper.appendChild(original);
		}
	}
}
/* Run the function once the page has loaded: */
addLoadEvent(roundedImages);