var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
var toolTipUp=0;
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) {toolTipSTYLE = document.getElementById("toolTipLayer").style;}
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
    toolTipUp=0;
  }
}

function toolTipHide()
{
    if( (ns4 || ns6) && toolTipUp != 1 ) return true;
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
}

function toolTip(msg, fg, bg)
{
  if(toolTip.arguments.length < 1) // hide
  {
    if( ns6||ns4 )
    {
	if( toolTipUp != 1 )
    	    setTimeout("toolTipHide()",1000);
	toolTipUp=1;
    }
    else
	toolTipHide();
  }
  else // show
  {
    if( ns6||ns4 )
    {
        if( toolTipUp == 2 ) return true;
	toolTipUp=2;
	clearTimeout();
    }
    if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '" width="400" style="opacity:.85;filter:alpha (opacity=85);"><td width="400">' +
    '<table border="0" cellspacing="2" cellpadding="1" bgcolor="' + bg + 
    '" width="400" style="opacity:.85;filter:alpha (opacity=85);"><td width="400"><p align="justify"  style="background-color:transparent"><span style="position: relative;"><font face="sans-serif" color="' + fg +
    '" size="2">' + msg +
    '&nbsp\;</font></span></p></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
	var aa = document.getElementById("toolTipLayer");
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}


function openWindow()
{
}