function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

function redirectPath() { 
  re = /((www.)?terrencej.smugmug.com)/; 
  tmp = window.location.href; 
  if (re.test(tmp)) { 
    tmp = tmp.replace(re, 'photos.terrencerandell.com'); 
    window.location.href = tmp; 
  } 
}
redirectPath();

YE.onAvailable('categoryTitle', function() {this.innerHTML = ' '});

function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }

function AddReferralCode()  {
  var links = this.getElementsByTagName("A");
  if (links && (links.length != 0)) {
    var smugLink = links.item(0);
    smugLink.href = "http://www.smugmug.com/?referrer=KGTcrM33nYqOE";
  }
}
YE.onAvailable('footer', AddReferralCode);


function delCategory() {
  re = /\/(Family|Other|Friends|Business)$/;

  var oList = YD.getElementsByClassName('miniBox', 'div', this);

  for (i = 0; i < oList.length; i++) {
    if (re.test(oList[i].getElementsByTagName('a')[0].href))
      oList[i].parentNode.removeChild(oList[i]);
  }
}
YE.onContentReady('categoriesBox', delCategory);

function AdjustBreadcrumb()
{
    var str = this.innerHTML;
    str = str.replace(/\n/g, " ");
    str = str.replace(/^\s*<a .*?<\/a>/i, '<a href="/galleries" class="nav">Galleries</a>');
    this.innerHTML = str;
}

YE.onContentReady("breadCrumbTrail", AdjustBreadcrumb);