function AddReferralCode() {
var links = this.getElementsByTagName("A");
if (links && (links.length != 0)) {
var smugLink = links.item(0);
smugLink.href = "http://www.smugmug.com/?referrer=E4aRnttSouW6A";
}
}
YE.onAvailable('footer', AddReferralCode);






rightClickWarning = "All photos are property of Beachglass Photography. All rights reserved. Unauthorized use is prohibited.";











function redirectPath() { 
  re = /((www.)?beachglassphotography.smugmug.com)/; 
  tmp = window.location.href; 
  if (re.test(tmp)) { 
    tmp = tmp.replace(re, 'www.beachglassphotography.com'); 
    window.location.href = tmp; 
  } 
}
redirectPath(); 











function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}










function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_2531679"))
  {
    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);

YE.onAvailable('popularTitle', function() {this.innerHTML = 'Featured Photos'});






//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





var vanityTable = 
 {
     sharegroups : "http://www.beachglassphotography.com/gallery/2559347",
     clients : "http://www.beachglassphotography.com/gallery/4834277_Tc5Th",
     buyphotos : "http://www.beachglassphotography.com/gallery/2532024",
     videos : "http://www.beachglassphotography.com/share/rNzdv9ltphPrc",
     contact : "http://www.beachglassphotography.com/gallery/2531679",
     familyphotos : "http://www.beachglassphotography.com/share/rNlDl28FPF9UI",
     livemusic : "http://www.beachglassphotography.com/share/c8WQby12AmI0E",
     prom: "http://www.beachglassphotography.com/gallery/4879795_n2sge#290967254_gueMP",
     kristenandthenoise: "http://www.beachglassphotography.com/share/f8W7TAzYnoY4Y",
     bartekikarolina: "http://www.beachglassphotography.com/gallery/5082149_fkPu9/1/306110949_4NxJZ",
     findme: "http://www.beachglassphotography.com/gallery/4554009_idRz9",
     musicvideos:  "http://www.beachglassphotography.com/gallery/5195536_hpyhK",
     guestlogin:   "http://www.beachglassphotography.com/gallery/2520977_CzpQf",
     private:   "http://www.beachglassphotography.com/gallery/2559347"     


 };


  function CheckRedirects()
 {
     if (YD.hasClass(document.body, 'homepage'))    // only run this code on the home page
     {
         // get the path from the current URL, 
         // convert it to lowercase and remove the leading slash
         var path = window.location.pathname.toLowerCase().substr(1);
         
         var newURL = vanityTable[path];        // look it up in our table
         
         // if we found it in the table && newURL is different than where we are
         if (newURL && (newURL != window.location))
         {
             window.location.replace(newURL);        // go to the new URL
         }
     }
 }




function createSWF( w, h, params) {
  var args = "";
  for (var i in params) {
    args += i + "=" + params[i] + "&amp;";
  }
document.writeln('<object width="100%" height="100%" align="middle">'+ '<param name="movie" value="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'"/>'+ '<param name="wmode" value="transparent" />'+ '<embed src="http://www.smugmug.com/ria/ShizamSlides-2007091201.swf?'+args+'" wmode="transparent" width="' + w + '" height="' + h + '" type="application/x-shockwave-flash" allowScriptAccess="always" allowNetworking="all"/></object>');
return 1;
} 


      <!-- Hide Categories -->
function delCategory() {
  re = /\/(Unseen)$/;

  var oList = YD.getElementsByClassName('miniBox', 'div', this);

  for (i = 0; i < oList.length; i++) {
    if (re.test(oList[i].getElementsByTagName('a')[0].href))
      oList[i].parentNode.removeChild(oList[i]);
  }
}
YE.onContentReady('categoriesBox', delCategory);
     <!-- End Hide Categories -->





