
function setCanvasDimensions(e)
{
   window.scrollTo(0,1);

   var windowHeihgt = $(window).height();
   var canvasHeight = $("#canvas").height() - 60;

   if(canvasHeight > windowHeihgt)
   {
      $("#canvas").css("margin-top", (windowHeihgt-canvasHeight)/2);
   }
   else
   {
      $("#canvas").css("margin", "auto");
   }
};

window.onload = function(event)
{
   setCanvasDimensions(event);


}

window.onorientationchange = function(event) {
   setCanvasDimensions(event); 
};