/* removes top level of breadcrumbs */
YE.onContentReady("breadCrumbTrail", RemoveTopOfBreadCrumb);

function RemoveTopOfBreadCrumb()
{
   var str = this.innerHTML;
   str = str.replace(/\n/g, " ");    // get rid of linebreaks which cause problems for regular expressions in javascript
   this.innerHTML = str.replace(/^\s*<a .*?a>.*?</i, "<");
}

function delHover() {
    oLst = YD.getElementsBy(function(el) {return (YD.hasClass(el,'imgBorder') || YD.hasClass(el,'imgBorderOn'))},'img');
    for (i=0; i < oLst.length ; i++) {
        if (oLst[i].title && oLst[i].title != '') oLst[i].title = '';
        if (oLst[i].alt && oLst[i].alt != '') oLst[i].alt = '';
    }
}
YE.onContentReady('bodyWrapper', function() {if (!YD.hasClass(document.body, 'smugmug_ajax')) delHover()});
onPhotoShow.subscribe(function(){YE.onAvailable('mainImage', delHover)});

/* makes about/contact page not allow clicking, enlarging etc. */
function doOnLoad() {
 if (window.AlbumID && (window.AlbumID == "8712691")) //
 removeLinkFromImg();
}

function removeLinkFromImg()

{

   var links = document.getElementsByTagName("A");

   for (var i = 0; i < links.length; i++)

   {

       var link = links[i];

       var divElm = link.parentNode;

       if (!divElm)

           continue;

       divElm = divElm.parentNode;

       if (!divElm)

           continue;

       if (divElm.className.indexOf("photo")<0)

           continue;

       link.href = "javascript:void(0);";

   }

}

function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_8712691")) 
  {
    var objElement = YD.get("comment")
    if (objElement != null) 
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery comments/gi, 'Guestbook');
      objElement.innerHTML = str;
    }
  }
}

YE.onAvailable("comment", ModifyText);