/* code to duplicate the Gallery */
function hasPath(sPath) {
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}
if (hasPath("galleries"))
YD.addClass(document.body, "galleries");
/* code to duplicate the Gallery END*/

/* code for changing Gallery comment to Guest Book comment on GuestBook Page */
function ModifyText () {
  if (YD.hasClass(document.body, "gallery_6140537")) {
    var objElement = YD.get("comment")
    if (objElement != null) {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, 'Guestbook');
      objElement.innerHTML = str;
    }
  }
}

YE.onAvailable("comment", ModifyText);

/* Code for making the Journal Pages(Guest Book) photos nonclickable, non enlargable etc */
/* Code for making the Journal Pages photos(Buy Prints) nonclickable, non enlargable etc */
function doOnLoad() {
  if (window.AlbumID && (window.AlbumID == "6140537")) //
     removeLinkFromImg();
  if (window.AlbumID && (window.AlbumID == "6246969")) //
     removeLinkFromImg();
}

function removeLinkFromImg() {
    var links = document.getElementsByTagName("A");
    for (var i = 0; i < links.length; i++) {
        var link = links[i];
        var divElm = link.parentNode;
        if (!divElm)
            continue;
        divElm = divElm.parentNode;
        if (!divElm)
            continue;
        if (divElm.className.indexOf("photo")<0)
            continue;
        link.href = "javascript:void(0);";
    }
} 

/* Work around for Email Spam */
function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain + ".com"; }


/* work around to update first bread crumb link from home to gallery */
function ModifyGalleryBreadcrumb () {
  this.innerHTML = this.innerHTML.replace('www.liketheocean.com"', 'www.liketheocean.com/galleries"');
  this.innerHTML = this.innerHTML.replace('>sathya<', '>Galleries<');
}
YE.onContentReady('breadCrumbTrail', ModifyGalleryBreadcrumb);
 
function ModifyCategoryBreadcrumb () {
  this.innerHTML = this.innerHTML.replace('"/"', '"/galleries"');
  this.innerHTML = this.innerHTML.replace('>sathya<', '>Galleries<');
}
YE.onContentReady('category', ModifyCategoryBreadcrumb);

// script to replace a user's name in the breadcrumb with "Home"
function ReplaceTopOfBreadcrumbWithHome()
{
    var str = this.innerHTML.replace(/\n/g, " ");
    this.innerHTML = str.replace(/\>[^\<]+<\/a>/i, ">Home</a>");
}
YE.onContentReady("breadCrumbTrail", ReplaceTopOfBreadcrumbWithHome);