<!--
// ============================================================================
// Monta Titol
// ============================================================================
function montaTitol(nom) 
{
	i = nom.indexOf("»");
		i = i + 2;
	document.write(nom.substring(0, i));
}

// ============================================================================
// Monta Autor
// ============================================================================
function montaAutor(nom) 
{
	i = nom.indexOf("»");
	i = i + 2;
	document.write(nom.substring(i, 150));
}

// ============================================================================
// Monta Noms rel·lacionats amb l'obra 
// ============================================================================
function montaNoms(nom) 
{
	subtit=nom.toLowerCase();
	subtit=subtit.replace(/(à)/gi, "a");
	subtit=subtit.replace(/(á)/gi, "a");
	subtit=subtit.replace(/(è)/gi, "e");
	subtit=subtit.replace(/(é)/gi, "e");
	subtit=subtit.replace(/(í)/gi, "i");
	subtit=subtit.replace(/(ï)/gi, "i");
	subtit=subtit.replace(/(ò)/gi, "o");
	subtit=subtit.replace(/(ó)/gi, "o");
	subtit=subtit.replace(/(ú)/gi, "u");
	subtit=subtit.replace(/(ü)/gi, "u");
	subtit=subtit.replace(/(À)/gi, "a");
	subtit=subtit.replace(/(Á)/gi, "a");
	subtit=subtit.replace(/(È)/gi, "e");
	subtit=subtit.replace(/(É)/gi, "e");
	subtit=subtit.replace(/(Í)/gi, "i");
	subtit=subtit.replace(/(Ï)/gi, "i");
	subtit=subtit.replace(/(Ò)/gi, "o");
	subtit=subtit.replace(/(Ó)/gi, "o");
	subtit=subtit.replace(/(Ú)/gi, "u");
	subtit=subtit.replace(/(Ü)/gi, "u");
	subtit=subtit.replace(/(Ç)/gi, "c");
	subtit=subtit.replace(/(ç)/gi, "c");
	subtit=subtit.replace(/(Ñ)/gi, "n");
	subtit=subtit.replace(/(ñ)/gi, "n");
	subtit=subtit.replace(/( )/gi, "_");
	subtit=subtit.replace(/(')/gi, "_");
	subtit=subtit.replace(/(-)/gi, "_");
	subtit=subtit.replace(/(,)/gi, "");
	subtit=subtit.replace(/(")/gi, "");
	subtit=subtit.replace(/(¡)/gi, "");
	subtit=subtit.replace(/(!)/gi, "");
	return(subtit)
}

// ============================================================================
// Fitxa de l'obra
// ============================================================================
function fitxa(nom) 
{
	i = nom.indexOf("»");
	subtit = nom.substring(5, i);
	montaNoms(subtit)
	a = '"' + subtit + '.php">';
	document.write("<A href="+ a);
	document.write('<img alt="Fitxa de l´obra" src="images/botficha.gif" border="0" /></a>');
	document.write('<img height="1" alt="" src="images/vacio.gif" width="1" />'); 
}

function fitxainfo(nom) 
{
	i = nom.indexOf(" -");
	subtit = nom.substring(1, i);
	montaNoms(subtit)
	a = '"http://www.lluisoshorta.cat/teatre/' + subtit + '.php">';
	document.write("<A href="+ a);
	document.write('<img alt="Fitxa de l´obra" src="images/botficha.gif" border="0" /></a>');
	document.write('<img height="1" alt="" src="images/vacio.gif" width="1" />'); 
}

// ============================================================================
// Enviar Comentaris
// ============================================================================
function comentaris(nom) 
{
	a = "toni";
	b = "nerin.cat";
	i = document.title.indexOf("»");
//	i = i - 1;
	i = i + 1;
	t = document.title.substring(0, i);
	document.write("<a href='mailto:" + a + "@" + b + "?subject=" + t + "' />");
	document.write('<img alt="Enviar comentaris" src="images/botmail.gif" border="0" /></a>')
	document.write('<img height="1" alt="" src="images/vacio.gif" width="1" />')
}

// ============================================================================
// Pàgina Anterior
// ============================================================================
function anterior(nom) 
{
	t = nom.indexOf("»");
//	t = t - 1;
	i = nom.substring(0, 1);
	i = i -1;

if (1 <= i)
	{
		subtit = nom.substring(5, t) + "_" + i;
		montaNoms(subtit)
		a = '"' + subtit + '.php" />';
		document.write("<A href="+ a);
		document.write('<img alt="Anterior" src="images/botprev.gif" border="0" /></a>'); 
		document.write('<img height="1" alt="" src="images/vacio.gif" width="1" />'); 
	}
}

// ============================================================================
// Pàgina Seguent
// ============================================================================
function seguent(nom) 
{
	var i=0;
	t = nom.indexOf("»");
//	t -= 1;
	i = nom.substring(0, 1);
	ff = nom.substring(2, 3);
      i++;
	if (i <= ff)
	{
		subtit = nom.substring(5, t) + "_" + i;
		montaNoms(subtit)
		a = '"' + subtit + '.php">';
		document.write("<A href="+ a);
		document.write('<img alt="Següent" src="images/botnext.gif" alt="Seg&uuml;ent" width="13" border="0" /></A>') 
		document.write('<img height="1" src="images/vacio.gif" width="1" />') 
	}
}

// ============================================================================
// Monta Imatge de l'obra 
// ============================================================================
function montaImatge(nom) 
{
	i = nom.indexOf("»");
//	i = i - 1;
	titol=nom.substring(5, i);
	subtit=nom.substring(5, i);
	montaNoms(subtit)
	imatge='"images/' + subtit + '.jpg"' + 'alt="'+ titol + '" width="580" height="210" />';
	document.write("<img alt='Títol' src=" + imatge);
}

// ============================================================================
// Monta Imatge de l'obra 
// ============================================================================
function montaImatge2(nom) 
{
	i = nom.indexOf("»");
	titol=nom.substring(1, i);
	subtit=nom.substring(1, i);
	montaNoms(subtit)
	imatge='"images/' + subtit + '.jpg"' + 'alt="'+ titol + '" width="580" height="210" />';
	document.write("<img alt='Títol' src=" + imatge);
}

// ============================================================================
// Pàgina Seguent
// ============================================================================
function primeraPagina(nom) 
{
	i = nom.indexOf("»");
	subtit = nom.substring(1, i) + "_1";
	montaNoms(subtit)
	a = '"' + subtit + '.php">';
	document.write("<A href="+ a);
	document.write('<img alt="Següent" src="images/llibre.gif" alt="Veure obra" /></A>') 
}
//-->