YE.onContentReady("albumNav_top", CreateMyNav);
function CreateMyNav() {
  var altviews = document.getElementById("altViews");
  var cartbuttons = document.getElementById("cartButtonsWrapper");
  if(altviews && cartbuttons) {
    cartbuttons.appendChild(altviews, cartbuttons.firstChild);
  }
}

YE.onContentReady("breadCrumbTrail", AdjustBreadcrumb);
function AdjustBreadcrumb()
{

    var tags = YD.getElementsByClassName("nav", "a", this);        // get all the <a> tags with class "nav"
    var filteredTags = new Array;

    for (var i in tags)
    {
        if (tags[i].parentNode == this)
        {
            filteredTags.push(tags[i]);
        }
    }
    if (filteredTags.length == 0)
    {
        return;
    }
    // default to targeting the first filtered tag
    var targetTag = filteredTags[0];
    
    // see if we have a community here
    if (filteredTags.length > 1)
    {
        // if we have a community here, then the user top level is in the 2nd position
        if (filteredTags[0].href.search(/\/community\//) != -1)
        {
            targetTag = filteredTags[1];
        }
    }
    // make sure URL ends with a slash
    var str = targetTag.href;
    if (str.search(/\/$/) == -1)
    {
        str += "/";
    }
    str +="galleries";
    //targetTag.href = str;
    // targetTag.href = "http://underwa.ter.net/pages/galleries.php";
    targetTag.href = "http://uwimages.smugmug.com";
    // targetTag.href = 'javascript:void(0);';
    targetTag.innerHTML = "Galleries";
    targetTag.nodeValue = '';
    target = document.getElementById('mycrumb');
    if(target) {
      target.innerHTML = this.innerHTML;
    }
}

function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("categories")) YD.addClass(document.body, "categories");

