rightClickWarning = "Copyright © Nelson Chen - All Rights Reserved.";


// make guestbook gallery comments heading to guestbook comments
function ModifyText () 
{
  if (YD.hasClass(document.body, "gallery_3651091")) 
  {
    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);

SM.PhotoBar.config.position = 'bottom';


/* code supposed tochange buy to something else but does not work*/
/*
addEvent(window, "load", redoCart);
function redoCart() {
  oList = getElementsByClass("cartbuttons");

  for (var i=0; i < oList.length ; i++)
  {
    aList = oList[i].getElementsByTagName("a");
    for (var j=0; j < aList.length ; j++)
      aList[j].parentNode.removeChild(aList[j]);

    bList = getElementsByClass("cart_add", oList[i], "img");
    for (var k=0; k < bList.length ; k++)
      bList[k].parentNode.removeChild(bList[k]);
    oList[i].innerHTML = oList[i].innerHTML.replace(/buy:/gi, '&nbsp;<span class="title">cart:</span>')
  }
}

function getElementsByClass(searchClass,node,tag) {
    var classElements = new Array();
    if ( node == null )
        node = document;
    if ( tag == null )
        tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = new RegExp("(^| )" + searchClass + "( |$)");
    for (var i = 0, j = 0; i < elsLen; i++) {
        if ( pattern.test(els[i].className) ) {
            classElements[j] = els[i];
            j++;
        }
    }
    return classElements;
}
*/


function addCategoryDescription() {
 var categoryDescription = {
     "BHSmusic" : "Boulder High School 2004-2008 Music Performances Photos and More",
     "HPYSmusic": "High Plains Youth Symphony Concert Photos",
     "BYSmusic" : "Boulder Youth Symphony Concert Photos",
     "NTSOmusic": "Niwot Timerline Symphony Orchestra Photos",
     "mtviewumc" : "Photos of Mountain View United Methodist Church (http://www.mtview.org)",
     "Places" : "Photos from the places in the world captured on the digital format",
     "Race_For_Cure" : "Photos from the Susan G. Komen Denver Race",
      "Renaissance_Festivals" : "Photos from the Colorado Renaissance Festivals"
 };

  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.appendChild(document.createTextNode(categoryDescription[RegExp.$1]));
      breadCrumb.parentNode.insertBefore(divTag, breadCrumb.nextSibling);
    }
  }
  if (YD.hasClass(document.body, "homepage")) {
    re = /\>([\w\-]+)<\/a>/i;

    divTag = YD.get("categoriesBox");
   if (divTag) {
      divTags = YD.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); 

