// JavaScript Document

// **** sostituisco tutte le immagini con un div
$(document).ready(function() {
	$(".myt img").each(function (s) {
		
		// 04/05/2011 se non ho impostato nessun alineamento (left,right) imposto il margin:auto sul DIV contenitore
		var stile = $(this).attr("style");
		var wrappo = "<div class='divimg' style='" + stile;
		if ((stile != undefined) && (stile.indexOf("left") < 0) && (stile.indexOf("right") < 0)) {wrappo += "margin:auto;"}
		wrappo += "'></div>";
		
		$(this).wrap(wrappo);
		//$(this).removeAttr("style");
		if ($(this).attr("alt") != "") {$(this).parent().append("<br>" + $(this).attr("alt")).height("auto");};
	});
});
