var ventanaBusqueda = null;
var fotoAux1 = new Image();
function verFoto (urlFoto,idioma)
{
	var cont = "<html><head><title>Ver Foto</title></head>\n";
	cont += "<table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
	if(idioma == "eng"){
		cont += "<tr><td align=center>Loading image...</td>\n";
	}else if(idioma == "cat"){
		cont += "<tr><td align=center>Carregant imatge...</td>\n";
	}else{
		cont += "<tr><td align=center>Cargando imagen...</td>\n";
	}
	cont += "</tr></table>\n";
	cont += "</body></html>";
	openWindow ("", "ventanaFoto", 400, 400, "no", "no");
	ventanaBusqueda.document.open();
	ventanaBusqueda.document.write (cont);
	ventanaBusqueda.document.close();
	fotoAux1.onload=loadFoto;
	fotoAux1.src = urlFoto;
	fotoAux1.idioma = idioma;
}
function loadFoto ()
{
	var w = fotoAux1.width + 10;
	var h = fotoAux1.height + 29;
	if(fotoAux1.idioma == "eng"){
		var cont = "<html><head><title>View Photo</title></head>\n";
	}else if(fotoAux1.idioma == "cat"){
		var cont = "<html><head><title>Veure foto</title></head>\n";
	}else{
		var cont = "<html><head><title>Ver Foto</title></head>\n";
	}
	cont += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>";
	cont += "<img src=\"" + fotoAux1.src + "\" border=0></body></html>";
	ventanaBusqueda.resizeTo (w, h);
	ventanaBusqueda.moveTo (Math.round (screen.width / 2) - Math.round (w / 2), Math.round (screen.height / 2) - Math.round (h / 2));
	ventanaBusqueda.document.open();
	ventanaBusqueda.document.write (cont);
	ventanaBusqueda.document.close();
}
function openWindow (url, name, w, h, scrollbars, resizable)
{
	if (ventanaBusqueda && !ventanaBusqueda.closed)
		ventanaBusqueda.close();
	var left = Math.round (screen.width / 2) - Math.round (w / 2);
	var top = Math.round (screen.height / 2) - Math.round (h / 2);
	ventanaBusqueda = window.open (url, name, "top=" + top + ", left=" + left + ", width=" + w + ", height=" + h + ", scrollbars=" + scrollbars + ", resizable=" + resizable);
	ventanaBusqueda.focus();
}