﻿var togglestatus = new Array();
var togglelast = "";

function boxOpen(id) {
	document.getElementById(id).className = "boxOpen";
    togglestatus[id] = true;
}

function boxClosed(id) {
	document.getElementById(id).className = "boxClosed";
    togglestatus[id] = true;
}

function toggleBoxOpen(id) {
  if( togglestatus[id] == null )
    togglestatus[id] = false;
  if( !togglestatus[id] )
    boxOpen(id);
  else
    boxClosed(id);
}

function toggleAndClose(id) {
	if( togglelast != "" )
		toggleBoxOpen( togglelast );
	toggleBoxOpen( id );
	togglelast = id;
}