function addCategoryDescription()
{
  var categoryDescription = {
      "Places"  : "Mainly images of the south west UK that don't fall into the category of Mendip.",
      "Rambling"  : "These galleries are home to images and movie clips taken when I'm pottering around the garden, or walking, typically without a definite route or purpose. Thoughts just come and go in an inconsequential way and the occasional photo needs to be taken which doesn't have a home anywhere else. ",
      "Skyscapes"  : "Clouds are for dreamers and their contemplation benefits the soul. Indeed, all who consider the shapes they see within them will save on psychoanalysis bills - Cloud Appreciation Society Manifesto ",
      "Environment"  : "The natural world, my natural world is normally in the Mendip Hills or South West of England",
      "Events"  : "Images from this gallery have been been moved to Environment ",
      "All_Dogs"  : "",
      "Music_and_Dance"  : "Images from this gallery have been been moved to Environment ",
      "Fly"  : "Fly was my 'wonder dog'. Most of her life was spent on 3 legs but nothing stopped her enjoying herself. She died on 25th February 2008 from Chronic Renal Failure 12 years old, active till almost the end and so much missed. "
  };

  if ((YAHOO.util.Dom.hasClass(document.body, "category")) && (!YAHOO.util.Dom.hasClass(document.body, "subcategory")))
  {

    re = /category_(\S+)/i;
    re.exec(document.body.className);

    breadCrumb = document.getElementById("breadcrumb");
    if (breadCrumb)
    {
      divTag = document.createElement("div");
      divTag.className = "categoryDescription";
      divTag.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
      breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
    }
  }
  if (YAHOO.util.Dom.hasClass(document.body, "homepage"))
  {
    re = /\>([\w\-]+)<\/a>/i;

    divTag = document.getElementById("categoriesBox");
    if (divTag)
    {
      divTags = YAHOO.util.Dom.getElementsByClassName("albumTitle", "p", divTags);

      for (i=0; i<divTags.length; i++)
      {
        re.exec(divTags[i].innerHTML);
        pTag = document.createElement("p");
        pTag.className = "categoryDescription";
        pTag.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
        divTags[i].parentNode.insertBefore(pTag, divTags[i].nextSibling);
      }
    }
  }
}

//
// 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


