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: "false",
		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(localGallerySlideshowConfigOverride) == "object")
	{
		SM.flash.Slideshow.prototype.gallerySlideshowOverrides = localGallerySlideshowConfigOverride;
	}
	if (typeof(localFullScreenSlideshowConfigOverride) == "object")
	{
		SM.flash.Slideshow.prototype.fullScreenSlideshowOverrides = localFullScreenSlideshowConfigOverride;
	}
}

// SM.flash.Slideshow is only defined in a galleries page
if (typeof(SM.flash.Slideshow) == "function")
{
	var oldEmbedSWF = SM.flash.Slideshow.superclass._embedSWF;
	SM.flash.Slideshow.superclass._embedSWF = MyEmbedSWF;
	SetSlideshowOverrides();
}

// ---------------------------------------------
// end of slideshow customization
// ---------------------------------------------


//********===Remove Footer Pipes====

YE.onAvailable("cobrand_footer", function() {this.innerHTML = this.innerHTML.replace(/\||what are feeds\?/gi, '');});


//-------**************start of StyleSheetSwitch Code
// add your own reliable webspace where you'll have to put lang1_file and lang2_file
// don't add a '/' at the end of the server address - this is done later!!
//var _g_myServer = "http://www.masterclass-ag.ro";
//var lang1 = "english";
//var lang1_file = "eng.css";
//var lang2 = "romana";
//var lang2_file = "ro.css";
 
//function readCookieStyle(name) {
//var nameEQ = name + "=";
//var ca = document.cookie.split(';');
//for(var i=0;i < ca.length;i++) {
//var c = ca[i];
//while (c.charAt(0)==' ') c = c.substring(1,c.length);
//if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
//}
//return null;
//}
 
//function createCookieStyle(name,value,days) {
//if (days) {
//var date = new Date();
//date.setTime(date.getTime()+(days*24*60*60*1000));
//var expires = "; expires="+date.toGMTString();
//}
//else expires = "";
//document.cookie = name+"="+value+expires+"; path=/";
//}
 
//function setSheet(lang) {
//createCookieStyle("style", lang, 365);
//location.reload();
//}
 
//function includeBrowserCSS()
//{
//document.writeln("<style type=\"text/css\">");
//var lang;
//var lang_file;
//var cookie = readCookieStyle("style");
//if (cookie == "english") {
//lang = "english";
//lang_file = "eng.css";
//}
//if (cookie == "romana") {
//lang = "romana";
//lang_file = "ro.css";
//}
// when no cookie is found, use english as standard language
//if (cookie != "english" && cookie != "romana") {
//lang = "english";
//lang_file = "eng.css";
//}
//document.writeln("@import url("+_g_myServer+"/"+lang_file+");");
//document.writeln("</style>");
//createCookieStyle("style", lang, 365);
//}
//------ end of StyleSheetSwitch Code