// Change Home Link (from Devbobo) YE.onContentReady('toolbar', function () { this.innerHTML = this.innerHTML.replace(/href="http:\/\/www.smugmug.com\/([?\w&;=]+)?"/, 'href="' + webServer + '"')});

function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_5370961")) 
  {
    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);

rightClickWarning = "Sorry you can't download a photograph from here. Click on the 'Prices' menu at the top of the page for more details or if there is a 'Buy' button on this page, simply click it to purchase this Photograph. (NOTE: There are some Client Galleries that are not for sale or download)";






if (YD.hasClass(document.body,'homepage') && !YD.hasClass(document.body,'galleries'))
loadSlideshow ();












function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}









// =========================
// ==  Keyword Redirect   ==
// =========================
 
function CheckGalleryRedirects()
{
    var galleryRedirectTable = 
    {
        "9795108_CjZAR" : "/Archive/MBKC"
    };
 
    // the only way it will let you go to the real gallery is if you add #stop to the end of the gallery URL
    // you can check for the loggedIn class because this executes before the body tag is even present
    if (window.location.hash != "#stop")
    {
        // get the path from the current URL, 
        var path = window.location.pathname;
        var results = path.match(/\/(\d+_[a-zA-Z0-9]+)(#|$)/);
        if (results && (results.length > 1))
        {
            var newURL = galleryRedirectTable[results[1]];        // 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
            }
        }
    }
}
 
CheckGalleryRedirects();
 


// Hide Categories
function delCategory() {
re = /\/(Archive|Other|Hidden)$/;


var oList = YD.getElementsByClassName('miniBox', 'div', this);

for (i = 0; i < oList.length; i++) {
if (re.test(oList[i].getElementsByTagName('a')[0].href))
oList[i].parentNode.removeChild(oList[i]);
}
}
YE.onContentReady('categoriesBox', delCategory);

// End Hide Categories 








function removeKeywords() {
 
 var aKeywords = ['17th may 2009','9th august 2009','12th july 2009','10th may 2009','dday','hotel','leverhulme','modified','northwest','round 9','september','10k','5th july','dominican','event','events','heaton','june 6th','motor sport','photograph','race life','robert','round 10','three sisters','timeattack','union'];
 
 var oBox = YD.get('keywordsBox');
 oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
 
 for (i=0; i<oKeywords.length; i++) {
   for (j=0; j<aKeywords.length; j++) {
     if (aKeywords[j] == oKeywords[i].innerHTML) {
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
       } catch(e){}
       try {
         oKeywords[i].parentNode.removeChild(oKeywords[i]);
       } catch(e){}
       break;
     }
   }
 }
}



filmstripMove = 1;