/*Versión: 0.1 Autor: Juan Antonio Duque Fecha: 29/11/2001 Versión: 0.2	Autor: Juan Pablo Mejias Fecha: 3/12/2001 Versión: 0.3 Autor: Juan Pablo Mejias Fecha: 15/01/2002 Motivo: Generacion del menu de Solicitud de Banca On Line*/
var constSpHg=12;var ruta=dameRuta();var constAncho=138;var constAnchoII=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(){desAgrGan();desCooperativas();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 fizq=document.fotoizq;var fizqinf=document.fotoizqinf;var fder=document.fotoder;var fderinf=document.fotoderinf;}else if(isIE4){mostrarSi='visible';mostrarNo='hidden';var fizq=fotoizq.style;var fizqinf=fotoizqinf.style;var fder=fotoder.style;var fderinf=fotoderinf.style;}else{if(isNM){desH=0;desW=0;}mostrarSi='visible';mostrarNo='hidden';var fizq=document.getElementById("fotoizq").style;var fizqinf=document.getElementById("fotoizqinf").style;var fder=document.getElementById("fotoder").style;var fderinf=document.getElementById("fotoderinf").style;}function CerraTodas(){
for(var i=0;i<nivel.length;i++){eval('var es=esVisible'+i);if(es){CerraCapa(i);}}}function CerraCapa(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){Mostrar(fizq,"N");Ocultar(fizqinf,"N");}else if(indice==4){Mostrar(fder,"N");Ocultar(fderinf,"N");}}}function MostrarCapa(indice){CerraTodas();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){Ocultar(fizq,"N");Mostrar(fizqinf,"N");}else if(indice==4){Ocultar(fder,"N");Mostrar(fderinf,"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 desAgrGan(){txt='<table border="0" cellspacing="0" cellpadding="0"><tr><td height="6" bgcolor="#34513B"><img src="'+ruta+'img/sp.gif" width="257" height="6"></td></tr><tr><td align="left" valign="top" width="257"><img src="'+ruta+'img/sp.gif" width="1" height="4"><br><img src="'+ruta+'img/rtagrigana.gif" width="191" height="16" border="0"><br><font class="tv11">'+descripcion[0]+'</font></td></tr></table>';GenerarCapaAgrGan(txt);if(isIE4){var winDesH=document.getElementById("fotoizqinf").offsetHeight;}else if(isNS4){var winDesH=document.fotoizqinf.document.height;}else{var winDesH=document.getElementById("fotoizqinf").offsetHeight;}posIniTop3=(posIniTopIni3+winDesH-49);}function desCooperativas(){
txt='<table border="0" cellspacing="0" cellpadding="0"><tr><td height="6" bgcolor="#6D3B32"><img src="'+ruta+'img/sp.gif" width="257" height="6"></td></tr><tr><td align="left" valign="top" width="257"><img src="'+ruta+'img/sp.gif" width="1" height="4"><br><img src="'+ruta+'img/rtcooperagr.gif" width="99" height="16" border="0"><br><font class="tm11">'+descripcion[1]+'</font></td></tr></table>';GenerarCapaCooper(txt);if(isIE4){var winDesH=document.getElementById("fotoderinf").offsetHeight;}else if(isNS4){var winDesH=document.fotoderinf.document.height;}else{var winDesH=document.getElementById("fotoderinf").offsetHeight;}posIniTop4=(posIniTopIni4+winDesH-49);}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" 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" 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){CerraTodas();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 GenerarCapaAgrGan(txt){if(isNS4){var capa=document.fotoizqinf.document;capa.write(txt);capa.close();}else if(isIE4){eval('document.all["fotoizqinf"].innerHTML=txt');}else{eval('document.getElementById("fotoizqinf").innerHTML=txt');}}function GenerarCapaCooper(txt){if(isNS4){var capa=document.fotoderinf.document;capa.write(txt);capa.close();}else if(isIE4){eval('document.all["fotoderinf"].innerHTML=txt');}else{eval('document.getElementById("fotoderinf").innerHTML=txt');}}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+'=document.idNivel'+indice+'.offsetHeight');}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)||(indice==6)||(indice==7)){if((wW+consAux)<constAncho){eval('winW'+indice+'=(constAncho-consAux)');wW=(constAncho-consAux);}else if(indice==2){eval('posIniLeft'+indice+'=(posIniLeftIni'+indice+'-(wW+consAux-constAncho))');}}else{if((wW+consAux)<constAnchoII){eval('winW'+indice+'=(constAnchoII-consAux)');
wW=(constAnchoII-consAux);}else if(indice==4){eval('posIniLeft'+indice+'=(posIniLeftIni'+indice+'-(wW+consAux-constAnchoII))');}}if(indice==5) colores=new Array('#00287A','#CAD1DF','#B8BDCD');else colores=new Array('#034D00','#DDE5D8','#719A83');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)){CerraCapa(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.pageX;y=evento.pageY;}for(var i=0;i<nivel.length;i++){eval('var es=esVisible'+i);if(es){eval('window.setTimeout("IntentaCerrarCapa(x,y,'+i+')",1000)');}}}