// 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('galleryTitle', function() {this.innerHTML = this.innerHTML.replace('Galleries', '')});






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();
  }
}






