HTML5 - Canvas

onload = init;
var img = new Image();

function init() {
dom.event.addEventListener(img, "load", draw);
img.src = "../common/IMG_0078.jpg";

}

function draw() {
var canvas = document.getElementById('canvas');
if (!canvas || ! canvas.getContext) {
return false;
}
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
}