+function showCalendar(date_box, click_obj)
+{
+ var calendar = document.getElementById('calendar');
+ if(date_box == 'from') {
+ var xpos = document.getElementById('frompic').offsetLeft;
+ var ypos = document.getElementById('frompic').offsetTop;
+ calendar_mode = 'from';
+ }
+ if(date_box == 'to') {
+ var xpos = document.getElementById('topic').offsetLeft;
+ var ypos = document.getElementById('topic').offsetTop;
+ calendar_mode = 'to';
+ }
+ calendar.style.left = xpos + 60 + 'px';
+ calendar.style.top = ypos + 80 + 'px';
+
+ if(calendar.style.visibility == "" || calendar.style.visibility == 'hidden') {
+ calendar.style.visibility = 'visible';
+ calendar.innerHTML = "Loading...";
+ calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix'));
+ calendar_shown = 1;
+ }
+ else {
+ calendar.style.visibility = 'hidden';
+ calendar_shown = 0;
+ }
+}
+
+function setMonth(year, month, day)
+{
+ var calendar = document.getElementById('calendar');
+ calendar.innerHTML = "Loading...";
+ calendar.innerHTML = HTML_AJAX.grab(encodeURI('rpc.php?action=get_calendar_matrix&year='+ year +'&month='+ month +'&day='+ day));
+}
+
+function setCalendarDate(year, month, day)
+{
+ document.getElementById(calendar_mode+'year').value = year;
+ document.getElementById(calendar_mode+'month').value = month;
+ document.getElementById(calendar_mode+'day').value = day;
+}