function addEvent(elm, evType, fn, useCapture) {
  // cross-browser event handling for IE5+, NS6 and Mozilla 
  // By Scott Andrew 
  if (elm.addEventListener) { 
    elm.addEventListener(evType, fn, useCapture); 
    return true; 
  } else if (elm.attachEvent) { 
    var r = elm.attachEvent('on' + evType, fn); 
    return r; 
  } else {
    elm['on' + evType] = fn;
  }
}

function setMailLink(e) {
  if (!document.getElementById)
    return;

  var maillink = document.getElementById('maillink');
  
  maillink.title = 'E-mail Us';
  var name = 'medical';
  var domain = 'aestheticlaser';
  var extension = '.co.uk';
  maillink.href = 'ma' + 'il' + 'to' + ':' + name + '@' + domain + extension;
  
  var creditmaillink = document.getElementById('creditmaillink');
  name = 'david';
  domain = 'clystvalley';
  creditmaillink.href = 'ma' + 'il' + 'to' + ':' + name + '@' + domain + extension;
}

addEvent(window, 'load', setMailLink, false);
