function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

/*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=5xIl87GgCKNr6";
}
}
}
YE.onAvailable('footer', AddReferralCode);

/*guest book */

function doOnLoad()
{
if (window.AlbumID && (window.AlbumID == "4691298" || window.AlbumID == "4697837"))
{
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;
if (divElm.className.indexOf("photo")<0) continue;
link.href = "javascript:void(0);";
}
}
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_4691298"))
  {
    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);

/*del Hover*/
function delHover() {
	imgTags = document.getElementsByTagName("img");
	for (i=0; i<imgTags.length; i++) {
		imgTags[i].title = "";
		imgTags[i].alt = "";
	}
}

/*Services and prices*/
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_4697837"))
  {
    var objElement = YD.get("comment")
    if (objElement != null)
    {
      var str = new String(objElement.innerHTML);
      str = str.replace(/\gallery/gi, 'Customer');
      objElement.innerHTML = str;
    }
  }
}

YE.onAvailable("comment", ModifyText);

function doOnLoad() {
  if (window.AlbumID && (window.AlbumID == "4697837")) //
  removeLinkFromImg();
}

function removeLinkFromImg() {
  oList = YD.getElementsByClassName("photo", "div");

  for (i=0; i < oList.length ; i++) {
    if (oList[i].childNodes) {
      oList[i].firstChild.removeAttribute("href");
      oList[i].firstChild.firstChild.removeAttribute("alt");
      oList[i].firstChild.firstChild.removeAttribute("title");
    }
  }
}

/*Photo of the day*/


/*Paypal*/



/*link re-direct*/

function redirectPath() { 
  re = /((www.)?jdeorta.smugmug.com)/; 
  tmp = window.location.href; 
  if (re.test(tmp)) { 
    tmp = tmp.replace(re, 'www.deortaphotography.com'); 
    window.location.href = tmp; 
  } 
}
redirectPath();
  
