// change the link on the SmugMug Logo

YE.onAvailable('homelink', function(e) {
    this.href = "http://www.elca.org/";
    this.firstChild.alt = "ELCA";
    this.firstChild.title = "ELCA";
});

// removes the pipes characters in the toolbar header

YE.onAvailable('toolbar', function(e) {
this.innerHTML = this.innerHTML.replace(new RegExp(/\|/g),"");
});

// vanity URLs  ( http://www.dgrin.com/showthread.php?p=765679 )
var vanityTable = 
 {
     lea : "http://elca.smugmug.com/gallery/7336363_yjzBb#472120587_KB8Kc"
     tvads: "http://elca.smugmug.com/gallery/7794069_osoJd#513279001_Go73K"
 };
function CheckRedirects()
 {
     if (YD.hasClass(document.body, 'homepage'))    // only run this code on the home page
     {
         // get the path from the current URL, 
         // convert it to lowercase and remove the leading slash
         var path = window.location.pathname.toLowerCase().substr(1);
         
         var newURL = vanityTable[path];        // look it up in our table
         
         // if we found it in the table && newURL is different than where we are
         if (newURL && (newURL != window.location))
         {
             window.location.replace(newURL);        // go to the new URL
         }
     }
 }

// Change Home Link (from Devbobo)
YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com([?\/\w&;=\-]+)?"/, 'href="' + webServer + '"')});