// override this method!
  // see events.jsp
  function hasEvents(date) {
  	return false;
  }

  function dateChanged(calendar) {    
      
    if (calendar.dateClicked) {
	  if(!hasEvents(calendar.date))
        return;

      var y = calendar.date.getFullYear();
      var m = calendar.date.getMonth();     // integer, 0..11
      var d = calendar.date.getDate();      // integer, 1..31
      
      showMoreEvents();
      
      var yyyymmdd = dateFormat(calendar.date, "yyyymmdd");
    
      // de-highlite rows  
      //if(document.getElementsByName){  
   	//	var tables = document.getElementsByTagName("table");  
   		//for(t=0; t<tables.length; t++) {
   			//var rows = tables[t].getElementsByTagName("tr");  
   			//for(i = 0; i < rows.length; i++){          
	       	//rows[i].className = "normal";
	    //	}    
	    //}  
	 // }
 
      //highlite the table rows that have this date as an attribute
      var rows = document.getElementsByTagName("tr");
      for(i=0; i< rows.length; i++) {
        if(rows[i].id && rows[i].id == yyyymmdd) 
	        rows[i].className = "highlite";
	    else 
	      if(rows[i].className && rows[i].className == "highlite") 
		    rows[i].className = "normal";
      }
      
      
	  // set the document's location to the anchor that shows the first event with this date
      var loc = document.location.toString();
	  var page = loc;
      var params=loc.lastIndexOf("#");
	  if(params != -1) 
    	page = loc.substring(0,params);   
	  document.location = page + "#" + yyyymmdd;
    }
  };

  //
  //
  //
  function initCalendar() {
	  Calendar.setup(
	    {
	      weekNumbers  : false,
	      flat         : "calendar-container", // ID of the parent element
	      flatCallback : dateChanged,          // our callback function
	      dateStatusFunc : function(date, y, m, d) {
	                         if (hasEvents(date)) return "special";
	                         else return false; // other dates are enabled
	                         // return true if you want to disable other dates
	                       }
	    }
	  );
	  	 
  }
