$(document).ready(function() {
		jQuery.each($(".article-common .text img[class!='js-ignore']"), function(key, value) {
			var queryObj = jQuery(value);
			if (queryObj.attr("align")=="") {
				queryObj.wrap("<div class='box-image-center'></div>");
				if (queryObj.attr("alt")!='')
					queryObj.parent().append("<em>"+queryObj.attr("alt")+"</em>");
			}
		});

		jQuery.each($(".article-common .text img[align='left']"), function(key, value) {
			var queryObj = jQuery(value);
			if (queryObj.attr("alt")!="") {
				queryObj.wrap("<div class='box-image-left'></div>");
				queryObj.parent().width(queryObj.outerWidth()+16);
				queryObj.parent().append("<em>"+queryObj.attr("alt")+"</em>");
				queryObj.removeAttr("align");
			} else {
				queryObj.addClass("image-left");
			}
		});

		jQuery.each($(".article-common .text img[align='right']"), function(key, value) {
			var queryObj = jQuery(value);
			if (queryObj.attr("alt")!="") {
				queryObj.wrap("<div class='box-image-right'></div>");
				queryObj.parent().width(queryObj.outerWidth()+16);
				queryObj.parent().append("<em>"+queryObj.attr("alt")+"</em>");
				queryObj.removeAttr("align");
			} else {
				queryObj.addClass("image-right");
			}
		});
	}
)