Tooltip.offX = 4;
Tooltip.offY = 4;
Tooltip.followMouse = false;

var skypeNow = '<img src="/images/skype_logo.png" align="left" style="margin-right: 5px;"> If you would like to schedule a free Skype<sup>TM</sup> consultation with one of our attorneys <i>(up to half an hour)</i>, please send us an email with your Skype username and the best time when you would like an attorney to contact you. (If we cannot make that time, we will email you back and arrange the time that would be mutually convenient.)';

var skypeSp = '<img src="/images/skype_logo.png" align="left" style="margin-right: 5px;"> Si usted quisiera programar una consulta libre de Skype<sup>TM</sup> con uno de nuestros abogados (hasta media hora), por favor env&iacute;enos un email con su username de Skype y el mejor tiempo en que usted quisiera que un abogado le entrara en contacto con. (Si no podemos hacer ese vez, le enviaremos por correo electr&oacute;nico detr&aacute;s y arreglaremos el tiempo que ser&iacute;a mutuamente conveniente.)';

function doPopup(e, message) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.clearTimer();
  var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
  if ( tip && tip.onmouseout == null ) {
      tip.onmouseout = Tooltip.tipOutCheck;
      tip.onmouseover = Tooltip.clearTimer;
  }
  Tooltip.show(e, message);
}

function hidePopup() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.timerId = setTimeout("Tooltip.hide()", 200);
}

Tooltip.tipOutCheck = function(e) {
  e = pop_event.DOMit(e);
  // is element moused into contained by tooltip?
  var toEl = e.relatedTarget? e.relatedTarget: e.toElement;
  if ( this != toEl && !contained(toEl, this) ) Tooltip.hide();
}

// returns true of oNode is contained by oCont (container)
function contained(oNode, oCont) {
  if (!oNode) return;
  while ( oNode = oNode.parentNode ) if ( oNode == oCont ) return true;
  return false;
}

Tooltip.timerId = 0;
Tooltip.clearTimer = function() {
  if (Tooltip.timerId) { clearTimeout(Tooltip.timerId); Tooltip.timerId = 0; }
}

Tooltip.unHookHover = function () {
    var tip = document.getElementById? document.getElementById(Tooltip.tipID): null;
    if (tip) {
        tip.onmouseover = null;
        tip.onmouseout = null;
        tip = null;
    }
}

pop_event.add(window, "unload", Tooltip.unHookHover, true);

