function ResizeBigImage(pic, maxsize)
{
  srcWidth=pic.width;
  srcHeight=pic.height;

  ratioWidth=srcWidth/maxsize;
//  ratioHeight=srcHeight/maxsize;

  y=Math.ceil(srcHeight/ratioWidth);
//  x=Math.ceil(srcWidth/ratioHeight);
  
  if (pic.width >= maxsize) 
  { 
      pic.width=maxsize;
      pic.height=y;
  }
}

