function ModifyGalleryBreadcrumb () {
  this.innerHTML = this.innerHTML.replace('beachglassphotography.com"', 'beachglassphotography.com/galleries"');
  this.innerHTML = this.innerHTML.replace('>BeachglassPhotography<', '>Galleries<');
}
YE.onContentReady('breadCrumbTrail', ModifyGalleryBreadcrumb);
 
function ModifyCategoryBreadcrumb () {
  this.innerHTML = this.innerHTML.replace('"/"', '"/galleries"');
  this.innerHTML = this.innerHTML.replace('>BeachglassPhotography<', '>Galleries<');
}
YE.onContentReady('category', ModifyCategoryBreadcrumb);





//////////////////////download button//////////////////////////////////////

onPhotoShow.subscribe(ProcessDownloadButton);

function IsSmugmugView()
{
    return(YD.hasClass(document.body, "smugmug"));
}


function ProcessDownloadButton()
{
    if (IsSmugmugView())
    {
        if (photoInfo[ImageID].albumOriginals && (photoInfo[ImageID].Format !== "MP4"))
        {
            InsertDownloadButton("cartButtonsWrapper");
        }
    }
}

function InsertDownloadButton(parentId)
{
    // now add the download button
    var parentDiv = document.getElementById(parentId);
    var downloadButton = document.getElementById("downloadButtonId");
    if (parentDiv && !downloadButton)
    {
        var downloadButtonInfo =
        {
            id: "downloadButtonId",
            label: "Download Image...",
            container: parentDiv,
            type: "button",
            className: "sm-button sm-button-small themesButton glyphButton",
            onclick: { fn: InitiateDownloadImage }
        };
        
        var dButtonObj = new YAHOO.widget.Button(downloadButtonInfo);
    }
}

function InitiateDownloadImage()
{
    // construct the download URL
    window.location = "/photos/" + ImageID + "_" + ImageKey + "-D.jpg";
}
/////////////////////////////////end download button//////////////////////////////
