	function fTellError( iMsg, sURL, iLine ) {
	 var s = 'Mensaje de error nº ' + iMsg +
	         ' en la línea nº ' + iLine + '\n' +
	         'URL: ' + sURL;
	 window.alert( s );
	 return true ; ///
	}
	window.onerror = fTellError;
	var sID_MPD;
	window.document.body.onClick     = fnvHideLastSubmenu;
	window.document.body.onScroll    = fnvHideLastSubmenu;
	window.document.body.onMouseMove = fnvUpdateOnMouseMove;
	function TMenuPullDown( iLeft, iTop, vWidth, iSubmenuWidth ) {
	 this.hTimer = null ;
	 this.iLeft = iLeft;
	 this.iTop = iTop;
	 this.vWidth = vWidth;
	 this.iRightY = 0;
	 this.iRightX = 0;
	 this.iLeftY = 0;
	 this.iLeftX = 0;
	 this.sFontFace  = 'Arial';
	 this.iFontSize  = 3;
	 this.sFontColor = 'Black';
	 this.sBgColor = '#ffFFdd';
	 this.iMillisecondsToHide = 5000; // Si no se ha elegido una sub-opción estando encima el cursor del ratón, el submenú desaparecerá a los 3"
	 this.iOffsetLeft = 3;
	 this.iMainPaneBorder    = 0;
	 this.iSubmenuPaneBorder = 0;
	 this.iSubmenuPaneWidth  = iSubmenuWidth;
	 this.iSubmenuTop        = 25;
	 this.oLastMenu = null ;
	 this.acSubItems = new Array();
	 this.addItem    = vAddItem;
	 this.addSubItem = vAddSubItem;
	 this.showMenu   = vShowMenu;
	 this.sHTML  = '<!-- MENU PANE DECLARATION BEGINS -->\n';
	 this.sHTML += "<DIV id='MainTable_MPD' style='position:absolute; top:" + this.iTop;
	 if( iLeft == -1 ) {
	  this.sHTML +=                            "px;' align='center'";
	 } else {
	  this.sHTML += "px; left:" + this.iLeft + "px;'";
	 }
	 this.sHTML += ">\n<TABLE width='" + this.vWidth + "' bgColor='" + this.sBgColor +
	               "' border='" + this.iMainPaneBorder + "'>\n";
	 this.sHTML += '<TR>\n';
	 this.sHTML += '<!-- MAIN MENU STARTS -->\n';
	 this.sHTML += '<!-- MAIN_MENU -->\n';
	 this.sHTML += '<!-- MAIN MENU ENDS -->\n';
	 this.sHTML += '</TR>\n';
	 this.sHTML += '</TABLE>\n';
	 this.sHTML += '<!-- SUB MENU STARTS -->\n';
	 this.sHTML += '<!-- SUB_MENU -->\n';
	 this.sHTML += '<!-- SUB MENU ENDS -->\n';
	 this.sHTML+= '</DIV>\n';
	 this.sHTML += '<!-- MENU PANE DECALARATION ENDS -->\n';
	}
	function vAddItem( sIDitem, sHTMLcell, sHint,
	                   sOnClick ) { // El parámetro  sOnClick  no se pasa si hay submenú
	 var sLookup = '<!-- ITEM ' + sIDitem + ' -->';
	 if( this.sHTML.indexOf( sLookup ) != -1 ) {
	  window.alert( sIDitem + " ya existe" ); // Reporta el error
	  return ; ///
	 }
	 var sMENUitem = '\n<!-- ITEM ' + sIDitem + ' -->\n';
	 sMENUitem += "<TD id='" + sIDitem + "' style='position:relative;' align='center' " +
	              "style='cursor:hand;'";
	 if( sHint != null ) {
	  sMENUitem += " title='" + sHint + "'";
	 }
	 if( sOnClick != null ) { // Sin submenú
	  sMENUitem += " OnClick='fnvHideLastSubmenu(); " + sOnClick + "; return false'";
	  sMENUitem += " onMouseOver='vMenuPullDown_onMouseOver(\""+sIDitem+'",0);';
	 } else {                 // Con submenú
	  sMENUitem += " OnClick='fnvHideLastSubmenu();                   return false'";
	  sMENUitem += " onMouseOver='vDisplaySubmenu(\"" + sIDitem + '",' +
	               this.iSubmenuTop + ',' + this.iOffsetLeft + ',' +
	               this.iMillisecondsToHide + ');';
	 }
	 sMENUitem += ' oFont' + sIDitem + '.color="' + this.sBgColor + '"; ' +
	              'this.bgColor="' + this.sFontColor + "\"; return true'";
	 if( sOnClick != null ) { // Sin submenú
	  sMENUitem += " onMouseOut ='fnvHideLastSubmenu(); ";
	 } else {                 // Con submenú
	  sMENUitem += " onMouseOut ='";
	 }
	 sMENUitem += "oFont" + sIDitem +
	              '.color="' +        this.sFontColor + '";' +
	              ' this.bgColor="' + this.sBgColor   + '"; return true\'">\n';
	 sMENUitem += "<font id='oFont" + sIDitem + "' face='" + this.sFontFace +
	              "' size='" + this.iFontSize + "' color='" + this.sFontColor + "'>";
	 sMENUitem += sHTMLcell + '</font>\n';
	 sMENUitem += '</TD>\n';
	 sMENUitem += '<!-- END OF ITEM ' + sIDitem + ' -->\n';
	 sLookup = '<!-- MAIN_MENU -->\n';
	 this.sHTML = this.sHTML.replace( sLookup, sMENUitem + sLookup );
	}
	function vAddSubItem( sIDparent, sHTMLcell, sHint,
	                      sOnClick ) { // (no terminar el valor de  sOnClick  en ; )
	 var ii = 0, iSubItem = 0;
	 while(      iSubItem == ii ) { // Itera al menos una vez
	  ii++; // >= 1
	  for( var i = 0; i < this.acSubItems.length; i++ ) {
	   if( this.acSubItems[ i ] == sIDparent + ii ) {
	    iSubItem = ii;
	    break ; ///
	   }
	  }
	 }
	 iSubItem = ii; // >= 1
// Añade el ítem al final del array.-
	 this.acSubItems[ this.acSubItems.length ] = sIDparent + iSubItem;
// Item del submenú.-
	 if( this.sHTML.indexOf( '<!-- ITEM ' + sIDparent + ' -->' ) == -1 ) {
	  window.alert( sIDparent + ' not found' ); // Reporta este error
	  return ; ///
	 }
	 sLookup = '<!-- NEXT ITEM OF SUB MENU ' + sIDparent + ' -->\n';
	 var sMENUitem = '\n';
	 if( this.sHTML.indexOf( sLookup ) == -1 ) {
	  sMENUitem += "<DIV id='" + sIDparent + "submenu' " +
	               "style='position:absolute; visibility:hidden; width:" +
	               this.iSubmenuPaneWidth + "; top:-300;'>\n";
	  sMENUitem += '<TABLE border=' + this.iSubmenuPaneBorder + ' bgColor=' +
	               this.sFontColor + ' width=' + this.iSubmenuPaneWidth + '>\n';
	  sMENUitem += '<!-- NEXT ITEM OF SUB MENU ' + sIDparent + ' -->\n';
	  sMENUitem += '</TABLE></DIV>\n';
	  var s = '<!-- SUB_MENU -->\n';
	  sMENUitem += s;
	  this.sHTML = this.sHTML.replace( s, sMENUitem );
	 }
	 sMENUitem  = "<TR><TD style='cursor:hand;' title='" + sHint + "'" +
	              " onclick='fnvHideLastSubmenu(); " + sOnClick + "; return false'" +
	              " onMouseOver='vMenuPullDown_onMouseOver(\"" + sIDparent + '",' +
	              iSubItem + '); oFont' + sIDparent + iSubItem + '.color="'+ this.sFontColor +
	              '"; this.bgColor="' + this.sBgColor   + "\"; return true'";
	 sMENUitem += " onMouseOut ='oFont" + sIDparent + iSubItem + '.color="'+ this.sBgColor   +
	              '"; this.bgColor="' + this.sFontColor + "\"; return true'>\n";
	 sMENUitem += "<font id='oFont" + sIDparent + iSubItem + "' face='" + this.sFontFace +
	              "' size='" + this.iFontSize + "' color='" + this.sBgColor + "'>\n";
	 sMENUitem += sHTMLcell + '</font>\n';
	 sMENUitem += '</TD></TR>\n';
	 this.sHTML = this.sHTML.replace( sLookup, sMENUitem + sLookup );
	}
	function vShowMenu( lVerbose ) {
	 document.writeln( this.sHTML );
//	 document.write  ( this.sHTML ); // hace lo mismo
	 if(                lVerbose != null && lVerbose ) {
	  window.alert(    this.sHTML ); // Sirve de comprobante al desarrollar este software
	 }
	}
	function iCalculateSumOffsetLeft( oItem ) {
	 var iTotalOffset = 0;
	 do {
	  iTotalOffset += oItem.offsetLeft;
	  oItem         = oItem.offsetParent;
	 } while ( oItem != null );
	 return iTotalOffset; ///
	}
	function vDisplaySubmenu( sIdMainMenu, iSubmenuTop, iOffsetLeft,
	                          iMillisecondsToHide ) {
	 var oMenu, oSubmenu;
	 oSubmenu = eval( sIdMainMenu + "submenu.style" );
	    oMenu = eval( sIdMainMenu );
	 oSubmenu.left = iCalculateSumOffsetLeft( oMenu ) - iOffsetLeft;
	 oSubmenu.top  = oMenu.style.top + iSubmenuTop;
	 oSubmenu.visibility = "visible";
	 if( this.oLastMenu != null && this.oLastMenu != oSubmenu ) {
	  fnvHideLastSubmenu();
	 }
	 var oSM = document.all[ sIdMainMenu + "submenu" ];
	 this.iLeftX  = oSM.style.posLeft;
	 this.iRightX = this.iLeftX + oSM.offsetWidth;
	 this.iLeftY  = oSM.style.posTop + oSM.offsetHeight;
	 this.iRightY = this.iLeftY;
	 this.oLastMenu = oSubmenu;
	 sID_MPD = sIdMainMenu;
	 vMenuPullDown_SubmenuIni( sID_MPD );
	 if( this.hTimer == null ) {
	     this.hTimer = setTimeout( 'fnvHideLastSubmenu();', iMillisecondsToHide );
	 }
	}
	function fnvHideLastSubmenu() { // oculta el último submenú
	 if(            this.hTimer != null ) {
	  clearTimeout( this.hTimer );
	                this.hTimer = null ;
	 }
	 if( this.oLastMenu != null ) {
	     this.oLastMenu.visibility = 'hidden';
	     this.oLastMenu.left = 0;
	     vMenuPullDown_SubmenuEnd( sID_MPD );
	 }
	}
	function fnvUpdateOnMouseMove( e ) {
	 var x, y;
/* Para el NS, utilizar.-
	 x = e.pageX;
	 y = e.pageY;
*/
	 x = window.event.clientX;
	 y = window.event.clientY;
	 if     ( x > this.iRightX || x < this.iLeftX ) {
	  fnvHideLastSubmenu();
	 }
	 else if( y > this.iRightY ) {
	  fnvHideLastSubmenu();
	 }
	}


