function escriureFoto (modif,fondo,marc,foto,text,autor) {
	var guion = '-'; 
	document.write('<body bgcolor="'+fondo+'" LINK="'+marc+'" VLINK="'+marc+'" ALINK="'+marc+'">');
	document.write('<center>');
	document.write('<STYLE TYPE="text/css">img { border-color:'+marc+'; } .tornar { font-size: 12pt; font-family: Courier New, Verdana, Arial, Helvetica, Geneva; text-decoration: none}</style>');
        if (text == "" || text == " ") { guion = ' ' }
	if  (screen.width > 800 || modif == 'n') { document.write('<img src="'+foto+'" border="1" alt="'+text+'"><br><font size="3" color="'+marc+'"><b>'+text+'</b>'+ guion +' foto:'+autor+'</font><br><a href="javascript:history.back()" class=tornar>&lt;&lt;&lt;&lt;&lt;</A>');}
					else { document.write('<img src="'+foto+'" border="1" height="85%" alt="'+text+'"><br><font size="3" color="'+marc+'"><b>'+text+'</b>'+ guion +' foto:'+autor+'</font><br><a href="javascript:history.back()" class=tornar>&lt;&lt;&lt;&lt;&lt;</A>'); }
	document.write('</center>');
	document.write('<br>');
	document.write('<div align=right>');
	document.write('<font color=silver size=2><b>1999-2005 &#169; copyright</b></font>');
	document.write('</body>');
	}
function calculs_ef (difAncho,difAlto) {
	if ( imatge_ef.height >= finestra_height ) { parametro = 'height="85%"'; }
	else { difAlto  = finestra_height - imatge_ef.height;
		if  ( difAlto < 100 ) { parametro = 'height="85%"'; }
		else  { parametro = ' '; }
	}
}
function showImageSize(theImage) {
	alert('height=' + theImage.height+
		'; width=' + theImage.width +
		'; hspace=' + theImage.hspace +
		'; vspace=' + theImage.vspace)
}
function fmodificacio () {
	var dateObj = new Date(document.lastModified), date, lmonth, fyear;
	var mes = dateObj.getMonth() + 1;
	var any = dateObj.getFullYear();
	if (any < 1990) { any = any + 100; }
	var dia = dateObj.getDate();
	modificacio = dia + '.' + mes + '.' + any;
}
function area_finestra () {
	var sfMax=0;
	var sf,frameMax;
	var ad=1;
	if (self.innerWidth) {
	finestra_width=self.innerWidth;
		finestra_height=self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientWidth) {
		finestra_width=document.documentElement.clientWidth;
		finestra_height=document.documentElement.clientHeight;
	} else if (document.body) {
		finestra_width=document.body.clientWidth;
		finestra_height=document.body.clientHeight;
	}
	if (document.layers||navigator.userAgent.toLowerCase().indexOf("gecko")>=0) finestra_width-=16;

	if ( top !=self || top.frames.length !=0 ) {
		ad=0;
		if (document.all) {
			sf=(top.document.body.clientWidth * top.document.body.clientHeight) / (self.document.body.clientWidth * self.document.body.clientHeight);
			if (sf<3) {
				ad=1;
			}
		} else {
			function getSurface(w) {
				if (!w.sf) w.sf=w.innerWidth * w.innerHeight;
				if (w.sf >=sfMax) { sfMax=w.sf; frameMax=w; }
			}
			function findFrameMax(w) {
				var i;
				if (w.frames.length==0) getSurface(w);
				else for (i=0; i < w.frames.length; i++) { if (w.frames[i].frames.length > 0) { findFrameMax(w.frames[i]); } else { getSurface(w.frames[i]); } }
			}
			if ((top !=self) || (top.frames.length==0)) {
				findFrameMax(top);
				if (frameMax==self) ad=1;
			}
		}
	}
}
function escLinks (clau) {
	var qLinks = 0;
	var nLinks = tLinks.length;
	var qlinea = 0;
	var lineaDetall = " ";
	var txt =new Array();
	txt = tLinks [qLinks].split("$");
	while (txt[0].indexOf (clau)) {
		qLinks++;
		if (qLinks<nLinks) {txt = tLinks[qLinks].split("$")} 
		else {return}
	}
	var qlinea = 0;
	txt = tLinks [qLinks].split("$");
	document.writeln ("<br>");
	document.writeln ("<table border=0 CELLPADDING=0 CELLSPACING=2>");
	document.writeln ("<tr><td>Enllaços:</td><td align=left>");
	document.writeln ("<table border=0 CELLPADDING=1 CELLSPACING=3>");
	while (qLinks < nLinks) {
		txt = tLinks [qLinks].split("$");
		if (txt [0] != clau) { break}
		if (txt [1] == "s" ) { 
			qlinea++;
			if  (qlinea == 1) {lineaDetall = "<tr>"};
			lineaDetall = lineaDetall + "<td align=left borderColor=sienna><a href='" + txt [2] + "'>" + txt [3] + "</a></td>";
			if  (qlinea == 5) {lineaDetall = lineaDetall + "</tr>";
					document.writeln (lineaDetall);
					qlinea = 0;
			}
		}
	qLinks++;
	};
	if  (qlinea > 0) {lineaDetall = lineaDetall + "</tr>";
			document.writeln (lineaDetall)
	}
	document.writeln ("</table>");
	document.writeln ("</td></tr></table>");
}
