rightClickWarning = "Copyrighted by Fadeless Photo. Download Restricted. For purchasing photos, please contact Zahid."; function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_8746744"))
  {
    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);

YE.onDOMReady(ClearLinksFromMany);

function ClearLinksFromMany()
{
    var listOfGalleries = [
        "8753199",            /* Pricing */
        "8747261",            /* Contact */
        "8746744"            /* Guestbook */
    ];
    if (window.AlbumID)
    {
        for (var i in listOfGalleries)
        {
            if (window.AlbumID == listOfGalleries[i])
            {
                removeLinkFromImg();
                break;
            }
        }
    }
}

function removeLinkFromImg() 
{
    var oList = YD.getElementsByClassName("photo", "div");
    for (var i=0; i < oList.length; i++)  
    {
        var aTags = oList[i].getElementsByTagName("a");
        for (var j=0; j < aTags.length; j++)
        {
            // get rid of the href on the <a> tag
            aTags[j].removeAttribute("href");
            // get rid of the alt and title tags on the <img> tag
            aTags[j].firstChild.removeAttribute("alt");
            aTags[j].firstChild.removeAttribute("title");
        }
    }
}

//------------------------------------------------------------------------------------
// Move share and slideshow buttons to the cart line
//-------------------------------------------------------------------------------------

YE.onContentReady("shareButton", MoveToCartDiv);
YE.onContentReady("slideshowButton", MoveToCartDiv);

function MoveToCartDiv()
{
	MoveObjToDiv(this, "cartButtonsWrapper");
}

function MoveObjToDiv(sourceObj, destDiv)
{
	var destDivObj = document.getElementById(destDiv);	// get the object for the dest div
	if (sourceObj && destDivObj)
	{
		sourceObj.parentNode.removeChild(sourceObj);	// remove object from it's current parent
		destDivObj.appendChild(sourceObj);				// add it to the new parent
	}	
}

//------------------------------------------------------------------------------------------
// Highlight the link in your navbar that matches the current page.
//
// See http://www.dgrin.com/showthread.php?t=141678 for documentation.
//------------------------------------------------------------------------------------------
YE.onContentReady("navcontainer", function ()
{
    function AddTrailingSlash(str)
    {
        if (str.charAt(str.length - 1) != "/")
        {
            str = str + "/";
        }
        return(str);
    }
    
    var links = this.getElementsByTagName("a");
    if (links && (links.length > 0))
    {
        var pageURL = window.location.href;
        if (window.location.hash.length != 0)
        {
            pageURL = pageURL.replace(window.location.hash, "");        // remove the hash value
        }
        pageURL = AddTrailingSlash(pageURL);            // normalize to always have a trailing slash
        
        // check each link for an href match with our current page
        for (var i = 0; i < links.length; ++i)
        {
            var testLink = links[i].href;            // relative link will be turned into absolute link here
            testLink = AddTrailingSlash(testLink);    // normalize to always have a trailing slash
            if (testLink == pageURL)
            {
                YD.addClass(links[i], "navCurrentPage");
                YD.addClass(links[i].parentNode, "navCurrentPageParent");
            }
        }
    }
});