Grid Overlay For Browser Using HTML5 Canvas
You can use cssText to update the style properties all in one go. 

This avoids the element being repainted after every style prop change.

i.e. var myStyleString = 'right: 30px'; // etc


getById('gridControls').style.cssText = myStyleString;

This way you also don't need the controls var.

you can read more about style here.