function getCalendar(month, year) {
  new Ajax.Updater('calendarWrap', '/get_calendar.php', {
    parameters: { cm: month, cy: year  },
    method: 'get'
  });
}


function getEvents(date) {
  var url = '/get_events.php';
  var pars = 'd=' + date;
  var myAjax = new Ajax.Request(
    url,
    {
      method: 'get',
      parameters: pars,
      onSuccess: function(request){
        var d = new Date(date.substr(0,4), date.substr(4,2)-1, date.substr(6,2), 0, 0, 0, 0);
        overlib(request.responseText, WIDTH, 250, CSSCLASS, TEXTFONTCLASS, 'fontClass',FGCLASS,'fgClass', BGCLASS,'bgClass', STICKY, FOLLOWMOUSE, CAPTIONFONTCLASS, 'capfontClass', CLOSEFONTCLASS, 'capfontClass', CAPTION, d.toDateString(), NOCLOSE, MOUSEOFF);
      }
    });
}

function toggleMore(id) {
	truncEl = $('descTrunc_' + id);
	fullEl = $('descFull_' + id);
	if (truncEl.visible())	{
    var tempElement = fullEl;
    tempElement.setStyle({'height':'0px', 'display':'block'});
    var ht = tempElement.scrollHeight;	
	  fullEl.style.height = truncEl.getHeight() + 'px';
		truncEl.hide();
    fullEl.show();
    fullEl.morph('height:' + ht + 'px');
	} else {
    fullEl.morph('height:' + truncEl.getHeight() + 'px', {afterFinish: function() { fullEl.hide();truncEl.show() }});
	}
}
