function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=aUvDzphm1l71Y";
}
}
YE.onAvailable('footer', AddReferralCode);

rightClickWarning = "All photos are property of Ron Skinner. All rights reserved. Unauthorized use is prohibited."

function norobotmail(aUser, aDomain) { 
       document.location = "mailto:" + aUser + "@" + aDomain;
    }

// ------------------------------------------------------------------------------------------------------------------------------------
// Script to change the breadcrumb link to your homepage to point to your galleries page instead of your slideshow
// It also changes that link to say "Galleries" instead of your user name

function AdjustBreadcrumb()
{
    // there are something like six different forms of the breadcrumb including search and keyword and date and communities, categories and galleries that we have to make this work for
    var tags = YD.getElementsByClassName("nav", "a", this);        // get all the <a> tags with class "nav"
    var filteredTags = new Array;
    // filter out any that aren't at the top level in the breadCrumbTrail (this gets rid of the relatedDate tags)
    for (var i in tags)
    {
        if (tags[i].parentNode == this)
        {
            filteredTags.push(tags[i]);
        }
    }
    if (filteredTags.length == 0)
    {
        return;
    }
    // default to targeting the first filtered tag
    var targetTag = filteredTags[0];
    
    // see if we have a community here
    if (filteredTags.length > 1)
    {
        // if we have a community here, then the user top level is in the 2nd position
        if (filteredTags[0].href.search(/\/community\//) != -1)
        {
            targetTag = filteredTags[1];
        }
    }
    // make sure URL ends with a slash
    var str = targetTag.href;
    if (str.search(/\/$/) == -1)
    {
        str += "/";
    }
    str +="galleries";            // can be changed to point to a category
    targetTag.href = str;
    targetTag.innerHTML = "Galleries";        // can be changed to whatever you want the top level to be called
}

YE.onContentReady("breadCrumbTrail", AdjustBreadcrumb);

// END OF
// Script to change the breadcrumb link to your homepage to point to your galleries page instead of your slideshow
// It also changes that link to say "Galleries" instead of your user name
// ------------------------------------------------------------------------------------------------------------------------------------


addEvent(window, "load", rem_pipes);

function rem_pipes () {
   for (var i = 0; i<3; i++) {
      var objElement = document.getElementById("footer")
      if (objElement != null) 
      {
         var str_a = new String(objElement.innerHTML);
         str_a = str_a.replace('|', '')
         objElement.innerHTML = str_a;
      }
      var objElement = document.getElementById("feeds")
      if (objElement != null) 
      {
         var str_b = new String(objElement.innerHTML);
         str_b = str_b.replace('|', '')
         objElement.innerHTML = str_b;
      }
   }
}

/* Featured Gallery title change... */
YE.onAvailable('featuredTitle', function() {this.innerHTML = 'Galleries of the Week'});

/* Category Title change... */
YE.onAvailable('categoryTitle', function() {this.innerHTML = 'My Portfolio'});

function RemoveGalleryWord()
{
    this.innerHTML = this.innerHTML.replace(/ Galleries$/, "");
}

YE.onAvailable("subCatGalleryTitle", RemoveGalleryWord);
YE.onAvailable("galleryTitle", RemoveGalleryWord);

YE.onAvailable("subCatGalleryTitle", function() {this.innerHTML = this.innerHTML.replace(/ Sub-Categories/, "")});