<!--// hide
// Copyright © 2005 Symphony Systems. All Rights Reserved.

// function to obfusticate email address  (link argument is optional)
// call like this: document.write(display_email('user','domain','link text'));

function display_email(user,domain,link){
  if (link == null) {
    return("<a href='mailto:" + user + "@" + domain + "'" + ">" + user + "@" + left_match(domain,"?") + "</a>");
  } else {
    return("<a href='mailto:" + user + "@" + domain + "'" + ">" + link + "</a>");
  }
}

// function returns part of a string prior to occurance of passed in char
function left_match(string,match){
  var lm = (string.indexOf(match) > 0) ? string.substring(0,string.indexOf(match)) : string;
  return(lm);
}

// function creates captions from image titles (converts http:// prefixed titles to hyperlinks)
function extractImageTitles(){
  images = document.getElementsByTagName('img');
  for (var i = 0; i < images.length; i++){
    var title = images[i].getAttribute('title');
    if ((title) && (title != '')){
      if (title.match('http://', 'i')){
        newlink = document.createElement('a');
        newlink.setAttribute('href', title);
        newlink.setAttribute('title', ('Go to ' + title));
        newlink.appendChild(document.createTextNode('Image source'));
        var newdiv = document.createElement('div');
        newdiv.className = 'caption';
        newdiv.appendChild(newlink);
        images[i].parentNode.appendChild(newdiv);
        images[i].removeAttribute('title');
      } else {
	var newdiv = document.createElement('div');
	newdiv.className = 'caption';
	newdiv.appendChild(document.createTextNode(title));
	images[i].parentNode.appendChild(newdiv);
	images[i].removeAttribute('title');
      }
    }
  }
}

window.onload = function(e) {extractImageTitles();}

//-->