rightClickWarning = "All photos are property of Denise Goldberg. All rights reserved. Unauthorized use is prohibited.";

function AddReferralCode()  {
  var links = this.getElementsByTagName("A");
  if (links && (links.length != 0)) {
    var smugLink = links.item(0);
    smugLink.href = "http://www.smugmug.com/?referrer=llX8NBuQ4l6uQ";
  }
}
YE.onAvailable('footer', AddReferralCode);

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

function norobotmail(aUser, aDomain) { 
       document.location = "mailto:" + aUser + "@" + aDomain;
    }

function ModifyText () 
{
  if (YD.hasClass(document.body, "gallery_2513005")) 
  {
    var objElement = YD.get("comment")
    if (objElement != null) 
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, 'guestbook');
      objElement.innerHTML = str;
    }
  }
  if (YD.hasClass(document.body, "gallery_5057959")) 
  {
    var objElement = YD.get("comment")
    if (objElement != null) 
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, 'guestbook');
      objElement.innerHTML = str;
    }
  }
  if (YD.hasClass(document.body, "gallery_7064431")) 
  {
    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);


// Change title of date box 
YE.onContentReady('datesTitle', function() {this.innerHTML = 'Photos by date'});

// Change title of popular box 
YE.onContentReady('popularTitle', function() {this.innerHTML = 'Random popular photos, or click to see <a href="/popular">all popular photos</a>'});

// Change title of keyword box 
YE.onContentReady('keywordsTitle', function() {this.innerHTML = 'Top 150 keywords, or click to see <a href="/keyword">all keywords</a>'});


//
// most recent
//
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

// remove the pipes from the footer

YE.onAvailable("cobrand_footer", function() {this.innerHTML = this.innerHTML.replace(/\||what are feeds\?/gi, '');});


