var titulopordefecto = "PopUp"; 
var ventana;
var cont=0;

function popup(cual,titulo)
{
if(cont==1){ventana.close();ventana=null}
if(titulo==null){titulo=titulopordefecto}
ventana=window.open('','ventana','status=no,scrollbars=no')
ventana.document.write('<html><head><title>' + titulo + '</title></head><body style="overflow:hidden" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" scroll="no" ><img src="' + cual + '" onLoad="opener.redimensionar(this.width, this.height)">');
ventana.focus();
ventana.document.close();
cont++;
}
function redimensionar(ancho, alto)
{
ventana.resizeTo(ancho+15,alto+58);
//ventana.moveTo((screen.width-ancho)/2,(screen.height-alto)/2); //centra la ventana. Eliminar si no se quiere centrar el popup
}

