
function submitDate(formObj) {
  submit();
}


var container;
var alink;

function showBirthdays() {
  if (document.getElementById('showBios')) {
    filterList('show');
    container = document.getElementById('showBios');
    alink = container.childNodes[0];
    if (alink.tagName == undefined) alink = container.childNodes[1];
    alink.href = "javascript:showBios()";
    alink.innerHTML = "Show Bios Only";
  }
}

function showBios() {
  if (document.getElementById('showBios')) {
    filterList('hide');
    container = document.getElementById('showBios');
    alink = container.childNodes[0];
    if (alink.tagName == undefined) alink = container.childNodes[1];
    alink.href = "javascript:showBirthdays()";
    alink.innerHTML = "More Birthdays";
  }
}

function filterList(action) {
  container = document.getElementById('showBios');
  if(document.getElementById('birthdays')) {
    var birthdayList = document.getElementById('birthdays');
    var page_objects = birthdayList.getElementsByTagName('dt');
    for (var j=0; j < page_objects.length; j++) {
      if(page_objects[j].className!="bio") {
        if(action=="hide") {
          page_objects[j].style.display= "none"; 
        } else if(action=="show") {
          page_objects[j].style.display= "block"; 
        }
      }
    }
  }
}

function bdayInit() {
  filterList('hide');
  if (document.getElementById('showBios')) {
    container = document.getElementById('showBios');
    alink = document.createElement ('a');
    alink.href = "javascript:showBirthdays()";
    alink.appendChild (document.createTextNode ("More Birthdays"));
    container.appendChild (alink);
    container.appendChild (document.createTextNode (' >>'));

  }
}

// window.onload only loads after page finishes loading - to load faster, the init function was added to Birthdays.tpl
//window.onload = bdayInit;
