/*Versión: 0.1 Autor: Juan Antonio Duque Fecha: 03/12/2001*/
var constSpHg=12;var ruta=dameRuta();var constAnchoCombo=137;var constAncho=255;var consScroll=12;var consTime=300;var consSalida=50;var desH=2;var desW=-2;var desL=1;var desT=0;var x;var y;for(var i=0;i<nivel.length;i++){eval('var esVisible'+i+'=false');eval('var winW'+i+'=0');eval('var winH'+i+'=0');eval('var posIniTopIni'+i+'=(topy'+i+'+posy'+i+'+3)');eval('var posIniTop'+i+'=(topy'+i+'+posy'+i+'+3)');eval('var posIniLeftIni'+i+'=posx'+i);eval('var posIniLeft'+i+'=posx'+i);eval('var inicio2'+i+'=0');eval('var fin2'+i+'=0');if(isNS4){eval('var combo'+i+'=document.idNivel'+i);eval('var tabla'+i+'=document.idTabla'+i);eval('var cuadro'+i+'=document.idCuadro'+i);eval('var scroll'+i+'=document.idScroll'+i);}else if(isIE4){eval('var combo'+i+'=idNivel'+i+'.style');eval('var tabla'+i+'=idTabla'+i+'.style');eval('var cuadro'+i+'=idCuadro'+i+'.style');eval('var scroll'+i+'=idScroll'+i+'.style');}else{eval('var combo'+i+'=document.getElementById("idNivel'+i+'").style');eval('var tabla'+i+'=document.getElementById("idTabla'+i+'").style');eval('var cuadro'+i+'=document.getElementById("idCuadro'+i+'").style');eval('var scroll'+i+'=document.getElementById("idScroll'+i+'").style');}}function ini(indice){mostrarDes(0);mostrarDes(1);for(var i=0;i<nivel.length;i++){construirCapa(i);}}document.onmousemove=MovimientoRaton;if(isNS4){document.captureEvents(Event.MOUSEMOVE);}if(isNS4){mostrarSi='show';mostrarNo='hide';var tab0=document.tabla10;var tab1=document.tabla11;var idDes0=document.idDescrip0;var idDes1=document.idDescrip1;}else if(isIE4){mostrarSi='visible';mostrarNo='hidden';var tab0=tabla10.style;var tab1=tabla11.style;var idDes0=idDescrip0.style;var idDes1=idDescrip1.style;}else{if(isNM){desH=0;desW=0;}mostrarSi='visible';mostrarNo='hidden';var tab0=document.getElementById("tabla10").style;var tab1=document.getElementById("tabla11").style;var idDes0=document.getElementById("idDescrip0").style;var idDes1=document.getElementById("idDescrip1").style;}function CerrarTodas(){
for(var i=0;i<nivel.length;i++){eval('var es=esVisible'+i);if(es){CerrarCapa(i);}}}function CerrarCapa(indice){eval('var es=esVisible'+indice);if (es){eval('Ocultar(combo'+indice+','+indice+')');eval('Ocultar(tabla'+indice+','+indice+')');eval('Ocultar(cuadro'+indice+','+indice+')');eval('Ocultar(scroll'+indice+','+indice+')');if((indice==3)||(indice==4)){indice=(indice-3);eval('Mostrar(tab'+indice+',"N")');eval('Ocultar(idDes'+indice+',"N")');}}}function MostrarCapa(indice){CerrarTodas();if(nivel[indice].length>maxScroll){eval('situarCapa(scroll'+indice+',posIniLeft'+indice+'+winW'+indice+'+2,posIniTop'+indice+'-1)');eval('Mostrar(scroll'+indice+','+indice+')');}if((indice==3)||(indice==4)){var indi=(indice-3);eval('Ocultar(tab'+indi+',"N")');eval('Mostrar(idDes'+indi+',"N")');}eval('Mostrar(tabla'+indice+','+indice+')');eval('Mostrar(cuadro'+indice+','+indice+')');eval('Mostrar(combo'+indice+','+indice+')');}function Mostrar(objeto,indice){if(indice!="N") eval('esVisible'+indice+'=true');objeto.visibility=mostrarSi;}function Ocultar(objeto,indice){if (indice!="N") eval('esVisible'+indice+'=false');objeto.visibility=mostrarNo;}function situarCapa(objeto,a,b){if(a!=0) objeto.left=a;if(b!=0) objeto.top=b;}function mostrarDes(indice){txt ='<table border="0" cellspacing="0" cellpadding="0">';if(indice==0){txt +='<tr><td align="left" valign="top" bgcolor="#648787" width="257" colspan="2"><img src="'+ruta+'img/sp.gif" width="257" height="7"></td></tr>';}else{txt +='<tr><td align="left" valign="top" bgcolor="#000000" width="257" colspan="2"><img src="'+ruta+'img/sp.gif" width="257" height="7"></td></tr>';}txt +='<tr><td align="left" valign="top" colspan="2"><img src="'+ruta+'img/sp.gif" width="1" height="4"></td></tr>';if(indice==0){txt +='<tr><td width="8" rowspan="3"><img src="'+ruta+'img/sp.gif" width="8" height="1"></td><td align="left" valign="top"><img src="'+ruta+'img/rtgestion.gif" width="219" height="12"></td></tr>';}else{
txt +='<tr><td width="8" rowspan="3"><img src="'+ruta+'img/sp.gif" width="8" height="1"></td><td align="left" valign="top"><img src="'+ruta+'img/rtbancaperso.gif" width="185" height="15"></td></tr>';}txt +='<tr><td align="left" valign="top"><img src="'+ruta+'img/sp.gif" width="1" height="5"></td></tr>';txt +='<tr><td align="left" valign="top" width="249"><font class="tn10">'+descripcion[indice]+'</font></td></tr>';txt +='<tr><td colspan="2"><img src="'+ruta+'img/sp.gif" width="1" height="5"></td></tr>';txt +='<tr><td bgcolor="#648787" colspan="2"><img src="'+ruta+'img/sp.gif" width="257" height="1"></td></tr>';txt +='<tr><td colspan="2"><img src="'+ruta+'img/sp.gif" width="1" height="1"></td></tr>';if(indice==0){txt +='<tr><td colspan="2"><img src="'+ruta+'img/edsplineagris.gif" width="257" height="1"></td></tr></table>';}else{txt +='<tr><td colspan="2"><img src="'+ruta+'img/edsplineaverde.gif" width="257" height="1"></td></tr></table>';}GenerarCapa(txt,indice,"idDescrip");var ind=(indice+3);if(isNS4){eval('var winDesH=document.idDescrip'+indice+'.document.height');}else{if(isIE4){eval('var winDesH=idDescrip'+indice+'.style.height');}else{eval('var winDesH=document.getElementById("idDescrip'+indice+'").offsetHeight');}}eval('posIniTop'+ind+'=(posIniTopIni'+ind+'+winDesH-33)');}function scrollArriba(indice){eval('var inicio2=inicio2'+indice);eval('var fin2=fin2'+indice);if((inicio2>0)&&(mover==1)){eval('inicio2'+indice+'=inicio2'+indice+'-1');eval('fin2'+indice+'=fin2'+indice+'-1');eval('txt=generarTxt(indice,inicio2'+indice+',fin2'+indice+')');GenerarCapa(txt,indice,"idNivel");eval('setTimeout("scrollArriba('+indice+')",consTime)');}}function scrollAbajo(indice){eval('var inicio2=inicio2'+indice);eval('var fin2=fin2'+indice);if((fin2<nivel[indice].length)&&(mover==2)){eval('inicio2'+indice+'=inicio2'+indice+'+1');eval('fin2'+indice+'=fin2'+indice+'+1');eval('txt=generarTxt(indice,inicio2'+indice+',fin2'+indice+')');GenerarCapa(txt,indice,"idNivel");eval('setTimeout("scrollAbajo('+indice+')",consTime)');}}
function generarTxt(indice,inicio2,fin2){txt='<table border=0 cellspacing=0 cellpadding=0>';for(var i=inicio2;i<fin2;i++){if(esUrl(i,indice)){txt +='<tr><td width="5"><img src="'+ruta+'img/sp.gif" width="1" height="1"></td><td align="left" valign="top"><a href="'+enlaces[indice][i]+'" onmouseover="mostrarCuadro('+i+','+indice+')" onmouseout="mostrarCuadro('+i+','+indice+')" target="_new" class="tn11">&nbsp;'+nivel[indice][i]+'</a></td></tr>';}else{txt +='<tr><td width="5"><img src="'+ruta+'img/sp.gif" width="1" height="1"></td><td align="left" valign="top"><a href="'+enlaces[indice][i]+'" onmouseover="mostrarCuadro('+i+','+indice+')" onmouseout="mostrarCuadro('+i+','+indice+')" class="tn11">&nbsp;'+nivel[indice][i]+'</a></td></tr>';}}txt +='</table>';return txt;}function construirCapa(indice){txt=generarTxt(indice,0,nivel[indice].length);GenerarCapa(txt,indice,"idNivel");if(isIE4){eval('winW'+indice+'=document.idNivel'+indice+'.offsetWidth');}else if(isNS4){eval('winW'+indice+'=document.idNivel'+indice+'.document.width');}else{eval('winW'+indice+'=document.getElementById("idNivel'+indice+'").offsetWidth');}eval('var es=esVisible'+indice);if(!es){CerrarTodas();if(nivel[indice].length>maxScroll){eval('fin2'+indice+'=maxScroll');}else{eval('fin2'+indice+'=nivel[indice].length');}eval('txt=generarTxt(indice,inicio2'+indice+',fin2'+indice+')');GenerarCapa(txt,indice,"idNivel");generarFondo(indice);eval('situarCapa(combo'+indice+',posIniLeft'+indice+',posIniTop'+indice+')');}}function GenerarCapa(txt,indice,objeto){if(isIE4){eval('document.all["'+objeto+indice+'"].innerHTML=txt');}else{if(isNS4){var capa=eval('document.'+objeto+indice+'.document');capa.write (txt);capa.close();}else{eval('document.getElementById("'+objeto+indice+'").innerHTML=txt');}}}function generarFondo(indice){if(isIE4){eval('winH'+indice+'=idNivel'+indice+'.style.height');}else if(isNS4){
eval('winH'+indice+'=document.idNivel'+indice+'.document.height');}else{eval('winH'+indice+'=document.getElementById("idNivel'+indice+'").offsetHeight');}eval('var wW=winW'+indice);eval('var wH=winH'+indice);if(nivel[indice].length<=maxScroll){var consAux=0;}else{var consAux=consScroll;}if((indice==0)||(indice==1)||(indice==2)||(indice==5)){if((wW+consAux)<constAnchoCombo){eval('winW'+indice+'=(constAnchoCombo-consAux)');wW=(constAnchoCombo-consAux);}else if(indice==2){eval('posIniLeft'+indice+'=(posIniLeftIni'+indice+'-(wW+consAux-constAnchoCombo))');}}else{if((wW+consAux)<constAncho){eval('winW'+indice+'=(constAncho-consAux)');wW=(constAncho-consAux);}else{eval('posIniLeft'+indice+'=(posIniLeftIni'+indice+'-(wW+consAux-constAncho))');}}if(indice==5) colores=new Array('#00287A','#CAD1DF','#B8BDCD');else colores=new Array('#003333','#D3E3E3','#6EA5AE');var contenido='<table border="0" cellspacing="0" cellpadding="1" bgcolor="'+colores[0]+'"><tr><td align="left" valign="top"><table border="0" cellspacing="0" cellpadding="0" bgcolor="'+colores[1]+'"><tr><td align="left" valign="top"><img src="'+ruta+'img/sp.gif" width="'+wW+'" height="'+(wH+desH)+'"></td></table></td></table>';GenerarCapa(contenido,indice,"idTabla");eval('situarCapa(tabla'+indice+',posIniLeft'+indice+',(posIniTop'+indice+'-1))');contenido='<table border="0" cellspacing="0" cellpadding="1" bgcolor="'+colores[2]+'"><tr><td><img src="'+ruta+'img/sp.gif" width="'+(wW+desW)+'" height="'+constSpHg+'"></td></tr></table>';GenerarCapa(contenido,indice,"idCuadro");eval('situarCapa(cuadro'+indice+',(posIniLeft'+indice+'+desL),(posIniTop'+indice+'+desT))');}function mostrarCuadro(posicion,indice){eval('situarCapa(cuadro'+indice+',0,(('+posicion+'*constSpHg)+(posIniTop'+indice+'+desT)-(inicio2'+indice+'*constSpHg)))');}function noEstadentro(x,y, indice){eval('var left=posIniLeft'+indice);eval('var topp=posIniTop'+indice);eval('var wW=winW'+indice);
eval('var wH=winH'+indice);if((nivel[indice].length>maxScroll)){wW=(wW+15);}if((x>(left+wW))||(y>(topp+wH))){return true;}if((x<left)||(y<(topp-consSalida))){return true;}else{return false;}}function IntentaCerrarCapa(x,y,indice){if (noEstadentro(x,y,indice)){CerrarCapa(indice);}}function MovimientoRaton(evento){if(isNS4){x=evento.pageX;y=evento.pageY;}else{if(isIE4||isIE5){x=window.event.x;y=(window.document.body.scrollTop+window.event.y);}else{x=evento.clientX;y=evento.clientY;}}for (var i=0;i<nivel.length;i++){eval('var es=esVisible'+i);if(es){eval('window.setTimeout("IntentaCerrarCapa(x,y,'+i+')",1000)');}}}
