

var anMenu = 100 //<-- anchura del men?
var totalMen = 13 //<-- total de botones principales
var imaflecha = '';//'url(../../Frontend/imagenes_portal/camara_pequenia.jpg)' //<-- ruta de la imagen de flecha
function tunMen(tex,enl,dest,subOp,an){
this.tex = tex;
this.enl = enl;
this.dest = dest;
this.subOp = subOp;
this.an = an;
}
/* Configurar las opciones aqui */

//var ruta = 'http://www.mct.gob.ve';

Op_0 = new tunMen('Noticias ',"http://www.mct.gob.ve/Controladores/Frontend/controlador_noticia_mes.php",null,null,100)

Op_1 = new tunMen('Programas ',"#",null,11,350)
	Op_1_0 = new tunMen('Soberaní­a y Seguridad Alimentaria ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=243",null,0,100)
	Op_1_1 = new tunMen('Tecnologí­a de la Información ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=244",null,0,100)
	Op_1_2 = new tunMen('Petróleo, Gas y Energía ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=245",null,0,100)
	Op_1_3 = new tunMen('Salud Pública ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=246",null,0,100)
	Op_1_4 = new tunMen('Calidad de la Educación ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=247",null,0,100)
	Op_1_5 = new tunMen('Innovación para la Calidad de la Gestión Pública ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=248",null,0,100)
	Op_1_6 = new tunMen('Ciencia y Tecnologìa para la Seguridad y Defensa del Estado ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=249",null,0,100)
	Op_1_7 = new tunMen('Hábitat y Desarrollo ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=250",null,0,100)
	Op_1_8 = new tunMen('Visibilidad y Apropiación Social de la CyT ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=251",null,0,100)
	Op_1_9 = new tunMen('Innovación para el Desarrollo Endógeno Local ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=252",null,0,100)
	Op_1_10 = new tunMen('Altos Estudios Estratégicos e Históricos para América Latina y el Caribe ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=253",null,0,100)


Op_2 = new tunMen('Planes y Políticas ',"#",null,2,200)
	Op_2_0 = new tunMen('Plan Nacional de CyT',"http://comunidades.mct.gob.ve/planNacional.php",null,0,100)
	Op_2_1 = new tunMen('Políticas del MPPCT ',"http://www.mct.gob.ve/Controladores/controlador_programas.php?id_programa=347",null,0,100)


Op_3 = new tunMen('Marco Legal ',"#",null,6,200)
	Op_3_0 = new tunMen('Leyes ',"http://www.mct.gob.ve/Vistas/Frontend/leyes.php?id_marco=1",null,0,100)
	Op_3_1 = new tunMen('Decretos ',"http://www.mct.gob.ve/Vistas/Frontend/decretos.php?id_marco=58",null,0,100)
	Op_3_2 = new tunMen('Resoluciones ',"http://www.mct.gob.ve/Vistas/Frontend/resoluciones.php?id_marco=65",null,0,100)
	Op_3_3 = new tunMen('Dictámenes ',"http://www.mct.gob.ve/Vistas/Frontend/dictamenes.php?id_marco=76",null,0,100)
	Op_3_4 = new tunMen('Acuerdos',"http://www.mct.gob.ve/Vistas/Frontend/decretos.php?id_marco=467",null,0,100);
	Op_3_5 = new tunMen('Reglamentos',"http://www.mct.gob.ve/Vistas/Frontend/decretos.php?id_marco=368",null,0,100);

Op_4 = new tunMen('Memoria y Cuenta',"#",null,5,80)
	Op_4_0 = new tunMen('Año 2003 ',"http://www.mct.gob.ve/Vistas/Frontend/memoria2003.php?id_marco=19",null,0,150)
	Op_4_1 = new tunMen('Año 2004 ',"http://www.mct.gob.ve/Vistas/Frontend/mc/mc2004",null,0,150)
	Op_4_2 = new tunMen('Año 2005 ',"http://www.mct.gob.ve/Vistas/Frontend/memoria2005.php?id_marco=172",null,0,150)
	Op_4_3 = new tunMen('Año 2006 ',"http://www.mct.gob.ve/Vistas/Frontend/memoria2006.php?id_marco=230",null,0,150)
	Op_4_4 = new tunMen('Año 2007 ',"http://www.mct.gob.ve/Vistas/Frontend/memoria2007.php?id_marco=461",null,0,150)

Op_5 = new tunMen('Empleo y Pasantías',"http://www.mct.gob.ve/Controladores/controlador_empleo.php",null,null,200)


Op_6 = new tunMen('Servicios ',"#",null,4,150)
	Op_6_0 = new tunMen('Fuentes de Financiamientos ',"http://financia.mct.gob.ve/",null,0,100)
	Op_6_1 = new tunMen('Comunidades Virtuales',"http://comunidades.mct.gob.ve/",null,0,100)
	Op_6_2 = new tunMen('CvLAC  ',"http://150.188.88.16:7777/silacve/PRC_CVLAC_LOGIN?f_opc=cvlac&f_nacion=V",null,0,100)
	Op_6_3 = new tunMen('Centro de Documentación ',"http://www.cdc.fonacit.gob.ve/boletin/",null,0,100)

Op_7 = new tunMen('Gobierno Nacional ',"#",null,2,100)
	Op_7_0 = new tunMen ('Gobierno en Línea',"http://www.gobiernoenlinea.ve", null,0,100)
	Op_7_1 = new tunMen ('Símbolos Patrios',"http://www.mct.gob.ve/Vistas/Frontend/simbolos_patrios/simbolos_patrios.php", null,0,100)


Op_8 = new tunMen('Páginas de Interés ',"http://www.mct.gob.ve/Vistas/Frontend/enlaces.php",null,null,100)

Op_9 = new tunMen('Documentos ',"http://www.mct.gob.ve/Vistas/Frontend/documentos.php",null,null,100)

Op_10 = new tunMen('Eventos y Convocatorias',"http://www.mct.gob.ve/Vistas/Frontend/convocatorias/listar_convocatorias.php",null,0,100)

Op_11 = new tunMen('Banco de Imágenes',"http://www.mct.gob.ve/Controladores/controlador_banco_imagenes.php",null,0,100)

Op_12 = new tunMen('Correo Institucional',"https://correo.mct.gob.ve/",null,0,100)

/* Fin de configuraci?n.
   No tocar a partir de aqu? */


var tunIex=navigator.appName=="Microsoft Internet Explorer"?true:false;
if(tunIex && navigator.userAgent.indexOf('Opera')>=0){tunIex = false}
var Opera = navigator.userAgent.indexOf('Opera')>=0 ? true : false;
var manita = tunIex ? 'hand' : 'pointer'
var subOps = new Array()
function construye(){
cajaMenu = document.createElement('ul')
cajaMenu.style.width = anMenu + "px"
cajaMenu.style.zIndex = 1
cajaMenu.style.marginLeft = 0
cajaMenu.style.paddingLeft = 0
document.getElementById('me').appendChild(cajaMenu)
for(m=0; m < totalMen; m++){
	opchon = eval('Op_'+m)
	boton = document.createElement('li')
	boton.style.marginLeft = 0
	boton.style.paddingLef = 0
	boton.style.listStyleType = 'none'
	boton.style.position = 'relative'
	boton.style.zIndex = (100 - m)
	boton.className = 'botones'
	boton.style.cursor = manita
	boton.id = 'op_' + m
	if(opchon.enl){
		lin = document.createElement('a')
		lin.className = 'enlacesmenu'
		lin.href = opchon.enl
		if(opchon.dest){
			lin.target = opchon.dest
		}
	boton.appendChild(lin)
	lin.appendChild(document.createTextNode(opchon.tex))
	}
	else{
		boton.appendChild(document.createTextNode(opchon.tex))
	}
	boton.onmouseover = function(){
		mostrar(this)
		}
	boton.onmouseout=function(){
		ocultar(this)
		}
	cajaMenu.appendChild(boton)
	if(opchon.subOp > 0 ){
		espan = document.createElement('span')
		espan.style.position = 'absolute'
		espan.style.right = 0
		boton.style.backgroundImage = imaflecha
		boton.style.backgroundPosition = 'center right'
		boton.style.backgroundRepeat = 'no-repeat'
		espan.className = 'espan'
		boton.appendChild(espan)
		subOps[subOps.length] = boton.id.replace(/o/,"O")
		}
	}
if(subOps.length >0){subMes()}
}
function subMes(){
lar = subOps.length
for(t=0;t<subOps.length;t++){
	opc =eval(subOps[t])
	for(v=0;v<opc.subOp;v++){
		if(eval(subOps[t] + "_" + v + ".subOp") >0){
			subOps[subOps.length] = subOps[t] + "_" + v
			}
		}
	}

construyeSub()
}
function construyeSub(){
for(y=0; y<subOps.length;y++){
opchon = eval(subOps[y])
capa = document.createElement('ul')
capa.className = 'subMe'
capa.style.width = opchon.an + "px"
capa.style.visibility = 'hidden'
capa.style.position = 'absolute'
capa.style.marginLeft = 0
capa.style.paddingLeft = 0
capa.style.zIndex = 10
document.getElementById(subOps[y].toLowerCase()).firstChild.nextSibling.appendChild(capa)
	for(s=0;s < opchon.subOp; s++){
		sopchon = eval(subOps[y] + "_" + s)
		opc = document.createElement('li')
		opc.style.marginLeft = 0
		opc.style.paddingLeft = 0
		opc.style.listStyleType = 'none'
		opc.className = 'botones2'
		opc.id = subOps[y].toLowerCase() + "_" + s
		if(sopchon.enl){
			lin2 = document.createElement('a')
			lin2.className = 'enlacesmenu2'
			lin2.href = sopchon.enl
			if(sopchon.dest){
				lin2.target = sopchon.dest
			}
		opc.appendChild(lin2)
		lin2.appendChild(document.createTextNode(sopchon.tex))
		}
		else{
			opc.appendChild(document.createTextNode(sopchon.tex))
		}
		capa.appendChild(opc)
		opc.style.cursor = manita
		opc.onmouseover = function(){
			mostrar2(this)
			}
		opc.onmouseout=function(){
			ocultar2(this)
			}
		if(sopchon.subOp > 0 ){
			espan = document.createElement('span')
			espan.style.position = 'absolute'
			espan.style.right = 0
			opc.style.backgroundImage = imaflecha
			opc.style.backgroundPosition = 'center'
			opc.style.backgroundRepeat = 'no-repeat'
			espan.className = 'espan'
			opc.appendChild(espan)
			}
		}
	}
	//construye2()
}
 function mostrar(cual){
if(Opera || (document.styleSheets.length > 0 && !document.styleSheets[0].disabled)){
	if(tunIex){cual.className = 'botonesHover'}
	if(cual.childNodes.length > 1){
		cual.firstChild.nextSibling.firstChild.style.visibility = 'visible'
		}
	}
}
 function mostrar2(cual){
if(Opera || (document.styleSheets.length > 0 && !document.styleSheets[0].disabled)){
	if(tunIex){cual.className = 'botonesHover2'}
	if(cual.childNodes.length > 1){
		cual.firstChild.nextSibling.firstChild.style.visibility = 'visible'
		}
	}
}
 function ocultar(cual){
	if(Opera || (document.styleSheets.length > 0 && !document.styleSheets[0].disabled)){
	if(tunIex){cual.className = 'botones'}
		if(cual.childNodes.length > 1){
		cual.firstChild.nextSibling.firstChild.style.visibility = 'hidden'
		}
	}
}
 function ocultar2(cual){
	if(Opera || (document.styleSheets.length > 0 && !document.styleSheets[0].disabled)){
	if(tunIex){cual.className = 'botones2'}
		if(cual.childNodes.length > 1){
		cual.firstChild.nextSibling.firstChild.style.visibility = 'hidden'
		}
	}
}
function enlace(cual){
enla = eval('O' + cual.substr(1)).enl
targ = eval('O' + cual.substr(1)).dest
if(targ && targ.toLowerCase() == '_blank'){
	window.open(enla,'','')
	}
else{
	location.href = enla
	}

}