// Change Home Link (from Devbobo)
YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com\/([?\w&;=]+)?"/, 'href="' + webServer + '"')});

// change the link on the SmugMug Logo

YE.onAvailable('homelink', function(e) {

this.href = "http://www.yukonphotographers.com/";

this.firstChild.alt = "Yukon Photographers";

this.firstChild.title = "Yukon Photographers";

});

// removes the pipes characters in the toolbar header

YE.onAvailable('toolbar', function(e) {

this.innerHTML = this.innerHTML.replace(new RegExp(/\|/g),"");

});

//For Vanity URLs

var vanityTable = 
 {
     "anna" : "http://yukonphotographers.smugmug.com/Norm-Hamilton/Client-Proofs/Anna/13548899_uNoh9#987427323_Nudpj",
     "samples" : "http://www.yukonphotographers.com/Norm-Hamilton/Samples/8145643_yQZj7#937697355_Tp9VV",
     "masuch" : "http://www.yukonphotographers.com/Norm-Hamilton/Client-Proofs/Kristine-Masuch/11615196_WTsQw",
     "touchup_examples" : "http://www.yukonphotographers.com/Norm-Hamilton/Client-Proofs/Touchup-Examples/11616604_q5wMF",
     "man_from_the_capital": "http://www.yukonphotographers.com/Norm-Hamilton/Man-From-The-Capital/11709035_dpfU6#824817728_vrdmd",
     "mountain_goats": "http://www.yukonphotographers.com/Shirly-Ambrose/Mountain-Goats/11843020_2xaiR#837278539_XeX74",
     "seagulls": "http://jfriend.smugmug.com/gallery/386570_mGpMQ"
 };

 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
         }
     }
 }


