function chk_img() { if (img.width > 800) { img.height *= 800 / img.width; img.width = 800; } else { img.width = img.width + 16; } }