
// Copyright Babysoft. All Right Reserved

// Display the tooltip
// Param1: (Req.) the ID you wish to display
// Return: false always
function myTooltip_display(id){
  return myTooltip_control(id, true);
}



// Hide the tooltip
// Param1: (Req.) the ID you wish to hide
// Return: false always
function myTooltip_hide(id){
  return myTooltip_control(id, false);
}



// Control the tooltip (display / hide)
// Param1: (Req.) the ID you wish to hide / display
// Param2: (Opt.) indicate should I display or hide this tooltip (false [default]: hide, true: show)
// Return: false always
function myTooltip_control(id, flag){

  if (flag == undefined || flag == null || flag === false || flag == ''){
    flag = false;
  }else{
    flag = true;
  }

  if (id == null || id == '' || document.getElementById(id) == null){
    alert('myTooltip->myTooltip_control: id ('+id+') not found, please check it and try again.');
    return false;
  }

  if (flag === true){
    document.getElementById(id).style.visibility='visible';
  }else{
    document.getElementById(id).style.visibility='hidden';
  }
  return false;

}



