/*==================================*/
/*== Add Referral Code to SM Link ==*/
/*==================================*/
function AddReferralCode()  {
  var links = this.getElementsByTagName("A");
  if (links && (links.length != 0)) {
    var smugLink = links.item(0);
    smugLink.href = "http://www.smugmug.com/?referrer=8jDMwxj6yp4f2";
  }
}
YE.onAvailable('footer', AddReferralCode);


/*======================================*/
/*== Changes "Pipes" to Dot in Footer ==*/
/*======================================*/
YE.onAvailable("footer", function() {this.innerHTML = this.innerHTML.replace(/\||what are feeds\?/gi, '•');});


/*=====================*/
/*== Vanity URL Code ==*/
/*=====================*/
var vanityTable = 
 {
     photo: "http://tinleyparkfrankfortrotary.com/gallery/6040611_TbxoL",
     rotary: "http://tinleyparkfrankfortrotary.com/gallery/5896320_SscGk",
     calender: "http://tinleyparkfrankfortrotary.com/gallery/5878985_BZ2X3",
     members: "http://tinleyparkfrankfortrotary.com/gallery/5896339_daGCm",
     contact: "http://tinleyparkfrankfortrotary.com/gallery/5896394_ir3gF",
     fundraising: "http://tinleyparkfrankfortrotary.com/gallery/5896374_CCUdX",
     fouryou: "http://tinleyparkfrankfortrotary.com/gallery/5896386_oyLSg",
     fourwaytest: "http://tinleyparkfrankfortrotary.com/gallery/5896389_JkWft",
     notices: "http://tinleyparkfrankfortrotary.com/gallery/7044911_dhDeR",
     eattoearn: "http://tinleyparkfrankfortrotary.com/gallery/9012179_p2VXX",
     recycling: "http://tinleyparkfrankfortrotary.com/gallery/9278098_NL8a6",
     topten: "http://www.tinleyparkfrankfortrotary.com/Information-Pages/Top-Ten/11019405_MYZr3"
 };


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
         }
     }
 }


function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }

/* End Of Top Javascript*/