// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at (http://www.jottings.com/obfuscator/) http://www.u.arizona.edu/~trw/spam/spam4.htm

function DisplayMail(coded,key,text) {
  shift=coded.length
  link=""
  for (i=0; i<coded.length; i++) {
    if (key.indexOf(coded.charAt(i))==-1) {
      ltr = coded.charAt(i)
      link += (ltr)
    }
    else {     
      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
      link += (key.charAt(ltr))
    }
  }
document.write("<a href='mailto:"+link+"'>"+text+"</a>")
}

function getElement(id){
    if(document.getElementById){    // test the most common method first.  Most browsers won't get past this test
        return document.getElementById(id);
    }else if(document.all){         // test older versions of IE
        return document.all[id];
    }else if(document.layers){      // test older versions of Netscape
        return document.layers[id];
    }else{                          // not sure what to do...return null
        return null;
    }
}