
// following in class for semi-transparency: filter:
//alpha(opacity=60); -moz-opacity:60%

var isNS4=document.layers?true:false;
var isIE=document.all?true:false;
var isIE6=isIE&&document.getElementById?true:false;
var isIE4=isIE&&!isIE6?true:false;
var isNS6=!isIE6&&document.getElementById?true:false;
var isNS=isNS4||isNS6;
var infobox_visible = 0;

var sdlmousex = 0;
var sdlmousey = 0;

currentbox = null;


function initBoxSize(divID, width, height)
{
  theDiv = GetDiv(divID);

  if (isIE4)
  {
    theDiv.style.width=width;
    theDiv.style.height=height;
  }
  else if (isNS4)
  {
    theDiv.clip.width=width;
    theDiv.clip.height=height;
  }
  else if(isIE6)
  {

    theDiv.style.width=width;
    theDiv.style.height=height;
  }
  else if(isNS6)
  {
    theDiv.style.width=200;
    theDiv.style.height=30;
  }
}

function followMouse_IE()
{
  if(currentbox != null)
  {
	GetDiv(currentbox).style.pixelTop=event.clientY+window.document.body.scrollTop+10;
        GetDiv(currentbox).style.pixelLeft=event.clientX+window.document.body.scrollLeft+10;
  }
  sdlmousex = event.clientX+window.document.body.scrollTop+10;
  sdlmousey = event.clientX+window.document.body.scrollLeft+10;

//  InfoBox.style.pixelTop=event.clientY+5;
//  InfoBox.style.pixelLeft=event.clientX-100;
// funky box fadin:   InfoBox.style.filter="alpha(opacity=" + event.clientY+ ")";
}

function followMouse_NS4(e)
{
  if(currentbox != null)
  {
	GetDiv(currentbox).top=e.y+10
        GetDiv(currentbox).left=e.x+10
  }
  sdlmousex = e.x;
  sdlmousey = e.y+10;
}

var NO=false;
function followMouse_NS6(e)
{
  if(currentbox != null)
  {
    x=e.pageX;
    y=e.pageY;
    GetDiv(currentbox).style.top=10+y;
    GetDiv(currentbox).style.left=x+10;
	sdlmousex = x+10;
    sdlmousey = 10+y;
   }
  
}

function initInfoBox()
{
  if(isNS4)
  {
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove=followMouse_NS4;
  }
  else if(isNS6)
    document.addEventListener("mousemove", followMouse_NS6, true);
  else if(isIE)
    document.onmousemove=followMouse_IE;
}


function showInfoBox(divID)
{
    currentbox=divID;
    if(isNS4)
    {
	GetDiv(currentbox).top=sdlmousey;
        GetDiv(currentbox).left=sdlmousex;
    }
    else if(isNS6) 
    {
    	GetDiv(currentbox).style.top=sdlmousey;
   	 GetDiv(currentbox).style.left=sdlmousex;

    }
    else if(isIE) 
    {
	GetDiv(currentbox).top=sdlmousey;
        GetDiv(currentbox).left=sdlmousex;
    }
    ShowDiv(divID);
}

function hideInfoBox(divID)
{
    currentbox=null;
    HideDiv(divID);
}


initInfoBox();
