// JavaScript Document
function setCalendarioBehavior()
{
  var i, aT, nameEvent, calendarioT;
  calendarioT = document.getElementById("Calendario");
  nameEvent = calendarioT.objActive = null;
  for (i=0; (aT = calendarioT.getElementsByTagName("a")[i]); i++) {
    if(window.getComputedStyle) // GECKO Based
      aT.stdBackColor = window.getComputedStyle(aT,null).backgroundColor;
	else if(aT.currentStyle) // Explorer Based
	  aT.stdBackColor = aT.currentStyle.backgroundColor;
    aT.overColor = '#B0E0C6';
	aT.selectedColor = null;
    if(aT.className.indexOf("Event") != -1) {
	 nameEvent = aT.className.substr(aT.className.lastIndexOf("Event"));
	 aT.eventObj = document.getElementById(nameEvent);
	 aT.onmousedown =  function () { this.eventObj.onmousedown(); };																										   
    }
    if(aT.className.indexOf("selected") != -1) {
	   calendarioT.objActive = aT;
       aT.style.backgroundColor = aT.selectedColor = '#B0E0C6';
	}
    aT.onmouseover = function() { this.style.backgroundColor = this.overColor; };
    aT.onmouseout = function() {	  
	   if(this.selectedColor != null)
		 this.style.backgroundColor = this.selectedColor;
	   else
		 this.style.backgroundColor = this.stdBackColor; 
    };
  }
}