//first lets make some dots

var d_canvas = document.getElementById('d_canvas');
var d_context = d_canvas.getContext('2d');
var d_alert = document.getElementById("d_alert_1");

//

//the below should be in the main.js file

function initialize(){//what's done onload
    var d_alert = document.getElementById("d_alert_1");
    d_alert.innerHTML = "Using numbers, draw inside the canvas.";
}

    function postMessage(message){
	d_alert.innerHTML = message;
    }

    function updateCanvas(){
    }

    function drawRectangle(x1,y1,width,height){
	var testColor = new Array(255, 0, 0, 1);
	d_context.fillStyle = "rgba(" + testColor + ")";

	if (x1>0 & y1>0 & width>0 & height>0){
	    postMessage("You drew a rectangle at "+x1+","+y1+" that is "+width+" wide and "+height+" high.");
	d_context.fillRect(x1, y1, width, height);
	}

	else{
	    postMessage("Enter the rest, please.");
	}
    }

    function drawSquare(x, y, interval){
	postMessage("You drew a square.");
	drawRectangle(x, y, interval, interval);
    }

    function drawDot(x,y){
	postMessage("You drew a dot at " + x + "," + y);
	drawSquare(x, y, 2);
    }
