function popUp(pagina, nom, ample, alt, altresFeatures) {
	if (parseInt(navigator.appVersion)>=4)  {
		offset_x = (screen.width - ample) / 2;  
		offset_y = (screen.height - alt) / 2 - 40;
	}
	else {
	    offset_x = 50;
		offset_y = 50;
	}
	altresFeatures += ",height="+alt+",width="+ample+",top="+offset_y+",left="+offset_x;
	handle=window.open(pagina, nom, altresFeatures);
	handle.focus();
}

function veure_foto(pic_url, finestra, width, height, title) {
		handle = popUp('', finestra, width, height, 'resizable=no');
		msg_left = parseInt(width/2)-30; msg_top = parseInt(height/2)-18;
		handle.document.write("<html><head><div style='position:absolute;left:" + msg_left + "px;top:" + msg_top + "px;'><b><font face=Verdana,Arial size=2>Loading...</font></b></div><title>" + title + "</title></head><body scroll=no leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onLoad='self.focus()'><div style='position:absolute;top:0px;left:0px;'><img src=" + pic_url + " border=0 width=" + width + " height=" + height + "></div><br></body></html>");
		handle.document.close();
}
