прокоментируйте пожалуйста строки а то никак не заберусь
var getdd = document.getElementById('slide').getElementsByTagName("DD");
var getdt = document.getElementById('slide').getElementsByTagName("DT");
var getMenu = document.getElementById('odnaknopka').getElementsByTagName("DT");
for (var x=0; x<getMenu.length; x++) {
getMenu[x].onclick=function() {
if (this.id == "menu1" && document.getElementById('smenu').className=='') {
expand (0,document.getElementById('slide').offsetHeight,'smenu')
document.getElementById('smenu').className = "clicked";
this.className="expand";
}
else {
for (var q=0; q<getdd.length; q++) {
eNext = getdd[q].firstChild;
while (eNext.nodeType!=1) {eNext = eNext.nextSibling;}
ulHeight = eNext.offsetHeight;
if (getdd[q].offsetHeight > 0) {
getdd[q].className='';
getdt[q+1].className='';
contract (ulHeight,0,getdd[q].id)
}
}
document.getElementById('slide').style.position = "absolute";
document.getElementById('smenu').style.overflow = "visible";
contract (document.getElementById('slide').offsetHeight,0,'smenu')
document.getElementById('smenu').className = '';
this.className='';
}
}
}
for (var i=0; i<getdt.length; i++) {
getdt[i].onclick=function() {
document.getElementById('slide').style.position = "relative";
document.getElementById('smenu').style.overflow = "visible";
if (this.id.indexOf('item') != -1) {
for (var z=0; z<getdd.length; z++) {
if (getdd[z].id.indexOf(this.id) !=-1 && getdd[z].className=='') {
eNext = getdd[z].firstChild;
while (eNext.nodeType!=1) {eNext = eNext.nextSibling;}
ulHeight = eNext.offsetHeight;
expand (30,ulHeight,getdd[z].id)
}
else {
eNext = getdd[z].firstChild;
while (eNext.nodeType!=1) {eNext = eNext.nextSibling;}
ulHeight = eNext.offsetHeight;
if (getdd[z].offsetHeight > 0) {
contract (ulHeight,0,getdd[z].id)
}
}
if (getdd[z].id.indexOf(this.id) !=-1 && getdd[z].className=='') {
getdd[z].className='selected';
this.className='slide';
}
else {
getdd[z].className='';
ePrevious = getdd[z].previousSibling;
while (ePrevious.nodeType!=1) {ePrevious = ePrevious.previousSibling;}
ePrevious .className='';
}
}
}
}
}
function expand (cY, fY, subY) {
cY=cY+2;
if (cY <= fY) {
document.getElementById(subY).style.height = cY + "px";
setTimeout ("expand("+cY+","+fY+",'"+subY+"')", 10);
}
}
function contract (cZ, fZ, subZ) {
cZ=cZ-2;
if (cZ >= fZ) {
document.getElementById(subZ).style.height = cZ + "px";
setTimeout ("contract("+cZ+","+fZ+",'"+subZ+"')", 10);
}
}