delpCategory();


function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");




YE.onContentReady("subcategoriesBox", swapBoxes);

if (YD.hasClass(document.body, "singleImage"))
  fixPhotoNav();


if (hasPath("featured"))
 YAHOO.util.Dom.addClass(document.body, "featured");



if (hasPath("keywordPage"))
 YAHOO.util.Dom.addClass(document.body, "keywordPage");




if (hasPath("galleries"))
  YAHOO.util.Dom.addClass(document.body, "galleries");





var objElement = document.getElementById("galleryTitle")
if (objElement != null)
objElement.innerHTML = objElement.innerHTML.replace('Galleries','Albums');





var objElement = document.getElementById("subCatGalleryTitle")
if (objElement != null)
objElement.innerHTML = objElement.innerHTML.replace('sub-categories','Categories');



var objElement = document.getElementById("subCatGalleryTitle")
if (objElement != null)
objElement.innerHTML = objElement.innerHTML.replace('Galleries','Albums');


var objElement = document.getElementById("categoryTitle")
if (objElement != null)
objElement.innerHTML = objElement.innerHTML.replace('Gallery','Daniel Taylor Photography');


function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_9147064")) 
  {
    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);



 
if (hasPath("find")) { 
YD.addClass(document.body, "find"); 
loadSmugMaps(); 
} 


YE.onContentReady("breadCrumbTrail", ReplaceTopOfBreadcrumbWithHome);

function ReplaceTopOfBreadcrumbWithHome()
{
    var str = this.innerHTML.replace(/\n/g, " ");
    this.innerHTML = str.replace(/\>[^\<]+<\/a>/i, ">Home</a>");
}



YE.onDOMReady(AddItemsToBuyButton);

function AddItemsToBuyButton()
{
    var buyButton = YAHOO.widget.Button.getButton("buyButton");
    if (buyButton)
    {
        var newBuyItem = { text: "View Catalog", url: "http://smugmug.com/prints/catalog/B", target: "_blank"};
        buyButton.getMenu().addItem(newBuyItem);
	var newBuyItem2 = { text: "How to Order", url: "http://smugmug.com/prints/catalog/B#Help", target: "_blank"};
        buyButton.getMenu().addItem(newBuyItem2);
    }
}




YE.onDOMReady(ClearLinksFromMany);

function ClearLinksFromMany()
{
    var listOfGalleries = [
        "9144180",             /* Vendors */
	"9147064",             /* Testimonials */
        "9283112",                /* Pricing */
        "8797638"              /* Contact */
        
    ];
    if (window.AlbumID)
    {
        for (var i in listOfGalleries)
        {
            if (window.AlbumID == listOfGalleries[i])
            {
                removeLinkFromImg();
                break;
            }
        }
    }
}

function removeLinkFromImg() 
{
    var oList = YD.getElementsByClassName("photo", "div");
    for (var i=0; i < oList.length; i++)  
    {
        var aTags = oList[i].getElementsByTagName("a");
        for (var j=0; j < aTags.length; j++)
        {
            // get rid of the href on the <a> tag
            aTags[j].removeAttribute("href");
            // get rid of the alt and title tags on the <img> tag
            aTags[j].firstChild.removeAttribute("alt");
            aTags[j].firstChild.removeAttribute("title");
        }
    }
}



