/*
 * 
 */
Event.observe(window, 'load', appendAltCaptionToImages, false);
function appendAltCaptionToImages() {
    var res = $A(document.getElementsByClassName("(nresumen|ndesarrollo)"));
    res.each(function(r) {
        var nodes = $A(r.getElementsByTagName("img"));
        nodes.each(function(node){

	    if (node.alt) {
   		new Insertion.Before(node,'<table class="imagen" '
                   + ((node.align)? 'style="float:'+node.align+'; clear:'+node.align+';" align="'+node.align+'" ': '')
                   + '>'
                   +'<caption align="bottom">'+ node.alt + '</caption>'
                   +'<tr><td>'
                   + '<img src="' + node.src + '"'
                   + ' alt="' + node.alt + '"'
                   + ">"
                   +'</td></tr></table>');
		Element.remove(node);
            }

/*
            var style = "float: " + node.align;
            new Insertion.Before(node,'<table class="imagen" style="' + style + '; clear:'+ node.align +';" align="' + node.align + '" >'
		   +'<caption align="bottom">'+ node.alt + '</caption>'
		   +'<tr><td>'
                   + '<img src="' + node.src + '"'
                   + ((node.alt) ? ' alt="' + node.alt + '"': "")
                   + ">"
                   +'</td></tr></table>');


                    '<div style="' + style + '" align="' + node.align + '">'
                    + '<img src="' + node.src + '"'
		    + ((node.alt) ? ' alt="' + node.alt + '"': "")
		    + ">"
                    + '<div class="imcaption">'+ node.alt + '</div>'
		    + '</div>'); 
            Element.remove(node);


*/
	    });       
    });
    
}
