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','Get the Picture Photography');









 
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);
    }
}


