document.title = "Danny Seidman Photography";
function RelevantTitle()
{
  var baseTitle = "Danny Seidman Photography - Specializing in Pacific Northwest Landscapes";
  var separator = " - ";
  var albumTitle = document.getElementById("albumTitle");
  var galleryTitle = document.getElementById("galleryTitle");
  if( albumTitle && albumTitle.textContent )
     document.title = baseTitle + separator + albumTitle.textContent;
  else if( galleryTitle && galleryTitle.textContent )
  {
     var galleryTitleText = galleryTitle.textContent;
     // Strip " sub-categories" off the end of the category text
     var finalPositionCategory = galleryTitleText.search(" sub-categories");
     if( finalPositionCategory >= 0 )
        galleryTitleText = galleryTitleText.substr( 0, finalPositionCategory );
     else
     {
        // Strip " galleries" off the end of the category/sub-category text
        var finalPositionSubCategory = galleryTitleText.search(" galleries");
        if( finalPositionSubCategory >= 0 )
           galleryTitleText = galleryTitleText.substr( 0, finalPositionSubCategory );
     }
     document.title = baseTitle + separator + galleryTitleText;
  }
  else // Not Gallery, Category, or Subcategory
  {
     // Set title on homepage
     document.title = baseTitle;
  }
}








// fix the pesky pipes

addEvent(window, "load", rem_pipes);

function rem_pipes () {
     var objElement = document.getElementById("footer")
     if (objElement != null)
     {
        var str_a = new String(objElement.innerHTML);
        str_a = str_a.replace(/\|/g, '')
        objElement.innerHTML = str_a;
     }

     var objElement = document.getElementById("allFeeds")
     if (objElement != null)
     {
        var str_b = new String(objElement.innerHTML);
        str_b = str_b.replace(/\|/g, '')
        objElement.innerHTML = str_b;
     }
     var objElement = document.getElementById("feedHelp")
     if (objElement != null)
     {
        var str_b = new String(objElement.innerHTML);
        str_b = str_b.replace(/\|/g, '')
        objElement.innerHTML = str_b;
     }
}




function ModifyText ()
{
 if (YD.hasClass(document.body, "gallery_7416886"))
 {
   var objElement = YD.get("comment")
   if (objElement != null)
   {
     var str = new String(objElement.innerHTML);
     str = str.replace(/\gallery/gi, 'Guestbook');
     objElement.innerHTML = str;
   }
 }
}

YE.onAvailable("comment", ModifyText);







function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");



YE.onContentReady("image_uHhGu", function () {this.parentNode.href = "javascript:void(0);";});










function addRecentFeatured(text, days, thumbUrl) {
 if (YD.hasClass(document.body, "homepage")) {
   divTags = YD.getElementsByClassName("boxBottom", "div", YD.get("featuredBox"));

   for (i=0; i<divTags.length; i++) {
     miniBox = document.createElement("div");
     miniBox.className = "miniBox";

     photoBox = document.createElement("div");
     photoBox.className = "photo";
     miniBox.appendChild(photoBox);

     photoLink = document.createElement("a");
     photoLink.setAttribute("href", "javascript:showRecent(" + days + ");");
     photoBox.appendChild(photoLink);

     photoImg = document.createElement("img");
     photoImg.setAttribute("border", "0");
     photoImg.setAttribute("alt", text);
     photoImg.setAttribute("title", text);
     photoImg.src = thumbUrl;
     photoImg.className = "imgBorder";
     photoLink.appendChild(photoImg);

     albumTitle = document.createElement("p");
     albumTitle.className = "albumTitle";
     miniBox.appendChild(albumTitle);
     albumLink = document.createElement("a");
     albumLink.className = "nav";
     albumLink.setAttribute("href", "javascript:showRecent(" + days + ");");
     albumTitle.appendChild(albumLink);

     albumLinkText = document.createTextNode(text);
     albumLink.appendChild(albumLinkText);
     spacerDiv = document.createElement("div");
     spacerDiv.className = "spacer";
     miniBox.appendChild(spacerDiv);

     divTags[i].insertBefore(miniBox, divTags[i].childNodes[1]);

     break;
   }
 }
}

//Goto Recent Gallery
 function showRecent(days)
{
  endDate = new Date();
  oneDay = 1000*60*60*24;
  startDate = new Date(endDate.getTime() - (parseInt(days) * oneDay));
  sUrl = "/date/";
  sUrl += startDate.getFullYear() + "-" + padDate(startDate.getMonth() + 1) + "-" + padDate(startDate.getDate());
  sUrl += "/";
  sUrl += endDate.getFullYear() + "-" + padDate(endDate.getMonth() + 1) + "-" + padDate(endDate.getDate());
   window.location = sUrl;
}

function padDate(datePart)
{
  if (datePart.toString().length != 1)
    return datePart
  return "0" + datePart;
}
//Goto Recent Gallery




function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
 var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
 if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
 for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
 if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
 if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
