var speed = 10;
function strechH() {
var h = obj.offsetHeight;
if (h - speed <= 0) {
obj.style.display = "none";
clearInterval(intervalID_Min);
}
else {
obj.style.height = (h - speed) + "px";
}
}
intervalID_Min = setInterval(strechH, 2);
}
function toMaxBox(obj) {
obj.style.display = "block";
var speed = 10;
var originalHeight = !obj.childNodes[0].offsetHeight ? obj.getElementsByTagName("ul")[0].offsetHeight : obj.childNodes[0].offsetHeight;
function strechM() {
var h = obj.offsetHeight;
if (h >= originalHeight) {
clearInterval(intervalID_Max);
}
else {
obj.style.height = (h + speed) + "px";
}
}
intervalID_Max = setInterval(strechM, 2);
}