rightClickWarning = "All images (c) B. D. Colen/ADIOL and may not be reproduced without permission using any technology now extant or developed in the future."


function hasPath(sPath)
{
re = new RegExp("\/" + sPath + "(\/|$)");
return re.test(window.location)
}

if (hasPath("galleries"))
YD.addClass(document.body, "galleries");

function addCategoryTitleToBreadcrumb(description) 
{
    var breadCrumb = YD.get("breadcrumb");
    if (breadCrumb)
    {
        var divTag = document.createElement("div");
        divTag.className = "categoryDescription";
        divTag.innerHTML = description;
        breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
    }
}

function addCategoryTitleToThumbs(descriptionObject, boxObjectName) 
{
    var re = /\>([^\<]+)<\/a>/i;    // pattern to find the category name between the <a> and </a> tags
    var divTag = YD.get(boxObjectName);
    if (divTag) 
    {
        var divTags = YD.getElementsByClassName("albumTitle", "p", divTag);
        for (var i = 0; i < divTags.length; i++) 
        {
            var matches = re.exec(divTags[i].innerHTML);    // get just the category name
            // if we found a category name and the category name exists in our categoryDescription object, then add the description
            if (matches && (matches.length > 1) && descriptionObject[matches[1]] != undefined) 
            {
                var pTag = document.createElement("p");
                pTag.className = "categoryDescription";
                pTag.innerHTML = descriptionObject[matches[1]];
                divTags[i].parentNode.insertBefore(pTag, divTags[i].nextSibling);
            }
        }
    }
}

/* Category descriptions */
function addCategoryDescription() 
{
    var categoryDescription = {
        // list "categoryname" : "category title",
        // or "categoryname.subcategoryname" : "subcategory title",
        // Examples:
        // "Kenya"  : "Our vacation to Kenya",
        // "Kenya.Highlights" : "The highlights galleries from our vacation to Kenya",
        "Weddings"  : "I do not do 'documentary style' photography of weddings; I do documentary photography of weddings. I approach each wedding as A Day In Our Life, as a fly-on-the-wall with a photographer’s eye and a documentarian’s head. I will capture all the special moments, all the details, all the nuances that make your wedding day, or days, special, including those moments and events you may not even be aware of when they occur. I will take some quick, simple, group shots, but I otherwise will not direct you or the flow of your day in any way – the highest compliment you can ever pay me is to say after your wedding, 'I don’t know how you got these photos – we weren’t even aware you were there.'  <BR><BR> But why take it from me? Here's the unsolicited note I received from the mother and father of the bride at my latest wedding:<BR><BR> <B><I> 'What a pleasure it was to have you at our wedding. You did such a fantastic job capturing every moment just <U>PERFECTLY!!</U> Everyone has said you did the best job <U>ever</U> seen. You were everywhere, but never 'in the way' of anything. You were like family to us and we loved having you as a guest. Your personality is so kind and patient - especially with nervous parents and the bride!<BR><BR> 'You captured our special time. We are <U>so</U> thankful. It was a pleasure to have you. Let us know if you need any <U>high</U> recommendations!'</B></I><BR><BR> I offer a wide range of services and packages, and if you are having a large wedding, and it is appropriate, I can offer to engage a second photographer whose shooting style and behavior will compliment mine.  <BR><BR> Please contact me to discuss your wedding needs.",
        "Always Carry A Camera" : "In order to help my students understand why they should always carry a camera, I have developed an assignment in which I tell them to go out with a notebook - but no camera - to 'take' a dozen photographs. The assignment is to return to class with detailed descriptions of a dozen images they would have captured had they had a camera with them. The lesson is, of course, that it doesn't matter how perfect the image - if you don't carry a camera, you can't capture it.",
        "A Day In Our Life" : "Why trust your memories to a shoebox full of snapshots?  <BR><BR>... when A DAY IN OUR LIFE can provide you with a photographic document of your family life at the dawn of the Millennium.  <BR><BR>If you commission me to document a day in your life, I will spend an entire day with your family - from when you wake up, to when you go to sleep - unobtrusively making candid photographs that truly capture family activities, interactions, and relationships. You may chose to have a typical weekend day of 'doing nothing' documented, or you may chose a family gathering, birthday party, or outing. What ever kind of day you select, and where ever you spend it, I will photograph all day and will then select 80 to 100 images that best tell the story of your day, and use them to produce a hardcover book your family will treasure for generations.  <BR><BR>As you can see from the photographs in these galleries, what will make your book so special is not what you do on your day, but the fact that I am there to record it. These are images unlike any produced as part of a typical family portraiture or wedding photography sessions. These are images that you, your children, and your children’s children will look at decades from now and be able to say, 'Yes, that really was A Day In Our Life ...'",
        "Corporate and Editorial" : "I approach corporate and editorial assignments as I do the rest of my work - I document your reality. Whether you're looking for environmental portraiture, whether you want to capture the work of your executives, factory floor, or laboratories, or whether you want to show the life-and-death drama in your operating rooms or on your hospital floors, I will approach the subject in the same way:  <BR><BR>I will shoot alone, without a car-load of equipment and assistants, using available light or a minimum of fill-flash, without disturbing the ongoing reality.  And, what is vitally important, I will bring to your assignment 23 years' experience as a reporter and almost 15 years experience in health care and university public relations; I not only know what you want, I know what you don’t want.  <BR><BR>To discuss commissioning me for your project, drop me an email at <a href='mailto:bd@bdcolenphoto.com'>bd@bdcolenphoto.com</a>."
 

    };
    
    var re, matches, i;        // various local variables

    // now fix it so that it works automatically even if the category or sub-category name has spaces in it
    // we replace those spaces with underscores (which is what the classname does) and add those to our object so we can match those too
    for (i in categoryDescription) 
    {
        var newName = i.replace(/ /g, "_");
        categoryDescription[newName] = categoryDescription[i];    // add a property to the object that has only underscores in the name
    }
    // on the homepage, we want to check for category names and add a description if a match found
    // on a category page, we want to check to see if the category that the page is needs a description under the breadcrumb
    //      and, we need to see if any of the sub-category items on the page need us to add a description under the name
    // on a sub-category page, we want to check to see if the sub-category that the page is needs a description under the breadcrumb
    if (YD.hasClass(document.body, "category")) 
    {
        // fetch the category name
        re = /category_(\S+)/i;
        matches = re.exec(document.body.className);
        if (matches && (matches.length > 1)) 
        {
            var categoryName = matches[1];
            // now see if we have a subcategory too
            if (YD.hasClass(document.body, "subcategory")) 
            {
                re = /subcategory_(\S+)/i;
                matches = re.exec(document.body.className);
                if (matches && (matches.length > 1)) 
                {
                    var subcatName = matches[1];
                    // category and subcategory so we are on a subcategory page showing a list of galleries in this subcategory
                    // we need to just add a subcategory title to this page if the category-subcategory matches
                    var fullName = categoryName + "." + subcatName;
                    if (categoryDescription[fullName])
                    {
                        addCategoryTitleToBreadcrumb(categoryDescription[fullName]);
                    }
                }
            }
            // here we're on a category page
            // we need to add a category description for the category page
            // and potentially add subcategory descriptions to the subcategory names displayed on this page
            else 
            {
                if (categoryDescription[categoryName])
                {
                    addCategoryTitleToBreadcrumb(categoryDescription[categoryName]);
                }
                // now we need to build a temporary subcategoryDescription object that has only the subcategory names in it that are in this category
                var subcatDescriptions = {};
                re = new RegExp("^" + categoryName + "\\.(.+)$", "i");
                for (i in categoryDescription)
                {
                    matches = re.exec(i);
                    if (matches && (matches.length > 1))
                    {
                        subcatDescriptions[matches[1]] = categoryDescription[i];
                    }
                }
                addCategoryTitleToThumbs(subcatDescriptions, "subcategoriesBox");
            }
        }
    }

    // then see if we're on the homepage
    if (YD.hasClass(document.body, "homepage")) 
    {
        addCategoryTitleToThumbs(categoryDescription, "categoriesBox");
    }
}

YE.onDOMReady(addCategoryDescription);





