// awg Remove top "Home" from breadCrumbTrail string. see thr 116099 #13
// awg 7/29/09 Commented out this script to allow Home "Al & Bobbie" to appear
//YE.onContentReady("breadCrumbTrail", RemoveTopOfBreadCrumb);

//function RemoveTopOfBreadCrumb() 
//{
//    var str = this.innerHTML;
//    str = str.replace(/\n/g, " ");    // get rid of linebreaks which cause problems //for regular expressions in javascript
//    this.innerHTML = str.replace(/^\s*<a .*?a>.*?</i, "<");
//}

// awg 5/5/08 add galleries page - see http://dgrin.smugmug.com/gallery/2160039
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
  YD.addClass(document.body, "galleries");

// awg 3/24/09 add Find page
if (hasPath("find"))
  YD.addClass(document.body, "find");


// awg 5/7/08 add to change galleries page main title to Galleries per RichW
if (YD.hasClass(document.body,"galleries"))
var objElement = document.getElementById("breadcrumb")
if (objElement != null) {
var str = new String(objElement.innerHTML);
str = str.replace('>Home<', '>Galleries<');
objElement.innerHTML = str;
}

// awg 9/8/08 added text to COMMENT
//YE.onContentReady('comment_header', function() {this.innerHTML = //this.innerHTML.replace('Comments', 'Comments (your name is appreciated)')});

// awg 10/1/08 added to reduce email spam on About US page
function norobotmail(aUser, aDomain) {
document.location = "mailto:" + aUser + "@" + aDomain;
}

// awg 12/7/08 swap position of all Cat page boxes see dgrin thr 67241. 
function swapBoxes() {
 //if (!YD.hasClass(document.body, 'category_Travel'))
 //   return;
   box1 = YD.get("subcategoriesBox");
   box2 = YD.get("galleriesBox");
   if (box1 && box2)
   {
      swap = box1.innerHTML;
      box1.innerHTML = box2.innerHTML;
      box2.innerHTML = swap;
   }
}

//awg 01-17-09 remove hover popup
function delHover() {
    oLst = YD.getElementsBy(function(el) {return (YD.hasClass(el,'imgBorder') || YD.hasClass(el,'imgBorderOn'))},'img');
    for (i=0; i < oLst.length ; i++) {
        if (oLst[i].title && oLst[i].title != '') oLst[i].title = '';
        if (oLst[i].alt && oLst[i].alt != '') oLst[i].alt = '';
    }
}
YE.onContentReady('bodyWrapper', function() {if (!YD.hasClass(document.body, 'smugmug_ajax')) delHover()});
onPhotoShow.subscribe(function(){YE.onAvailable('mainImage', delHover)});