// This file is used to hide the email links from spiders and spambots
function buildaddresses(id) {
  firstpart = ['info','error.notification','chairman','annecahill22','joanakeogh','treasurer','giselaholstein','info','vidatansey','rosiepaterson','troughton','doniemcnamara',
               'pnuod','martine','naomi.donoghue','cfitzz','jan','pepbyrne','kirwana','mary.sedressage','ajhession','diy','kyle.gillian','dunnemonica','wouter.liekens',
               'shenry2009','nidressage','ajbdevine3','annemanoras','hennessy5','ballinaparkstud','lchristie','quivsrocks'];
  nextpart = ['dressageireland','yahoo','eircom','annemariedunphy','hotmail','sky','talk21','iol','hgtelekom','gmail','jumpingaround','indigo','celticgroup','tiscali'];
  lastpart = ['ie','net','com','co.uk'];
  addresses = [['secretary',0,0,0],['errornotification',1,0,0],['robertmccormick',2,0,0],['annecahill',3,1,0],['joankeogh',4,2,1],['norbertvoncramon',5,0,0],
               ['giselaholstein',6,2,1],['annemariedunphy',7,3,2],['vidatansey',8,4,2],['rosemarypaterson',9,5,2],['helentroughton',10,6,2],['doniemcnamara',11,2,1],
               ['unaodonnell',12,7,0],['martinegreenlee',13,8,2],['naomidonoghue',14,9,2],['clarefitzsimons',15,9,2],['janheine',16,10,2],['paulbyrne',17,2,1],
               ['annekirwan',18,11,0],['marycox',19,9,2],['juliahession',20,2,1],['billdelahoyde',21,0,0],['sorrellklatzko',21,0,0],['gilliankyle',22,9,2],['johnkyle',22,9,2],
               ['monicadunne',23,4,2],['wouterliekens',24,12,0],['sylviahenry',25,4,3],['valeriemccormick',26,13,3],['judydevine',27,9,2],['annemanoras',28,4,2],
               ['mariehennessy',29,2,1],['vivienneoconnor',30,4,2],['lindachristie',31,2,1],['caoimhekennedy',32,9,2]];
  for (i = 0; i < addresses.length; i++) {
    if (id == addresses[i][0]) {
      return address = firstpart[addresses[i][1]] + '@' + nextpart[addresses[i][2]] + '.' + lastpart[addresses[i][3]];
    }
  }
}

function sendemail(id) {
  buildaddresses(id);
  window.document.location.href = 'mailto:' + address;
}

function writeemail(id) {
  buildaddresses(id);
  window.document.write('<a href="#" onClick="sendemail(\''+id+'\');return false;" title="click to send an email" onMouseOver="window.status=\'\';return true;">' + address + '</a>');
}
