// change the link on the SmugMug Logo

YE.onAvailable('homelink', function(e) {

this.href = "http://caroline2.smugmug.com/";

this.firstChild.alt = "my Life";

this.firstChild.title = "My Life";

});

// removes the pipes characters in the toolbar header

YE.onAvailable('toolbar', function(e) {

this.innerHTML = this.innerHTML.replace(new RegExp(/\|/g),"");

});


function addCategoryDescription()
{
  var categoryDescription = {
      "Holidays"  : "We spend as much time as we can on the boat or going off in the campervan,so we don't have holidays as such but every time we go away is like a mini holiday",
      "Animals"  : "Our Dogs, Other Dogs, and any other animals that catch my eye",
      "Weather"  : "We have such changeable weather in the UK so this section is intended to show just how much variety there is.",
"Other"  : "For private galleries that contain test images or site specific stuff",
"PhotoDiaries"  : "I used to call this section my Photodiary but I'm not good at keeping it up to date, so decided this would be more of an occasional gallery with the odd picture that interests me but doesn't fit anywhere else.",
"Fly"  : "Very special of pics of my lovely Fly, who will always be loved and missed",
"Family"  : "The special people in my life."
  };

  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);
      }
    }
  }
}



function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=fUW5qS1Mau40c";
}
}
YE.onAvailable('footer', AddReferralCode);

//duplicates the homepage, but makes it separately adressable
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

YE.onContentReady('mapTitle', function() {this.innerHTML = this.innerHTML.replace('around the world', 'around the Mendips')});


function norobotmail(aUser, aDomain) {
document.location = "mailto:" + aUser + "@" + aDomain;
}


//Shizams slideshow
function createSWF( w, h, params) {
  var args = "";
  for (var i in params) {
    args += i + "=" + params[i] + "&amp;";
  }
document.writeln('<object width="100%" height="100%" align="middle">'+ '<param name="movie" value="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'"/>'+ '<param name="wmode" value="transparent" />'+ '<embed src="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'" wmode="transparent" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" allowScriptAccess="always" allowNetworking="all"/></object>');
return 1;
}

