function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

//===FACEBOOK BUTTON====
var pos = window.document.URL.indexOf("gallery");

if (pos > 0 && SM) {
        var thisURL = window.document.URL ;
    SM.buttons.FacebookButton = new YAHOO.widget.Button({
        id: 'Share on Facebook',
        label: 'Share on Facebook',
        container: 'altViews',
        type: 'link',
        href: 'http://www.facebook.com/share.php?u='+thisURL+'&t=Mark+Thirlwall+Photography+-+Photo+Gallery',
        target: '_blank',
        className: 'sm-button sm-button-small shareButton glyphButton menuButton share_button'
    });

}