function hasPath(sPath)
{
  re = new RegExp("\/" + sPath + "(\/|$)"); 
  return re.test(window.location)
}

// Fix the Pesky Pipes

YE.onAvailable("cobrand_footer", function() {this.innerHTML = this.innerHTML.replace(/\||what are feeds\?/gi, '');});


// Popular Box Title
YE.onContentReady('popularTitle', function() {this.innerHTML = 'Miguel Lasa Photography - Popular Photos'});

// Keyword Box Title
YE.onContentReady('keywordsTitle', function() {this.innerHTML = 'Browse by Keywords'});

// Search Box Title
YE.onAvailable('headerBoxTop2', function() {this.innerHTML = 'Search Miguel Lasa Photography'});

// Map Box Title 
YE.onContentReady('mapTitle', function() {this.innerHTML = 'Mapped Photos'});

// Date Box Title
YE.onContentReady('datesTitle', function() {this.innerHTML = 'Browse by Date'});


// Right Click Message

rightClickWarning = "All photos are © Miguel Lasa. All rights reserved. Unauthorized use is prohibited."


// Secure Email

function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }


// Referral Code

function AddReferralCode()  {
   var footerDiv = YD.get("footer");
   if (footerDiv)  {
     var links = footerDiv.getElementsByTagName("A");
     if (links && (links.length != 0)) {
       var smugLink = links.item(0);
       smugLink.href = "http://www.smugmug.com/?referrer=qxjmWDOMj8pwA";
     }
  }
}
YE.onAvailable('footer', AddReferralCode);

/*============================*/
/*== Redirect Stuff ==*/
/*============================*/

function redirectPath() { 
  re = /((www.)?miguel-lasa.smugmug.com)/; 
  tmp = window.location.href; 
  if (re.test(tmp)) { 
    tmp = tmp.replace(re, 'www.miguellasa.com'); 
    window.location.href = tmp; 
  } 
}
redirectPath();

displaySmugPopular = false;


// no click in journal style 

function doOnLoad() {
  if (window.AlbumID && (window.AlbumID == "1526729")) //
  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);";

    }

} 