code: function makeBoxes(wid, hgt, w0, h0) {
  		var wnum = ~~(wid/w0), wrem = wid%w0,
  			hnum = ~~(hgt/h0), hrem = hgt%h0,
  			xend = wid-wrem, yend = hgt-hrem;
  
  		var bxs = [];
  		for (var y = 0; y < hgt; y += h0)
  			for (var x = 0; x < wid; x += w0)
  				bxs.push({x:x, y:y, w:(x==xend?wrem:w0), h:(y==yend?hrem:h0)});
  
  		return bxs;
  	}
docs: partitions a rect of wid x hgt into array of bboxes of w0 x h0 (or less)