function initCalendar(id) {
	closeAll(id);
	var links = document.getElementById("calendarDiv").getElementsByTagName("a"); 

	for (var i=0; i<links.length; i++) {
		links[i].onclick = function() {
			var relAttribute = this.getAttribute('rel');
			closeAll(relAttribute);
			if (relAttribute) {
				var content = document.getElementById("item_" + relAttribute);
				var topic = document.getElementById("topic_" + relAttribute);
				content.className = (content.className == "open") ? "closed" : "open";
				topic.className = (topic.className == "topic-checked") ? "topic" : "topic-checked";
				document.location.href = '#a_'+relAttribute
				return false;
			}    
		}
	}
}

function closeAll(id) {
  var links = document.getElementById("calendarDiv").getElementsByTagName("a");
	for (var i=0; i<links.length; i++) {
	   
		var relAttribute = links[i].getAttribute('rel');
		
		var currentItem =  document.getElementById("item_" + relAttribute);
		
		if (relAttribute && relAttribute != id) {
			var content = document.getElementById("item_" + relAttribute);
			var topic = document.getElementById("topic_" + relAttribute);
							
			topic.className = "topic";
			content.className = "closed"; 
		}           
	}
}    
