function toggleView(id) {
  // Toggles the list view. We have two elements. The first is the
  // display block that will be hidden/displayed by clicking on the
  // button. The second is the button itself, which will change from
  // a small plus sign (for hidden) to a small minus sign (for
  // displayed) and vice-versa. The input parameter, id, is a unique
  // identifier that is appended to the strings "body" and "btn" to
  // provide the element ID tags. 'id' may be an integer or string.

  var body = document.getElementById("body" + id);
  var btn  = document.getElementById("btn" + id);

  // This covers the special case where there is no body. We
  // still change the button to indicate something happened.
  if (btn && !body) {
    if (btn.src.search(/open.png/i) >= 0) {
       btn.src = "images/closed.png";
    } else {
       btn.src = "images/open.png";
    }
  }

  // Return if anything is wrong
  if (!body || !btn) return;

  // Toggle the view
  if(body.style.display == "none") {
    body.style.display = "block";
    btn.src = "images/open.png";
  } else {
    body.style.display = "none";
    btn.src = "images/closed.png";
  }
}


function toggleBlock(id) {
	var b = document.getElementById(id);
	if (!b) return;
	if(b.style.display == "none") {
		b.style.display = "block";
	} else {
		b.style.display = "none";
	}
}


function toggleDay(id) {
	toggleBlock("day" + id);
}

