// Función para abrir fotografía en ventana nueva redimensionada a tamaño de la imagen

var estilos = "/css/estilos.css"
var titulo = ""

var ventana
function imagen(cual)
{
if(ventana){ventana.close()}
	ventana=window. open('','ventana','resize=no,scrollbars=no,resizable=no')
	ventana.document.writeln ('<html>')
	ventana.document.writeln ('<head>')
	ventana.document.writeln ('<link href="' + estilos + '" rel="stylesheet" type="text/css">')
	ventana.document.writeln('<title>' + titulo + '</title></head>')
	ventana.document.writeln('<body style="overflow:hidden">')
	ventana.document.writeln('<img id="imagen" alt="pulsar para cerrar" src="' + cual + '" onLoad="opener.redimensionarventana(this.width, this.height)" onClick="window.close();" border="0">')
	ventana.document.writeln ('</body>')
	ventana.document.writeln ('</html>')
	ventana.document.close()
}
var cont

function redimensionarventana(ancho, alto)
{
	ventana.resizeTo(ancho+10,alto+29)
	ventana.moveTo((screen.width - ancho)/2,(screen.height - (alto+60))/2)
}

// Función para abrir ventana sin scroll

function ventana(cual,ancho,alto,barras) {
	window.open (cual, null, "width="+ancho+",height="+alto+",status=no,toolbar=no,menubar=no,location=no,resizable=no,titlebar=no,scrollbars="+barras);
}
