// change the link on the SmugMug Logo

YE.onAvailable('homelink', function(e) {

this.href = "http://justonemoment.com.au/";

this.firstChild.alt = "justonemoment";

this.firstChild.title = "justonemoment";

});

function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }


// removes the pipes characters in the toolbar header

YE.onAvailable('toolbar', function(e) {

this.innerHTML = this.innerHTML.replace(new RegExp(/\|/g),"");

});

addEvent(window, "load", showSlideshowCaption);

function showSlideshowCaption()
{
  try
  {
    if (showCaption == false)
      setCaption();
  }
  catch(e) {}
}

// dont want to use the lightbox
useLightbox = false;

YE.onAvailable('mainImageLink', function(){this.removeAttribute('href')});

// makes vanity urls
var vanityTable = 
 {
          skyeleo : "http://justonemoment.smugmug.com/gallery/8540037_eEgQa",
          ojj : "http://justonemoment.smugmug.com/gallery/9106164_PH5Zj",
          boudoir : "http://justonemoment.smugmug.com/gallery/9509599_FwTSo",
          taraclayton :"http://justonemoment.smugmug.com/gallery/10500099_Qzmjp",
          eleisharyan : "http://www.justonemoment.smugmug.com/gallery/10684277_yq468",
          ginadan : "http://www.justonemoment.com.au/Weddings/Gina-and-Dan/11339886_Jfhuw",
          sallymike : "http://www.justonemoment.com.au/Weddings/SallyMike/11128947_4uEmi",
          lauraandjosh : "http://www.justonemoment.com.au/Weddings/LauraandJosh/10941882_9MqNz",
          tennillemike : "http://www.justonemoment.com.au/Weddings/TennilleMike/11428534_XxfRB"

 };

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
         }
     }
 } 