Good evening friends! The question is, there is a piece of code (below), the problem is that I do not understand what it is doing (superficial understanding)
<script type="text/javascript"> var step = 2; function expandPanel() { var panel = document.getElementById("panel") if (panel.clientHeight < (panel.originalHeight-step)) { var h = panel.clientHeight + step; panel.style.height = h+"px"; setTimeout("expandPanel()",25) } else { panel.style.height = "100px"; var panelTitle = document.getElementById("panelTitle") panelTitle.firstChild.nodeValue = "Свернуть" } } function collapsePanel() { var panel = document.getElementById("panel") if (panel.clientHeight >= step) { var h = panel.clientHeight - step panel.style.height = h+"px"; setTimeout("collapsePanel()",25) } else { panel.style.display = "none"; var panelTitle = document.getElementById("panelTitle") panelTitle.firstChild.nodeValue = "Развернуть" } } function changePanel() { var panel = document.getElementById("panel") if (!panel.style.height || (panel.style.display == "none")) { if (panel.style.display == "none") { panel.style.display = "" expandPanel() } else { panel.originalHeight = panel.clientHeight collapsePanel(); } } } </script>