function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

if (hasPath("Featured"))
YD.addClass(document.body, "featured");




// -------------------------------------------------------------------------------------------
// Start of Code to auto-open a gallery that is all alone in a category
//
// If page is a category page or a sub-category page and there is only one 
// thumbnail on the page (whether it's a sub-category or a gallery thumb)
// we will auto-open it.
// -------------------------------------------------------------------------------------------
YE.onContentReady("category", function()
{
    try
    {
        // if there are any parameters following the category URL, then don't auto-open
        if (window.location.search.length != 0) return;
        var boxes = Sizzle(".boxBottom .miniBox", this);
        // if one and only one miniBox, then just open it
        if (boxes.length == 1)
        {
            var links = Sizzle("a", boxes[0]);
            window.location.replace(links[0].href + "?ao=0");
        }
    } catch (e) {}
});

// on a gallery page, add search params to each cat/sub-cat link in the breadcrumb 
// to prevent auto-open when we navigate back up the params
YE.onContentReady("breadCrumbTrail", function()
{
    if (YD.hasClass(document.body, "galleryPage"))
    {
        var navs = Sizzle("a.nav", this);
        for (var i = 0; i < navs.length; i++)
        {
            if (navs[i].href.indexOf("?") == -1)
            {
                navs[i].href += "?ao=0";
            }
        }
    }
});

// -------------------------------------------------------------------------------------------
// End of Code to auto-open a gallery that is all alone in a category
// -------------------------------------------------------------------------------------------

