/**
 * @author Bruno
 */
$(document).ready(function() {
	var disegna = function()
	{
		var cx, cy, w, h, o;
		cx = Math.floor(Math.random() * 800);
		cy = Math.floor(Math.random() * 350);
		w = 10 + (Math.floor(Math.random() * 190));
		h = 10 + (Math.floor(Math.random() * 190));
		o = Math.random();
		$('canvas').drawRect(
			{
				x:cx,
				y:cy,
				width:w,
				height:h,
				fillStyle:"#ff6600",
				opacity:o,
				fromCenter: false
			}
		).drawArc(
			{
				x:cx,
				y:cy,
				radius:w,
				fillStyle:"#666",
				opacity:0.2
			}
		)
	}
	$('#disegna_btn').click(disegna);
	$('#clear_btn').click(function(){
		$('canvas').clearCanvas();
	})
});
