// JavaScript Document
var qMenu; var txMenu;
var qsMenu; var txsMenu; 
var qssMenu; var txssMenu;
function vaContacto(v){
	ubica="Contacto > <strong>"+eval("menuPpal6["+v+"][0]")+"</strong>"
	if(v==0){f="contacto"}
	if(v==1){f="cv"}
	if(v==2){f="registro"}
	document.cpoppal.ubicacion.value = ubica
	document.cpoppal.forma.value = f
	document.cpoppal.action = "index.php"
	document.cpoppal.submit()
}
function armaMenu(qM){
	allLineas=""
	elMenu=eval("menuPpal"+qM)
  if(qM==6){
	for(x=0;x<elMenu.length;x++){		
		menuLineas='<tr><td id="m'+x+'" height="20" onClick=vaContacto('+x+') onMouseOver="RS_menuLine('+x+')"><span class="style2">'+elMenu[x][0]+'</span></td></tr>'
		allLineas=allLineas+menuLineas
	}		
  }else{
	for(x=0;x<elMenu.length;x++){
		if(elMenu[x][1] <= 0){vaClic=""}else{vaClic="onClick=vaFicha("+elMenu[x][1]+",1,"+x+","+qM+")"}
		menuLineas='<tr><td id="m'+x+'" height="20" '+vaClic+' onMouseOver="RS_menuLine('+x+','+elMenu[x][1]+','+elMenu[x][2]+')"><span class="style2">'+elMenu[x][0]+'</span></td></tr>'
		allLineas=allLineas+menuLineas
	}
  }
	newMenu='<table width="134" height="34" border="0" cellpadding="0" cellspacing="0"><TBODY><TR><TD height=7></TD></TR>'+allLineas+'<TR><TD height=7></TD></TR></TBODY></table>'
	document.getElementById("tablaMenu").innerHTML=newMenu
}
function vaFicha(f,m,l,qm,ql){
	if(qm==2){window.txMenu="Plataforma RELAC"}
	if(qm==3){window.txMenu="Panorama LAC"}
	if(qm==4){window.txMenu="Comunicaciones"}
	if(qm==5){window.txMenu="Recursos"}
	if(m==1){elMenu=eval("menuPpal"+qm);ubica=txMenu+" &gt <strong>"+elMenu[l][0]+"</strong>";}
	if(m==2){elMenu=eval("menuPpal"+qm);sbMenu=eval('subMenu'+ql);ubica=txMenu+" &gt "+elMenu[window.txsMenu][0]+" &gt <strong>"+sbMenu[l][0]+"</strong>";}

	document.cpoppal.ubicacion.value = ubica
	document.cpoppal.qfx.value = f
	document.cpoppal.action = "index.php"
	document.cpoppal.submit()
}
function armasubMenu(sM,qLin){
	window.qsMenu=qLin
	smallLineas=""
	sbMenu=eval('subMenu'+qLin)

	for(x=0;x<sbMenu.length;x++){
	smmenuLineas='<tr><td id="sm'+x+'" height="20" onClick=vaFicha('+sbMenu[x][1]+',2,'+x+','+sM+','+qLin+') onMouseOver="RS_submenuLine('+qLin+','+x+')"><span class="style2">'+sbMenu[x][0]+'</span></td></tr>'
	smallLineas=smallLineas+smmenuLineas
	}
	smnewMenu='<table width="134" height="34" border="0" cellpadding="0" cellspacing="0"><TBODY><TR><TD height=7></TD></TR>'+smallLineas+'<TR><TD height=7></TD></TR></TBODY></table>'
	document.getElementById("tablasubMenu").innerHTML=smnewMenu
}
function RS_swapImage(qID,qImage) {
	RS_swapImageRestore()
	RS_hideLayers('all')
	RS_clearMenuLine()
	RS_clearSubmenu()
	if(qID!="nm"){
		document.getElementById(qID).style.cursor="hand"
		document.getElementById(qID).src=qImage
	}
}
function RS_swapImageRestore() {
/*
	document.getElementById('plataforma').src='images/estado1_04.png'
	document.getElementById('panorama').src='images/estado1_05.png'
	document.getElementById('comunicaciones').src='images/estado1_06.png'
	document.getElementById('recursos').src='images/estado1_07.png'
	document.getElementById('contacto').src='images/estado1_08.png'
	document.getElementById('foro').src='images/estado1_09.png'
*/	
}
function RS_showLayer(qLy) {
	armaMenu(qLy)
	if(qLy==2){posLeft=178}
	if(qLy==3){posLeft=299}
	if(qLy==4){posLeft=405}
	if(qLy==5){posLeft=518}
	if(qLy==6){posLeft=600}
	
	document.getElementById('menuPlataforma').style.left=posLeft
	document.getElementById('menuPlataforma').style.visibility='visible'
	window.qMenu = qLy

}
function RS_showsubLayer(qLin) {
	armasubMenu(qMenu,qLin)
	if(window.qMenu==2){posLeft=330}
	if(window.qMenu==3){posLeft=451}
	if(window.qMenu==4){posLeft=557}
	if(window.qMenu==5){posLeft=670}
	
	document.getElementById('submenuPlataforma').style.left=posLeft
	document.getElementById('submenuPlataforma').style.visibility='visible'
}
function RS_hideLayers(qLy) {
	if(qLy=="all"){
		document.getElementById('menuPlataforma').style.visibility='hidden'
	}else{
		document.getElementById(qLy).style.visibility='hidden'
	}
}
function RS_menuLine(qID,vLink,IDint){
		window.txsMenu = qID
		RS_clearMenuLine()
		RS_clearSubmenu()
//		RS_clearsubMenuLine()
		eval('document.getElementById("m'+qID+'").style.cursor="hand"')
		eval('document.getElementById("m'+qID+'").bgColor="#DBDBDB"')
		postop=62 + (qID*20)
		document.getElementById('submenuPlataforma').style.top=postop
		if(vLink==-1){RS_showsubLayer(IDint)}
}
function RS_clearMenuLine(){
	if(document.getElementById('menuPlataforma').style.visibility=='visible'){
		cualMenu=eval("menuPpal"+window.qMenu)
		for(x=0;x<cualMenu.length;x++){
			eval('document.getElementById("m'+x+'").bgColor="#FFFFFF"')
		}
	}
}
function RS_submenuLine(qLinppal,qID){
		RS_clearsubMenuLine()
		eval('document.getElementById("sm'+qID+'").style.cursor="hand"')
		eval('document.getElementById("sm'+qID+'").bgColor="#DBDBDB"')
}
function RS_clearsubMenuLine(){
	if(document.getElementById('submenuPlataforma').style.visibility=='visible'){
		qsubM=eval("subMenu"+window.qsMenu)
		for(x=0;x<qsubM.length;x++){
			eval('document.getElementById("sm'+x+'").bgColor="#FFFFFF"')
		}
	}
}
function RS_clearSubmenu(){
	document.getElementById('submenuPlataforma').style.visibility='hidden'
}
function muestra(){
	
	if(subMenu2[0]){alert(subMenu2[0])}
	if(subMenu2[1]){alert(subMenu2[1])}
	if(subMenu2[2]){alert(subMenu2[2])}
		
}