
<!--

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;

function BrowserInfo()
{
  this.name = navigator.appName;
  this.codename = navigator.appCodeName;
  this.version = navigator.appVersion.substring(0,4);
  this.platform = navigator.platform;
  this.javaEnabled = navigator.javaEnabled();
  this.screenWidth = screen.width;
  this.screenHeight = screen.height;
}

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}


// * Dependencies * 
// this function requires the following snippets:
// JavaScript/readable_MM_functions/findObj
//
// Accepts a variable number of arguments, in triplets as follows:
// arg 1: simple name of a layer object, such as "Layer1"
// arg 2: ignored (for backward compatibility)
// arg 3: 'hide' or 'show'
// repeat...
//
// Example: showHideLayers(Layer1,'','show',Layer2,'','hide');
function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}

/* 
Example:

in the BODY:

*/
function test()
{
  if (document.layers) getMouseLoc;     //NS
  else if (document.all) getMouseLoc(); //IE
  alert(mouseLocation.x+","+mouseLocation.y);
}

function Point(x,y) {  this.x = x; this.y = y; }

mouseLocation = new Point(-500,-500);

function getMouseLoc(e)
{
  if(!document.all)  //NS
  {
    mouseLocation.x = e.pageX;
    mouseLocation.y = e.pageY;
  }
  else               //IE
  {
    mouseLocation.x = event.x + document.body.scrollLeft;
    mouseLocation.y = event.y + document.body.scrollTop;
  }
  return true;
}




function hideAllLayersArray(){


	var max=(arrayCapas.length) ;
	for(i=0;i<max ; i++){
	
		var theLayer=arrayCapas[i]
		showHideLayers(theLayer,'','hide')
//		alert(theLayer+''+'hide')
	}
}

function moveLayerToMouseLoc(theLayer, offsetH, offsetV)
{
  var obj;
  var b = new BrowserInfo();
//  alert(b.version+ ' '+b.name);

	
//showHideLayers('toolTipLayer','','hide','Layer1','','hide','Layer2','','hide')
  if ((findObj(theLayer))!=null)
  {

    if (ns4 )  //NS
    {
	 hideAllLayersArray()
         document.onMouseMove = getMouseLoc;
      	 obj = document.layers[theLayer];
         obj.left = mouseLocation.x + 250;
//	 obj.left = 120;
         obj.top  = mouseLocation.y - 10;
    }
    else if (ns6)//IE
	{
    alert('Navigator. Documento Layers: ' + thelayer + ' ' +ns6 );
	 hideAllLayersArray()
      //   document.onMouseMove = getMouseLoc;
	getMouseLoc();
      	 //obj = document.layers[theLayer];
	obj = document.getElementById(theLayer).style;
         obj.left = mouseLocation.x + 250;
//	 obj.left = 120;
         obj.top  = mouseLocation.y - 10;
	}
    else if (document.all)//IE
    {hideAllLayersArray();
      getMouseLoc();
      obj = document.all[theLayer].style;

	obj.pixelLeft = 120 ;
	obj.pixelTop  = mouseLocation.y - 10;
    }
	
	
    showHideLayers(theLayer,'','show');
  }

}

//NS init:
if(document.layers){ document.captureEvents(Event.MOUSEMOVE); document.onMouseMove = getMouseLoc; }

function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = findObj(selName); if (selObj) jumpMenu(targ,selObj,restore);
}
//-->
