/*--------------------------------------------------------------------------------*/
function printLinks(e)
/*--------------------------------------------------------------------------------*/
{
  if (!document.getElementsByTagName || !addEvent || !printPage || !cancelClickSafari || !window.print)
  {
    return;
  }
  
  var all_links = document.getElementsByTagName('a');
  
  for (i = 0; i < all_links.length; i++)
  {
    var link = all_links[i];
    if (link.className && (' ' + link.className + ' ').indexOf(' printLink ') != -1)
    {
      link.innerHTML = 'Click here to print this page&hellip;';
      link.title = 'Print a "printer friendly" version of this page';
      addEvent(link, 'click', printPage, false);
      link.onclick = cancelClickSafari;
    }
  }
}

/*--------------------------------------------------------------------------------*/
function printPage(e)
/*--------------------------------------------------------------------------------*/
{
  if (!window.print)
  {
    return;
  }
  
  window.print();
  
  if (window.event)
  {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (e && e.stopPropagation && e.preventDefault)
  {
    e.stopPropagation();
    e.preventDefault();
  }
}

/*--------------------------------------------------------------------------------*/
function cancelClickSafari()
/*--------------------------------------------------------------------------------*/
{
  return false;
}