function hasPath(sPath)
{
  re = new RegExp("\/" + sPath + "(\/|$)");
  return re.test(window.location)
}

function AddReferralCode()
{
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=c6KxPaNuJaYEM";
}
}
YE.onAvailable('footer', AddReferralCode);


//Change "gallery comments" to "guestbook comments"
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_4477813"))
  {
    var objElement = YD.get("comment")
    if (objElement != null)
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, 'Guestbook');
      objElement.innerHTML = str;
    }
  }
}

YE.onAvailable("comment", ModifyText);

//Anti-spam email//
function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }


//Stop filmstrip view from moving
filmstripMove = 0;

//Reverse filmStrip navigation
rightMoves = -5;
leftMoves = 5;

var vanityTable = 
{
     capebreton: "http://tyson.smugmug.com/gallery/8079656_dBhAx"
};

 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
         }
     }
 }