////////////////////(c) 2011 - Maurici Carbó Jordi /////////////////////////////// 
//////////////////////////////////////////////////////////////////////////////////
////////////////Comentaris i consultes: maurici@nummolt.com //////////////////////
////////////////////http://www.nummolt.com////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////

function getNodeText(xmlNode)  
{  
  if(!xmlNode) return '';  
  if(typeof(xmlNode.textContent) != "undefined") return xmlNode.textContent;  
  return xmlNode.firstChild.nodeValue;  
}  

function opt(id,text)
{
this.m_id=id;
this.m_text=text;
}

var bibop=[];
bibop[0]=new opt(0,"Tots els llibres");
bibop[1]=new opt(1,"Llibres per adults");
bibop[2]=new opt(2,"Llibres per a joves");
bibop[3]=new opt(3,"&Agrave;lbums de c&ograve;mic");
bibop[4]=new opt(4,"Llibres col&middot;lectius");
bibop[5]=new opt(5,"Pr&ograve;legs");
bibop[6]=new opt(6,"Narracions");
bibop[7]=new opt(7,"Contes");	
bibop[8]=new opt(8,"Guions de c&ograve;mic");
bibop[9]=new opt(9,"Divulgaci&oacute;");
bibop[10]=new opt(10,"Comentaris de llibres");
bibop[11]=new opt(11,"Entrevistes");
bibop[12]=new opt(12,"Articles");
bibop[13]=new opt(13,"Diversos");

var linkop=[];
linkop[0]=new opt(0,"P&agrave;gina de l'AELC");
linkop[1]=new opt(1,"P&agrave;gina de Lletra");

function clic_vincle(lligam)
{
	window.open(lligam);
}

function pagestate()
{
this.m_state=0;
this.m_state2=0;
this.m_bibliopcions=false;
this.m_vinclopcions=false;
this.m_act_bibliopcions=false;
this.m_act_vinclopcions=false;
this.m_des_bibliopcions=false;
this.m_des_vinclopcions=false;

this.p_getstate=function(){return this.m_state;};
this.p_setstate=function(a){
	this.m_state=a;
	var llista =[];
	llista=document.getElementsByTagName('li');
	for(var x=0; x<llista.length;x++)
	{
		llista[x].firstChild.className="m_Out";
	}
	};
	
	this.p_estirar=function(n){
	switch (n)
	{
	case 5: 
		var adesplegar=document.getElementById("bibliopcions");
		var subllista=document.createElement("ul");
		var llisteta="";
		for (var x=0;x<bibop.length;x++)
			{
			llisteta +="<li class=indexid_2>";
			llisteta +="<span onmousedown= clic_bibliografia2(this,"+ x +") onmouseover=hover_over2(this," + x +") onmouseout=hover_out2(this," + x +")>";
			llisteta += bibop[x].m_text + "</span>";
			llisteta +="</li>";
			}
		subllista.innerHTML=llisteta;
		adesplegar.appendChild(subllista);
//		alert ("estirar: "+ n + " bibop: length:" + bibop.length);	
		break;
	case 7: 
		var adesplegar=document.getElementById("vinclopcions");
		var subllista=document.createElement("ul");
		var llisteta="";
		llisteta +="<li class=indexid_2>";
		llisteta +="<span onmousedown= clic_vincle('http://www.joaquimcarbo.net/indexOld.html') onmouseover=hover_over(this,0) onmouseout=hover_out(this,0)>";
		llisteta += "Antiga p&agrave;gina";
		llisteta +="</span> </li>";
		llisteta +="<li class=indexid_2>";
		llisteta +="<span onmousedown= clic_vincle('http://www.escriptors.cat/autors/carboj/') onmouseover=hover_over(this,0) onmouseout=hover_out(this,0)>";
		llisteta += "P&agrave;gina de l'AELC";
		llisteta +="</span> </li>";
		llisteta +="<li class=indexid_2>";
		llisteta +="<span onmousedown= clic_vincle('http://ca.wikipedia.org/wiki/Joaquim_Carb%C3%B3_i_Masllorens') onmouseover=hover_over(this,0) onmouseout=hover_out(this,0)>";
		llisteta += "Wikip&egrave;dia";
		llisteta +="</span> </li>";		
		llisteta +="<li class=indexid_2>";
		llisteta +="<span onmousedown= clic_vincle('http://lletra.uoc.edu/ca/autor/joaquim-carbo') onmouseover=hover_over(this,0) onmouseout=hover_out(this,0)>";
		llisteta += "Lletra (UOC)";
		llisteta +="</span> </li>";				
		llisteta +="<li class=indexid_2>";
		llisteta +="<span onmousedown= clic_vincle('http://www.xtec.cat/lic/centre/professorat/dossiersgust/gust_2008_09/gust_primaria/carbo%20definitiu/Carbo_professorat.pdf') onmouseover=hover_over(this,0) onmouseout=hover_out(this,0)>";
		llisteta += "Guia per al professorat";
		llisteta +="</span> </li>";				
		subllista.innerHTML=llisteta;
		adesplegar.appendChild(subllista);		
		break;
	}
	};

	this.p_arronsar=function(n){
		switch (n)
		{
			case 5:
			var arronsar1=document.getElementById("bibliopcions");
			var fill1=arronsar1.lastChild;
			arronsar1.removeChild(fill1);
			break;
			case 7: 
			var arronsar2=document.getElementById("vinclopcions");
			var fill2=arronsar2.lastChild;
			arronsar2.removeChild(fill2);			
			break;
		}
	};
		
	this.p_fercoses=function(){ 
//	alert ("act_bibliopcions: "+ this.m_act_bibliopcions +" des_bibliopcions: " + this.m_des_bibliopcions  );
	if (this.m_act_bibliopcions)
	{
		if(!this.m_bibliopcions)
		{
			this.p_estirar(5); 
			this.m_bibliopcions=true; 
		}
		this.m_act_bibliopcions=false;
	}
	if (this.m_act_vinclopcions) 
	{
		if(!this.m_vinclopcions)
		{
//			alert("estirar vinclopcions");
			this.p_estirar(7); 
			this.m_vinclopcions=true;
		}
		this.m_act_vinclopcions=false;
	}
	if (this.m_des_bibliopcions) 
	{
		if(this.m_bibliopcions)
		{
			this.p_arronsar(5);
			this.m_bibliopcions=false;
		}
		this.m_des_bibliopcions=false;
	}
	if (this.m_des_vinclopcions) 
	{
		if(this.m_vinclopcions)
		{
//			alert("arronsar vinclopcions");
			this.p_arronsar(7); 
			this.m_vinclopcions=false;
		}
		this.m_des_vinclopcions=false;
	}
	};
}
var my_state=new pagestate();
my_state.p_setstate(0);


function request()
{
this.m_request=false;
	try {
	  this.m_request = new XMLHttpRequest();
	} catch (provantmicrosoft) {
	  try {
	    this.m_request = new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (altresmicrosofts) {
	    try {
	      this.m_request = new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (totfallainohiharesafer) {
	      this.m_request = false;
	    }
	  }
	}
}
var my_request=new request();

function proleg(a,b)
{
	this.m_id=a;
	this.m_text=b;
}

function llista_proleg()
{
	this.m_llista = [];	
	
	this.addLlistaProleg=	function (a1,b1)
	{
		var filanova=new proleg(a1,b1);
		this.m_llista.push(filanova); 	
	};
	
	if (!my_request.m_request) 
	{alert("Error inicialitzant XMLHttpRequest del cos principal: Proleg i Justificació: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
	else
		{
		my_request.m_request.open("GET","proleg.xml",true);
		my_request.m_request.onreadystatechange = function (){
			if (my_request.m_request.readyState==4)
				{
				if(my_request.m_request.status==200)
					{
					var xmlDoc=my_request.m_request.responseXML; 
					var x=xmlDoc.getElementsByTagName("Table");
					for (var i=0;i<x.length;i++)
					  { 
						var a2=0; var b2="";
						 
						a2=x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
						 
						 if (x[i].getElementsByTagName("text")[0].hasChildNodes)
						 {if(x[i].getElementsByTagName("text")[0].childNodes[0].nodeType==3)
//							 {b2=x[i].getElementsByTagName("text")[0].childNodes[0].nodeValue;}}				
//						 		{b2=x[i].getElementsByTagName("text")[0].firstChild.nodeValue;}}			
						 {b2=getNodeText(x[i].getElementsByTagName("text")[0]);}}				

						 obj_llista_proleg.addLlistaProleg(a2,b2); 
					  }
					}
				}
		};
		my_request.m_request.send(null);
		}	
}

var obj_llista_proleg=new llista_proleg();


////////////////////////////////////////INTERACCIÓ////inici/////////////////////////////////////////////////////


function netejacos()
{
var tauler=document.getElementById("cos");

	while (tauler.hasChildNodes())
	{
		var fill = tauler.firstChild; 
		tauler.removeChild(fill);
	}
}


function escriurealcos(codiHTML)
{

	var tauler = document.getElementById("cos");
	netejacos();
	var xinxeta=document.createElement("div");
	xinxeta.innerHTML=codiHTML;
	tauler.appendChild(xinxeta);

//	document.getElementById("cos").innerHTML=codiHTML;
}

function clic_coberta()
{
	my_state.p_setstate(0);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxeta=document.createElement("img");
	xinxeta.src="coberta.jpg";
	tauler.appendChild(xinxeta);
//	escriurealcos("<img src=coberta.jpg>");
}

function clic_proleg(aquest)
{
	my_state.p_setstate(1);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxeta=document.createElement("span");
	xinxeta.innerHTML=obj_llista_proleg.m_llista[0].m_text;	
	tauler.appendChild(xinxeta);
	
//	escriurealcos(obj_llista_proleg.m_llista[0].m_text);
	
}
function clic_justificacio(aquest)
{
	
	my_state.p_setstate(2);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxeta=document.createElement("span");
	xinxeta.innerHTML=obj_llista_proleg.m_llista[1].m_text;	
	tauler.appendChild(xinxeta);	
	
//	escriurealcos(obj_llista_proleg.m_llista[1].m_text);
}

function mostrarespostes(x)
{
	var comentari=document.createElement("div");
	//alert(x + " " +obj_llista_laconversa.m_llista[x].m_visible)	;
	if(obj_llista_laconversa.m_llista[x].m_visible==0)
		{	
			obj_llista_laconversa.m_llista[x].m_visible=1;
			var textinterior=document.createElement("span");
			textinterior.title=obj_llista_laconversa.m_llista[x].m_pregunta;
			textinterior.innerHTML=obj_llista_laconversa.m_llista[x].m_resposta;
			var divID="marc"+x;
			var divoninsertar=document.getElementById(divID);
			divoninsertar.appendChild(textinterior);
		}
		else
		{
			obj_llista_laconversa.m_llista[x].m_visible=0;
			var divID="marc"+x;
			var divoninsertar=document.getElementById(divID);
			var oldChild=divoninsertar.childNodes[1];
			divoninsertar.removeChild(oldChild);
		}
	}


function clic_preguntes(aquest)
{
	my_state.p_setstate(3);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxota=document.createElement("div");
	xinxota.innerHTML="<span class=cos_gran >La conversa:</span>";

	for (var npreg=0; npreg<obj_llista_laconversa.m_llista.length; npreg++)
	{
		var marc=document.createElement("div");
		marc.id="marc"+npreg;
		var xinxeta=document.createElement("a");
		xinxeta.href="javascript:mostrarespostes("+ npreg +")";
		var subxinxeta=document.createElement("div");
		subxinxeta.innerHTML=obj_llista_laconversa.m_llista[npreg].m_pregunta;
		xinxeta.appendChild(subxinxeta);
		marc.appendChild(xinxeta);
		xinxota.appendChild(marc);
	}
tauler.appendChild(xinxota);		
}


function mostracomentaris(x)
{
var comentari=document.createElement("div");
//alert(x + " " +obj_llista_llibresunenun.m_llista[x].m_visible)	;
if(obj_llista_llibresunenun.m_llista[x].m_visible==0)
	{	
		obj_llista_llibresunenun.m_llista[x].m_visible=1;
		var textinterior=document.createElement("span");
		textinterior.title=obj_llista_llibresunenun.m_llista[x].m_titol;
		textinterior.innerHTML=obj_llista_llibresunenun.m_llista[x].m_comentari;
		var divID="marc"+x;
		var divoninsertar=document.getElementById(divID);
		divoninsertar.appendChild(textinterior);
	}
	else
	{
		obj_llista_llibresunenun.m_llista[x].m_visible=0;
		var divID="marc"+x;
		var divoninsertar=document.getElementById(divID);
		var oldChild=divoninsertar.childNodes[1];
		divoninsertar.removeChild(oldChild);
	}
}

function clic_comentaris(aquest)
{
	my_state.p_setstate(4);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxota=document.createElement("div");
	xinxota.innerHTML="<span class=cos_gran >Els llibres d'un en un:</span>";
	for (var npreg=0; npreg<obj_llista_llibresunenun.m_llista.length; npreg++)
	{
		var marc=document.createElement("div");
		marc.id="marc"+npreg;
		var xinxeta=document.createElement("a");
		xinxeta.href="javascript:mostracomentaris("+ npreg +")";
		var subxinxeta=document.createElement("div");
		subxinxeta.innerHTML=obj_llista_llibresunenun.m_llista[npreg].m_titol;
		xinxeta.appendChild(subxinxeta);
		marc.appendChild(xinxeta)
		xinxota.appendChild(marc);
	}
tauler.appendChild(xinxota);		
}

function clic_bibliografia(aquest)
{
	my_state.p_setstate(5);
	my_state.m_act_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;

	//	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();

}

function clic_bibliografia2(aquest, aqui)
{
	my_state.p_setstate(5);
	my_state.m_state2=aqui;
	aquest.className="m_Selected";
	var adults=true;
	var joves=true;
	var text="";
	var tipusescrit=[];
	switch (aqui)
	{
	case 0: 
		tipusescrit=[];
		tipusescrit=[1];
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Tots els llibres:";
		text +="</span>";
		text += "<span class=cos_petit>";
		text += "<br>";
		text += "(&#9632;&nbsp; = Llibres per adults)";
		text +="</span>";
		text += "</p>";		
	break;
	case 1:
		tipusescrit=[];
		tipusescrit=[1]; 
		adults=true;
		joves=false;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Llibres per adults:";
		text +="</span>";
		text += "</p>";				
	break;
	case 2:
		tipusescrit=[];
		tipusescrit=[1]; 
		adults=false;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Llibres per joves:";
		text +="</span>";
		text += "</p>";				
	break;
	case 3:
		tipusescrit=[];
		tipusescrit=[2]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "&Agrave;lbums de c&ograve;mic:";
		text +="</span>";
		text += "</p>";				
	break;
	case 4:
		tipusescrit=[];
		tipusescrit=[3]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Llibres col&middot;lectius:";
		text +="</span>";
		text += "</p>";				
	break;
	case 5:
		tipusescrit=[];
		tipusescrit=[4]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Pr&ograve;legs:";
		text +="</span>";
		text += "</p>";				
	break;

	case 6:
		tipusescrit=[];
		tipusescrit=[7]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Narracions:";
		text +="</span>";
		text += "</p>";				
	break;
	
	case 7:
		tipusescrit=[];
		tipusescrit=[8,15,16]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Contes:";
		text +="</span>";
		text += "</p>";				
	break;
	
	case 8:
		tipusescrit=[];
		tipusescrit=[9]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Guions de c&ograve;mic";
		text +="</span>";
		text += "</p>";				
	break;
	
	case 9:
		tipusescrit=[];
		tipusescrit=[10]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Divulgaci&oacute;";
		text +="</span>";
		text += "</p>";				
	break;

	case 10:
		tipusescrit=[];
		tipusescrit=[11]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Comentaris de llibres";
		text +="</span>";
		text += "</p>";				
	break;

	case 11:
		tipusescrit=[];
		tipusescrit=[12]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Entrevistes";
		text +="</span>";
		text += "</p>";				
	break;

	case 12:
		tipusescrit=[];
		tipusescrit=[13,14]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Articles";
		text +="</span>";
		text += "</p>";				
	break;

	case 13:
		tipusescrit=[];
		tipusescrit=[5,6]; 
		adults=true;
		joves=true;
		text += "<p>";
		text += "<span class=cos_gran>";
		text += "Diversos";
		text +="</span>";
		text += "</p>";				
	break;
	}
		for (var te=0;te<tipusescrit.length;te++)
		{	
			var lngt=obj_llista_escrit.m_llista.length;
			
			if(tipusescrit[te]==15){text+="<p><span class=cos_gran>Historietes Neus</span></p>";}
			if(tipusescrit[te]==16){text+="<p><span class=cos_gran>Historietes Miquelet</span></p>";}
			if(tipusescrit[te]==14){text+="<p><span class=cos_gran>Col&middot;laboraci&oacute; Ausona</span></p>";}
			if(tipusescrit[te]==5){text+="<p><span class=cos_gran>Traducci&oacute;</span></p>";}
			if(tipusescrit[te]==6){text+="<p><span class=cos_gran>Teatre</span></p>";}
			
			for (var x=0;x<lngt;x++)
			{
				var teskrit=parseInt(obj_llista_escrit.m_llista[x].m_tipus_escrit_id);
				var teskpublic=parseInt(obj_llista_escrit.m_llista[x].m_tipus_public_id);

				var si=false;
				if ((adults && teskpublic==1)||(joves && teskpublic==2)){si=true;}
				if ((teskrit==tipusescrit[te])&&(si))
				{	
					text += "<p>";
					if(teskpublic==1){ text += "&#9632;&nbsp;";}
					text += obj_llista_escrit.m_llista[x].m_id_CODI;
					text += " - <b>";		
					text += obj_llista_escrit.m_llista[x].m_titol;
					text += "</b>";
					
					if (obj_llista_escrit.m_llista[x].m_comentari.length>1)
					{
						text += " (";
						text += obj_llista_escrit.m_llista[x].m_comentari;
						text += ")";
					}
					text +="<br>";
					if (obj_llista_escrit.m_llista[x].m_url.length>1)
					{
						text += obj_llista_escrit.m_llista[x].m_url;
						text += "<br>";
					}
					for (var x1=0;x1<obj_llista_recopilacio.m_llista.length;x1++)
					{
						
						if (obj_llista_recopilacio.m_llista[x1].m_escrit_id_e==obj_llista_escrit.m_llista[x].m_id_e)
						{
							
							var id_publicacio=obj_llista_recopilacio.m_llista[x1].m_publicacio_id_pub;
							for (var x2=0;x2<obj_llista_publicacio.m_llista.length;x2++)
							{
								if(obj_llista_publicacio.m_llista[x2].m_id_pub==id_publicacio)
								{
									text += "<span class=cos_petit >";
									text += "Publicat,";
									text += " any "+ obj_llista_publicacio.m_llista[x2].m_any;
									text += ": '"+ obj_llista_publicacio.m_llista[x2].m_titol+"' ";
									for (var x3=0;x3<obj_llista_llibre.m_llista.length;x3++)
									{
										if(obj_llista_llibre.m_llista[x3].m_llibre_id_ll==obj_llista_publicacio.m_llista[x2].m_id_pub)
										{
											text += " - ";
											text += obj_llista_llibre.m_llista[x3].m_nombre_edicions + " ed.";
											if(obj_llista_llibre.m_llista[x3].m_edicio_txt.length>1)
											{
												text += " ";
												text += obj_llista_llibre.m_llista[x3].m_edicio_txt;
												text += " ";
												
											}
											for (var x4=0;x4<obj_llista_editorial.m_llista.length;x4++)
											{
												if(obj_llista_editorial.m_llista[x4].m_id_ed==obj_llista_llibre.m_llista[x3].m_editorial_id_ed)
												{
												text += " ";
												text += obj_llista_editorial.m_llista[x4].m_nom_ed;
												text += ", ";
												text += obj_llista_editorial.m_llista[x4].m_lloc;
												text += " ";
												}
											}
										}
									}
									
									for (var x3=0;x3<obj_llista_article.m_llista.length;x3++)
									{
										if(obj_llista_article.m_llista[x3].m_publicacio_id_pub==obj_llista_publicacio.m_llista[x2].m_id_pub)
										{
											for (var x4=0;x4<obj_llista_revista.m_llista.length;x4++)
											{
												if(obj_llista_revista.m_llista[x4].m_id_revista==obj_llista_article.m_llista[x3].m_revista_id_revista)
												{
													text += " ";
													text += obj_llista_revista.m_llista[x4].m_nom;
													text += ", ";
												}
											}
												if (obj_llista_article.m_llista[x3].m_numeros.length>1)
												{
													text += "num.: ";
													text += obj_llista_article.m_llista[x3].m_numeros;
												}
											}
									}
									for (var x3=0;x3<obj_llista_colaboracio.m_llista.length;x3++)
									{
										if(obj_llista_colaboracio.m_llista[x3].m_llibre_id_ll==obj_llista_publicacio.m_llista[x2].m_id_pub)
										{
											for (var x4=0;x4<obj_llista_tipus_colaboracio.m_llista.length;x4++)
											{
												if(obj_llista_tipus_colaboracio.m_llista[x4].m_id_t_col==obj_llista_colaboracio.m_llista[x3].m_tipus_colaboracio_id_t_col)
												{
													text += "<br>";
													text += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
													text += obj_llista_tipus_colaboracio.m_llista[x4].m_concepte;
													text += ": ";
												}
											}	
											for (var x4=0;x4<obj_llista_autor.m_llista.length;x4++)
											{
												if(obj_llista_autor.m_llista[x4].m_id_aut==obj_llista_colaboracio.m_llista[x3].m_autor_id_aut)
												{
													text += obj_llista_autor.m_llista[x4].m_nom;
												}
											}
										}
									}
									for (var x3=0;x3<obj_llista_ilustracio.m_llista.length;x3++)
									{
										if(obj_llista_ilustracio.m_llista[x3].m_llibre_id_ll==obj_llista_publicacio.m_llista[x2].m_id_pub)
										{
											for (var x4=0;x4<obj_llista_tipus_ilustracio.m_llista.length;x4++)
											{
												if(obj_llista_tipus_ilustracio.m_llista[x4].m_id_tip_ilus==obj_llista_ilustracio.m_llista[x3].m_tipus_ilustracio_id_tip_ilus)
												{
													text += "<br>";
													text += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
													text += obj_llista_tipus_ilustracio.m_llista[x4].m_concepte;
													text += ": ";
												}
											}
											for (var x4=0;x4<obj_llista_dibuixant.m_llista.length;x4++)
											{
												if(obj_llista_dibuixant.m_llista[x4].m_id_dib==obj_llista_ilustracio.m_llista[x3].m_dibuixant_id_dib)
												{
													text += " ";
													text += obj_llista_dibuixant.m_llista[x4].m_nom;
													text += " ";
												}
											}	
										}
									}
									for (var x3=0;x3<obj_llista_actuacio.m_llista.length;x3++)
									{
										if(obj_llista_actuacio.m_llista[x3].m_publicacio_id==obj_llista_publicacio.m_llista[x2].m_id_pub)
										{
											for (var x4=0;x4<obj_llista_tipus_actuacio.m_llista.length;x4++)
											{
												if(obj_llista_tipus_actuacio.m_llista[x4].m_id_tip_act==obj_llista_actuacio.m_llista[x3].m_tip_act_id)
												{
													text += "<br>";
													text += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
													text += obj_llista_tipus_actuacio.m_llista[x4].m_concepte;
													text += ": ";
												}
											}
											for (var x4=0;x4<obj_llista_companyia.m_llista.length;x4++)
											{
												if(obj_llista_companyia.m_llista[x4].m_id_companyia==obj_llista_actuacio.m_llista[x3].m_companyia_id)
												{
													text += " ";
													text += obj_llista_companyia.m_llista[x4].m_nom_comp;
													text += " ";
												}
											}
											for (var x4=0;x4<obj_llista_lloc.m_llista.length;x4++)
											{
												if(obj_llista_lloc.m_llista[x4].m_id_companyia==obj_llista_actuacio.m_llista[x3].m_lloc_id)
												{
													text += ", ";
													text += obj_llista_lloc.m_llista[x4].m_lloc;
												}
											}
										}
									}
									text += "<br>";
									text += "</span>";
								}
							}
						}	
					}	
					text += "</p>";
				}				
			}
		}	
		escriurealcos(text);	
}


function mostrarapendix(x)
{
	var comentari=document.createElement("div");
	//alert(x + " " +obj_llista_apendix.m_llista[x].m_visible)	;
	if(obj_llista_apendix.m_llista[x].m_visible==0)
		{	
			obj_llista_apendix.m_llista[x].m_visible=1;
			var textinterior=document.createElement("span");
			textinterior.title=obj_llista_apendix.m_llista[x].m_titol;
			textinterior.innerHTML=obj_llista_apendix.m_llista[x].m_explicacio;
			var divID="marc"+x;
			var divoninsertar=document.getElementById(divID);
			divoninsertar.appendChild(textinterior);
		}
		else
		{
			obj_llista_apendix.m_llista[x].m_visible=0;
			var divID="marc"+x;
			var divoninsertar=document.getElementById(divID);
			var oldChild=divoninsertar.childNodes[1];
			divoninsertar.removeChild(oldChild);
		}
}

function clic_apendix(aquest)
{
	my_state.p_setstate(6);
	my_state.m_des_bibliopcions=true; 
	my_state.m_des_vinclopcions=true;
	my_state.p_fercoses();
	var tauler = document.getElementById("cos");
	netejacos();
	var xinxota=document.createElement("div");
	xinxota.innerHTML="<span class=cos_gran >Ap&egrave;ndix:</span>";
	for (var npreg=0; npreg<obj_llista_apendix.m_llista.length; npreg++)
	{
		var marc=document.createElement("div");
		marc.id="marc"+npreg;
		var xinxeta=document.createElement("a");
		xinxeta.href="javascript:mostrarapendix("+ npreg +")";
		var subxinxeta=document.createElement("div");
		subxinxeta.innerHTML=obj_llista_apendix.m_llista[npreg].m_titol;
		xinxeta.appendChild(subxinxeta);
		marc.appendChild(xinxeta);
		xinxota.appendChild(marc);
	}
tauler.appendChild(xinxota);		
}


function clic_vincles(aquest)
{
	my_state.p_setstate(7);
	my_state.m_act_vinclopcions=true;
	my_state.m_des_bibliopcions=true;

	my_state.p_fercoses();
}

function hover_over(aquest, quin)
{
if (quin==my_state.p_getstate())
	{
	aquest.className="m_Selected";
	}
else
	{
	aquest.className="m_Over";
	}
}

function hover_out(aquest, quin)
{
if (quin==my_state.p_getstate())
	{
		aquest.className="m_Selected";
	}
else
	{
	aquest.className="m_Out";
	}
}

function hover_over2(aquest, quin)
{
if (quin==my_state.m_state2)
	{
	aquest.className="m_Selected";
	}
else
	{
	aquest.className="m_Over";
	}
}

function hover_out2(aquest, quin)
{
if (quin==my_state.m_state2)
	{
		aquest.className="m_Selected";
	}
else
	{
	aquest.className="m_Out";
	}
}

var my_request2=new request();
function escrit(a,b,c,d,e,f,g,h)
{
	this.m_id_e=a;
	this.m_id_CODI=b;
	this.m_titol=c;
	this.m_comentari=d;
	this.m_url=e;
	this.m_tipus_escrit_id=f;
	this.m_tipus_public_id=g;
	this.m_tipus_tema_id=h;

	this.p_escritCopy=function pscrtcpy(b){
		try{
		this.m_id_e=b.m_id_e;
		this.m_id_CODI=b.m_id_CODI;
		this.m_titol=b.m_titol;
		this.m_comentari=b.m_comentari;
		this.m_url=b.m_url;
		this.m_tipus_escrit_id=b.m_tipus_escrit_id;
		this.m_tipus_public_id=b.m_tipus_public_id;
		this.m_tipus_tema_id=b.m_tipus_tema_id;	
	}catch (e){alert("Error al copiar: Objecte escrit");}
	};
}

function llista_escrit()
{
	this.m_llista = [];	
	this.addLlistaEscrit=	function(a1,b1,c1,d1,e1,f1,g1,h1){
		var filanova=new escrit(a1,b1,c1,d1,e1,f1,g1,h1);
		this.m_llista.push(filanova);
	};
  this.p_Swap=function(i,j){
    try{
  	var aux=new escrit(0,0,0,0,0,0,0,0);
  	aux.p_escritCopy(this.m_llista[i]);
  	this.m_llista[i].p_escritCopy(this.m_llista[j]);
  	this.m_llista[j].p_escritCopy(aux);
   }catch(error){alert("Error al fer swap (ordenació d'escrits)");}
  };
/*
  this.p_Sort=function (){
		var mida=this.m_llista.length;
		var continuarbucle=true;
		//document.form.debug.value =" mida: "+ mida + ", ";
		while(continuarbucle)
			{
			continuarbucle=false;	
			for(var x=0;x<mida-1;x++)
				{
				if(this.m_llista[x].m_tipus_escrit==this.m_llista[x+1].m_tipus_escrit)
					{
					
					if((parseInt(this.m_llista[x].m_id_CODI) > parseInt(this.m_llista[x+1].m_id_CODI)) || parseInt(this.m_llista[x].m_id_CODI)==0)
						{
						//document.form.debug.value += this.m_llista[x].m_id_CODI+", "+this.m_llista[x+1].m_id_CODI+ " ## ";
						this.p_Swap(x,x+1);	
						continuarbucle=true;
						}
					}
				}
			}
		};
*/  
  
	if (!my_request2.m_request) 
	{alert("Error inicialitzant XMLHttpRequest dels escrits: Escrit: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
	else
		{
		my_request2.m_request.open("GET","escrit.xml",true);
		my_request2.m_request.onreadystatechange = function (){
			
			if (my_request2.m_request.readyState==4)
				{
				if(my_request2.m_request.status==200)
					{
					var xmlDoc=my_request2.m_request.responseXML; 
					var x=xmlDoc.getElementsByTagName("Table");
					var a2=0; var b2=0; var c2=""; var d2=""; var e2=""; var f2=0; var g2=0; var h2=0;
					for (var i=0;i<x.length;i++)
					  { 
						a2=0; b2=0; c2=""; d2=""; e2=""; f2=0; g2=0; h2=0;
						try {
						a2=x[i].getElementsByTagName("id_e")[0].childNodes[0].nodeValue;
						b2=x[i].getElementsByTagName("id_CODI")[0].childNodes[0].nodeValue;
						}catch (hihaerror) {alert ("Error al extreure escrits de l'xml - Pas 1");}
						
						try{
						 if (x[i].getElementsByTagName("titol")[0].hasChildNodes)
						 {if(x[i].getElementsByTagName("titol")[0].childNodes[0].nodeType==3)
							 {c2=x[i].getElementsByTagName("titol")[0].childNodes[0].nodeValue;}}				
						} catch (hihaerror){alert ("Error al extreure escrits de l'xml - Pas 2");}
						 try{
							if (x[i].getElementsByTagName("comentari")[0].hasChildNodes)
						 {if(x[i].getElementsByTagName("comentari")[0].childNodes[0].nodeType==3)
							 {d2=x[i].getElementsByTagName("comentari")[0].childNodes[0].nodeValue;}}						
						 }catch (hihaerror){d2="";}
						try{
						 if (x[i].getElementsByTagName("url")[0].hasChildNodes)
						 {if(x[i].getElementsByTagName("url")[0].childNodes[0].nodeType==3)
							 {e2=x[i].getElementsByTagName("url")[0].childNodes[0].nodeValue;}}			
						}catch (hihaerror){e2="";}
						
						try{
						f2=x[i].getElementsByTagName("tipus_escrit_id")[0].childNodes[0].nodeValue;
						g2=x[i].getElementsByTagName("tipus_public_id")[0].childNodes[0].nodeValue;
						h2=x[i].getElementsByTagName("tipus_classificacio_id")[0].childNodes[0].nodeValue;
						}catch(hihaerror){alert("Error al extreure escrits de l'xml - pas 5");}

						obj_llista_escrit.addLlistaEscrit(a2,b2,c2,d2,e2,f2,g2,h2); 
						//document.form.debug.value += "i: "+i+" titol: "+c2+ " url: "+e2+" Len: "+x.length;
						}
//////			obj_llista_escrit.p_Sort();
					}
				}
		};
		my_request2.m_request.send(null);
		}	
}
var obj_llista_escrit=new llista_escrit();


var my_request3=new request();
function tipus_escrit (a,b)
{
	this.m_id_te=a;
	this.m_concepte=b;
}
function llista_tipus_escrit()
{
this.m_llista=[];	
this.addLlista_tipus_escrit = function(a1,b1){
	var filanova = new tipus_escrit(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request3.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Tipus_Escrit: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request3.m_request.open("GET","tipus_escrit.xml",true);
	my_request3.m_request.onreadystatechange = function (){
		if (my_request3.m_request.readyState==4)
			{
			if(my_request3.m_request.status==200)
				{
				var xmlDoc=my_request3.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2="";
					 
					a2=x[i].getElementsByTagName("id_te")[0].childNodes[0].nodeValue;
					 
					 if (x[i].getElementsByTagName("concepte")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeValue;}}				
					 //document.form.debug.value +=" id: "+a2+ " Concepte: "+b2;
					 obj_llista_tipus_escrit.addLlista_tipus_escrit(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Tipus_Escrit: " + obj_llista_tipus_escrit.m_llista.length;
	};
	my_request3.m_request.send(null);
	}	
}
var obj_llista_tipus_escrit=new llista_tipus_escrit();

var my_request4=new request();
function tipus_public (a,b)
{
	this.m_id_tp=a;
	this.m_t_public=b;
}
function llista_tipus_public()
{
this.m_llista=[];	
this.addLlista_tipus_public = function(a1,b1){
	var filanova = new tipus_public(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request4.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Tipus_Public: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request4.m_request.open("GET","tipus_public.xml",true);
	my_request4.m_request.onreadystatechange = function (){
		if (my_request4.m_request.readyState==4)
			{
			if(my_request4.m_request.status==200)
				{
				var xmlDoc=my_request4.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2="";
					 
					a2=x[i].getElementsByTagName("id_tp")[0].childNodes[0].nodeValue;
					 
					 if (x[i].getElementsByTagName("t_public")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("t_public")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("t_public")[0].childNodes[0].nodeValue;}}				
					 //document.form.debug.value +=" id: "+a2+ " Public: "+b2;
					 obj_llista_tipus_public.addLlista_tipus_public(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Tipus_Public: " + obj_llista_tipus_public.m_llista.length;
	};
	my_request4.m_request.send(null);
	}	
}
var obj_llista_tipus_public=new llista_tipus_public();

var my_request5=new request();
function tipus_classificacio (a,b)
{
	this.m_id_tc=a;
	this.m_concepte=b;
}
function llista_tipus_classificacio()
{
this.m_llista=[];	
this.addLlista_tipus_classificacio = function(a1,b1){
	var filanova = new tipus_classificacio(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request5.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Tipus_Classificacio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request5.m_request.open("GET","tipus_classificacio.xml",true);
	my_request5.m_request.onreadystatechange = function (){
		if (my_request5.m_request.readyState==4)
			{
			if(my_request5.m_request.status==200)
				{
				
				var xmlDoc=my_request5.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2="";
					
					a2=x[i].getElementsByTagName("id_tc")[0].childNodes[0].nodeValue;
					 if (x[i].getElementsByTagName("concepte")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeValue;}}				
					 //document.form.debug.value +=" id: "+a2+ " classificacio: "+b2;
					 obj_llista_tipus_classificacio.addLlista_tipus_classificacio(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Tipus_classificacio: " + obj_llista_tipus_classificacio.m_llista.length;
	};
	my_request5.m_request.send(null);
	}	
}
var obj_llista_tipus_classificacio=new llista_tipus_classificacio();

var my_request6=new request();
function recopilacio (a,b,c)
{
	this.m_id=a;
	this.m_escrit_id_e=b;
	this.m_publicacio_id_pub=c;
}
function llista_recopilacio()
{
this.m_llista=[];	
this.addLlista_recopilacio = function(a1,b1,c1){
	var filanova = new recopilacio(a1,b1,c1);
	this.m_llista.push(filanova);
};
if (!my_request6.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Recopilació: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request6.m_request.open("GET","recopilacio.xml",true);
	my_request6.m_request.onreadystatechange = function (){
		if (my_request6.m_request.readyState==4)
			{
			if(my_request6.m_request.status==200)
				{
				var xmlDoc=my_request6.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; c2=0;
					a2=x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
					b2=x[i].getElementsByTagName("escrit_id_e")[0].childNodes[0].nodeValue;
					c2=x[i].getElementsByTagName("publicacio_id_pub")[0].childNodes[0].nodeValue;
					 //document.form.debug.value +=" id: "+a2+ " id_e: "+b2+ " id_pub: "+c2;
					 obj_llista_recopilacio.addLlista_recopilacio(a2,b2,c2); 
				  }
				}
			}
	//	document.form.debug.value +="Llista recopilacio: " + obj_llista_recopilacio.m_llista.length;
	};
	my_request6.m_request.send(null);
	}	
}
var obj_llista_recopilacio=new llista_recopilacio();


var my_request7=new request();
function publicacio (a,b,c,d,e)
{
	this.m_id_pub=a;
	this.m_titol=b;
	this.m_any=c;
	this.m_tpub_id=d;
	this.m_imatge=e;
}
function llista_publicacio()
{
this.m_llista=[];	
this.addLlista_publicacio = function(a1,b1,c1,d1,e1){
	var filanova = new publicacio(a1,b1,c1,d1,e1);
	this.m_llista.push(filanova);
};
if (!my_request7.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Tipus_Classificacio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request7.m_request.open("GET","publicacio.xml",true);
	my_request7.m_request.onreadystatechange = function (){
		if (my_request7.m_request.readyState==4)
			{
			if(my_request7.m_request.status==200)
				{
				
				var xmlDoc=my_request7.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2="";var d2=0; var e2="";
					a2=x[i].getElementsByTagName("id_pub")[0].childNodes[0].nodeValue;

					try{
					if (x[i].getElementsByTagName("titol")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("titol")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("titol")[0].childNodes[0].nodeValue;}}				
					}catch (hihaerror){b2="";}
					try{
					if (x[i].getElementsByTagName("any")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("any")[0].childNodes[0].nodeType==3)
						 {c2=x[i].getElementsByTagName("any")[0].childNodes[0].nodeValue;}}
					}catch (hihaerror){c2="";}			
	
					d2=x[i].getElementsByTagName("tpub_id")[0].childNodes[0].nodeValue;
					
					try{
					if (x[i].getElementsByTagName("imatge")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("imatge")[0].childNodes[0].nodeType==3)
						 {e2=x[i].getElementsByTagName("imatge")[0].childNodes[0].nodeValue;}}
					}catch (hihaerror){e2="";}
					
					//document.form.debug.value +=" id: "+a2+ " classificacio: "+b2;
					 obj_llista_publicacio.addLlista_publicacio(a2,b2,c2,d2,e2); 
				  }
				}
			}
		//document.form.debug.value +="Publicació: " + obj_llista_publicacio.m_llista.length;
	};
	my_request7.m_request.send(null);
	}	
}
var obj_llista_publicacio=new llista_publicacio();

var my_request8=new request();
function tipus_publicacio (a,b)
{
	this.m_id_tpub=a;
	this.m_tipus=b;
}
function llista_tipus_publicacio()
{
this.m_llista=[];	
this.addLlista_tipus_publicacio = function(a1,b1){
	var filanova = new tipus_publicacio(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request8.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Tipus_Publicació: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request8.m_request.open("GET","tipus_publicacio.xml",true);
	my_request8.m_request.onreadystatechange = function (){
		if (my_request8.m_request.readyState==4)
			{
			if(my_request8.m_request.status==200)
				{
				
				var xmlDoc=my_request8.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				//alert("llarg: " + x.length);
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2="";
					
					a2=x[i].getElementsByTagName("id_tpub")[0].childNodes[0].nodeValue;
					 if (x[i].getElementsByTagName("tipus")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("tipus")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("tipus")[0].childNodes[0].nodeValue;}}				
					 //document.form.debug.value +=" id: "+a2+ " tipusPublicacio: "+b2;
					 obj_llista_tipus_publicacio.addLlista_tipus_publicacio(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Tipus_publicacio: " + obj_llista_tipus_publicacio.m_llista.length;
	};
	my_request8.m_request.send(null);
	}	
}
var obj_llista_tipus_publicacio=new llista_tipus_publicacio();

var my_request9=new request();
function llibre (a,b,c,d,e)
{
	this.m_id_edicio=a;
	this.m_editorial_id_ed=b;
	this.m_llibre_id_ll=c;
	this.m_nombre_edicions=d;
	this.m_edicio_txt=e;
}
function llista_llibre()
{
this.m_llista=[];	
this.addLlista_llibre = function(a1,b1,c1,d1,e1){
	var filanova = new llibre(a1,b1,c1,d1,e1);
	this.m_llista.push(filanova);
};
if (!my_request9.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Llibre: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request9.m_request.open("GET","llibre.xml",true);
	my_request9.m_request.onreadystatechange = function (){
		if (my_request9.m_request.readyState==4)
			{
			if(my_request9.m_request.status==200)
				{
				
				var xmlDoc=my_request9.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; var c2=0;var d2=0;var e2="";
					
					a2=x[i].getElementsByTagName("id_edicio")[0].childNodes[0].nodeValue;
					b2=x[i].getElementsByTagName("editorial_id_ed")[0].childNodes[0].nodeValue; 
					c2=x[i].getElementsByTagName("llibre_id_ll")[0].childNodes[0].nodeValue; 
					
					if (x[i].getElementsByTagName("nombre_edicions")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nombre_edicions")[0].childNodes[0].nodeType==3)
						 {d2=x[i].getElementsByTagName("nombre_edicions")[0].childNodes[0].nodeValue;}}
					
					if (x[i].getElementsByTagName("edicio_txt")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("edicio_txt")[0].childNodes[0].nodeType==3)
						 {e2=x[i].getElementsByTagName("edicio_txt")[0].childNodes[0].nodeValue;}}				
													
					//document.form.debug.value +=" id: "+a2+ " llibre: "+b2 + " edicions: "+d2;
					 obj_llista_llibre.addLlista_llibre(a2,b2,c2,d2,e2); 
				  }
				}
			}
		//document.form.debug.value +="Llibres: " + obj_llista_llibre.m_llista.length;
	};
	my_request9.m_request.send(null);
	}	
}
var obj_llista_llibre=new llista_llibre();


function novetats()
{

	var dataactual=new Date();
	var anynovetat=dataactual.getFullYear()-1;
	
	for (var xn=0;xn<obj_llista_llibre.m_llista.length;xn++)
	{
	//document.form.debug.value +=" xn: " + xn;
	var id_depublicacio = obj_llista_llibre.m_llista[xn].m_llibre_id_ll;
	for (var xm=0;xm<obj_llista_publicacio.m_llista.length;xm++)
		{
		if(obj_llista_publicacio.m_llista[xm].m_id_pub==id_depublicacio)
			{
				
				var anyennumero=parseInt(obj_llista_publicacio.m_llista[xm].m_any);
				if (anyennumero>=anynovetat)
				{
					var tauler=document.getElementById("novetats");
					var xinxeta=document.createElement("div");
					var innertext="<br>";
					innertext += "*&nbsp;" + obj_llista_publicacio.m_llista[xm].m_titol;
					innertext += "<br>";
					innertext += "("+ obj_llista_publicacio.m_llista[xm].m_any+ "&nbsp;";
					for (var xp=0; xp<obj_llista_editorial.m_llista.length;xp++)
					{
						if(obj_llista_editorial.m_llista[xp].m_id_ed==obj_llista_llibre.m_llista[xn].m_editorial_id_ed)
						{
							innertext += obj_llista_editorial.m_llista[xp].m_nom_ed;
						}
					}
					innertext +=")";
					xinxeta.innerHTML=innertext;
					tauler.appendChild(xinxeta);
				}
			}
		}
	}	
}



var my_request10=new request();
function editorial (a,b,c)
{
	this.m_id_ed=a;
	this.m_nom_ed=b;
	this.m_lloc=c;
}
function llista_editorial()
{
this.m_llista=[];	
this.addLlista_editorial = function(a1,b1,c1){
	var filanova = new editorial(a1,b1,c1);
	this.m_llista.push(filanova);
};
if (!my_request10.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Editorial: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request10.m_request.open("GET","editorial.xml",true);
	my_request10.m_request.onreadystatechange = function (){
		if (my_request10.m_request.readyState==4)
			{
			if(my_request10.m_request.status==200)
				{
				
				var xmlDoc=my_request10.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2="";
					
					a2=x[i].getElementsByTagName("id_ed")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("nom_ed")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nom_ed")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("nom_ed")[0].childNodes[0].nodeValue;}}
					
					if (x[i].getElementsByTagName("lloc")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("lloc")[0].childNodes[0].nodeType==3)
						 {c2=x[i].getElementsByTagName("lloc")[0].childNodes[0].nodeValue;}}				
													
					//document.form.debug.value +=" id: "+a2+ " editorial: "+b2 + " lloc: "+c2;
					 obj_llista_editorial.addLlista_editorial(a2,b2,c2); 
				  }
				}
			}
		//document.form.debug.value +="Editorials: " + obj_llista_llibre.m_llista.length;
	};
	my_request10.m_request.send(null);
	}	
}
var obj_llista_editorial=new llista_editorial();

var my_request11=new request();
function article (a,b,c,d)
{
	this.m_id_article=a;
	this.m_numeros=b;
	this.m_publicacio_id_pub=c;
	this.m_revista_id_revista=d;
}
function llista_article()
{
this.m_llista=[];	
this.addLlista_article = function(a1,b1,c1,d1){
	var filanova = new article(a1,b1,c1,d1);
	this.m_llista.push(filanova);
};
if (!my_request11.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: article: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request11.m_request.open("GET","article.xml",true);
	my_request11.m_request.onreadystatechange = function (){
		if (my_request11.m_request.readyState==4)
			{
			if(my_request11.m_request.status==200)
				{
				
				var xmlDoc=my_request11.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2=0; var d2=0;
					
					a2=x[i].getElementsByTagName("id_article")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("numeros")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("numeros")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("numeros")[0].childNodes[0].nodeValue;}}
					
					c2=x[i].getElementsByTagName("publicacio_id_pub")[0].childNodes[0].nodeValue;
					d2=x[i].getElementsByTagName("revista_id_revista")[0].childNodes[0].nodeValue;
												
					//document.form.debug.value +=" id: "+a2+ " numeros: "+b2 + " revista: "+d2;
					 obj_llista_article.addLlista_article(a2,b2,c2,d2); 
				  }
				}
			}
		//document.form.debug.value +="Article: " + obj_llista_article.m_llista.length;
	};
	my_request11.m_request.send(null);
	}	
}
var obj_llista_article=new llista_article();

var my_request12=new request();
function revista (a,b)
{
	this.m_id_revista=a;
	this.m_nom=b;
}
function llista_revista()
{
this.m_llista=[];	
this.addLlista_revista = function(a1,b1){
	var filanova = new revista(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request12.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: article: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request12.m_request.open("GET","revista.xml",true);
	my_request12.m_request.onreadystatechange = function (){
		if (my_request12.m_request.readyState==4)
			{
			if(my_request12.m_request.status==200)
				{
				
				var xmlDoc=my_request12.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_revista")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("nom")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nom")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("nom")[0].childNodes[0].nodeValue;}}

					//document.form.debug.value +=" id: "+a2+ " nom: "+b2;
					 obj_llista_revista.addLlista_revista(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Revista: " + obj_llista_revista.m_llista.length;
	};
	my_request12.m_request.send(null);
	}	
}
var obj_llista_revista=new llista_revista();

var my_request13=new request();
function colaboracio (a,b,c,d)
{
	this.m_id_ll_aut=a;
	this.m_llibre_id_ll=b;
	this.m_autor_id_aut=c;
	this.m_tipus_colaboracio_id_t_col=d;
}
function llista_colaboracio()
{
this.m_llista=[];	
this.addLlista_colaboracio = function(a1,b1,c1,d1){
	var filanova = new colaboracio(a1,b1,c1,d1);
	this.m_llista.push(filanova);
};
if (!my_request13.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: colaboracio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request13.m_request.open("GET","colaboracio.xml",true);
	my_request13.m_request.onreadystatechange = function (){
		if (my_request13.m_request.readyState==4)
			{
			if(my_request13.m_request.status==200)
				{
				
				var xmlDoc=my_request13.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; var c2=0; var d2=0; 
					
					a2=x[i].getElementsByTagName("id_ll_aut")[0].childNodes[0].nodeValue;
					b2=x[i].getElementsByTagName("llibre_id_ll")[0].childNodes[0].nodeValue;
					c2=x[i].getElementsByTagName("autor_id_aut")[0].childNodes[0].nodeValue;
					d2=x[i].getElementsByTagName("tipus_colaboracio_id_t_col")[0].childNodes[0].nodeValue;
					
					//document.form.debug.value +=" id: "+a2+ " llibre: "+b2+ " Autor: "+ c2;
					 obj_llista_colaboracio.addLlista_colaboracio(a2,b2,c2,d2); 
				  }
				}
			}
		//document.form.debug.value +="Revista: " + obj_llista_colaboracio.m_llista.length;
	};
	my_request13.m_request.send(null);
	}	
}
var obj_llista_colaboracio=new llista_colaboracio();


var my_request14=new request();
function tipus_colaboracio (a,b)
{
	this.m_id_t_col=a;
	this.m_concepte=b;
}
function llista_tipus_colaboracio()
{
this.m_llista=[];	
this.addLlista_tipus_colaboracio = function(a1,b1){
	var filanova = new tipus_colaboracio(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request14.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: tipus colaboració: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request14.m_request.open("GET","tipus_colaboracio.xml",true);
	my_request14.m_request.onreadystatechange = function (){
		if (my_request14.m_request.readyState==4)
			{
			if(my_request14.m_request.status==200)
				{
				var xmlDoc=my_request14.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_t_col")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("concepte")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeValue;}}

					//document.form.debug.value +=" id: "+a2+ " tipus: "+b2;
					 obj_llista_tipus_colaboracio.addLlista_tipus_colaboracio(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Revista: " + obj_llista_tipus_colaboracio.m_llista.length;
	};
	my_request14.m_request.send(null);
	}	
}
var obj_llista_tipus_colaboracio=new llista_tipus_colaboracio();

var my_request15=new request();
function autor (a,b)
{
	this.m_id_aut=a;
	this.m_nom=b;
}
function llista_autor()
{
this.m_llista=[];	
this.addLlista_autor = function(a1,b1){
	var filanova = new autor(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request15.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: autor: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request15.m_request.open("GET","autor.xml",true);
	my_request15.m_request.onreadystatechange = function (){
		if (my_request15.m_request.readyState==4)
			{
			if(my_request15.m_request.status==200)
				{
				var xmlDoc=my_request15.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_aut")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("nom")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nom")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("nom")[0].childNodes[0].nodeValue;}}

					//document.form.debug.value +=" id: "+a2+ " autor: "+b2;
					 obj_llista_autor.addLlista_autor(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Revista: " + obj_llista_tipus_colaboracio.m_llista.length;
	};
	my_request15.m_request.send(null);
	}	
}
var obj_llista_autor=new llista_autor();


var my_request16=new request();
function ilustracio (a,b,c,d)
{
	this.m_id_ilust=a;
	this.m_llibre_id_ll=b;
	this.m_dibuixant_id_dib=c;
	this.m_tipus_ilustracio_id_tip_ilus=d;
}
function llista_ilustracio()
{
this.m_llista=[];	
this.addLlista_ilustracio = function(a1,b1,c1,d1){
	var filanova = new ilustracio(a1,b1,c1,d1);
	this.m_llista.push(filanova);
};
if (!my_request16.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: ilustracio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request16.m_request.open("GET","ilustracio.xml",true);
	my_request16.m_request.onreadystatechange = function (){
		if (my_request16.m_request.readyState==4)
			{
			if(my_request16.m_request.status==200)
				{
				var xmlDoc=my_request16.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; var c2=0; var d2=0; 
					
					a2=x[i].getElementsByTagName("id_ilust")[0].childNodes[0].nodeValue;
					b2=x[i].getElementsByTagName("llibre_id_ll")[0].childNodes[0].nodeValue;
					c2=x[i].getElementsByTagName("dibuixant_id_dib")[0].childNodes[0].nodeValue;
					d2=x[i].getElementsByTagName("tipus_ilustracio_id_tip_ilus")[0].childNodes[0].nodeValue;

					//document.form.debug.value +=" id: "+a2+ " dibuixant id: "+c2;
					 obj_llista_ilustracio.addLlista_ilustracio(a2,b2,c2,d2); 
				  }
				}
			}
		//document.form.debug.value +="Ilustracio: " + obj_llista_ilustracio.m_llista.length;
	};
	my_request16.m_request.send(null);
	}	
}
var obj_llista_ilustracio=new llista_ilustracio();

var my_request17=new request();
function dibuixant (a,b)
{
	this.m_id_dib=a;
	this.m_nom=b;
}
function llista_dibuixant()
{
this.m_llista=[];	
this.addLlista_dibuixant = function(a1,b1){
	var filanova = new dibuixant(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request17.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: ilustracio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request17.m_request.open("GET","dibuixant.xml",true);
	my_request17.m_request.onreadystatechange = function (){
		if (my_request17.m_request.readyState==4)
			{
			if(my_request17.m_request.status==200)
				{
				var xmlDoc=my_request17.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; 
					
					a2=x[i].getElementsByTagName("id_dib")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("nom")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nom")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("nom")[0].childNodes[0].nodeValue;}}

					//document.form.debug.value +=" id: "+a2+ " dibuixant id: "+b2;
					 obj_llista_dibuixant.addLlista_dibuixant(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Dibuixant: " + obj_llista_dibuixant.m_llista.length;
	};
	my_request17.m_request.send(null);
	}	
}
var obj_llista_dibuixant=new llista_dibuixant();

var my_request18=new request();
function tipus_ilustracio (a,b)
{
	this.m_id_tip_ilus=a;
	this.m_concepte=b;
}
function llista_tipus_ilustracio()
{
this.m_llista=[];	
this.addLlista_tipus_ilustracio = function(a1,b1){
	var filanova = new tipus_ilustracio(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request18.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: tipus ilustracio: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request18.m_request.open("GET","tipus_ilustracio.xml",true);
	my_request18.m_request.onreadystatechange = function (){
		if (my_request18.m_request.readyState==4)
			{
			if(my_request18.m_request.status==200)
				{
				var xmlDoc=my_request18.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=0; 
					
					a2=x[i].getElementsByTagName("id_tip_ilus")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("concepte")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeValue;}}

					//document.form.debug.value +=" id: "+a2+ " concepte id: "+b2;
					 obj_llista_tipus_ilustracio.addLlista_tipus_ilustracio(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Dibuixant: " + obj_llista_dibuixant.m_llista.length;
	};
	my_request18.m_request.send(null);
	}	
}
var obj_llista_tipus_ilustracio=new llista_tipus_ilustracio();

var my_request19=new request();
function actuacio (a,b,c,d,e,f)
{
	this.m_id_actuacio=a;
	this.m_periode_actuacions=b;
	this.m_publicacio_id=c;
	this.m_tip_act_id=d;
	this.m_companyia_id=e;
	this.m_lloc_id=f;
}
function llista_actuacio()
{
this.m_llista=[];	
this.addLlista_actuacio = function(a1,b1,c1,d1,e1,f1){
	var filanova = new actuacio(a1,b1,c1,d1,e1,f1);
	this.m_llista.push(filanova);
};
if (!my_request19.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Representacio - actuació: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request19.m_request.open("GET","actuacio.xml",true);
	my_request19.m_request.onreadystatechange = function (){
		if (my_request19.m_request.readyState==4)
			{
			if(my_request19.m_request.status==200)
				{
				var xmlDoc=my_request19.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2=0; var d2=0; var e2=0; var f2=0; 
					
					a2=x[i].getElementsByTagName("id_actuacio")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("periode_actuacions")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("periode_actuacions")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("periode_actuacions")[0].childNodes[0].nodeValue;}}
					
					c2=x[i].getElementsByTagName("publicacio_id")[0].childNodes[0].nodeValue;
					d2=x[i].getElementsByTagName("tip_act_id")[0].childNodes[0].nodeValue;
					e2=x[i].getElementsByTagName("companyia_id")[0].childNodes[0].nodeValue;
					f2=x[i].getElementsByTagName("lloc_id")[0].childNodes[0].nodeValue;
					
					//document.form.debug.value +=" id: "+a2+ " periode actuacions: "+b2 +"Publicacio id:" + c2;
					 obj_llista_actuacio.addLlista_actuacio(a2,b2,c2,d2,e2,f2); 
				  }
				}
			}
		//document.form.debug.value +="Actuacio: " + obj_llista_actuacio.m_llista.length;
	};
	my_request19.m_request.send(null);
	}	
}
var obj_llista_actuacio=new llista_actuacio();

var my_request20=new request();
function companyia(a,b)
{
	this.m_id_companyia=a;
	this.m_nom_comp=b;
}
function llista_companyia()
{
this.m_llista=[];	
this.addLlista_companyia = function(a1,b1){
	var filanova = new companyia(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request20.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Companyia: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request20.m_request.open("GET","companyia.xml",true);
	my_request20.m_request.onreadystatechange = function (){
		if (my_request20.m_request.readyState==4)
			{
			if(my_request20.m_request.status==200)
				{
				var xmlDoc=my_request20.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_companyia")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("nom_comp")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("nom_comp")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("nom_comp")[0].childNodes[0].nodeValue;}}
										
					
					//document.form.debug.value +=" id: "+a2+ " nom companyia: "+b2;
					 obj_llista_companyia.addLlista_companyia(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Companyia: " + obj_llista_companyia.m_llista.length;
	};
	my_request20.m_request.send(null);
	}	
}
var obj_llista_companyia=new llista_companyia();


var my_request21=new request();
function lloc(a,b)
{
	this.m_id_lloc=a;
	this.m_lloc=b;
}
function llista_lloc()
{
this.m_llista=[];	
this.addLlista_lloc = function(a1,b1){
	var filanova = new lloc(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request21.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Lloc: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request21.m_request.open("GET","lloc.xml",true);
	my_request21.m_request.onreadystatechange = function (){
		if (my_request21.m_request.readyState==4)
			{
			if(my_request21.m_request.status==200)
				{
				var xmlDoc=my_request21.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_lloc")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("lloc")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("lloc")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("lloc")[0].childNodes[0].nodeValue;}}
					//document.form.debug.value +=" id: "+a2+ " lloc: "+b2;
					 obj_llista_lloc.addLlista_lloc(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Companyia: " + obj_llista_companyia.m_llista.length;
	};
	my_request21.m_request.send(null);
	}	
}
var obj_llista_lloc=new llista_lloc();



var my_request22=new request();
function tipus_actuacio(a,b)
{
	this.m_id_tip_act=a;
	this.m_concepte=b;
}
function llista_tipus_actuacio()
{
this.m_llista=[];	
this.addLlista_tipus_actuacio = function(a1,b1){
	var filanova = new tipus_actuacio(a1,b1);
	this.m_llista.push(filanova);
};
if (!my_request22.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Lloc: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request22.m_request.open("GET","tipus_actuacio.xml",true);
	my_request22.m_request.onreadystatechange = function (){
		if (my_request22.m_request.readyState==4)
			{
			if(my_request22.m_request.status==200)
				{
				var xmlDoc=my_request22.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; 
					
					a2=x[i].getElementsByTagName("id_tip_act")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("concepte")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("concepte")[0].childNodes[0].nodeValue;}}
					//document.form.debug.value +=" id: "+a2+ " concepte: "+b2;
					 obj_llista_tipus_actuacio.addLlista_tipus_actuacio(a2,b2); 
				  }
				}
			}
		//document.form.debug.value +="Companyia: " + obj_llista_companyia.m_llista.length;
	};
	my_request22.m_request.send(null);
	}	
}
var obj_llista_tipus_actuacio=new llista_tipus_actuacio();

var my_request23=new request();
function laconversa(a,b,c)
{
	this.m_id=a;
	this.m_pregunta=b;
	this.m_resposta=c;
	this.m_visible=0;
}
function llista_laconversa()
{
this.m_llista=[];	
this.addLlista_laconversa = function(a1,b1,c1){
	var filanova = new laconversa(a1,b1,c1);
	this.m_llista.push(filanova);
};
if (!my_request23.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Lloc: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request23.m_request.open("GET","laconversa.xml",true);
	my_request23.m_request.onreadystatechange = function (){
		if (my_request23.m_request.readyState==4)
			{
			if(my_request23.m_request.status==200)
				{
				var xmlDoc=my_request23.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2="";
					
					a2=x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("pregunta")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("pregunta")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("pregunta")[0].childNodes[0].nodeValue;}}

					if (x[i].getElementsByTagName("resposta")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("resposta")[0].childNodes[0].nodeType==3)
//						 {c2=x[i].getElementsByTagName("resposta")[0].childNodes[0].nodeValue;}}
					 		{c2=getNodeText(x[i].getElementsByTagName("resposta")[0]);}}				
					
					//document.form.debug.value +=" id: "+a2+ " pregunta: "+b2 + "resposta: "+c2;
					 obj_llista_laconversa.addLlista_laconversa(a2,b2,c2); 
				  }
				}
			}
		//document.form.debug.value +="Companyia: " + obj_llista_companyia.m_llista.length;
	};
	my_request23.m_request.send(null);
	}	
}
var obj_llista_laconversa=new llista_laconversa();

var my_request24=new request();
function llibresunenun(a,b,c,d)
{
	this.m_id=a;
	this.m_titol=b;
	this.m_comentari=c;
	this.m_escrits_id=d;
	this.m_visible=0;
}
function llista_llibresunenun()
{
this.m_llista=[];	
this.addLlista_llibresunenun = function(a1,b1,c1,d1){
	var filanova = new llibresunenun(a1,b1,c1,d1);
	this.m_llista.push(filanova);
};
if (!my_request24.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Lloc: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request24.m_request.open("GET","llibresunenun.xml",true);
	my_request24.m_request.onreadystatechange = function (){
		if (my_request24.m_request.readyState==4)
			{
			if(my_request24.m_request.status==200)
				{
				var xmlDoc=my_request24.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2=""; var d2=0;
					
					a2=x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("titol")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("titol")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("titol")[0].childNodes[0].nodeValue;}}

					if (x[i].getElementsByTagName("comentari")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("comentari")[0].childNodes[0].nodeType==3)
//						 {c2=x[i].getElementsByTagName("comentari")[0].childNodes[0].nodeValue;}}
			 		{c2=getNodeText(x[i].getElementsByTagName("comentari")[0]);}}									

				d2=x[i].getElementsByTagName("escrits_id")[0].childNodes[0].nodeValue;
					
					//document.form.debug.value +=" id: "+a2+ " titol: "+b2 + "comentari: "+c2 + "escrits_id" + d2;
					 obj_llista_llibresunenun.addLlista_llibresunenun(a2,b2,c2,d2); 
				  }
				}
			}
	};
	my_request24.m_request.send(null);
	}	
}
var obj_llista_llibresunenun=new llista_llibresunenun();

var my_request25=new request();
function apendix(a,b,c)
{
	this.m_id=a;
	this.m_titol=b;
	this.m_explicacio=c;
	this.m_visible=0;
}
function llista_apendix()
{
this.m_llista=[];	
this.addLlista_apendix = function(a1,b1,c1){
	var filanova = new apendix(a1,b1,c1);
	this.m_llista.push(filanova);
};
if (!my_request25.m_request) 
{alert("Error inicialitzant XMLHttpRequest del cos principal: Lloc: Proveu de recarregar la pagina, o be usar un altre explorador: el Firefox, per exemple.");}
else
	{
	my_request25.m_request.open("GET","apendix.xml",true);
	my_request25.m_request.onreadystatechange = function (){
		if (my_request25.m_request.readyState==4)
			{
			if(my_request25.m_request.status==200)
				{
				var xmlDoc=my_request25.m_request.responseXML; 
				var x=xmlDoc.getElementsByTagName("Table");
				for (var i=0;i<x.length;i++)
				  { 
					var a2=0; var b2=""; var c2=""; var d2=0;
					
					a2=x[i].getElementsByTagName("id")[0].childNodes[0].nodeValue;
					
					if (x[i].getElementsByTagName("titol")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("titol")[0].childNodes[0].nodeType==3)
						 {b2=x[i].getElementsByTagName("titol")[0].childNodes[0].nodeValue;}}

					if (x[i].getElementsByTagName("explicacio")[0].hasChildNodes)
					 {if(x[i].getElementsByTagName("explicacio")[0].childNodes[0].nodeType==3)
//						 {c2=x[i].getElementsByTagName("explicacio")[0].childNodes[0].nodeValue;}}
			 		{c2=getNodeText(x[i].getElementsByTagName("explicacio")[0]);}}									
					
					//document.form.debug.value +=" id: "+a2+ " titol: "+b2 + "explicacio: "+c2;
					 obj_llista_apendix.addLlista_apendix(a2,b2,c2); 
				  }
				}
			}
		//document.form.debug.value +="Companyia: " + obj_llista_companyia.m_llista.length;
	};
	my_request25.m_request.send(null);
	}	
}
var obj_llista_apendix=new llista_apendix();
clic_coberta();
setTimeout("novetats()",6000);


