function crearMenu(idPadre){

		var bloque = document.createElement('div');
		var padre = document.getElementById(idPadre);
		
		bloque.setAttribute('id','MenuPTS');
		padre.appendChild(bloque);
		
		crearSeccion('Seccion0','MenuPTS','block','seccionPrincipalMenu');

		//seccion PTS Granada
		//*******************************************************************
		anadirElemento('Seccion0','e1','PTS GRANADA','PTS_Granada_en.html','botonPtsGranada');					
		crearSeccion('Seccion1','e1','none','seccion');
		
		//detalle ENTORNO SALUDABLE
		anadirElemento('Seccion1','e1_1','A Healthy Environment','Entorno_Saludable_en.html','subSeccionPtsGranada');
		//detalle MISION
		anadirElemento('Seccion1','e1_2','Mission','Mision_en.html','subSeccionPtsGranada');
		//detalle PROMOTORES Y ALIANZAS
		anadirElemento('Seccion1','e1_3','Sponsors and Alliances','Promotores_Y_Alianzas_en.html','subSeccionPtsGranada');
		//detalle INFRAESTRUCTURAS
		anadirElemento('Seccion1','e1_4','Facilities','Infraestructuras_en.html','subSeccionPtsGranada');
		
		//subseccion QUIENES SOMOS
		//------------------------------------------------------------
		anadirElemento('Seccion1','e1_5','About Us','Quienes_Somos_en.html','subSeccionPtsGranada');
		crearSeccion('Seccion1_1','e1_5','none','seccion');
		
		//detalle PRESENTE
		anadirElemento('Seccion1_1','e1_5_1','Present','Presente_en.html','detallePtsGranada');
		//detalle FUTURO
		anadirElemento('Seccion1_1','e1_5_2','Future','Futuro_en.html','detallePtsGranada');
		//------------------------------------------------------------
		
		//detalle PROYECTOS
		anadirElemento('Seccion1','e1_6','Aims','Proyectos_en.html','subSeccionPtsGranada');
		anadirElemento('Seccion1','e1_7','Virtual Visits','http://www.3dvista.com/pts/','subSeccionPtsGranada');
		//*******************************************************************
		
		//seccion INVESTIGACI?N
		//*******************************************************************
		anadirElemento('Seccion0','e2','RESEARCH','Investigacion_en.html','botonInvestigacion');		
		crearSeccion('Seccion2','e2','none','seccion');
		
		//subseccion CENTROS DE INVESTIGACI?N
		//------------------------------------------------------------		
		anadirElemento('Seccion2','e2_1','Research Centres','Centro_Investigacion_en.html','subSeccionInvestigacion');		
		/*crearSeccion('Seccion2_1','e2_1','none','seccion');
		
		anadirElemento('Seccion2_1','e2_1_1','Biomedical R. C.','Centro_Inv_Biomedica_en.html','detalleInvestigacion');
		anadirElemento('Seccion2_1','e2_1_2','López Neyra Parasitology and Biomedicine Institute','IPB_Lopez_Neyra_en.html','detalleInvestigacion');
		anadirElemento('Seccion2_1','e2_1_3','Andalusian Institute of Legal Medicine','Inst_And_Medicina_Legal_en.html','detalleInvestigacion');		
		anadirElemento('Seccion2_1','e2_1_4','Crystallography Research Laboratory','LEC_en.html','detalleInvestigacion');
		anadirElemento('Seccion2_1','e2_1_4','Genomics and Oncology Research Centre','Genomica_en.html','detalleInvestigacion');
		anadirElemento('Seccion2_1','e2_1_4','Andalusian R&D&I Laboratory for Health and Safety in the Workplace','LabPrevencion_en.html','detalleInvestigacion');
		anadirElemento('Seccion2_1','e2_1_4','Andalusian Centre of Excellence for Research into Innovative Medicines','CexMedicamentos_en.html','detalleInvestigacion');*/		
		
		//------------------------------------------------------------
		
		//detalle LINEAS DE INVESTIGACI?N
		anadirElemento('Seccion2','e2_2','Research Programmes','Lineas_Investigacion_en.html','subSeccionInvestigacion');		
		
		//subseccion SERVICIOS
		anadirElemento('Seccion2','e2_3','Services','Servicios_Investigacion_en.html','subSeccionInvestigacion');
			
		//*******************************************************************		
		
		//seccion DESARROLLO EMPRESARIAL
		anadirElemento('Seccion0','e3',' BUSINESS DEVELOPMENT','Desarrollo_Empresarial_en.html','botonDesarrolloEmpresarial');		
		crearSeccion('Seccion3','e3','none','seccion');			
		
		//subseccion BIC-GRANADA
		//------------------------------------------------------------		
		anadirElemento('Seccion3','e3_1','BIC Centre Granada','Centro_BIC_Granada_en.html','subSeccionDesarrolloEmpresarial');		
		crearSeccion('Seccion3_1','e3_1','none','seccion');
		
		//detalles
		anadirElemento('Seccion3_1','e3_1_1','Companies','Empresas_BIC_en.html','detalleDesarrolloEmpresarial');
		anadirElemento('Seccion3_1','e3_1_2','Services','Servicios_BIC_en.html','detalleDesarrolloEmpresarial');
		
		//------------------------------------------------------------
		
		//subseccion CENTRO DE DESARROLLO FARMACEUTICO Y ALIMENTARIO
		//------------------------------------------------------------		
		anadirElemento('Seccion3','e4_1','Pharmaceutical and Food Development Center','Centro_Des_Farm_Alim_en.html','subSeccionDesarrolloEmpresarial');		
		
		//------------------------------------------------------------
		
		anadirElemento('Seccion3','e5_1','ROVI','ROVI_en.html','subSeccionDesarrolloEmpresarial');		
		anadirElemento('Seccion3','e6_1','Telefonica R&D','Telefonica_en.html','subSeccionDesarrolloEmpresarial');	
		anadirElemento('Seccion3','e6_1','SERVILENS FIT&COVER','ServilensFit_en.html','subSeccionDesarrolloEmpresarial');	
		anadirElemento('Seccion3','e6_1','Master Diagnóstica','Master_en.html','subSeccionDesarrolloEmpresarial');
		anadirElemento('Seccion3','e6_1','IDEA Business Centre','IDEA_en.html','subSeccionDesarrolloEmpresarial');			
		//*******************************************************************
		
		//seccion ASISTENCIA SANITARIA
		//*******************************************************************
		anadirElemento('Seccion0','e4','HEALTH CARE','Asistencia_Sanitaria_en.html','botonAsistenciaSanitaria');		
		crearSeccion('Seccion4','e4','none','seccion');
		
		//detalle HOSPITAL UNIVERSITARIO
		anadirElemento('Seccion4','e4_1','University Hospital','Hospital_Universitario_en.html','subSeccionAsistenciaSanitaria');
		
		//detalle CMAT 061 EMERGENCIAS
		anadirElemento('Seccion4','e4_2','CMAT 061 Emergencies','CMAT_Emergencias_en.html','subSeccionAsistenciaSanitaria');
		//*******************************************************************
		
		//seccion DOCENCIA
		anadirElemento('Seccion0','e5','TEACHING','Docencia_en.html','botonDocencia');
		crearSeccion('Seccion5','e5','none','seccion');
		anadirElemento('Seccion5','e5_1','OTRI','OTRI_en.html','subSeccionDocencia');
		
		
		
		//seccion SERVICIOS
		anadirElemento('Seccion0','e6','SERVICES','Servicios_en.html','botonServicios');
		
		//seccion ENLACES
		anadirElemento('Seccion0','e7','LINKS','Enlaces_en.html','botonEnlaces');
		
	}

	//funcion que crea una seccion
	function crearSeccion(idSec, idPadre, display, estilo){
	
		//creamos un elemento de tipo lista
		var seccion = document.createElement('ul');

		//obtenemos el padre
		var padre = document.getElementById(idPadre);

		var abuelo = padre.parentNode;

		//completamos las propiedades de la seccion
		//seccion.setAttribute('style','display:none');
		seccion.setAttribute('id',idSec);
		seccion.className = estilo;
		seccion.style.display = display;

		if(idSec!='Seccion0'){
			funcion = function () {
				Alternar(this);
			};
			padre.onclick = funcion;
		}
		
		//aniadimos el elemento al padre
		abuelo.appendChild(seccion);
	}

	//funcion que aniade un elemento a una seccion
	function anadirElemento(idSec,idElement,text,ref,estilo){
		//obtenemos la secci?n
		var seccion = document.getElementById(idSec);

		//creamos el elemento
		var elemento = document.createElement('li');
		var Texto = document.createTextNode(text);
		var enlace = document.createElement('a');

		enlace.setAttribute('href',ref);		
		
		//frame donde vamos a cargar la pagina referenciada
		if(idElement=='e1_7'){
			enlace.setAttribute('target',"_blank");
		}
		//frame donde vamos a cargar la pagina referenciada
		else{
			if(ref!='#'){
				enlace.setAttribute('target',"");
				//enlace.setAttribute('target',"iframe");
			}
		}

		//completamos las propiedades del elemento		
		enlace.appendChild(Texto);
		elemento.appendChild(enlace);
		
		elemento.className = estilo;
		elemento.setAttribute('id',idElement);

		//aniadimos a esa seccion un elemento
		seccion.appendChild(elemento);
	}

	//funcion que despliega una seccion o la oculta
	function Alternar(Seccion1){
	
		//El siguiente hermano es la seccion en si
		Seccion = Seccion1.nextSibling;
		var padre = Seccion.parentNode;
		var hijo = padre.firstChild;

		//cerramos todos los hermanos	
		while(hijo){
			if(hijo.tagName=='UL'){
				if(hijo==Seccion){
					if (Seccion.style.display=="none"){
						Seccion.style.display="block";
					}
					//La secci?n est? desplegada
					else{
						Seccion.style.display="none";
					}	
				}
				else{
					hijo.style.display = "none";
				}
			}
			hijo = hijo.nextSibling;
		}

	}
	
	