<!--
function moodBlogPostsQuery(year, month, start, end, mood, callback, data, q) {
  baseUrl = "/";
  callUrl = baseUrl + "blogposts2.cgi?month=" + month + "&year=" + year + "&mood=" + mood + "&start=" + start + "&end=" + end;
  if (data && (data != "")) {
    callUrl = callUrl + "&data=" + data;
  }
  if (q && (q != "")) {
    callUrl = callUrl + "&q=" + q;
  }
  $.get(callUrl, callback);
}

function moodBlogResultObject(year,month,day,hour,minute,second,mood,score,posttitle,url,user) {
  this.year = year;
  this.month = month;
  this.day = day;
  this.hour = hour;
  this.minute = minute;
  this.second = second;
  this.mood = mood;
  this.score = score;
  this.posttitle = posttitle;
  this.url = url;
  this.user = user;
}

function moodBlogObject(data, posts) {
  this.data = data;
  this.posts = posts;
}

function moodBlogParse(xml) {
  nd = ($("data", xml).size() == 1);
  d = nd ? $("data", xml).text() : undefined;
  nt = parseInt($("results/count", xml).text());
  s = (nt > 0) ? new Array(nt) : undefined;
  if (nt > 0) {
    tc = 0;
    $("result", xml).each(function (k) {
      bpYear = this.getAttribute("year");
      bpMonth = this.getAttribute("month");
      bpDay = this.getAttribute("day");
      bpHour = this.getAttribute("hour");
      bpMinute = this.getAttribute("minute");
      bpSecond = this.getAttribute("second");
      bpMood = this.getAttribute("mood");
      bpScore = this.getAttribute("score");
      bpTitle = this.getAttribute("title");
      bpUrl = this.getAttribute("url");
      bpUser = this.getAttribute("user");
      s[tc] = new moodBlogResultObject(bpYear, bpMonth, bpDay, bpHour, bpMinute, bpSecond, bpMood, bpScore, bpTitle, bpUrl, bpUser);
      tc++;
    });
  }
  return new moodBlogObject(d, s);
}
//-->
