function mimenu(noactiv) {
noactiv = parseInt(noactiv);
// Array multidimensional que contiene:
// -El texto que aparece en el menu
// -La direccion a enlazar 
// -0 si el enlace va en la misma pagina o 1 si se abre nueva pagina o 2 sin enlace
var menuitem = new Array();
menuitem[0] = new Array('La Sociedad','','2');
menuitem[1] = new Array('Estatutos','estatutos.php?1','0');
menuitem[2] = new Array('Junta Directiva','directiva.php?2','0');
menuitem[3] = new Array('Bolet&iacute;n de inscripci&oacute;n','http://www.semergen.es/semergen/inicio-de-sesion?forwardURL=loadAffiliateForm&affiliate=1','1');
menuitem[4] = new Array('Contacto','contacto.php?4','0');
menuitem[5] = new Array('Formaci&oacute;n','','2');
menuitem[6] = new Array('Congresos','congresos.htm?6','0');
//menuitem[6] = new Array('Congreso Nacional 2003','cngrsnaci03.htm','0');
//menuitem[7] = new Array('Congreso Nacional 2004','http://semergen2004.atlasit.com/','1');
//menuitem[8] = new Array('Congreso Cantabria 2005','cngrscant05.htm','0');
menuitem[7] = new Array('Cursos y talleres','cursos.htm?7','0');
menuitem[8] = new Array('Grupos de trabajo','http://www.semergen.es/semergen/grupos-de-trabajo','1');
menuitem[9] = new Array('Biblioteca','','2');
menuitem[10] = new Array('Publicaciones','publicaciones.htm?10','0');
menuitem[11] = new Array('Revistas on-line','revistasonline.php?11','0');
menuitem[12] = new Array('Libros on-line','librosonline.php?12','0');
menuitem[13] = new Array('B&uacute;squeda bibliogr&aacute;fica','busqueda.htm?13','0');
menuitem[14] = new Array('Noticias','','2');
menuitem[15] = new Array('Noticias','noticias.php?15','0');
menuitem[16] = new Array('Herramientas de consulta','','2');
menuitem[17] = new Array('Calculadoras','calculadoras.htm?17','0');
menuitem[18] = new Array('Dietas y consejos','dietas.htm?18','0');
menuitem[19] = new Array('Documentos de consenso','consenso.php?19','0');
menuitem[20] = new Array('Software','software.php?20','0');
menuitem[21] = new Array('Humanidades','','2');
menuitem[22] = new Array('Medicina','hummed.htm?22','0');
menuitem[23] = new Array('Arte y literatura','humlit.php?23','0');
//menuitem[24] = new Array('Ocio','ocio.htm?24','0');
//menuitem[21] = new Array('Literatura','humlit.htm','0');
//menuitem[22] = new Array('Música','hummus.htm','0');
//menuitem[23] = new Array('Cine','humcin.htm','0');
//menuitem[24] = new Array('Gastronom&iacute;a','humgas.htm','0');
//menuitem[25] = new Array('Turismo','humtur.htm','0');
menuitem[24] = new Array('Enlaces','','2');
menuitem[25] = new Array('Semergen','http://www.semergen.es','1');
menuitem[26] = new Array('Enlaces locales','enlaceslocal.php?26','0');
menuitem[27] = new Array('Enlaces médicos','enlacesmed.php?27','0');
menuitem[28] = new Array('Otros enlaces','enlacesotros.php?28','0');

var strprincipio = '<table cellspacing="0" cellpadding="0" width="100%"><tr><td width="5" style="color:#000000; background-color:#ffffff; font-size: 12px; font-style: normal; font-weight:bold;">&nbsp;</td><td style="padding-left:10; padding-top:3; padding-bottom:3; color:#000000; background-color:#ffffff; font-size: 12px; font-style: normal; font-weight:bold;">&nbsp;</td><td width="5" style="color:#000000; background-color:#ffffff; font-size: 12px; font-style: normal; font-weight:bold;">&nbsp;</td></tr>';
var strTit001 = '<tr><td width="5" style="color:#000000; background-color:#ffffff; font-size: 12px; font-style: normal; font-weight:bold;">&nbsp;</td>';

var strTit002 = '<td style="padding-left:10; padding-top:3; padding-bottom:3; color:#ffffff; background-color:#208415; font-size: 12px; font-style: normal; font-weight:bold;">';
var strTit009 = '<td style="padding-left:10; padding-top:3; padding-bottom:3; color:#84c879; background-color:#eeffcc; font-size: 11px; font-style: normal; font-weight:bold;">';
var strTit003 = '</td>';

var strTit004 = '<td style="padding-left:10; padding-top:3; padding-bottom:3; background-color:#eeffcc;"><a href="';
var strTit005 = '" class="activado" target="_blank">';
var strTit006 = '" class="activado">';
var strTit007 = '</a></td>';

var strTit008 = '<td width="5" style="color:#000000; background-color:#ffffff; font-size: 12px; font-style: normal; font-weight:bold;">&nbsp;</td></tr>';
var strfinal = '</table>';

var i = 0 ;

document.write(strprincipio);
 while (i < menuitem.length) {
   document.write(strTit001);
   if (i == noactiv) {
     document.write(strTit009 + menuitem[i][0] + strTit003);
   }
   else {
     if (menuitem[i][2]==2) {
       document.write(strTit002 + menuitem[i][0] + strTit003);
     }
     else {
       if (menuitem[i][2]==0) {
         document.write(strTit004 + menuitem[i][1] + strTit006 + menuitem[i][0] + strTit007);
       }
       else {
         document.write(strTit004 + menuitem[i][1] + strTit005 + menuitem[i][0] + strTit007);
       }
     } 
   }
   document.write(strTit008);
   i++;
 }
document.write(strfinal);
}

function cabecera() {
var strCab001 = '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td rowspan="2" bgcolor="#eeffcc" align="right" width="100" valign="middle"><a href="index.php"><img src="imgs/logo2010.gif" border="0" width="86" height="74" style="padding-right:8px;"></a></td><td rowspan="2" width="35" background="imgs/degradado1.gif" style="background-repeat: repeat-y;">&nbsp;</td><td bgcolor="#208415" width="320" align="right" height="60" valign="middle"><a href="index.php"><img src="imgs/titulo001.gif" border="0" width="314" height="52"></a></td><td bgcolor="#208415" width="200" align="right" height="60" valign="middle"><img src="imgs/medrural2.gif" border="0" width="133" height="54"></td><td bgcolor="#208415">&nbsp;</td><td bgcolor="#208415" width="174" align="center" height="60" valign="middle"><a href="http://www.esteve.com" target="_blank"><img src="imgs/esteve2.gif" border="0" width="154" height="46"></a></td></tr><tr><td bgcolor="#208415" align="left" valign="middle" colspan="4" style="padding-left:6; padding-top:2; padding-bottom:2; font-size:12; color:#ddffdd;">Sociedad Espa&ntilde;ola de M&eacute;dicos de Atenci&oacute;n Primaria</td></tr></table>';
document.write(strCab001);
}

function editor(ventana,ancho,alto,scr) {
props="'toolbar=1,scrollbars="+scr+",location=1,statusbar=1,menubar=1,resizable=1,width="+ancho+",height="+alto+",left = 20,top = 20'";
window.open(ventana,'',eval(props));
}

function pie(port) {
// El valor de port determina los botones de la barra:
// port 0 boton portada a la izquierda
// port 1 sin botones
// port 2 boton editar (noticias) a la derecha y boton portada a la izquierda
port = parseInt(port);
var strPie001 = '<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td bgcolor="#ffffff" colspan="3">&nbsp;</td></tr><tr><td bgcolor="#208415" width="85" height="26" align="center" valign="middle">';
   switch (port) {
     case 0 :
     case 2 :
       var strPie002 = '<A HREF="index.php" onmouseover="move_in(\'boton_a\',\'botones/portada2.png\')" onmouseout="move_out(\'boton_a\',\'botones/portada1.png\')"><img name="boton_a" src="botones/portada1.png" border="0" width="65" height="20"></a>';
       break;
     case 1 :
       var strPie002 = '&nbsp;';
       break;
     case 3 :
       var strPie002 = '<span onmouseover="move_in(\'boton_a\',\'botones/cerrar2.png\')" onmouseout="move_out(\'boton_a\',\'botones/cerrar1.png\')"><img name="boton_a" src="botones/cerrar1.png" border="0" width="65" height="20" onClick="window.close()"></span>';
       break;
   }
var strPie003 = '</td><td bgcolor="#208415" align="center" valign="middle"><span id="fecha" style="color:#ffffff; font-size:12px; font-style:normal; font-weight:bold;"></span>&nbsp;&nbsp;<span id="reloj" style="color:#ffffff; font-size:12px; font-style:normal; font-weight:bold;"></span></td><td bgcolor="#208415" width="85" align="center" valign="middle">';
   switch (port) {
     case 0 :
     case 1 :
     case 3 :
       var strPie004 = '&nbsp;';
       break;
     case 2 :
       var strPie004 = '<A HREF="JavaScript:editor(\'editor.php\',424,200,1);" onmouseover="move_in(\'boton_b\',\'botones/editar2.png\')" onmouseout="move_out(\'boton_b\',\'botones/editar1.png\')"><img name="boton_b" src="botones/editar1.png" border="0" width="65" height="20"></a>';
       break;
   }
var strPie005 = '</td></tr></table><br><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center" width="85"><img src="imgs/cantabria.gif" border="0" width="65" height="40" alt="Mapa de Cantabria"></td><td align="center" style="text-align:center; color:#208415; background-color:#ffffff; font-size: 10px; font-style: normal; font-weight:normal;">SEMERGEN Cantabria | Webmaster: <a href="mailto:edugutierrez'+'@'+'ono.com" class="activ4">Eduardo Guti&eacute;rrez Delgado</a> | <a href="mailto:icuetob'+'@'+'semergen.es" class="activ4">Secretar&iacute;a</a><br>';
  if (port == 3) {
    var strPie006 = 'Aviso legal';
  }
  else {
    var strPie006 = '<a href="norm.htm" target="_blank" class="activ4">Aviso legal</a>';
  }
var strPie007 = ' | Ayuda | Comit&eacute; editorial | Mapa del web</td><td align="center" width="85"><img src="imgs/escudo_cantabria.gif" border="0" width="23" height="40" alt="Escudo de Cantabria"></td></tr></table>';
document.write(strPie001 + strPie002 + strPie003 + strPie004 + strPie005 + strPie006 + strPie007);
}

function move_in(img_name,img_src) {
document[img_name].src=img_src;
}

function move_out(img_name,img_src) {
document[img_name].src=img_src;
}

function hacerhora(){
var diabueno=new Array("Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado");
var mesbueno=new Array("enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre");
var nuevahora=new Date();
var dia=nuevahora.getDay();
var mes=nuevahora.getMonth();
var diames=nuevahora.getDate();
var ano=nuevahora.getYear();
var hor=nuevahora.getHours();
var min=nuevahora.getMinutes();
var seg=nuevahora.getSeconds();
if (diames<10) diames="0"+diames;
if (ano<1000) ano+=1900;
if (min<10) min="0"+min;
if (seg<10) seg="0"+seg;
var mihora=hor+":"+min+":"+seg;
var mifecha=diabueno[dia]+", "+diames+" de "+mesbueno[mes]+" de "+ano;
document.getElementById("fecha").innerHTML=mifecha;
document.getElementById("reloj").innerHTML=mihora;
}

function enmarcha(){
setInterval("hacerhora()",1000);
}

window.onLoad=enmarcha();