
//FUNCIONES PARA TRABAJAR CON LAS CAPAS

var pos_X, pos_Y
var max_X = 0, max_Y = 0
     
//capturamos el evento en Nestcape Navigator
if (document.layers)
	document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = CapturarRaton

      
// Función que posiciona en cada momento la capa_informacion mediante las coordenadas capturadas del ratón
function CapturarRaton(e)
{
	//para Nestcape 4x abrimos el documento de la capa_informacion y escribimos la cadena de contenido
	if (document.layers)
    {
    	pos_x = e.pageX
        pos_y = e.pageY
        document.layers['capa_informacion'].left = pos_X + max_X
        document.layers['capa_informacion'].top = pos_Y + max_Y
    }
	else	  
		//para Internet Explorer menor que 6x
		if (document.all)
    	{
    		pos_X = event.x + document.body.scrollLeft
        	pos_Y = event.y + document.body.scrollTop
        	document.all('capa_informacion').style.left = pos_X + max_X
        	document.all('capa_informacion').style.top = pos_Y + max_Y
    	}
        else  
			//para Internet Explorer y Nestcape superiores a 6x y Mozilla
			if (document.getElementById)
    		{
    			pos_X = e.clientX
        		pos_Y = e.clientY
        		document.getElementById('capa_informacion').style.left = pos_X + max_X
        		document.getElementById('capa_informacion').style.top = pos_Y + max_Y
    		}
}

	  
//Función que situa la capa_informacion en la posicion adecuada y lo hace visible
function MostrarCapa(Mensaje,Clase)
{
 	max_X = 0
	max_Y = 0
	
	//para Nestcape 4x abrimos el documento de la capa_informacion y escribimos la cadena de contenido
	if (document.layers)
    {
    	cadena = "<table width=150 border=0 cellpadding=2 cellspacing=0><tr><td>" + Mensaje + "</td></tr></table>"
		document.capa_informacion.document.write(cadena)
        document.capa_informacion.document.close()
        document.capa_informacion.visibility = "visible"
	}
    else      
    	//para Internet Explorer menor que 6x
    	if (document.all)
    	{   
			document.all('capa_informacion').innerHTML = Mensaje
			document.all('capa_informacion').className = Clase 
			document.all('capa_informacion').style.visibility = "visible"
   	 	}
		else  
    		//para Internet Explorer y Nestcape superiores a 6x y Mozilla
			if (document.getElementById)
    		{
				document.getElementById('capa_informacion').innerHTML = Mensaje
				document.getElementById('capa_informacion').className = Clase
        		document.getElementById('capa_informacion').style.visibility = "visible"
    		}
}
      
	  
//Funcion para ocultar la capa_informacion y asignarle la posicion Y con exceso negativo
function OcultarCapa()
{
    //Para evitar que salgan las barras de desplazamiento en la ventana
	max_X = -1000
	max_Y = -1000
	
	//para Nestcape 4x
	if (document.layers)
    	document.layers['capa_informacion'].visibility = "hide"
	else
		//para Internet Explorer menor que 6x	  
		if (document.all)
       		document.all('capa_informacion').style.visibility = "hidden"
        else  
			//para Internet Explorer y Nestcape superiores a 6x y Mozilla
			if (document.getElementById)
       			document.getElementById('capa_informacion').style.visibility = "hidden"
}
