function mouseIn(){
  event.srcElement.mouseFlag="true";
}

function mouseOut(){
  hideToolTips(event.srcElement.id);
}

var link ;
var div ;

function showToolTips(tt) {
  //alert(document.body.clientHeight);
  var tooltip;
  if (document.all[tt].length==null){
    tooltip = document.all[tt];

  }
  else {
    tooltip = document.all[tt](1);
  }
  if (link != event.srcElement){
    if (div !=null){
      div.style.display ="none" ;
      div.mouseFlag ="false";
    }
  }
  link = event.srcElement;
  link.mouseFlag="true";

  div = tooltip;
  div.onmouseover=mouseIn;
  div.onmouseout=mouseOut;

  if (tooltip.style.display=="none"){
    if (tooltip.innerText==null || tooltip.innerText.length==0){
      tooltip.innerText = MSG_NO_SUMMARY;
    }

	tooltip.innerText = tooltip.innerText.replace(/\?/g, ' ');

    tooltip.align='left';
    tooltip.style.backgroundColor = '#F1FBFC';
    tooltip.style.color = '#014569';
    tooltip.style.border = "groove darkred 1px";
    tooltip.style.position = "absolute";
    tooltip.style.width = 300;
    if (isIE55up()) {
      tooltip.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(' +
          'direction=135, color=#808080, strength=5)';
    }

    //alert (" y:"+document.body.scrollTop);
    var x = event.x+document.body.scrollLeft;
    var y = event.y+document.body.scrollTop;
    var distToMove = 0;
    tooltip.style.overflowY = 'auto';
    tooltip.style.display = "block";
    if (tooltip.clientHeight>200){
      tooltip.style.height=200;
      distToMove = 200;
    }else {
      distToMove = tooltip.clientHeight;
    }

    if (y+distToMove>document.body.clientHeight&&event.y-distToMove>0){
        tooltip.style.top = y-distToMove;
    }
    else {
      tooltip.style.top = y+5;
    }
    if (x+300>document.body.clientWidth&&x-300>0){
        tooltip.style.left = x-300;
    }
    else {
      tooltip.style.left = x+15;
    }
  }
}

function hide(tooltip){
  if (link.mouseFlag!="true"&&div.mouseFlag!="true")
  tooltip.style.display = tooltip.style.display="none" ;
}

function hideToolTips (tt){
  if (document.all[tt].length==null){
    tooltip = document.all[tt];
  }
  else {
    tooltip = document.all[tt](1);
  }

  event.srcElement.mouseFlag="false";
  setTimeout("hide(tooltip)",500);
}

function isIE55up() {
  var agt = navigator.userAgent.toLowerCase();

  // *** BROWSER VERSION ***
  // Note: On IE5, these return 4, so use isIE5up to detect IE5.
  var majorVer = parseInt(navigator.appVersion);
  var minorVer = parseFloat(navigator.appVersion);

  var isIE     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  var isIE55   = (isIE && (majorVer == 4) && (agt.indexOf("msie 5.5") !=-1));
  var isIE6    = (isIE && (majorVer == 4) && (agt.indexOf("msie 6.")!=-1) );

  return (isIE55 || isIE6);
}
