function phShadow() {
	var spanList = document.getElementsByTagName("span");
	for(var i=0; i < spanList.length; i++) {
		if(spanList[i].className.match("mt-enclosure-image")){
			try{
				var imgTag = spanList[i].getElementsByTagName("img")[0];
				cssFloat(imgTag, "none");

				var inner = spanList[i].innerHTML;
				var shadow_base = document.createElement("div");
				var shadow_top = document.createElement("div");
				var shadow_left = document.createElement("div");
				var shadow_border = document.createElement("div");
				shadow_base.className = "shadow_base";
				shadow_top.className = "shadow_top";
				shadow_left.className = "shadow_left";
				shadow_border.className = "shadow_border";
				spanList[i].appendChild(shadow_base);
				shadow_base.appendChild(shadow_top);
				shadow_top.appendChild(shadow_left);
				shadow_left.appendChild(shadow_border);
				shadow_border.innerHTML = inner;
				spanList[i].removeChild(imgTag); 

				shadow_base.style.width = (imgTag.width + 8) + "px";
				if(imgTag.className.match("mt-image-center")){
					spanList[i].style.display = "block";
					shadow_base.style.marginRight = "auto";
					shadow_base.style.marginLeft = "auto";
				}else if(imgTag.className.match("mt-image-left")){
					cssFloat(spanList[i], "left");
					spanList[i].style.marginRight = "20px";
				}else if(imgTag.className.match("mt-image-right")) {
					l = 20;
					cssFloat(spanList[i], "right");
					spanList[i].style.marginLeft = "20px";
				}else if(imgTag.className.match("mt-image-none")) {
					spanList[i].style.clear = "both";
					shadow_base.style.clear = "both";
				}
				cssFloat(imgTag, "none");
			}catch(e){
			}
		}
	}
}

function cssFloat(obj, style)
{
	if(navigator.appName == "Microsoft Internet Explorer")
		obj.style.styleFloat = style;
	else
		obj.style.cssFloat = style;
}

if(window.addEventListener) {
	window.addEventListener("load", phShadow, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", phShadow);
}