function MostraQ()
{
	var datastring1="",datalong1="",datastring2="",datalong2="";
	datactual = new Date ();
	mesactual = new Date ();
	texte1 = new Array("La storia dell'interpretazione del Tirant lo Blanch ha visto come centrale la stessa questione: definito di volta in volta, tra l'altro, come","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent","Miquel Martí i Pol no s'ha dedicat només a la poesia: tot i considerar que la prosa és la seva assignatura pendent");
	texte2 = new Array("mc-icons/tirantloblanc.jpg","mc-icons/miquelmarti.jpg","mc-icons/miquelmarti.jpg","mc-icons/miquelmarti.jpg","mc-icons/miquelmarti.jpg","mc-icons/miquelmarti.jpg");
	texte3 = new Array("http://www.uoc.edu/lletra/obres/tirant/index.html","http://www.uoc.edu/lletra/noms/mmartiipol/index.html","http://www.uoc.edu/lletra/noms/mmartiipol/index.html","http://www.uoc.edu/lletra/noms/mmartiipol/index.html","http://www.uoc.edu/lletra/noms/mmartiipol/index.html","http://www.uoc.edu/lletra/noms/mmartiipol/index.html");
	dates = new Array("20031001","20031016","20031101","20031116","20031201","20031216")
	
	//any
	datatotal=String(datactual.getFullYear());
	
	//mes
	mesactual=datactual.getMonth()+1;	
	datastring2=String(mesactual);
	datalong2=datastring2.length;
	
	if (datalong2<2) datatotal=datatotal+"0"+datastring2;		
	else datatotal=datatotal+datastring2;
	
	//dia
	datastring1=String(datactual.getDate());
	datalong1=datastring1.length;
	
	if (datalong1<2) datatotal=datatotal+"0"+datastring1;
	else datatotal=datatotal+datastring1;
	
	for(var k=0;k<6;k++){
		//alert("data del sistema " + datatotal + "-- data del array " + dates[k]);
	
		if (dates[k]==datatotal) {
			document.write('<a href="'+texte3[k]+'"><img src="'+texte2[k]+'" valign="top" align="left" border="0" hspace="15"></a>'+texte1[k]+'');
			//alert("estoy en igual"); 
			//alert(k);
			break;}
		else if (dates[k]>datatotal) {
			document.write('<a href="'+texte3[k-1]+'"><img src="'+texte2[k-1]+'" valign="top" align="left" border="0" hspace="15"></a>'+texte1[k-1]+'');
			//alert("escogo el anterior"); 
			//alert(k);
			break;}		
		}
	
}	

/* Funcions javascript per a enviament del missatge a un amic */
//Detecta navegadors
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;


function envia(titol) {
	var theUrl;

	theUrl = location.href;
	window.open('http://www.uoc.edu/lletra/esp/formulari_amic.html?Titol='+titol+'&url='+theUrl+'','Formulari','width=540,height=450,location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=no,status=no');
}

function caixa(){
	if (document.all){
	document.write('<img src="../img/pix_trans.gif" width="3" height="1" border="1"/><INPUT class="textarea2" VALUE="" NAME="QueryText" SIZE="18">');
	}else{
	document.write('<img src="../mc-icons/pix_trans.gif" width="3" height="1" /><INPUT class="log6" VALUE="" NAME="QueryText" SIZE="12">');
	}
}

function caixa2(){
	if (document.all){
	document.write('<img src="../mc-icons/pix_trans.gif" width="3" height="1"/><INPUT class="textarea2" VALUE="" NAME="QueryText" SIZE="18">');
	}else{
	document.write('<img src="../mc-icons/pix_trans.gif" width="3" height="1"/><INPUT class="log6" VALUE="" NAME="QueryText" SIZE="11">');
	}
}
// Funcions

function obrirfinestra(a){
window.open(a,'Finestra','height=300,width=338,scrollbars=no');
return false;
}
function obrirfinestra2(a){
window.open(a,'Finestra2','height=300,width=418,scrollbars=yes');
return false;
}
function obrirfinestra3(a){
window.open(a,'Finestra3','height=400,width=530,scrollbars=no');
return false;
}
function obrirfinestra4(a){
window.open(a,'Finestra4','height=350,width=500,scrollbars=no');
return false;
}
function obrirfinestra5(a){
window.open(a,'Finestra5','height=400,width=500,scrollbars=no');
return false;
}

function obrirfinestra6(a){
window.open(a,'Finestra6','height=400,width=650,scrollbars=yes');
return false;
}

function obrirfinestra7(a){
window.open(a,'Finestra7','height=400,width=450,scrollbars=yes');
return false;
}

function obrirfinestra8(a){
window.open(a,'Finestra8','width=770,height=440,location=no,toolbar=no,directories=no,menubar=no,resizable=no,scrollbars=no,status=no');
return false;
}

function obrirfinestra9(a){
window.open(a,'Finestra9','height=500,width=550,scrollbars=yes');
return false;
}

function obrirfinestra10(a){
window.open(a,'Finestra9','height=520,width=750,scrollbars=yes');
return false;
}

function obrirfinestra11(a){
window.open(a,'Finestra11','height=350,width=500,scrollbars=yes');
return false;
}

function obrirfinestra15(a){
window.open(a,'Finestra11','height=290,width=500,scrollbars=yes');
return false;
}

function obrirfinestra14(a){
window.open(a,'Finestra14','height=350,width=620,scrollbars=yes');
return false;
}

function obrirfinestra12(a){
window.open(a,'Finestra12');
return false;
}

function obrirfinestra13(a){
window.open(a,'Finestra13','height=350,width=702,scrollbars=no');
return false;
}


function canviacolor(pep,colorp){
		pep.bgColor=colorp;
}


//// Menu desplaçable varia 09/12/2002
var pujar=false;
function mou(){
	if (pujar==true)	{	menuUp()
	}else{
	menuDown()	
	}	
document.cercaform.Terms.focus();
}

function canvia_arrow() {
	if (!isNS4)
	{
	if (pujar==true){
		MM_swapImage('mostrar','','mc-icons/arrow_on_up.gif',1);
		}else{
		MM_swapImage('mostrar','','mc-icons/arrow_on.gif',1);
		}	
	}
}

function canvia_arrow_off() {
	if (!isNS4)
	{
	if (pujar==true){
		MM_swapImage('mostrar','','mc-icons/arrow_off_up.gif',1);
		}else{
		MM_swapImage('mostrar','','mc-icons/arrow_off.gif',1);
		}	
	}	
}

function menuUp(){		
	if (isIE5) {
	theObject = menuvaria.style;     
	}else if (isNS6){
		theObject=document.getElementById('menuvaria').style;	  
	}else{ //Ns 4.x	
		theObject=document.layers['menuvaria'];				
	}				
	if (parseInt(theObject.top) > 145) {						
		theObject.top = parseInt(theObject.top) - 5;		
		setTimeout('menuUp()', 1);
	}else {
		theObject.top =145;				
		pujar=false;
		if (!isNS4)
		{
			MM_swapImage('mostrar','','mc-icons/arrow_off.gif',1);
		}
	}
}	
//100
//345
function menuDown(){	
	if (isIE5) {
	theObject = menuvaria.style;     
	}else if (isNS6){
		theObject=document.getElementById('menuvaria').style;	  
	}else{ //Ns 4.x	
		theObject=document.layers['menuvaria'];				
	}				
	if (parseInt(theObject.top) < 375) {						
		theObject.top = parseInt(theObject.top) + 5;		
		setTimeout('menuDown()', 1);
	}else {
		theObject.top =375;		
		pujar=true;
		if (!isNS4)
		{
			MM_swapImage('mostrar','','mc-icons/arrow_off_up.gif',1);		
		}
	}
}	

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function option_manager(objecte_llista){
		if (objecte_llista.selectedIndex!=0){        			        			        			
			window.open(objecte_llista.options[objecte_llista.selectedIndex].value,'_blank')        			
			objecte_llista.selectedIndex=0;        			        			        			
		}
}
/*
function lang(idioma){
	var localizacion="";
	localizacion=location.href;
	if (idioma=='cat'){
	//location.href=localizacion.replace(/www.lletra.com/g,'www.uoc.edu/lletra');
	location.href=localizacion.replace(/www.lletra.com/g,'www.lletra.cat');
	}else if(idioma=='eng'){
	location.href=localizacion.replace(/www.lletra.com/g,'www.lletra.net');
	}
}	
*/

function lang(idioma){
	var dir="";
	var d1, d2;
	dir=location.href;
	dir=dir.substring(0,dir.lastIndexOf("/"));
	d1 = dir.substring(dir.lastIndexOf("/")+1,dir.length);
	dir = dir.substring(0,dir.lastIndexOf("/"));
	d2 = dir.substring(dir.lastIndexOf("/")+1,dir.length);
	dir = dir.substring(0,dir.lastIndexOf("/"));
	var destino="";
	if(idioma=="cat"){
		destino = "http://www.lletra.cat/"+d2+"/"+d1+"/"; 
	}
	if(idioma=="eng"){
		destino = "http://www.lletra.net/"+d2+"/"+d1+"/"; 
	}
	location.href=destino;
}