function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

function addCategoryDescription() {
var categoryDescription = {
    "Most_Recent" : "These galleries are the most recent within the last several months.",
    "Portfolio" : "The Editorial Portfolio features published images of celebrities, on and off the red carpet.",
     "Events" : "Private and Corporate events are located here, shot by your house photographer Steve Mack."
};

 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 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)});