//var _p=30;var _t=1;
var _p=10;var _t=10;
var _dIn="R";var _dOut="T";
var _h=515;var _w=770;
var _w00=690;var _h00=280;
var _wM=180;_hM1=100;_l=10;
var _id="";
var _te=0;var _tep=0;
var despliega;var pliega;var entrar;var diI;var diN;
var _ac=new Array();var _acp=new Array();
var _m;var _mI;var _dentro=false;
function onload_(){
	if(navigator.userAgent.indexOf("Netscape")!=-1){
		despliega=despliega2;pliega=pliega2;
		entrar=entrar2;
		diI=diI2;diN=diN2;
		document.getElementById("xI").style.overflow="hidden";
	}else{
		despliega=despliega1;pliega=pliega1;
		entrar=entrar1;
		diI=diI1;diN=diN1;
	}
	centrar();
	window.onresize=new Function("centrar()");
	document.onkeydown=_was;
	_m=new Array();
	_mI=new Array();
	var oTag=document.getElementsByTagName("span");
	for (var i=0;i<oTag.length;i++){
		var oOpc=oTag[i];
		if(oOpc.getAttribute("id")){
			var o=oOpc.getAttribute("id");
		 	if(o.charAt(0)=="_"){
		 		if(o.length<=6&&!oOpc.className) oOpc.className="NNm"+o.charAt(1);
				oOpc.onmouseover=new Function("clase('"+o+"','Ox');");
				oOpc.onmouseout=new Function("clase('"+o+"','Nx')");
				if(o=="_0ES") oOpc.onclick=new Function("entrar();");
				else if(o!="_0GA"&&o!="_0IN") {
					oOpc.onclick=new Function("pinchar('"+o+"','');");
					if ("A1234".indexOf(o.charAt(1))!=-1&&o.length==6) _m[_m.length]=o;
					if ("234".indexOf(o.charAt(1))!=-1&o.length==6)diN(oOpc.getAttribute("id"));
				}
			}
		}
	}
	oTag=document.getElementsByTagName("div");
	for (var i=0;i<oTag.length;i++){
		var oOpc=oTag[i];
		if(oOpc.getAttribute("id"))
			var o=oOpc.getAttribute("id");
		 	if(o.charAt(0)=="I"){
		 		if(navigator.userAgent.indexOf("Netscape")!=-1){
					oOpc.style.position="absolute";
					oOpc.style.top="10px";
					oOpc.style.overflow="auto";
					oOpc.style.width="95%";
					oOpc.style.height="90%";
				}
		 		diN(o);
		 		_mI[_mI.length]=o;
		 	}
	}
	hid("FrFe");hid("FrI");hid("FrM1");hid("FrM2");hid("MATx");hid("Fr00");
	ba("FoGe","osc");ba("FoTi","osc");ba("FoMA","muyosc");
	dim("FrTi",30,-14,600,0);dim("FrLo",660,35,0,0);dim("FrM0",30,428,0,0);dim("Fr00",40,30,_w00,_h00);
	vis("FoGe");
	var iSr=new Array("pat1","bord","clau","brun","juli","merl","juan","elsa","samo","ague","lete","imel","dolo","danz","char","raul","afri","deca","canc","arsc","tria","cebr","sarr");
	var iW=new Array (81,12,                        160,   200,   200,    180,   120,   150,   200,  130,   140,   200,   140,   160,   160,   160,   160,   200,   160,   250,   200,   200,   200);
	var iH=new Array (55,55,                         207,   131,   146,    135,   167,   174,   150,  186,   208,   85,    186,   204,   150,   155,   218,   142,   239,   132,   150,   155,   148);
	var iA=new Array ("Xacobeo","borde derecho","Claudio Astronio","Bruno Forst","Julián Elvira","Luis M. de Merlo","Juan Carlos Asensio","Elsa Ferrer","Samos","Águeda Matute","Carlos G. Amigo","Imelda Ferrer","Dolores Seijas","Inquedanza","Charo Pita","Raúl Prieto","África Morris","deca","Canco López","Ars Combinatoria","Triacastela","O Cebreiro","Sarria");
	var iL=new Array("xacobeo.es");
	oTag=document.getElementsByTagName("img");
	for(var i=0;i<oTag.length;i++){
		var oI=oTag[i];
		if(oI.getAttribute("name")){
			var o=oI.getAttribute("name");
			if(o=="logo"){
	 			if(!oI.src) oI.src="../images/logo.gif";
	 			if(oI.style.width=="") oI.style.width="100px";
	 			if(oI.parentNode.style.width=="") oI.parentNode.style.width="100px";
	 			if(oI.style.height=="") oI.style.height="100px"
	 			oI.alt="logotipo de Ars Combinatoria";
			}else{
			 	for(var j=0;j<iSr.length;j++){
			 		if(iSr[j]==o){
			 			if(!oI.src) oI.src="../images/"+o.substr(0,4)+".jpg";
			 			if(oI.style.width=="") oI.style.width=iW[j]+"px";
			 			if(oI.style.height==""&&iH[j]!=0) oI.style.height=iH[j]+"px"
			 			oI.alt=iA[j];
						if(o.indexOf("pat")==0) oI.parentNode.href="http://www."+iL[j];
						else if(oI.parentNode.style.width=="") oI.parentNode.style.width=iW[j]+"px";
						break;
					}
				}
			}
			if(oI.getAttribute("id")&&oI.getAttribute("id").charAt(0)=="_"){
			 	oI.className="imgOut";
				oI.onmouseover=new Function("{this.className='imgIn'}");
				oI.onmouseout=new Function("{this.className='imgOut'}");
				oI.onclick=new Function("pinchar('"+oI.getAttribute("id")+"','');");

			}
		}
	}
	if (location.href.indexOf("#pr")!=-1){
		_p=50;_t=4;
		entrar1();
	}
}
function entrar1(){
	_te=1;
	hid("FrM0");
	dim("FrM1",_l,345,_wM,85);
	dim("FrM2",_l,30,_wM,280);
	dim("MATx",200,445,175,70);
	var acIn=new Array();
	acIn[0]=despliegaStr("FoMA","R",0,0,_w,_h,"_ac[1]");
	acIn[1]="mueve(\"FrLo\",640,122,30,435,\"_ac[2]\")";
	acIn[2]="tiTam(70,39,\"_ac[3]\")";
	acIn[3]="mueve(\"FrTi\","+_l+",455,10,355,\"_ac[4]\")";
	if (location.href.indexOf("#pr")!=-1) acIn[4]="pinchar(\""+location.href.substring(location.href.indexOf("#pr")+3,location.href.indexOf("#pr")+9)+"\",\"_ac[6]\")";
	else acIn[4]="pinchar00(\"_ac[5]\")";
	acIn[5]="espera(2000,\"_ac[6]\")";
	acIn[6]=despliegaStr("FoTi","R",200,345,570,85,"_ac[7]");
	acIn[7]=despliegaStr("FrM1","R",0,0,_wM,_hM1,"_ac[8]");
	acIn[8]=despliegaStr("FrFe","T",0,0,440,30,"_ac[9]");
	acIn[9]=despliegaStr("MATx","T",0,0,175,70,"_ac[10]");
	acIn[10]="setTe0(\"_ac[11]\")";
	acIn[11]="_dentro=true;";
	_ac=acIn;
	setTimeout(acIn[0],1);
	document.getElementById("_00").onclick=new Function("pinchar00('');");
	document.getElementById("_00").style.cursor="pointer";
}
function entrar2(){
	hid("FrM0");
	dim("FrM1",_l,330,_wM,_hM1);
	dim("FrM2",_l,30,_wM,280);
	dim("MATx",200,445,175,70);
 	dim("FrTi",475,330,0,0);
	dim("FrLo",122,435,0,0);
	fo("FrTi",39);
	fo("LCA",62);
	fo("LCC",62);
	document.getElementById("_00").onclick=new Function("pinchar00('');");
	document.getElementById("_00").style.cursor="pointer";
	vis("MATx");
	vis("FrM1");
	vis("FrFe");
	pinchar00('');
	_dentro=true;
}
function _was(ev){
	if(!_dentro||_te!=0||_tep!=0||_m.length==0)return; 
	var k;var o;
	if(!ev){
		k=window.event.keyCode;
		o=window.event.srcElement.name;
	}else if(ev.keyCode){
		k=ev.keyCode;
		o=ev.target.name;
	}else{
		k=ev;
		el="";
	}
	if(_id=="_1P000"&&(k==34)) {pinchar("_1PE00","");}
	else if(_id=="_1P000"&&k==33) {pinchar("_A4000","");}
	else if(_id=="_A2000"&&k==33) {pinchar("_1T000","");}
	else if(k==80) {pinchar("_1P000","");}
	else if(k==65) {pinchar("_1A000","");}
	else if(k==67) {pinchar("_1U000","");}
	else if(k==84) {pinchar("_1T000","");}
	else if(k==34){
		var enco=false;
		for(var i=0;i<_m.length;i++){
			if(_id.charAt(1)=="1"&&_m[i].charAt(1)!="1"&&N1(_m[i])==N1(_id)){
				enco=true;break;
			}else if(_id.charAt(1)!=1&&_m[i]==_id){
				i=(i==_m.length-1)?0:i+1;
				enco=true;break;
			}
		}
		if(enco) pinchar(_m[i],"");
	}
	else if(k==33){
		var enco=0;
		for(var i=_m.length-1;i>=0;i--){
			if(enco==0&&(_id.charAt(1)=="1"||_id.charAt(1)=="A")&&_m[i]==_id){
				enco=1;
			}else if(enco==1&&_m[i].charAt(1)==_id.charAt(1)){
				enco=9;break;
			}else if(enco==0&&_id.charAt(1)!="1"&&_m[i]==_id){
				enco=2;
			}else if(enco==2&&N1(_m[i])==N1(_id)){
				enco=9;break;
			}else if(enco==2&&N1(_m[i])!=N1(_id)){
				enco=-1;break;
			}
		}
		if(enco==9) pinchar(_m[i],"");
		else if(enco==-1||enco==0) pinchar("_1"+N1(_id)+"000","");
	}
}
function clase(id,op){
	if(document.getElementById(id)){
		var cl=document.getElementById(id).className;
		document.getElementById(id).className=(op.charAt(0)=='x'?cl.charAt(0):op.charAt(0))+(op.charAt(1)=='x'?cl.charAt(1):op.charAt(1))+cl.substring(2,cl.length);
	}
}
function despliegaStr(f,d,l,t,w,h,s){return("despliega('"+f+"','"+d+"',"+l+","+t+","+w+","+h+",0,'"+s+"')");}
function vis(f){document.getElementById(f).style.visibility="visible";}
function hid(f){document.getElementById(f).style.visibility="hidden";}
function diN1(f){document.getElementById(f).style.display="none";}
function diN2(f){if(f.charAt(0)=="I") hid(f); else diN1(f);}
function diI1(f){document.getElementById(f).style.display="inline";}
function diI2(f){if(f.charAt(0)=="I") vis(f); else diI1(f);}
function diNinfo(s){
	for(var i=0;i<_mI.length;i++) diN(_mI[i]);
	haz(s)
}
function fo(f,t){document.getElementById(f).style.fontSize=parseInt(t)+"px";}
function ba(f,i){document.getElementById(f).style.background="url(../images/fondo"+i+".jpg) black";}
function tiTam(td,th,s){
	if(td>th){
		td=td-10;
		if(td<th)td=th;
	}else if(td<th){
		td=td+10;
		if(td>th)td=th;
	}
	fo("FrTi",td);
	fo("LCA",td*8/5);
	fo("LCC",td*8/5);
	if (td!=th) setTimeout("tiTam("+td+","+th+",'')",400);
	if(s!="") haz(s);
}
function tit(i){
	var o;
	if(document.getElementById("_1"+i+"000")) o=document.getElementById("_1"+i+"000");
	else if(document.getElementById("_A"+i+"000")) o=document.getElementById("_A"+i+"000");
	if(o.firstChild&&o.firstChild.nodeValue!="") return o.firstChild.nodeValue;
	else if(o.innerText) return o.innerText;
	else if(o.innerHTML) return o.innerHTML;
	else return "";
}
function espera(m,s){if(s!="") setTimeout(eval(s),m); else _te=0;}
function haz(s){if(s!="") setTimeout(eval(s),1); else _te=0;}
function setTe0(s){_te=0;haz(s);}
function setTep0(s){_tep=0;haz(s);}
function dim(f,l,t,w,h){
	if(!document.getElementById(f)) return;
	var oFr=document.getElementById(f);
	oFr.style.left=l+"px";
	oFr.style.width=(w==0)?"":w+"px";
	oFr.style.top=t+"px";
	oFr.style.height=(h==0)?"":h+"px";
}
function clip(f,t,r,b,l){document.getElementById(f).style.clip="rect("+t+"px,"+r+"px,"+b+"px,"+l+"px)";}
function N1(i){return(i.charAt(2));}
function N2(i){return(i.substring(2,4));}
function N3(i){return(i.substring(2,5));}
function N4(i){return(i.substring(2,6));}
function mueve(f,ld,lh,td,th,sig){
	if(!document.getElementById(f))
		haz(sig);
	else{
		dim(f,ld,td,0,0);
		var fu;
		if(th==td&&ld>lh) fu=mueveRL;
		else if(th==td&&ld<lh) fu=mueveLR;
		else if(lh==ld&&td>th) fu=mueveBT;
		else if(lh==ld&&td<th) fu=mueveTB;
		else if(td<th) fu=mueveDT;
		else fu=mueveDB;
		fu(f,ld,lh,td,th,sig);
	}
}
function mueveDT(f,ld,lh,td,th,sig){ 
	var dif;var l;var t;
	var difl=Math.abs(lh-ld);
	var dift=th-td;
	if(difl>dift){
		l=ld+_p*((lh<ld)?-1:1);
		t=td+parseInt((_p*dift)/difl);
		dif=((lh<ld)?l-lh:lh-l);
	}else if(dift>difl){
		t=td+_p;
		l=ld+parseInt((_p*difl)/dift)*((lh<ld)?-1:1);
		dif=th-t;
	}else{
		t=td+_p;
		l=ld+_p*((lh<ld)?-1:1);
		dif=th-t;
	}
	if(dif<=0){
		dim(f,lh,th,0,0);
		haz(sig);
	}else{
		ld=l;
		td=t;
		dim(f,l,t,0,0);
		setTimeout("mueveDT('"+f+"',"+ld+","+lh+","+td+","+th+",'"+sig+"')",_t*1.7);
	}
}
function despliega1(f,d,l,t,w,h,c,sig){
	if(!document.getElementById(f))
		haz(sig);
	else{ 
		vis(f);
		c=c+_p;
		dif=(d=="L"||d=="R")?w-c:h-c;
		if(dif<=0){
			clip(f,t,l+w,t+h,l);
			haz(sig);
		}else{
			var n1=(d=="B")?t+h-c:t;
			var n2=(d=="L")?l+c:l+w;
			var n3=(d=="T")?t+c:t+h;
			var n4=(d=="R")?l+w-c:l;
			clip(f,n1,n2,n3,n4);
			setTimeout("despliega1('"+f+"','"+d+"',"+l+","+t+","+w+","+h+","+c+",'"+sig+"')",_t*(d=="L"||d=="R")?1:1.5);
		}
	}
}
function despliega2(f,d,l,t,w,h,c,sig){
	clip(f,t,l+w,t+h,l);
	vis(f);
	haz(sig);
}
function pliega1(f,d,l,t,w,h,c,sig){
	if(!document.getElementById(f)){
		haz(sig);
	}else{
		c=c+_p;
		dif=(d=="T"||d=="B")?h-c:w-c;
		if(dif<=0){
			clip(f,0,0,0,0);
			haz(sig);
		}else{
			var n1=(d=="T")?t+c:t;
			var n2=(d=="R")?l+w-c:l+w;
			var n3=(d=="B")?t+h-c:t+h;
			var n4=(d=="L")?l+c:l;
			clip(f,n1,n2,n3,n4);
			setTimeout("pliega1('"+f+"','"+d+"',"+l+","+t+","+w+","+h+","+c+",'"+sig+"')",_t*(d=="L"||d=="R")?1:1.5);
		}
	}
}
function pliega2(f,d,l,t,w,h,c,sig){
	clip(f,0,0,0,0);
	haz(sig);
}
function pinchar(id,s){
	if(_id==id||_tep!=0) return;
	_tep=1;
	for(var i=0;i<_acp.length;i++) _acp[i]="";
	//resalte
	if(N4(id)!=N4(_id)) {clase("_4"+N4(_id),'xN');clase("_4"+N4(id),'xS');}
	if(N3(id)!=N3(_id)) {clase("_3"+N3(_id)+"0",'xN');clase("_3"+N3(id)+"0",'xS');}
	if(N2(id)!=N2(_id)) {clase("_2"+N2(_id)+"00",'xN');clase("_2"+N2(id)+"00",'xS');}
	if(N1(id)!=N1(_id)) {
		clase("_1"+N1(_id)+"000",'xN');
		clase("_A"+N1(_id)+"000",'xN');
		clase("_1"+N1(id)+"000",'xS');
		clase("_A"+N1(id)+"000",'xS');
	}
	var n=0;
	//ocultar
	if (_id=="_00"){
		_acp[n]="pliega(\"Fr00\",\""+_dOut+"\",0,0,"+_w00+","+_h00+",0,'_acp["+(n+1)+"]')";
		n++;
	}else if(_id!=""&&N4(id)!=N4(_id)){
		_acp[n]="infoOut('_acp["+(n+1)+"]')";
		n++;
		if(N1(id)!=N1(_id)){
			_acp[n]="menuOut('_acp["+(n+1)+"]')";
			n++;
		}
		_acp[n]="diNinfo('_acp["+(n+1)+"]')";
		n++;
	}
	//mostrar
	if(N4(id)!=N4(_id)){
		_acp[n]="menuIn('"+tit(N1(id))+"','"+id+"','_acp["+(n+1)+"]')";
		n++;
		_acp[n]="infoIn('"+N4(_id)+"','"+N4(id)+"','_acp["+(n+1)+"]')";
		n++;
	} 
	//incluir secciones comunes
	var oEl;
	for (i=1;document.getElementById(N4(id)+"A"+i);i++){
		oEl=document.getElementById(N4(id)+"A"+i);
		oEl.appendChild(document.getElementById(oEl.getAttribute("name")));
	}
	_acp[n]="setTep0('"+s+"')";
	setTimeout(_acp[0],1);
	_id=id;
}
function pinchar00(s){
	if(_id=="_00"||_tep!=0) return;
	_tep=1;
	for(var i=0;i<_acp.length;i++) _acp[i]="";
	var n=0;
	if (_id!=""){
		clase("_4"+N4(_id),'xN');
		clase("_3"+N3(_id)+"0",'xN');
		clase("_2"+N2(_id)+"00",'xN');
		clase("_"+_id.charAt(1)+N1(_id)+"000",'xN');
		_acp[n]="infoOut('_acp["+(n+1)+"]')";
		n++;
		_acp[n]="menuOut('_acp["+(n+1)+"]')";
		n++;
	}
	_acp[n]="diNinfo('_acp["+(n+1)+"]')";
	n++;
	_acp[n]=despliegaStr("Fr00",_dIn,0,0,_w00,_h00,"_acp["+(n+1)+"]");
	n++;
	_acp[n]="setTep0(\""+s+"\")";
	_id="_00";
	setTimeout(_acp[0],1);
}
function menuIn(t,el,sig){
	document.getElementById("tiM2").innerHTML=t;
	for(var i=0;i<_m.length;i++)
		if (_m[i].charAt(1)!="1")
			if((_m[i].charAt(1)=="2"&&N1(_m[i])==N1(el))||(_m[i].charAt(1)=="3"&&N2(_m[i])==N2(el))||(_m[i].charAt(1)=="4"&&N3(_m[i])==N3(el))) diI(_m[i]);
			else if (_m[i].charAt(1)!="A") diN(_m[i]);
	despliega("FrM2","B",0,0,_wM,280,0,sig);
}
function menuOut(sig){
	pliega("FrM2","T",0,0,_wM,280,0,sig);
}
function infoIn(elv,eln,sig){
	if(document.getElementById("I"+elv)) diN("I"+elv);
	if(document.getElementById("I"+eln)) diI("I"+eln);	
	despliega("FrI",_dIn,200,30,540,290,0,sig);
}
function infoOut(sig){
	pliega("FrI",_dOut,200,30,540,290,0,sig);
}
function centrar(){
	var f=document.getElementById("FoGe");
	if(!f.offsetWidth) return;
	var w=0;
	var h=0;
	if(window.innerWidth){ 
		w=window.innerWidth; 
		h=window.innerHeight; 
	} 
	else if(document.body.clientWidth){ 
		w=document.body.clientWidth; 
		h=document.body.clientHeight; 
	} 
	else if(document.documentElement.clientWidth){ 
		w=document.documentElement.clientWidth; 
		h=document.documentElement.clientHeight; 
	}
	if(w!=0) dim("FoGe",(parseInt(f.offsetWidth)<w)?f.style.left=parseInt((w-f.offsetWidth)/2):"0",(parseInt(f.offsetHeight)<h)?parseInt((h-f.offsetHeight)/2):"0",0,0);
}