var vanityTable = 
 {
     latest: "http://www.lalandscapes.com/Recentadditions/brentwoodoctober-4-2009/9854482_fryAU",
     if: "http://www.lalandscapes.com/share/XOyLCEU5c9NNQ",
     fargo2008: "http://www.lalandscapes.com/gallery/4537606_3aFqX#267258031",
     newpics: "http://www.lalandscapes.com/share/TMxIO2iRYCnRE",
     lariver: "http://www.lalandscapes.com/gallery/5022035_oLXUu#P-1-18",
     indyfab: "http://www.lalandscapes.com/gallery/5099986_EWZKb",
     downtown_sanpedro: "http://www.lalandscapes.com/gallery/5243182_pyAFx",
     july4: "http://www.lalandscapes.com/gallery/5342019_Rf6nY",
     montgomery: "http://www.lalandscapes.com/gallery/8891090_8kay4",
     hollywood_downtown: "http://www.lalandscapes.com/gallery/5506197_Fvn6L",
     brentwood: "http://www.lalandscapes.com/gallery/5564199_v9HWE",
     heritagevalley: "http://www.lalandscapes.com/gallery/5615569_pwKN7",
     smmountains: "http://www.lalandscapes.com/gallery/5692832_Qof8Q",
     striking: "http://www.lalandscapes.com/gallery/5710517_tQjia",
     lightning: "http://www.lalandscapes.com/gallery/5710517_tQjia",
     downtown: "http://www.lalandscapes.com/gallery/8168957_nZfLb",
     downloads: "http://downloads.lalandscapes.com",
     chicago2008: "http://www.lalandscapes.com/gallery/5864543_p34vT",
     topanga: "http://www.lalandscapes.com/gallery/6007329_uJcfy",
     lospadres: "http://www.lalandscapes.com/gallery/6320489_z84tT",
     hwy33: "http://www.lalandscapes.com/gallery/6385187_n8qSy",
     storm: "http://www.lalandscapes.com/gallery/6434377_xA2yP",
     soda_lake: "http://www.lalandscapes.com/gallery/6522272_TpMnz",
     hawaii: "http://www.lalandscapes.com/gallery/6870109_3Jqz3",
     fargo2009: "http://www.lalandscapes.com/gallery/7660569_MxVsk",
     createfixate: "http://www.lalandscapes.com/gallery/7693194_zAAWm",
     houses: "http://www.lalandscapes.com/Velocipedia/houses20091004/9861760_26kGN",
     chicago2009: "http://www.lalandscapes.com/Unlisted/chicago-2009/9574658_DboFS",
     bennie: "http://www.lalandscapes.com/Unlisted/Bennies-1st-Birthday/9691843_FLKdS",
     house: "http://www.lalandscapes.com/gallery/10079889_MY4h9",
     baby: "http://www.lalandscapes.com/Unlisted/1232009-1040-PM/10539316_dFmA5",
     jackson: "http://www.lalandscapes.com/Unlisted/jackson/10606010_kJAUS",
     carts: "http://www.lalandscapes.com/La-landscapes/shopping-carts/11455083_9BTLr",
     washington: "http://www.lalandscapes.com/Recentadditions/Wasington-DCOctober-2009/9947446_tjEqJ",
     smpier: "http://www.lalandscapes.com/gallery/5079928_Ma7Cm#305948394_mWDN2"
 };
 
 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 IsHomePage()
 {
    return(YD.hasClass(document.body, 'homepage'));
 }


// On IE/FF set the title before the Document OnLoad takes place
document.title = "l.a. landscapes :: photography by josh harris";
addEvent( window, "load", CustomizeTitle );
function CustomizeTitle()
{
    var baseTitle = "l.a. landscapes :: photography by josh harris";
    var separator = " -- ";
    var albumTitle = GetText( document.getElementById("albumTitle") );
    var galleryTitle = GetText( document.getElementById("galleryTitle") );
    var subCatTitle = GetText ( document.getElementById("subCatGalleryTitle") );
    var singleImage = document.body.className && document.body.className.indexOf("singleImage") > -1 ? true : false;
    var pageTypeDefined = typeof( pageType ) != "undefined";
    var pageTypeDetailsDefined = typeof( pageTypeDetails ) != "undefined";
// Don't change the title from the above document.title on the homepage
    if( document.body.className && document.body.className.indexOf("homepage") > -1 )
    {
        document.title = baseTitle;
        return;
    }
 
// An album page (holds a bunch of photos, could be "zoomed in" on a specific photo)
    if( albumTitle )
    {
        var photoTitle = GetPhotoTitle();
        if( photoTitle )
            document.title = baseTitle + separator + albumTitle + separator + photoTitle;
        else
            document.title = baseTitle + separator + albumTitle;
        return;
    }
// A gallery page (holds a bunch of albums and/or a bunch of sub categories)
    if( galleryTitle )
    {
// Strip " sub-categories" off the end of the category text
        var finalPositionCategory = galleryTitle.indexOf(" sub-categories");
        if( finalPositionCategory > -1 )
            galleryTitle = galleryTitle.substr( 0, finalPositionCategory );
        else
            {
// Strip " galleries" off the end of the category/sub-category text
              var finalPositionSubCategory = galleryTitle.indexOf(" galleries");
              if( finalPositionSubCategory > -1 )
          galleryTitle = galleryTitle.substr( 0, finalPositionSubCategory );
             }
 
            document.title = baseTitle + separator + galleryTitle;
    return;
    }
// Pick up sub-category
    if( subCatTitle )
    {
// Strip " sub-categories" off the end of the category text
        var finalPositionCategory = subCatTitle.indexOf(" sub-categories");
        if( finalPositionCategory > -1 )
            galleryTitle = subCatTitle.substr( 0, finalPositionCategory );
        else
            {
// Strip " galleries" off the end of the category/sub-category text
              var finalPositionSubCategory = subCatTitle.indexOf(" galleries");
              if( finalPositionSubCategory > -1 )
          galleryTitle = subCatTitle.substr( 0, finalPositionSubCategory );
             }
 
            document.title = baseTitle + separator + galleryTitle;
    return;
    }
 
// A single image (like the kind you get when you click an image in a keyword page)
    if( singleImage )
        {
 var photoTitle = GetPhotoTitle();
 if( photoTitle )
            document.title = baseTitle + separator + photoTitle;
 else
     document.title = baseTitle + separator + "untitled photo";
 return;
 }
// A single keyword page
    if( pageTypeDefined && pageType == 'Keyword' && pageTypeDetailsDefined )
 {
// Keyword page
             document.title = baseTitle + separator + "Keyword: " + pageTypeDetails;
     return;
 }
// A multiple keyword page
    if( pageTypeDefined && pageType == 'Keywords' && pageTypeDetailsDefined )
 {
// Multiple keywords page
// Put " + " between each keyword instead of -
             var keywordList = pageTypeDetails;
     keywordList = keywordList.replace(/\-/g, " + ");
     document.title = baseTitle + separator + "Keywords: " + keywordList;
     return;
 }
// The main keywords page. Note: single image takes precedence over this type
    if( document.body.className && document.body.className.indexOf("keywordPage") > -1 )
        {
// Main Keywords Page
            document.title = baseTitle + separator + "Keywords";
            return;
 }
// None of the rules above set the title! Oh well, fall back on the base title.
    document.title = baseTitle;
} // CustomizeTitle
function Trim( text )
{
    text = text.replace(/(^\s+)|(\s+$)/g, ""); // trim leading and trailing white space
    return text;
} // Trim
function GetText( node )
{
    if( !node )
        return "";
    if( node.innerText )
        return Trim( node.innerText ); // For IE
    if( node.textContent )
        return Trim( node.textContent ); // For others
    return "";
} // GetText
function GetPhotoTitle()
{
// If the photo title is set, it starts with the breadcrumb.
    var breadCrumbStart = "photography by josh harris > ";
    var mainPhoto = document.getElementById("mainPhoto");
    if( !mainPhoto || !mainPhoto.title || mainPhoto.title.indexOf( breadCrumbStart ) != 0 )
 return "";
    return Trim( mainPhoto.title.substr( breadCrumbStart.length ) );
} // GetPhotoTitle

function norobotmail(aUser, aDomain) { document.location = "mailto:" + aUser + "@" + aDomain; }

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;
}

YE.onAvailable('galleryTitle', function() {this.innerHTML = 'galleries'});

YE.onAvailable('categoryTitle', function() {this.innerHTML = 'galleries'});

rightClickWarning = "Joshua T. Harris copyrights all photos, images, and content appearing on the L.A. Landscapes photography web sites http://www.lalandscapes.com and http://lalandscapes.smugmug.com. The site is intended for viewing only. All photographs on this page, and galleries associated with this page, are copyrighted and may not be used in any way including downloading, reproducing and forwarding. No commercial or reproduction rights are granted for any of the images or design without the written permission of Joshua T. Harris and is prohibited under United States and International copyright laws. Copyright (c) 2008 Joshua T. Harris. All rights reserved.";