/* 	
Javascript for "sketches toward a fresh NEO-GEO canvas every 5 seconds for the duration of Western culture"
or "border control: red, white & blue/green, white & red [plus black]"  [after Peter Halley]
© Graham Budgett 2008 
*/
function paintNeoGeoCanvas() {
var sw = screen.availWidth;
var sh = screen.availHeight;
self.moveTo(1,1);
self.resizeTo(sw,sh);	
var col = ["red","white","blue","green","white","red","black"];	
var bord = ["dotted","double","ridge","dashed","solid","groove","inset","outset"]			
var n  = Math.random()*50;	
	for (i=0; i<= n; i++) {			
		var w  = Math.floor(Math.random()*sw);
		var h  = Math.floor(Math.random()*sh);
		var br = (Math.floor(Math.random()*sw)-(sw/2));
		var bb = (Math.floor(Math.random()*sh)-(sh/2));
		var bw = Math.floor(Math.random()*200);
		var bs = Math.floor(Math.random()*8);
		var bc = Math.floor(Math.random()*7); 
		var bz = Math.floor(Math.random()*50);
		var bo = Math.random();		
		var canvas = document.getElementById("canvas");
		var cell = document.createElement("div");		
		cell.style.position = "absolute"
		cell.style.width = w;
		cell.style.height = h;
		cell.style.right = br;
		cell.style.bottom = bb;
		cell.style.borderWidth = bw;
		cell.style.borderStyle = bord[bs];
		cell.style.borderColor = col[bc];
		cell.style.opacity = bo;
		cell.style.zIndex = bz;			
		canvas.appendChild(cell);
	}
}	