Explain, please, what the heightOK and widthOK properties mean in this script, as well as how the javascript knows that duration is the speed at which the image changes in milliseconds (if it is not decrypted anywhere in the code):
function func(name, width, height, duration, type) { var img = document.images.im, heightOk = 0, widthOk = 0; if (type == true) { if ((h < height) && (w < width)) { if (img.height < height) img.height++; else heightOk = 1; if (img.width < width) img.width++; else widthOk = 1; } if ((h > height) && (w > width)) { if (img.height > height) img.height--; else heightOk = 1; if (img.width > width) img.width--; else widthOk = 1; } if ((h > height) && (w < width)) { if (img.height > height) img.height--; else heightOk = 1; if (img.width < width) img.width++; else widthOk = 1; } if ((h < height) && (w > width)) { if (img.height < height) img.height++; else heightOk = 1; if (img.width > width) img.width--; else widthOk = 1; } if (heightOk + widthOk == 2) setTimeout(func, duration, name, width, height, duration, false); else setTimeout(func, duration, name, width, height, duration, true); } else if (type == false) { if ((h < height) && (w < width)) { if (img.height > h) img.height--; else heightOk = 1; if (img.width > w) img.width--; else widthOk = 1; } if ((h > height) && (w > width)) { if (img.height < h) img.height++; else heightOk = 1; if (img.width < w) img.width++; else widthOk = 1; } if ((h > height) && (w < width)) { if (img.height < h) img.height++; else heightOk = 1; if (img.width > w) img.width--; else widthOk = 1; } if ((h < height) && (w > width)) { if (img.height > h) img.height--; else heightOk = 1; if (img.width < w) img.width++; else widthOk = 1; } if (heightOk + widthOk != 2) setTimeout(func, duration, name, width, height, duration, false); else setTimeout(func, duration, name, width, height, duration, true); } } var h = document.images.im.height; var w = document.images.im.width; var width = Number(prompt("ΠΠ΅Π΄ΠΈΡΠ΅ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΡΡ ΡΠΈΡΠΈΠ½Ρ")); var height = Number(prompt("ΠΠ΅Π΄ΠΈΡΠ΅ ΠΌΠ°ΠΊΡΠΈΠΌΠ°Π»ΡΠ½ΡΡ Π²ΡΡΠΎΡΡ")); var duration = Number(prompt("ΠΠ΅Π΄ΠΈΡΠ΅ milliseconds")); func('i', width, height, duration, true);