
var oImageCaptions = {
	init : function(){
		var a = document.getElementsByTagName("img");
		var sExp = /\bcaption/gi;
		for(var i=0, j=a.length; i<j; i++){
			if(a[i].getAttribute("alt"))
				if(a[i].getAttribute("alt").match(sExp)){
					this.captionify(i);
				};
		};
	},
	
	captionify : function(n){
		var oImage = document.getElementsByTagName("img")[n];
		var o = document.createElement("div");
		o.className = "imageCaption " + oImage.className;
		oImage.className = "";
		o.style.width = oImage.offsetWidth + "px";
		var p = document.createElement("p");
		p.appendChild(document.createTextNode(oImage.getAttribute("alt").replace(/caption:/gi, "")));
		oImage.parentNode.insertBefore(o, oImage);
		o.appendChild(p);
		o = p = null;
		oImage.previousSibling.insertBefore(oImage, oImage.previousSibling.firstChild);
		oImage.setAttribute("alt", oImage.getAttribute("alt").replace(/caption:\s?/gi, ""))
		oImage.setAttribute("title", oImage.getAttribute("alt").replace(/caption:\s?/gi, ""))
	}
}


indicoAddLoad(
	function(){
		oImageCaptions.init();
	}
);
document.write("<style>\n");
document.write("div.imgRight {\n");
document.write("	float:right !important;\n");
document.write("	padding:0 0 .3em 10px;\n");
document.write("}\n");
document.write("div.imgLeft {\n");
document.write("	float:left;\n");
document.write("	padding:0 10px .3em 0;\n");
document.write("}\n");
document.write("div.imageCaption p {\n");
document.write("	margin:.5em 0;\n");
document.write("	font-size:80%;\n");
document.write("	color:#69939E;\n");
document.write("}\n");
document.write("</style>\n");