// fix the pesky pipes

//YE.onAvailable("cobrand_footer", function() {this.innerHTML = //this.innerHTML.replace(/\||what are feeds\?/gi, '');});

// Change the smugmug link at the bottom to my referral code
function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=MuoTCEc4BBFRA";
}
}
YE.onAvailable('footer', AddReferralCode);

SM.PhotoBar.config.position = 'bottom';

// right-click protection
rightClickWarning = "All photographs are the property of Anup Sekhar. All rights reserved. Unauthorized use is strictly prohibited.";

// Changing the title of each page to reflect what's shown on the page
document.title = "Frozen Color Photography";
function RelevantTitle()
{
   var baseTitle = "Frozen Color :: Photography by Anup Sekhar";
   var separator = " :: ";
   var albumTitle = document.getElementById("albumTitle");
   var galleryTitle = document.getElementById("galleryTitle");
   if( albumTitle && albumTitle.textContent )
      document.title = baseTitle + separator + albumTitle.textContent;
   else if( galleryTitle && galleryTitle.textContent )
   {
      var galleryTitleText = galleryTitle.textContent;
      // Strip " sub-categories" off the end of the category text
      var finalPositionCategory = galleryTitleText.search(" sub-categories");
      if( finalPositionCategory >= 0 )
         galleryTitleText = galleryTitleText.substr( 0, finalPositionCategory );
      else
      {
         // Strip " galleries" off the end of the category/sub-category text
         var finalPositionSubCategory = galleryTitleText.search(" galleries");
         if( finalPositionSubCategory >= 0 )
            galleryTitleText = galleryTitleText.substr( 0, finalPositionSubCategory );
      }
      document.title = baseTitle + separator + galleryTitleText;
   }
   else // Not Gallery, Category, or Subcategory
   {
      // Set title on homepage
      document.title = baseTitle;
   }
}

// replacing the mailto with scrambled text to fool spambots
function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }
