////============================================
//// expo06.js, 04/29/09, by ralph abraham
//// draw two lines, same color
//// expo06.js, by ralph abraham, 29 april, 2009

//// SETUP

	// wait for the browser to load
	window.onload = function() {
	// set up background basic template
		base00(); // draw entire canvas
		drawdisk();
	};
	
    // setup single white canvas
	function base00()  {
		var canvas = document.getElementById("canvas"); // only one canvas
		var ctx = canvas.getContext("2d");
		// setup whole rectangle (x0, y0, width, height)
		ctx.clearRect(0, 0, 320, 280);
 		ctx.fillStyle = "white"; //  white
 		ctx.fillRect (0, 0, 320, 280);
	};
	
	// draw someting on the canvas
	// draw red disk, cf resig p. 298
	function drawdisk() {
		var canvas = document.getElementById("canvas"); // only one canvas
		var ctx = canvas.getContext("2d");
		// draw circle 
		ctx.save();
		ctx.beginPath();
			ctx.arc(160,140,100,0,Math.PI*2,true); // full circle
			ctx.strokeStyle = "red";
		ctx.fillStyle = "red"; //  red
		ctx.fill();
		ctx.restore();
	};
    
////////// END ///////////
