rightClickWarning = "All images are Copyright Brian Petrie. If you would like to purchase this image, please click the 'Buy' link at the top of the page. Thank you! "; // =====Start 2nd Home Page/Galleries Page===

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");


// 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>");
}


/*===================================*/
/*== SM Bay Photo Help Page Script ==*/
/*===================================*/

            var t = {"Bprints":0,"Merchandise":1,"Downloads":2,"More":3,"Help":4},
        activeIndex = t[location.hash.split("#")[1]] || 0;

    var handleTabChange = function(ev) {
        var id = ev.newValue.get('element').id,
            activeIndex = this.get('activeIndex');
            
        if (t.Bprints >= 0 && activeIndex === 0) {
            //if we have a bay tab, it will always be at index 0
            YD.get('catSmall').innerHTML = 'Bay Photo'; 
        } else if (/tab_cat_(prints|merchandise)$/.test(id)) {
            //no bay tab, prints and merch are ezp
            YD.get('catSmall').innerHTML = 'EZ Prints'; 
        } else {
            YD.get('catSmall').innerHTML = ''; 
        }
    };

    YE.onDOMReady(function() {
        var catTabs = new YAHOO.widget.TabView('cat_tabs');

        catTabs.addListener('activeTabChange', handleTabChange);
        catTabs.set('activeIndex', activeIndex);
    });
