function sizeRes(t, maxW) {
 //var maxW = 520;
 w=t.width;
 h=t.height;
 if (w > maxW) {
  //f=1-((w - maxW) / w);
	f = maxW / w;
	
  t.width=w * f;
  t.height=h * f;
 }
}
