rightClickWarning = "I think you meant to hit buy photos :)"; function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=7AvYI73vB6Fd6";
}
}
YE.onAvailable('footer', AddReferralCode);


function delHover() {
    oLst = YD.getElementsBy(function(el) {return (YD.hasClass(el,'imgBorder') || YD.hasClass(el,'imgBorderOn'))},'img');
    for (i=0; i < oLst.length ; i++) {
        if (oLst[i].title && oLst[i].title != '') oLst[i].title = '';
        if (oLst[i].alt && oLst[i].alt != '') oLst[i].alt = '';
    }
}
YE.onContentReady('bodyWrapper', function() {if (!YD.hasClass(document.body, 'smugmug_ajax')) delHover()});
onPhotoShow.subscribe(function(){YE.onAvailable('mainImage', delHover)});


function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

//-------------------------------------------------------------------------
// Code to move the slideshow button to the same row 
// as the buy button
//-------------------------------------------------------------------------
function MyNewSlideshowInit(container, id, config)
{
    if (config && config.slideshowDiv && (config.slideshowDiv == "fsssButton"))
    {
        var cartDiv = YD.get("cartButtonsWrapper");
        if (cartDiv)
        {
            var ssDiv = YD.get("fsssButton");
            if (ssDiv)
            {
                ssDiv.parentNode.removeChild(ssDiv);
            }
            var newDiv = document.createElement("div");
            newDiv.id = "fsssButton";
            cartDiv.appendChild(newDiv);
            container = "cartButtonsWrapper";
        }
    }
    return (myOldSlideshowInit.apply(this, arguments));
}

var myOldSlideshowInit;
if (typeof(SM.buttons.slideshow) != "undefined")
{
    // hook the init function on the SM.buttons.slideshow object
    myOldSlideshowInit = SM.buttons.slideshow.prototype.init;
    SM.buttons.slideshow.prototype.init = MyNewSlideshowInit;
}
