/**
* fichero JavaScript para construir tips dinamicos cross-browser
*@Autor   Luciano Moreno   (http://www.htmlweb.net)
*/   

    /**
      * var tipX, tipY >> posiciones izquierda y superior del tip respecto al cursor 
      * var estilo >> <almacena la ruta de acceso a los estilos del tip en cada navegador
      * var x, y >> almacenan las posiciones temporales del tip al mover el cursor sobre el link
      * var masX,masY >> pixels en coordenadas X e Y que se suman a la posicion del tip cuando 
      * no esta visible, para que no aparezcan las barras de desplazamiento en la ventana
      */
      var colortitulo = "#CCCCCC"
	  var colorcuerpo = "#EEEEEE"
      var tipX=10,tipY=0;
      var estilo,x,y;
      var masX=-1000,masY=-1000;
      
      /**
      * capturamos el evento en Nestcape Navigator
      */
      if(document.layers)
      {
          document.captureEvents(Event.MOUSEMOVE);
      }
          
      document.onmousemove=capturaRaton;
      
      /**
      * funcion que situa el tip en la posicion adecuada y lo hace visible
      * var cadena >> contiene el codigo HTML del contenido de la capa tip en forma de string
      */
      function muestraTip(titulo,mensaje)
      {
		var cadena = '<table border="0" width="200" cellspacing="0" cellpadding="0">'+
		'<tr><td width="100%" bgcolor="#000000">'+
		
		'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
		'<tr><td width="100%" bgcolor='+colortitulo+'>'+
		
		'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
		'<tr><td width="100%">'+
		
		'<font class="tooltiptitle">&nbsp;'+titulo+'</font>'+
		
		'</td></tr>'+
		'</table>'+
		
		'</td></tr>'+
		
		'<tr><td width="100%" bgcolor='+colorcuerpo+'>'+
		
		'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+
		
		'<tr><td width="100%">'+
		
		'<font class="tooltipcontent">'+mensaje+'</font>'+
		
		'</td></tr>'+
		'</table>'+
		
		'</td></tr>'+
		'</table>'+
		
		'</td></tr>'+
		'</table>';
     
          /**
              * quitamos los pixels de mas en Y cuando vamos a mostrar el tip
          */
          masX=tipX;
          masY=tipY;
          
          /**
          * para Nestcape 4x abrimos el documento de la capa y escribimos la cadena de contenido
          */
          if(document.layers)
          {
              document.tip.document.write(cadena);
              document.tip.document.close();
              document.tip.visibility="visible"
          }
          /**
          * para Internet Explorer y Nestcape 6x escribimos en contenido del tip directamente
          */
          if(document.all)
          {
              document.all("ToolTip").innerHTML=cadena;
              document.all("ToolTip").style.visibility="visible"
          }
          if(document.getElementById)
          {
              document.getElementById("ToolTip").innerHTML=cadena;
              document.getElementById("ToolTip").style.visibility="visible"
          }
      }
      
      /**
      * funcion que posiciona en cada momento el tip mediante las coordenadas capturadas del raton
      */
      function capturaRaton(e)
      {
          if(document.all)
          {
              x=event.x+document.body.scrollLeft;
              y=event.y+document.body.scrollTop;
              document.all("ToolTip").style.left=x+masX;			 
              document.all("ToolTip").style.top=y+masY;
          }
          else if(document.layers)
          {
              x=e.pageX;
              y=e.pageY;
              document.layers['ToolTip'].left=x+masX;
              document.layers['ToolTip'].top=y+masY;
          }
          else if(document.getElementById)
          {
              x=e.clientX;
              y=e.clientY;
              window.status=x;          
              document.getElementById("ToolTip").style.left=x+masX;
              document.getElementById("ToolTip").style.top=y+masY;
          }
      }
      
      /**
      * funcion para ocultar el tip y asignarle la posicion Y con exceso negativo
      */
      function ocultaTip()
      {
          masY=-1000;
          masX=-1000;
          if(document.all)
              document.all("ToolTip").style.visibility="hidden";
          else if(document.layers)
              document.layers["ToolTip"].visibility="hide";
          else if(document.getElementById)
              document.getElementById("ToolTip").style.visibility="hidden";
      }

/**
* fin del fichero
*/