+
+ /* javascript for previous and next month */
+ len = strlen(urlformat);
+ for (i=0; i<len; ++i) {
+ sprintf(&escaped_urlformat[i*2], "%02X", urlformat[i]);
+ }
+
+ wprintf("<script type=\"text/javascript\"> "
+ " function minical_change_month(year, month) { "
+ " p = 'year=' + year + '&month=' + month "
+ " + '&urlformat=%s&r=' + CtdlRandomString(); "
+ " new Ajax.Updater('%s', 'mini_calendar', "
+ " { method: 'get', parameters: p, evalScripts: true } ); "
+ " } "
+ "</script>\n"
+ ,
+ escaped_urlformat, div_id
+ );
+
+}
+
+/* ajax embedder for the above mini calendar */
+void ajax_mini_calendar(void) {
+ char urlformat[256];
+ int i, len;
+ char *escaped_urlformat;
+
+ escaped_urlformat = bstr("urlformat");
+ len = strlen(escaped_urlformat) * 2 ;
+ for (i=0; i<len; ++i) {
+ urlformat[i] = xtoi(&escaped_urlformat[i*2], 2);
+ urlformat[i+1] = 0;
+ }
+
+ embeddable_mini_calendar( atoi(bstr("year")), atoi(bstr("month")), urlformat );