function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

// Move filmstrip thumbs below the main image
YE.onDOMReady(PutFilmstripBelow);

function PutFilmstripBelow()
{
    if (YD.hasClass(document.body, "filmstrip"))
    {
        var moveWrapper = document.getElementById("moveWrapper");
        var photos = document.getElementById("photos");
        if (moveWrapper && photos)
        {
            var photosObj = photos.parentNode.removeChild(photos);
            moveWrapper.parentNode.insertBefore(photosObj, moveWrapper);
            photos.style.display = "block";
        }    
    }
}

// script to replace a user's name in the breadcrumb with "Home"
YE.onContentReady("breadCrumbTrail", ReplaceTopOfBreadcrumbWithHome);

function ReplaceTopOfBreadcrumbWithHome()
{
    var str = this.innerHTML.replace(/\n/g, " ");
    this.innerHTML = str.replace(/\>[^\<]+<\/a>/i, ">Home</a>");
}

