var sizeMap = {'small':5,'medium':12,'large':20};

function drawCircle(id, size, circleSize) {
      var cnv = document.getElementById(id);
      var jg = new jsGraphics(cnv);
      jg.setColor("#00ff00"); // green
      jg.fillEllipse(size - circleSize/2, size - circleSize/2, circleSize, circleSize); // co-ordinates related to the document
      jg.paint(); // draws, in this case, directly into the document
}

function drawCircles(data, size) {
      for (var i=0;i<data.length;i++) {
            var circleSize = getSize(data[i].size);
            if (circleSize > 0) {
                  drawCircle(data[i].id, size, circleSize);
            }
      }
}

function getSize(sizeString) {
      var size = sizeMap[sizeString];
      if (size) { return size; } else { return 0; }
}
     


 

