function debugBox (bBox) {
	dojo.debug('bbox coords, bBox.x:' + bBox.x + ' bBox.width:' + bbox.width + ' bBox.y:' + bbox.y + ' bBox.height:' + bbox.height);
}

function debugPt (pt) {
	dojo.debug('pt.x:' + pt.x + ' pt.y:' + pt.y);
}

mdebug = function(matrix){
	var m = dojo.gfx.matrix.normalize(matrix);
	dojo.debug("xx: " + m.xx + ", xy: " + m.xy + " | dx:" + m.dx);
	dojo.debug("yx: " + m.yx + ", yy: " + m.yy + " | dy:" + m.dy);
};

writematrix = function(matrix){
  // write out matrix in standard SVG matrix format
	var m = dojo.gfx.matrix.normalize(matrix);
	return(m.xx + ", " + m.yx + ", " + m.xy + ", " + m.yy + ", " + m.dx + ", " + m.dy);
}

readmatrix = function(inM) {
	return new dojo.gfx.matrix.Matrix2D({xx: 1, xy: 0, yx: 0, yy: 1, dx: 20, dy: 20})
}


makeShapes = function() {
//	dojo.html.setClass(gShapes[id].getEventSource(), "moveable");
/*	
	id = "shape_2";
	gShapes[id] = surface.createPath()
			.moveTo(10, 20).lineTo(80, 150)
			.setAbsoluteMode(false).lineTo(40, 0)
			.setAbsoluteMode(true).lineTo(180, 100)
			.setAbsoluteMode(false).lineTo(0, -30).lineTo(-30, -50)
			.setAbsoluteMode(true).lineTo(10,20)
			.moveTo(15, 25).lineTo(90, 130)
			.setAbsoluteMode(false).lineTo(40, 0)
			.setAbsoluteMode(true).lineTo(180, 100)
			.setAbsoluteMode(false).lineTo(0, -30).lineTo(-30, -50)
			.closePath()
			.setStroke({ color: "red", width: 1 })
			.setFill([0, 0, 255, 1.0])
			.setTransform({ dx: 10, dy: 18 })
			;

	
	gShapes[id].getEventSource().setAttribute('shapeid', id);
	dojo.html.setClass(gShapes[id].getEventSource(), "moveable");
*/	

//	gShapes[id] = surface.createCircle({cx: 100, cy: 30, r: 50})
//			.setFill([0, 255, 0, 1.0])
//			.setStroke({color: [0, 255, 255, 1.0], width: 1})
//			;
//	gShapes[id].getEventSource().setAttribute('shapeid', id);
//	dojo.html.setClass(gShapes[id].getEventSource(), "moveable");
/*			
	var m = dojo.gfx.matrix;
    var g1 = surface.createGroup();
    var g2 = g1.createGroup();


	var rx = 100, ry = 60, xRotg = 30;
    var startPoint = m.multiplyPoint(m.rotateg(xRotg), {x: -rx, y: 0  });
    var endPoint   = m.multiplyPoint(m.rotateg(xRotg), {x: 0,   y: -ry});
    
    var re1 = g1.createPath()
		.moveTo(startPoint)
		.arcTo(rx, ry, xRotg, true, false, endPoint)
		.setStroke({color: "red"})
		;
    var ge1 = g1.createPath()
		.moveTo(re1.getLastPosition())
		.arcTo(rx, ry, xRotg, false, false, startPoint)
		.setStroke({color: "blue"})
		;
    var re2 = g2.createPath()
		.moveTo(startPoint)
		.arcTo(rx, ry, xRotg, false, true, endPoint)
		.setStroke({color: "red"})
		;
    var ge2 = g2.createPath()
		.moveTo(re2.getLastPosition())
		.arcTo(rx, ry, xRotg, true, true, startPoint)
		.setStroke({color: "blue"})
		;
		
	g1.setTransform({dx: 200, dy: 200});
	g2.setTransform({dx: 10,  dy: 10});
	var id0 = "shape_" + (gShapeCounter++);
	gShapes[id0] = g1;
	gShapes[id0].getEventSource().setAttribute('shapeid', id0);

*/
	var id = "shape_" + (gShapeCounter++);
	gShapes[id] = new imgchf.rectangle(id);
	gShapes[id].setExtents(5,20);
	gShapes[id].setPosition(100,100);
	
//	, 100, 100, 5, 20);
	
	id = "shape_" + (gShapeCounter++);
	gShapes[id] = new imgchf.ellipse(id, 100, 50, 20, 10);
//	dojo.html.setClass(gShapes[id].getEventSource(), "moveable");
	

	
};
