// obtained from: "JavaScript The Definitive Guide" (5th edition) from David Flanagan published by O'Reilly; Example 22-10

var hbVML = {};

hbVML.makeCanvas = function (id, left, top, width, height)
{
  var vml = document.createElement ("v:shape");
  vml.setAttribute ("id", id);
  hbVML.transformCanvas (vml, left, top, width, height)
  return vml;
}

hbVML.addCanvasToParent = function (canvas, parent, left, top, width, height)
{
  hbVML.transformCanvas (canvas, left, top, width, height)
  parent.appendChild (canvas);
}

hbVML.transformCanvas = function (canvas, left, top, width, height)
{
 // canvas.setAttribute ("width", width + "px");
 // canvas.setAttribute ("height", height + "px");
 // canvas.setAttribute ("top", top + "px");
 // canvas.setAttribute ("left", left + "px");
  canvas.style.width = width + "px";
  canvas.style.height = height + "px";
  canvas.style.top = top + "px";
  canvas.style.left = left + "px";
  canvas.setAttribute ("coordsize", width + " " + height);
  canvas.setAttribute ("coordorigin", left + " " + top);
}
