rightClickWarning = "All photos are copyrighted by Dorin Bofan. All rights reserved. Unauthorized use is prohibited."; // ********hide text bubble when mouse over images
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)});

// ********Disable preview thumbnail
showImagePreview = false;

document.title = "Dorin Bofan - Nature and Travel Photography";
function RelevantTitle()
{
   var baseTitle = "Dorin Bofan - Nature and Travel Photography";
   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;
   }
}

function ModUserName()
{
this.innerHTML = "Dorin Bofan Nature and Travel Photography";
}

YE.onContentReady("userName", ModUserName);

// ********script to replace a user's name in the breadcrumb with "Home"
YE.onContentReady("breadCrumbTrail", ReplaceTopOfBreadcrumbWithHome);

function ReplaceTopOfBreadcrumbWithHome()
{
    var str = this.innerHTML.replace(/\n/g, " ");
    this.innerHTML = str.replace(/\>[^\<]+<\/a>/i, ">Home</a>");
}

// ********change default comment to gallery
YE.onAvailable("commentType", function() {this.selectedIndex = 2;});

// ********force original size
//resizeMedium();

//function resizeMedium() {
//var url = window.location.href;

//if (url.indexOf("/Medium"=0)) {
//window.location.replace(url.substr(0, url.lastIndexOf("/")))
//}
//}

// ********replace "gallery comments" with "Guestbook comments"
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_9300536"))
  {
    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);


// **********---------------------------------------------
// Slideshow parameter modification
// ---------------------------------------------
function MyEmbedSWF(swfURL, containerID, swfID, version, backgroundColor, expressInstall)
{
	// catch all exceptions here so, if there's an error, we just continue on as if we weren't here
	try {
		var overrides = null;
		if (this._type == "gallery")
		{
			overrides = this.gallerySlideshowOverrides;
		}
		else if (this._type == "fullScreen")
		{
			overrides = this.fullScreenSlideshowOverrides;
		}
		if (overrides)
		{
			// copy all overrides over into the objects flashVars
			for (var i in overrides)
			{
				this._flashVars[i] = overrides[i];
			}
		}
	} catch (e) {}
	oldEmbedSWF.apply(this, arguments);		// call the regular handler for this method
}


function SetSlideshowOverrides()
{
	var globalGallerySlideshowConfigOverride = {
		showButtons: "false",
		showSpeed: "false",
		showThumbs: "false",
		captions: "false",
		transparent: "true"		// no comma after the last entry in this table or IE7 will barf
	};

	var globalFullScreenSlideshowConfigOverride = {
		showButtons: "true",
		showSpeed: "false",
                showThumbs: "false",
		captions: "false"              // no comma after the last entry in this table or IE7 will barf
	};
	
	SM.flash.Slideshow.prototype.gallerySlideshowOverrides = globalGallerySlideshowConfigOverride;
	SM.flash.Slideshow.prototype.fullScreenSlideshowOverrides = globalFullScreenSlideshowConfigOverride;
	
	// now check to see if anything was defined just for this gallery and use it instead
	if (typeof(localGa