<!--
function moodTagsAdd(id, realm, tags, callback) {
  $.post("http://ilps.science.uva.nl/MoodViews/Tags/tags.cgi", {
    id: realm + "-" + id,
    tags: tags
  }, callback);
}

function moodTagsGet(id, realm, callback) {
  $.get("http://ilps.science.uva.nl/MoodViews/Tags/tags.cgi?" + realm + "-" + id, callback);
}

function moodTagsTagObject(realm, tagname, when) {
  this.realm = realm;
  this.tagname = tagname;
  this.when = when;
}

function moodTagsObject(id, mood, start, end, tags, error, numtags) {
  this.id = id;
  this.mood = mood;
  this.start = start;
  this.end = end;
  this.tags = tags;
  this.error = error;
  this.numtags = numtags
}

function moodTagsParse(xml) {
  error = ($("/moodtags/error", xml).size() == 0) ? undefined : $("/moodtags/error", xml).text();
  graphid = $("/moodtags/graph/graphid", xml).text();
  graphmood = $("/moodtags/graph/mood", xml).text();
  graphstart = $("/moodtags/graph/start", xml).text();
  graphend = $("/moodtags/graph/end", xml).text();
  nt = parseInt($("tags/count", xml).text());
  s = (nt > 0) ? new Array(nt) : undefined;
  if (nt > 0) {
    tc = 0;
    $("tag", xml).each(function (k) {
      tagName = $("name" ,this).text();
      tagRealm = $("realm" ,this).text();
      tagWhen = $("when" ,this).text();
      s[tc] = new moodTagsTagObject(tagRealm, tagName, tagWhen);
      tc++;
    });
  }
  parsed = new moodTagsObject(graphid, graphmood, graphstart, graphend, s, error, nt);
  return parsed;
}
//-->
