displaySmugPopular = false;
showPhotoBar = true;

/**
 * Used by footer to setup pages
 */
function hasPath(sPath){
    re = new RegExp("\/" + sPath + "(\/|$)");
    return re.test(window.location);
}

/**
 * Slideshow
 */
function createSWF(w, h, params){
    var args = "";
    for (var i in params) {
        args += i + "=" + params[i] + "&";
    }
    
    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;
}

/**
 * Referral link setup
 */
function AddReferralCode(){
    var links = this.getElementsByTagName("A");
    if (links && (links.length != 0)) {
        var smugLink = links.item(0);
        smugLink.href = "http://www.smugmug.com/?referrer=W5k9W88EbAKzk";
    }
}
YE.onAvailable('footer', AddReferralCode);

/**
 * Right click on image warning
 */
rightClickWarning = "All photos are property of AbbiOrca Photography. All rights reserved. Unauthorized use is prohibited.";

/**
 * Setting Category descriptions Here
 */
function addCategoryDescription(){
    var categoryDescription = {
        "Tour of California": "Tour of California Photos from 2006-present.",
        "Velodrome": "Track racing 2005-present.",
        "Portfolio": "Some of our favorites from 2005-present.",
        "2007 Cyclo-Cross": "All 2007 CycloCross Events."
    };
    
    if ((YAHOO.util.Dom.hasClass(document.body, "category")) && (!YAHOO.util.Dom.hasClass(document.body, "subcategory"))) {
    
        re = /category_(\S+)/i;
        if (re.exec(document.body.className)) {
            foundCat = RegExp.$1.replace('_', ' ');
            
            breadCrumb = document.getElementById("breadcrumb");
            if (breadCrumb) {
                divTag = document.createElement("div");
                divTag.className = "categoryDescription";
                if (categoryDescription[foundCat] != undefined) {
                    divTag.appendChild(document.createTextNode(categoryDescription[foundCat]));
                    breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
                }
            }
        }
    }
    if (YAHOO.util.Dom.hasClass(document.body, "homepage")) {
        re = /\>([\w\- ]+)<\/a>/i;
        
        divTag = document.getElementById("categoriesBox");
        if (divTag) {
            divTags = YAHOO.util.Dom.getElementsByClassName("albumTitle", "p", divTag);
            
            for (i = 0; i < divTags.length; i++) {
                re.exec(divTags[i].innerHTML);
                if (categoryDescription[RegExp.$1] != undefined) {
                    pTag = document.createElement("p");
                    pTag.className = "categoryDescription";
                    pTag.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
                    divTags[i].parentNode.insertBefore(pTag, divTags[i].nextSibling);
                }
            }
        }
    }
}



YE.addListener(window, "load", addCategoryDescription); 

