function PopUp(imagenSrc){
	foto1 = new Image();
	foto1.src = (imagenSrc);
	Control(imagenSrc);
}
function Control(img){
	if((foto1.width!=0)&&(foto1.height!=0)){
		verFoto(img);
	}
	else{
		funcion="Control('"+img+"')";
		intervalo=setTimeout(funcion,20);
	}
}
function verFoto(img){
	ancho = foto1.width + 30;
	alto = foto1.height + 70;
	/*alert('width: '+foto1.width);
	alert('height: '+foto1.height);
	alert('ancho: '+ancho);
	*/
	//si la imagen es mas grande que la pantalla.
	if (ancho > screen.width){
		ancho = screen.width - 10;
	}
	if (alto > screen.height){
		alto = screen.height - 10;
	}
	
	cadena = "width="+ancho+",height="+alto;
	ventana = window.open(img,"ventana",cadena);
	ventana.resizeTo(ancho,alto)
	//tara centrar
	x = (screen.width - ancho) / 2;
	y = (screen.height - alto) / 2;
	ventana.moveTo(x, y); 

	ventana.focus( );
}
