var intMaxOptions = 8;
function CargaElMenu(){
	var i, lf, tp, NoHaEntrado;
	lf = 16;
	//tp = 46;
	tp = 35;
	NoHaEntrado = 0;
	for(i = 0; i < opcionesMenu.length; i++){
// si hay mas de cinco opciones hay que colocar una segunda columna con su correspondiente left		
			if(i > intMaxOptions && !NoHaEntrado){ 
// pintamos la linea final de cada columna			
			eval("arena('lineaPara"+i+"','central',"+lf+","+tp+",154,1,null,1,null,'<img src=/img/Portada/spgris.gif height=1 width=154>')");						
			lf = 192; 
			//tp = 46;
			tp = 35;
			//tp = 30;
			NoHaEntrado = 1;	
		}
		eval("arena('opcion"+i+"','central',"+lf+","+tp+",154,22,null,1,null,'<table id=branch name=branch cellpadding=0 cellspacing=0 border=0 width=154><tr><td><img src=/img/Portada/spgris.gif height=1 width=154></td></tr><tr><td><img src=/img/Portada/sp.gif width=10 height=2></td></tr><tr><td><a onClick=javascript:setObject(1);verSub("+(i+1)+");javascript:setObject(0); onmouseover=pastSub.hide();ChangeIcon_OnMouseOver(this);MostrarSegundoNivel("+(i+1)+");rollCapa1("+i+") onmouseout=rollCapa2("+i+") class= tgrisOscuro13n>"+opcionesMenu[i].split('|')[0]+". <font class=tgris11n><b>"+opcionesMenu[i].split('|')[1]+"</b></font></a></td></tr></table>')");

		//tp += 30;
		//tp += 25;
		tp += 22;
	}
	eval("arena('lineaPara"+i+"','central',"+lf+","+tp+",154,1,null,1,null,'<img src=/img/Portada/spgris.gif height=1 width=154>')");
}

//GESTION PARA VISUALIZAR LOS APARTADOS DE SEGUNDO NIVEL
function verEnlace(n){
	if (opSub[n][0] == null)
		document.location.href=opSub[n][1];		
}

function MostrarSegundoNivel(n){
	if (opSub[n][0]!=null){
		  var tp, lf, incremento;
		  lf = (n > 6) ? 193  : 16 
		  if(document.all || document.layers) incremento = 15;
		  else if(!document.all && document.getElementById) incremento = 10;
		  eval("tp = "+ incremento + " + opcion"+(n-1)+".y + 82"); 
		  var aux="<table width=155 cellspacing=0 cellpadding=0 border=0><tr><td bgcolor=#ADADAD><table width=100% cellspacing=1 cellpadding=0 border=0>";
		  for (i=0;i<=opSub[n].length-1;i++){
		   aux+="<tr onmouseover=rollTabla1(this) onmouseout=rollTabla2(this) bgcolor=#D5D5D5><td class=tg9>&nbsp;<b>·</b>&nbsp;<a onMouseOver=this.style.cursor='hand'; onClick=javascript:setObject('1');javascript:location.href='"+opSub[n][i][1]+"';javascript:setObject('0'); class=tg9>"+opSub[n][i][0]+"</a></td></tr>";
		  }
		  aux+="</table></td><td colspan="+opSub[n].length+"><img src=img/fle.gif width=4 height=7></td></tr></table>";
		  pastSub.fill(aux);
		  pastSub.move(lf,tp-(Math.round((opSub[n].length*13)/2)));
		  pastSub.show();
	 }

}
//GESTION PARA OCULTAR LOS APARTADOS DE SEGUNDO NIVEL
function hideSub(){
	clearTimeout(timePast);
	timePast = setTimeout("pastSub.hide()",4000);
}
function rollCapa1(cual){ 
	if(n6)
		eval(doc+"lyopcion"+cual+stl+"backgroundColor = '#f0f0f0'")
	else if(n)
		eval(doc+"['lybase']"+stl+doc+"['lycentral']"+stl+doc+"['lyopcion"+cual+"']"+stl+"bgColor = '#f0f0f0'")
	else 		
		eval(doc+"lybase."+doc+"lycentral."+doc+"lyopcion"+cual+stl+"backgroundColor = '#f0f0f0'")
}	
function rollCapa2(cual){	
	if(n6)
		eval(doc+"lyopcion"+cual+stl+"backgroundColor = '#ffffff'")
	else if(n)
		eval(doc+"['lybase']"+stl+doc+"['lycentral']"+stl+doc+"['lyopcion"+cual+"']"+stl+"bgColor = '#ffffff'")
	else 		
		eval(doc+"lybase."+doc+"lycentral."+doc+"lyopcion"+cual+stl+"backgroundColor = '#ffffff'")
	hideSub();
 }

function rollTabla1(cual){ cual.bgColor = "#b5b5b5"; }
function rollTabla2(cual){ cual.bgColor = "#D5D5D5"; }

//RollOver de asesores.

for (i = 0; i < 5 ; i++){
	eval("asesor"+i+" = new Image()");
	eval("asesor"+i+".src ='/img/Portada/a"+i+"0.gif'");
	eval("asesor"+i+"1 = new Image()");
	eval("asesor"+i+"1.src ='/img/Portada/a"+i+"1.gif'");
}

function RollOverMenu(item){

eval("document.images['asesor"+item+"'].src=asesor"+item+"1.src");
}
function RollOutMenu(item,item2){

eval("document.images['asesor"+item+"'].src=asesor"+item+".src");
}

function ChangeIcon_OnMouseOver(this_OnMouseOver){
	this_OnMouseOver.style.cursor='hand';
}





