//Code to set up standardized links for Newest trip and Newest photos added
//Set consistent variables - format may differ if there are spaces in the keyword
   lastupdate='1 Aug 2009 (Blog link [thePhotoTourist.com])';
   newcontentdate='15 November 2009';
   tripsearch='egypt2008';
   tripkeyword='egypt2008';
   tripset='Touring Egypt, cruising the Nile, and diving Sharm, Sep-Oct 2008';
   NewPhotoSearch='09noreaster';
   NewPhotoKeyword='09noreaster';
   NewPhotoSet='Aftermath of the November 09 storm at Rehoboth Beach, Delaware, USA';
   NewestUWKey='bonaire08';     //use for newest scuba search
   NewestUWDate='July 2008';
   NewestNaturKey='bonaire08';     //use for newest nature search
   NewestNaturDate='July 2008';
   NewestPplKey='thoreau4th09';     //use for newest living search
   NewestPplDate='July 4th, 2009';
   NewestDestKey='09noreaster';  //use for newest sights search
   NewestDestDate='November 15th, 2009';
   NewestStudyKey='Balloons08';     //use for newest stills search

   StatiaNewYear='statiasaba0708';

//Function to return a formatted http address for a search
function SetSearch(term1,term2) {
   var search1='http\:\/\/www.rickcollier.com\/search\/index.mg\?searchWords\=';
   var search2='\&searchType\=InUser\&NickName\=RickCollier\&x\=0\&y\=0';
   var querystring=search1+term1+'\+'+term2+search2;
   return querystring;
}
//Function to return a formatted http address for a keyword page 
function SetKeyword(term1) {
   var search1='http\:\/\/www.rickcollier.com\/keyword\/'+term1;
   return search1;
   }
//Function to return a formatted http address for a page combining two keywords
function SetTwoKeyword(term1,term2) {
   var search1='http\:\/\/www.rickcollier.com\/keyword\/'+term1+'\-'+term2;
   return search1;
   }
//Function to return consistently formatted values for newest trips and photos
function Newest(type,in_val) {
   var output='';
   if (type=='trip') {   
      if (in_val=='describe') output=tripset;
      else if (in_val=='keywrd') output=SetKeyword(tripkeyword);
      else output=SetSearch(in_val,tripsearch);
      }
   else if (type=='scuba') output=SetTwoKeyword(type,NewestUWKey);
   else if (type=='naturcat') output=SetTwoKeyword(type,NewestNaturKey);
   else if (type=='destcat') output=SetTwoKeyword(type,NewestDestKey);
   else if (type=='pplcat') output=SetTwoKeyword(type,NewestPplKey);
   else if (type=='studycat') output=SetTwoKeyword(type,NewestStudyKey);
   else {
      if (in_val=='describe') output=NewPhotoSet;
      else if (in_val=='keywrd') output=SetKeyword(NewPhotoKeyword);
      else output=SetSearch(in_val,NewPhotoSearch);
      }
   return output;
}
//Function to redirect the current window to appropriate keyword or search address
function GotoNewest(type,param1) {
   window.location=Newest(type,param1);
}
//Function to go find something that isn't new
function GoGet(parm1,parm2) {
   window.location=SetTwoKeyword(parm1,parm2);
}

//Function to return date of latest web site update
function lastwebupdate() {
return lastupdate;
}

//Function to display the latest web site update
function WriteLastUpdate() {
document.write(lastupdate);
}

//Function to display the latest web content upload
function WriteNewContent() {
document.write(newcontentdate);
}

//Find a string in the http address
function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

//Pop-up warning when someone right-clicks on an image
rightClickWarning = "All photos are property of and copyright © RickCollier.com.  All rights reserved.  Unauthorized use is prohibited.  You may purchase a print or electronic download (without a copyright watermark) by clicking the link on this page to buy this photo.";

//Show captions on full-screen slideshows:
YE.onAvailable('captions', function() {if (YD.hasClass(document.body,
"fsSlideshow")) this.click();});

//Change Guestbook comments so it doesn't say "gallery..."
function ModifyText ()
{
  if (YD.hasClass(document.body, "gallery_4197871"))
  {
    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);

//Referral code in footer
function AddReferralCode()  {
  var links = this.getElementsByTagName("A");
  if (links && (links.length != 0)) {
    var smugLink = links.item(0);
    smugLink.href = "http://www.smugmug.com/?referrer=AzMehYNZbELWI";
  }
}
YE.onAvailable('footer', AddReferralCode);

//Page & Gallery redirect table and code
var galleryRedirectTable = 
 {
   //Sights sub-categories to galleries
     "Sights/566915" : "http://www.rickcollier.com/gallery/4252252_k6QRp", 
     "Sights/566916" : "http://www.rickcollier.com/gallery/4252922_44gJ3", 
     "Sights/566918" : "http://www.rickcollier.com/gallery/4595159_MZUB8", 
     "Sights/566917" : "http://www.rickcollier.com/gallery/4380514_3ZKUQ", 
     "Sights/781307" : "http://www.rickcollier.com/gallery/8155371_xYMGN", 
     "Sights/566919" : "http://www.rickcollier.com/gallery/4595118_L3we4",
   //Blog
     "blog" : "http://www.thePhotoTourist.com",
     "phototourist" : "http://www.thePhotoTourist.com",
     "thephototourist" : "http://www.thePhotoTourist.com",
     "phototourism" : "http://www.thePhotoTourist.com",
   //Site map
     "sitemap" : "http://www.rickcollier.com/gallery/5628452_C3Wjf",
     "site%20map" : "http://www.rickcollier.com/gallery/5628452_C3Wjf",
   //nature scenes to landscape scenes
     "gallery/4247417_ede4g" : "http://www.rickcollier.com/gallery/4199281", 
   //Trips to trip list
     "trips" : "http://www.rickcollier.com/gallery/4199307",
     "trip" : "http://www.rickcollier.com/gallery/4199307",
   //Places to place list
     "places" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "place" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "destination" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "destinations" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "location" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "locations" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
     "map" : "http://www.rickcollier.com/gallery/4561717_wUeUd",
   //landscape harbors to living to the sea
     "gallery/4252299_fzbuY" : "http://www.rickcollier.com/gallery/4247545", 
   //living underwater to underwater scuba divers
     "gallery/4252129_UX6CB" : "http://www.rickcollier.com/gallery/4247242", 
   //all underwater
     "gallery/5533682_xrkmx" : "http://www.rickcollier.com/keyword/scuba",
   //nature picks
     "gallery/4626158_3Y6cM" : "http://www.rickcollier.com/keyword/naturpick", 
   //living picks
     "gallery/4626175_goECS" : "http://www.rickcollier.com/keyword/pplpick", 
   //sights picks
     "gallery/4626205_FPqgX" : "http://www.rickcollier.com/keyword/destpick", 
   //pet rock picks
     "gallery/4625995_6FhBs" : "http://www.rickcollier.com/keyword/studypick", 
   //friends & family
     "family" : "http://www.rickcollier.com/gallery/4194712_6uXNq", 
     "friends" : "http://www.rickcollier.com/gallery/4194712_6uXNq", 
     "family&friends" : "http://www.rickcollier.com/gallery/4194712_6uXNq", 
     "familyandfriends" : "http://www.rickcollier.com/gallery/4194712_6uXNq", 
   //Egypt
     "scuba%20egypt" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "egypt%20scuba" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "diving%20egypt" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "egypt-scuba" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "egypt_scuba" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "egypt%20diving" : "http://www.rickcollier.com/keyword/egypt-scuba",
     "egypt" : "http://www.rickcollier.com/keyword/egypt",
     "egypt08" : "http://www.rickcollier.com/keyword/egypt2008",
     "egypt2008" : "http://www.rickcollier.com/keyword/egypt2008",
     "egypt%202008" : "http://www.rickcollier.com/keyword/egypt2008",
     "cairo2008" : "http://www.rickcollier.com/keyword/egypt2008-cairo",
     "cairo%202008" : "http://www.rickcollier.com/keyword/egypt2008-cairo",
     "nile%20cruise%202008" : "http://www.rickcollier.com/keyword/nilecruise08",
     "nilecruise2008" : "http://www.rickcollier.com/keyword/nilecruise08",
     "luxor2008" : "http://www.rickcollier.com/keyword/egypt2008-luxor",
     "luxor%202008" : "http://www.rickcollier.com/keyword/egypt2008-luxor",
     "egypt%20diving%202008" : "http://www.rickcollier.com/keyword/egypt2008-scuba",
     "egyptdiving2008" : "http://www.rickcollier.com/keyword/egypt2008-scuba",
     "diving%20sharm%202008" : "http://www.rickcollier.com/keyword/egypt2008-scuba",
     "sharm%20diving%202008" : "http://www.rickcollier.com/keyword/egypt2008-scuba",
     "sharmdiving2008" : "http://www.rickcollier.com/keyword/egypt2008-scuba",
     "divingsharm2008" : "http://www.rickcollier.com/keyword/egypt2008-scuba", 
   //Canary Cottage
     "canarycottage" : "http://www.rickcollier.com/keyword/canarycottage", 
     "canary%20cottage" : "http://www.rickcollier.com/keyword/canarycottage", 
   //fireworks (living and sights)
     "fireworks" : "http://www.rickcollier.com/keyword/fireworks",
     "gallery/4474423_sE3Hv" : "http://www.rickcollier.com/keyword/fireworks",
     "gallery/4474428_q6Rtu" : "http://www.rickcollier.com/keyword/fireworks", 
   //Balloons
     "balloon" : "http://www.rickcollier.com/keyword/balloon",
     "balloons08" : "http://www.rickcollier.com/keyword/balloons08",
     "balloons" : "http://www.rickcollier.com/keyword/balloon",
   //Lake Thoreau 4th
     "thoreau4th09" : "http://www.rickcollier.com/keyword/thoreau4th09",
     "thoreau4th2009" : "http://www.rickcollier.com/keyword/thoreau4th09",
     "july4th2009" : "http://www.rickcollier.com/keyword/thoreau4th09",
     "july4th09" : "http://www.rickcollier.com/keyword/thoreau4th09",
     "july409" : "http://www.rickcollier.com/keyword/thoreau4th09",
   //Lake Thoreau
     "lakethoreau" : "http://www.rickcollier.com/keyword/lake+thoreau",
     "thoreau" : "http://www.rickcollier.com/keyword/lake+thoreau",
   //Bonaire
     "bonaire" : "http://www.rickcollier.com/keyword/bonaire", 
     "bonaire08" : "http://www.rickcollier.com/keyword/bonaire08", 
     "bonaire2008" : "http://www.rickcollier.com/keyword/bonaire08", 
     "bonaire%202008" : "http://www.rickcollier.com/keyword/bonaire08", 
     "bonaire%20scuba" : "http://www.rickcollier.com/keyword/bonaire-scuba", 
     "bonaire-scuba" : "http://www.rickcollier.com/keyword/bonaire-scuba", 
     "bonaire_scuba" : "http://www.rickcollier.com/keyword/bonaire-scuba", 
     "scuba%20bonaire" : "http://www.rickcollier.com/keyword/bonaire-scuba", 
     "bonaire%20diving" : "http://www.rickcollier.com/keyword/bonaire-scuba", 
     "diving%20bonaire" : "http://www.rickcollier.com/keyword/bonaire-scuba" 
 };

function CheckRedirects()
 {
  if (! YD.hasClass(document.body, 'loggedIn'))
     {
         // get the path from the current URL, 
         // convert it to lowercase and remove the leading slash
         var path = window.location.pathname.substr(1); 

	 var newURL = galleryRedirectTable[path];
	 
	 if (newURL && (newURL != window.location))
	 {
	    window.location.replace(newURL);        // go to the new URL
         } else {
         var LCpath = path.toLowerCase();
         newURL = galleryRedirectTable[LCpath];
         if (newURL && (newURL != window.location))
            {
            window.location.replace(newURL);
            }
         }
     }
 }

// function to obscure mail address on links
function norobotmail() { document.location = "mailto:support@rickcollier.com"; }

// remove internal-use keywords from the list displayed for users
function removeKeywords() {
  if (! YD.hasClass(document.body, 'loggedIn')) {
    var aKeywords = ['uwcat','pick','scubacat','uwpick','scubapick','pplcat','pplpick','naturcat','naturpick','destcat','destpick','studycat','studypick'];

    var oBox = YD.get('keywordsBox');
    oKeywords = YD.getElementsByClassName('keyword', 'a', oBox);
    for (i=0; i<oKeywords.length; i++) {
      for (j=0; j<aKeywords.length; j++) {
        if (aKeywords[j] == oKeywords[i].innerHTML) {
          try {
            oKeywords[i].parentNode.removeChild(oKeywords[i].previousSibling);
          } catch(e){}
          try {
            oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
          } catch(e){}
          try {
            oKeywords[i].parentNode.removeChild(oKeywords[i].nextSibling);
          } catch(e){}
          try {
            oKeywords[i].parentNode.removeChild(oKeywords[i]);
          } catch(e){}
          break;
        }
      }
    }
  }
}

// Functions to detect needed version of flash player for slideshow
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
			// alert("flashVer="+flashVer);
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
// End Adobe flash detection kit Rev 1.6

// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------

// -- Function to remove galleries and photos counts from description fields
function RemovePhotoCount() {
    var elements = YAHOO.util.Dom.getElementsByClassName('description', 'p');
    var x;
    for (x in elements)
    {
        elements[x].innerHTML = elements[x].innerHTML.replace(/\d+ galleries with \d+ photos?.?/i, "");
    }
}

// Function to add text to Categories
function addCategoryDescription() {

  var UWt3xt="<div class=\"CatSelText\"><a href=\"http:\/\/www.rickcollier.com\/keyword\/scuba\" title=\"All 'Underwater' photos in one place\" class=\"CatSelLink\">All Underwater<\/a> ◊ <a href=javascript:GotoNewest('scuba','') title=\"New Images Uploaded "+NewestUWDate+".\" class=\"CatSelLink\">Newest Underwater<\/a> ◊ <a href=\"http:\/\/www.rickcollier.com\/keyword\/uwpick\" title=\"The photographer's favorites\" class=\"CatSelLink\">Rick's Picks<\/a><\/div><br>";

  var NaturT3xt="<div class=\"CatSelText\"><a href=\"http:\/\/www.rickcollier.com\/keyword\/naturcat\" title=\"All 'Nature' photos in one place\" class=\"CatSelLink\">All Nature<\/a> ◊ <a href=javascript:GotoNewest('naturcat','') title=\"New Images Uploaded "+NewestNaturDate+".\" class=\"CatSelLink\">Newest Nature<\/a> ◊ <a href=\"http:\/\/www.rickcollier.com\/keyword\/naturpick\" title=\"The photographer's favorites\" class=\"CatSelLink\">Rick's Picks<\/a><\/div><br>";

  var Liv1ngT3xt="<div class=\"CatSelText\"><a href=\"http:\/\/www.rickcollier.com\/keyword\/pplcat\" title=\"All 'Living' photos in one place\" class=\"CatSelLink\">All Living<\/a> ◊ <a href=javascript:GotoNewest('pplcat','') title=\"New Images Uploaded "+NewestPplDate+".\" class=\"CatSelLink\">Newest Living<\/a> ◊ <a href=\"http:\/\/www.rickcollier.com\/keyword\/pplpick\" title=\"The photographer's favorites\" class=\"CatSelLink\">Rick's Picks<\/a><\/div><br>";

  var S1ghtsT3xt="<div class=\"CatSelText\"><a href=\"http:\/\/www.rickcollier.com\/keyword\/destcat\" title=\"All 'Sights' photos in one place\" class=\"CatSelLink\">All Sights<\/a> ◊ <a href=javascript:GotoNewest('destcat','') title=\"New Images Uploaded "+NewestDestDate+".\" class=\"CatSelLink\">Newest Sights<\/a> ◊ <a href=\"http:\/\/www.rickcollier.com\/keyword\/destpick\" title=\"The photographer's favorites\" class=\"CatSelLink\">Rick's Picks<\/a><\/div><br>";

  var categoryDescription = {
    "Underwater" : UWt3xt,
    "Nature" : NaturT3xt,
    "Living" : Liv1ngT3xt,
    "Sights" : S1ghtsT3xt
  };

  if ((YD.hasClass(document.body, "category")) && (!YD.hasClass(document.body, "subcategory")))  {

    re = /category_(\S+)/i;
    re.exec(document.body.className);

    breadCrumb = YD.get("breadcrumb");
    if (breadCrumb && categoryDescription[RegExp.$1]) {
      divTag = document.createElement("div");
      divTag.className = "categoryDescription";
      divTag.innerHTML = categoryDescription[RegExp.$1];
      breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
    }
  }
}

YE.onContentReady('bodyWrapper', addCategoryDescription);

function FixBreadCrumb() 
{
  var objElement = document.getElementById("breadcrumb");
  if (objElement != null) 
  {
    var homeText = "RickCollier.com Home";
    var homeCrumb = " "+" "+" "+"<a href=\"http:\/\/www.rickcollier.com\/\" class=\"smSneakUL\">"+homeText+"<\/a>";
    var sightsCrumb = homeCrumb+" > <a href=\"http:\/\/www.rickcollier.com\/Sights\" class=\"smSneakUL\">Sights<\/a>";

    var bCrumbRedirectTable = {
      "gallery/4252922_44gJ3" : sightsCrumb+" > <b>The Medieval and Crusades<\/b>",
      "gallery/4252252_k6QRp" : sightsCrumb+" > <b>The Holy Land<\/b>",
      "gallery/4595159_MZUB8" : sightsCrumb+" > <b>Native America<\/b>",
      "gallery/4380514_3ZKUQ" : sightsCrumb+" > <b>The Ancient World<\/b>",
      "gallery/4595118_L3we4" : sightsCrumb+" > <b>Natural Wonders<\/b>",
      "gallery/8155371_xYMGN" : sightsCrumb+" > <b>Colonial Times<\/b>",
      "gallery/5628452_C3Wjf" : homeCrumb+" > <b>Site Map<\/b>"
    };

    var path = window.location.pathname.substr(1);
    var str = new String(objElement.innerHTML);
    var newBreadCrumb = bCrumbRedirectTable[path];

    if (newBreadCrumb) 
    {
      str = newBreadCrumb;
    } else {
      str = str.replace(">RickCollier<", ">"+homeText+"<");
    }
    objElement.innerHTML = str;
  }
}
