var x = document.createElement(„canvas“);
var context = x.getContext(„2d“);
rotateCanvas(180, context)
rotateCanvas= function(degree, context)
{
context.translate( canvasWidth, canvasHeight);
context.rotate(degree* Math.PI / 180);
context.translate(0, 0);
return context;
}