function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_6796203"))
  {
    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");

YE.onAvailable('galleryTitle', function() {this.innerHTML = 'New Gallery Title'});

YE.onAvailable('categoryTitle', function() {this.innerHTML = 'Something New'});

addEvent(window, "load", rem_pipes);


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)});


function doOnLoad() {
  if (window.AlbumID && (window.AlbumID == "6796203")) //
  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 showRecent(days){
  endDate = new Date();
  oneDay = 1000*60*60*24;
  startDate = new Date(endDate.getTime() - (parseInt(days) * oneDay));
  sUrl = "/date/";
  sUrl += startDate.getFullYear() + "-" + padDate(startDate.getMonth() + 1) + "-" + padDate(startDate.getDate());
  sUrl += "/";
  sUrl += endDate.getFullYear() + "-" + padDate(endDate.getMonth() + 1) + "-" + padDate(endDate.getDate());
   window.location = sUrl;
}

function padDate(datePart){
  if (datePart.toString().length != 1)
    return datePart

  return "0" + datePart;

}
// end Most Recent



function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}