// Menu horizontal y Vertical
var elemVer = 0;
var elemHor = 0;
var my_top = 0;
var my_left = 0;
var mnuItems = '';
var mnuHorItems = '';
var mnuVerItems = '';
var mnuVerDIV = '';
var actTexmnuHor = false;
var actTexmnuVer = true;
var mnuHorBgColor  = "#046CB6";
var mnuVerBgColor  = "#FF6317";
var mnuVerBgColor2 = "#FF6317";

// Añade Items del Menu Horizontal
addmnuHor ('Inicio','.','Inicio');
addmnuHor ('Noticias','noticias.php','Noticias');
addmnuHor ('Eventos','eventos.php','Eventos');
addmnuHor ('Boletín','boletin.php','Boletín');
addmnuHor ('Enlaces','enlaces.php','Enlaces');

// Añade Items del Menu Vertical
addmnuVer ('Agenda','agenda.php?iv=0','Utiliza la Agenda para enterarte de nuestras próximas actividades');

function addmnuHor (titulo, enlace, texto) {
  mnuHorItems += '<td bgcolor="' + mnuHorBgColor + '"><a href="' + enlace +'" class="tmenu" onMouseOver="ShowAnima(' + "'H" + elemHor + "'" + ')" onMouseOut="HideAnima(' + "'H" + elemHor + "'" + ')">' + titulo + '</a> |&nbsp;</td>';
  if (actTexmnuHor) { maketextDiv ("H", elemHor, texto); }
  elemHor++;
}

function addmnuVer (titulo, enlace, texto) {
  mnuVerItems += '<tr><td colspan="2" height="6"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerItems += '<tr><td width="25" bgcolor="' + mnuVerBgColor2 + '" align="center">';
  mnuVerItems += '<div style="visibility:hidden" id="V' + elemVer + 'bola"><img src="imagenes/bola.gif"></div></td>';
  mnuVerItems += '<td bgcolor="' + mnuVerBgColor +'" height="16" width="110">&nbsp; <a href="http://www.barcelonaproducciones.com/' + enlace + '" class="l2menu" onMouseOver="ShowAnima(' + "'V" + elemVer + "'" + ')" onMouseOut="HideAnima(' + "'V" + elemVer + "'" + ')">' + titulo + '</a></td>';
  mnuVerItems += '</tr>'; 
  if (actTexmnuVer) { maketextDiv ("V", elemVer, texto); }
  elemVer++;
}

function writedivtext () { document.writeln (mnuVerDIV); }

function writeMenuHor () {
  mnuItems += '<table cellpadding="0" cellspacing="0" align="right" class="lmenu">';
  mnuItems += '<tr><td bgcolor="#90B6DA" width="12" height="18"><img src="imagenes/lcornerdown.gif" width="12" height="18"></td>';
  mnuItems += '<td bgcolor="#046CB6" width="5" height="18"><img src="imagenes/spacer.gif"></td>';
  mnuHorItems  = mnuItems + mnuHorItems + '</tr></table>';
  document.writeln (mnuHorItems);
}

function writeMenuVer () {
  mnuVerItems  = '<table cellpadding="0" cellspacing="0" height="123" class="lmenu">' + mnuVerItems;
  mnuVerItems += '<tr><td colspan="2">&nbsp;</td></tr></table>';
  document.writeln (mnuVerItems);
}

function maketextDiv (mnu, elemento, texto) {
  my_top=elemento*22+121; my_left=140;
  if (mnu=="H") { my_top=5; my_left=635; } 
  mnuVerDIV += '<div style="position:absolute; top: ' + my_top + 'px; left: ' + my_left + 'px; visibility:hidden" id="' + mnu + elemento + 'text">';
  mnuVerDIV += '<table cellpadding="0" cellspacing="0" width="140" align="center">';
  mnuVerDIV += '<tr><td colspan="4" height="1" bgcolor="#FF0000"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerDIV += '<tr><td colspan="3" height="3" bgcolor="#FFE064"><img src="imagenes/spacer.gif"></td>';
  mnuVerDIV += '<td colspan="1" height="3" bgcolor="#FF0000" width="1"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerDIV += '<tr><td bgcolor="#FFE064" width="10">&nbsp;</td>';
  mnuVerDIV += '<td bgcolor="#FFE064" class="onyellow" width="120">' + texto + '</td>';
  mnuVerDIV += '<td bgcolor="#FFE064" width="9"><img src="imagenes/spacer.gif"></td>';
  mnuVerDIV += '<td bgcolor="#FF0000" width="1"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerDIV += '<tr><td colspan="3" height="3" bgcolor="#FFE064"><img src="imagenes/spacer.gif"></td>';
  mnuVerDIV += '<td colspan="1" height="3" bgcolor="#FF0000" width="1"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerDIV += '<tr><td colspan="4" height="1" bgcolor="#FF0000"><img src="imagenes/spacer.gif"></td></tr>';
  mnuVerDIV += '</table>';
  mnuVerDIV += '</div>';
}

function ShowAnima(which) { DivShow(which+"text"); DivShow(which+"bola");}
function HideAnima(which) { DivHide(which+"bola"); DivHide(which+"text");}