rightClickWarning = "rcp in ec"; // footer javascript


function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
  YD.addClass(document.body, "galleries");

if (hasPath("featured"))
  YD.addClass(document.body, "featured");

if (hasPath("bio"))
  YD.addClass(document.body, "bio");

if (hasPath("links"))
  YD.addClass(document.body, "links");

if (hasPath("find"))
  YD.addClass(document.body, "find");

if (hasPath("popularpics"))
  YD.addClass(document.body, "popularpics");

if (hasPath("all"))
  YD.addClass(document.body, "all");





if (YD.hasClass(document.body,"gallery_5356883|gallery_3937472") && YD.hasClass(document.body,"galleryPage"))
{ 
showPhotoBar = false;
}



delCategory();



if (YD.hasClass(document.body,"gallery_3020273") && YD.hasClass(document.body,"galleryPage"))
{ 
helpMenuToggle('Viewing0');
}




YE.onAvailable('bioTitle', function() {this.innerHTML = 'About'});


function noLinky()

{

if (window.AlbumID && (window.AlbumID == "2399134" || window.AlbumID == "1931916" || window.AlbumID == "2017099"))

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;

        divElm = divElm.parentNode;

        if (!divElm)

            continue;

        if (divElm.className.indexOf("photo")<0)

            continue;

        link.href = "javascript:void(0);";

    }

}

noLinky();


function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=4CzYbaQTTB64Z";
}
}
YE.onAvailable('footer', AddReferralCode);







YE.onContentReady('galleryCommentLink', function() {this.innerHTML = this.innerHTML.replace('Link', 'Email Address')});













YE.onContentReady('categoryTitle', function() {this.innerHTML = this.innerHTML.replace('Gallery', '')});






function checkPasswordPage()
{
   if ( YD.getElementsByClassName('galleryPassword', 'div')[0] ) {
      YD.addClass(document.body,"galleryPasswordPage"); 
   }
}










// print image

function makepage(src)
{
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.

  return "\n" +
    "<head>\n" +
    "<title>LM Sports Pix</title>\n" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    "<img src='" + src + "'/>\n" +
    "\n" +
    "\n";
}

function printme(evt)
{
  if (!evt) {
    // Old IE
    evt = window.event;
  }    
  var image = evt.target;
  if (!image) {
    // Old IE
    image = window.event.srcElement;
  }
  src = image.src;
  link = "about:blank";
  var pw = window.open(link, "_new");
  pw.document.open();
  pw.document.write(makepage(src));
  pw.document.close();
}


/* Update map coordinates and zoom level */

function UpdateMap()
   {
   map.setCenter(new GLatLng(33.875542, -117.567561), 5);
   }
/* If this is the find page, add a listener for the map's load event */


if (hasPath("map")) {
 YD.addClass(document.body, "map");
 loadSmugMaps();
} 






if (YD.hasClass(document.body,"gallery_3958476") && YD.hasClass(document.body,"isMovie"))
{ 
showPhotoBar = false;
}






addEvent(window, "load", enableSlideshowOptions);

function enableSlideshowOptions()
{
  if (YD.hasClass(document.body, "fsSlideshow"))
  {
    document.getElementById("captions").blur();
    document.getElementById("fades").blur();
  }
}






// This is a script to combine the categories with the gallery listing to have just one continuous listing of thumbs
YE.onContentReady("subcategoriesBox", CombineCategoriesWithGalleries);

function IsArrayEmpty(testVal)
{
    return(!testVal || (testVal.length == 0));
}

function CombineCategoriesWithGalleries()
{
    // get miniBoxes in the subcategoriesBox object
    var miniBoxes = YD.getElementsByClassName("miniBox", "div", this);
    // get target galleriesBox object
    var galleriesObj = document.getElementById("galleriesBox");
    var galleryMiniBoxes = new Array;

    // now find the right miniBox in the galleriesBox in order to insert the sub-categories
    if (galleriesObj)
    {
        galleryMiniBoxes = YD.getElementsByClassName("miniBox", "div", galleriesObj);
    }
    
    // if we don't have everything we need, then return without doing anything
    if (!galleriesObj || IsArrayEmpty(miniBoxes) || IsArrayEmpty(galleryMiniBoxes) || (window.location.hash == "#stop"))
    {
        this.style.display = "block";        
        return;
    }
    
    // move all the sub-categories over to the gallery listing
    for (var i in miniBoxes)
    {
        miniBoxes[i].parentNode.removeChild(miniBoxes[i]);
        galleryMiniBoxes[0].parentNode.insertBefore(miniBoxes[i], galleryMiniBoxes[0]);
    }
}







function RemoveGalleryWord()
{
    this.innerHTML = this.innerHTML.replace(/ Galleries$|Sub-Categories$/, "");
}

YE.onAvailable("subCatGalleryTitle", RemoveGalleryWord);
YE.onAvailable("galleryTitle", RemoveGalleryWord);






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)});










