// add function to mark li on hover if the browser doesn't support li:hover
window.addEvent('domready', function() {
    // fixExternalLinks();
    fixEmailLinks();
    });

/*
var finddomain = new RegExp('http://([^/]*)');

function fixExternalLinks()
{
  var ls = document.getElementsByTagName('a');
  var cd = getCurrentDomain();
  for(var i = ls.length; i-- > 0;)
  {
    var a = $(ls[i]);
    var m = a.href.match(finddomain);
    if(
        (m != null && m[1] != cd) || 
        a.getAttribute('rel') == 'ext' || 
        a.hasClass('rel') || 
        a.hasClass('ext')) 

      a.target = '_blank';
  }
}

function getCurrentDomain()
{
  var domain = window.location.href;
  var x = domain.match(finddomain);
  return x[1];
}
*/



// 2011-09-13 JK added to intercept mailto links and display a disclaimer message using mootools.
// per http://www.packtpub.com/article/selecting-dom-elements-using-mootools-1.2-part2
// per http://www.lightfootlaw.com/alabama-lawyer/ui/js/lightfoot.js
// per http://www.lightfootlaw.com/alabama-lawyer/attorney.cfm?ID=68

function fixEmailLinks()
{
  var ls = document.getElementsByTagName('a');
  for(var i = ls.length; i-- > 0;)
  {
    var a = $(ls[i]);

    if(a.href.indexOf('mailto:') > -1)
    {
      a.onclick = function() {
        var ok = confirm('Before sending us an e-mail, please be advised that communicating with us concerning any matter in which we have not previously agreed to represent you may not create an attorney-client relationship, and your communication may not be treated as privileged or confidential by us. We cannot agree to represent you in any legal matter without first checking for conflicts of interests which normally requires a conversation with you about the nature of the matter and the identities of all the adverse parties.');
        return ok;
      }
    }
  }
}


