framesWarning = false;
addEvent(window, "load", initPortfolio);

function initPortfolio() {
  var objElement = document.getElementById("smugmug");
  var str_class = objElement.className;
  if (str_class.match("category_Portfolio") != null)
  {
    check_top();
    add_title();
    rem_pipes();
  }
}

function rem_pipes () {
   var objElement = document.getElementById("footer")
   if (objElement != null) 
   {
     var str = new String(objElement.innerHTML);
     str = str.replace(str, '<span class="text"> powered by SmugMug | portions © SmugMug, Inc. </span>')
     objElement.innerHTML = str;
   }
}

function add_title () {
  var objElement = document.getElementById("extraDiv1");
  objElement.innerHTML = "<span class='title'>" + document.getElementById("albumTitle").innerHTML + "</span>";
}

function check_top() {
  var albumTitle = document.getElementById("albumTitle").innerHTML;
  var genesisHTML = "http://76.31.194.63/index.html?";
  albumTitle = albumTitle.substr(0,albumTitle.indexOf(" "));
  if(window == top)
  {
    window.location.href = genesisHTML + albumTitle;
  }
}
