
document.write('<div id="drawingBoard" style="position:relative;left:0px;top:0px;z-index:2;overflow:visible;"></div>');
var canvas = new jsGraphics('drawingBoard');

/**
 Circles an element on the web page
 @param id id of the element
 @param color the color of the line; defaults to "#C30", a nice red color
 @param stroke the thickness of the line; defaults to 3
 @param padLeft amount of space to add to left of the element.  Defaults to 15
 @param padRight amount of space to add to the right of the element.  Defaults to 15
 @param padTop amount of space to add above the element.  Defaults to 12.
 @param padBottom amount of space to add below the element.  Defaults to 12.
 @author Neil Lamoureux        
 */
 function circle(id, color, stroke, padLeft, padRight, padTop, padBottom){
// Set defaults (for backwards compatibility)
    if (typeof(color) == "undefined"){
        color = "#C30"
    }
    if (typeof(stroke) == "undefined"){
        stroke = 3;
    }
    if (typeof(padLeft) == "undefined"){
        padLeft = -15;
    }
    if (typeof(padRight) == "undefined"){
       padRight = -15;
    }
    if (typeof(padTop) == "undefined"){
        padTop = 30;
    }
    if (typeof(padBottom) == "undefined"){
       padBottom = 30;
    }
// get the x, y position plus the height    
    var centerX, centerY, w, h = 0;
    if (typeof(id) != "undefined"){
        var el = document.getElementById(id);
        if (el != null){
// set x and y to the center of the element        
            w = el.offsetWidth;
            h = el.offsetHeight;
            centerX = el.offsetLeft + w / 2;
            centerY = el.offsetTop + h / 2;

            while (el.offsetParent) {
              el = el.offsetParent;
              centerX += el.offsetLeft;
              centerY += el.offsetTop;
           }
       }
    }
// set the color and stroke   
   canvas.setColor(color);
   canvas.setStroke(stroke);
// draw the oval   
   canvas.drawOval(centerX - w / 2 - padLeft, centerY - h / 2 - padTop
   , w + padRight + padLeft, h + padTop + padBottom);
   canvas.paint();
}
