function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

if (hasPath("gallery/8957545_TURid"))
YD.addClass(document.body, "contact");

// Move filmstrip thumbs below the main image
YE.onDOMReady(PutFilmstripBelow);

function PutFilmstripBelow()
{
    if (YD.hasClass(document.body, "filmstrip"))
    {
        var moveWrapper = document.getElementById("moveWrapper");
        var photos = document.getElementById("photos");
        if (moveWrapper && photos)
        {
            var photosObj = photos.parentNode.removeChild(photos);
            moveWrapper.parentNode.insertBefore(photosObj, moveWrapper);
            photos.style.display = "block";
        }    
    }
}
//-------------------------------------------------------------
// Clear links and thus clickability from photos in journal galleries
//-------------------------------------------------------------

YE.onDOMReady(ClearLinksFromMany);

function ClearLinksFromMany()
{
    var listOfGalleries = [
        "8957545",            /* About Us */
        "10264138",            /* Contact Us */
    ];
    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++)
		{
			try 
			{
				// 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");
			} catch (e) {}
		}
	}
}