function showimage(imgfile,titulo,legtext,ancho,alto)
{
for (i=0;i<=3;i++){
	legtext=legtext.replace('Ã¡','á');
	legtext=legtext.replace('Ã©','e');
	legtext=legtext.replace('Ã­','í');
	legtext=legtext.replace('Ã³','ó');
	legtext=legtext.replace('Ãº','ú');
}

	var win = $("<div>");
	title = titulo;
titulo='<strong>'+titulo+'</strong>. ';
	var i = $("<img>").attr("src", imgfile).attr("style","float:left;margin:10px;padding: 10px;width:100%;height:auto;");
	var p = $("<p>").append(titulo).append(legtext.toString());
	p.prepend(i);
	win.append(p);
	$("body").append(win);

var winwidth = $(window).height() * 0.6 * ancho / alto;
if (winwidth > $(window).width() * 0.9) {
winwidth = $(window).width() * 0.9;
}
	win.dialog({
		show: { effect: "fade", duration: 400 },
		hide: { effect: "fade", duration: 400 },
		title: title,
		autoOpen: false,
		width: winwidth,
		maxWidth: $(window).width() * 0.9,
		maxHeight: $(window).height() * 0.9,
		position: "top",
	                buttons: [],
			close: function(event, ui){
				$(this).dialog('destroy').remove();
			}
	});
	win.dialog("open");
	if(this.complete) $(this).load();
}

