function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_6977637")) 
  {
    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);


function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

function addCategoryDescription() {
 var categoryDescription = {
     "Sports" : "Various Sporting Events. For ELHS sports photos, see http://elhs.smugmug.com",
     "Portraits" : "Family, Senior, and individual portraits",
     "Verner's_Weddings" : "Many FULL wedding galleries!  Exactly what the bride and groom each receive",
     "HTLC" : "Holy Trinity Lutheran Church Photos - pro-bono work by Verners",
     "Events" : "A varity of events Verners was asked to photograph",
     "HTLS" : "Holy Trinity Lutheran School sports and activity photos - pro-bono work by Verners",
     "Dance" : "Dances photographed by Verners",
     "Other" : "Other galleries...",
     "Fun" : "Some miscellaneous galleries we've collected and put online...",
     "Family" : "Some personal photos of the family and events"
 };

  if ((YD.hasClass(document.body, "category")) && (!YD.hasClass(document.body, "subcategory"))) { 

    re = /category_(\S+)/i;
    re.exec(document.body.className);

    breadCrumb = YD.get("breadcrumb");
    if (breadCrumb && categoryDescription[RegExp.$1]) {
      divTag = document.createElement("div");
      divTag.className = "categoryDescription";
      divTag.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
      breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
    }
  }
  if (YD.hasClass(document.body, "homepage")) {
    re = /\>([\w\-]+)<\/a>/i;

    divTag = YD.get("categoriesBox");
   if (divTag) {
      divTags = YD.getElementsByClassName("albumTitle", "p", divTag);

      for (i=0; i<divTags.length; i++) {
       re.exec(divTags[i].innerHTML);
        if (categoryDescription[RegExp.$1] != undefined) {
          pTag = document.createElement("p");
          pTag.className = "categoryDescription";
          pTag.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
          divTags[i].parentNode.insertBefore(pTag, divTags[i].nextSibling);
        }
      }
    }
  }
}
YE.addListener(window, "load", addCategoryDescription); 

function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }
